Skip to content

CHTable Opts Policy - #18543

Closed
dsouzai wants to merge 1 commit into
eclipse-openj9:masterfrom
dsouzai:chtXnojit
Closed

CHTable Opts Policy#18543
dsouzai wants to merge 1 commit into
eclipse-openj9:masterfrom
dsouzai:chtXnojit

Conversation

@dsouzai

@dsouzai dsouzai commented Nov 30, 2023

Copy link
Copy Markdown
Contributor

Only disable CHTable Opts under -Xnojit if AOT compilation is not possible; otherwise, SCC validation will fail. Furthermore, if recompilation is not allowed, only disable the CHTable Opts if AOT compilation is also not possible.

CHTable opts and Recompilation have been coupled together for a long time, and in #11247 the coupling was made further implicit. This PR decouples it under AOT.

Closes #17918

Only disable CHTable Opts under -Xnojit if AOT compilation is not
possible; otherwise, SCC validation will fail. Furthermore, if
recompilation is not allowed, only disable the CHTable Opts if AOT
compilation is also not possible.

Signed-off-by: Irwin D'Souza <dsouzai.gh@gmail.com>
@dsouzai

dsouzai commented Nov 30, 2023

Copy link
Copy Markdown
Contributor Author

@mpirvu could you please review? fyi @knn-k.

@knn-k

knn-k commented Dec 1, 2023

Copy link
Copy Markdown
Contributor

How about adding a testcase for making sure that AOT works under -Xnojit?

@dsouzai
dsouzai marked this pull request as draft December 5, 2023 23:51
}
// if AOT is not possible and recompilation is disabled,
// disable CH Table opts
if (!TR::Options::sharedClassCache())

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't fully understand this code.
If SCC/AOT is completely disabled, then: noRecomp ==> no CHOpts. Let's say there is a reason for this implication.
What happens in the "default" case where both JIT and AOT compilations are allowed. Why don't we enforce the same policy noRecomp ==> no CHOpts? It's possible to run with -Xjit:noRecompile and whatever breaks if we don't disable CHOpts when recompilation is disabled, is going to break in Xjit Xaot case too.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah part of the reason I changed this PR back to a draft is because I realized the logic isn't accurate, so I need to ensure that we don't break existing behaviour (ie, behaviour when JIT compilation is possible). I'll un-draft once I also have a testcase, which is a little non-trivial to write up because it needs multiple stages.

@mpirvu mpirvu self-assigned this Dec 6, 2023
KavinSatheeskumar added a commit to KavinSatheeskumar/openj9 that referenced this pull request Dec 11, 2025
Fixes issue:
eclipse-openj9#17918

Previously, there was an issue that when -Xnojit was set, AOT loads were disabled. This is because -Xnotjit disabled CHTable Ops, which were needed for AOT header validation. This PR

removes some of the logic to disable CHTable Ops and replaces with some logic to check whether AOT loads are ever possible. If they aren't then we disable AOT loads.

This PR borrows a lot from eclipse-openj9#18543

The exact logic we use to check if AOT loads are ever possible is as follows

If -Xshareclasses:none is NOT specified (since there is a default SCC even if you don't specify a name)
If -Xnoaot is NOT specified
If -Xaot:noload is NOT specified
then AOT loads are potentially possible.
KavinSatheeskumar added a commit to KavinSatheeskumar/openj9 that referenced this pull request Dec 11, 2025
Fixes issue:
eclipse-openj9#17918

Previously, there was an issue that when -Xnojit was set, AOT loads were disabled. This is because -Xnotjit disabled CHTable Ops, which were needed for AOT header validation. This PR

removes some of the logic to disable CHTable Ops and replaces with some logic to check whether AOT loads are ever possible. If they aren't then we disable AOT loads.

This PR borrows a lot from eclipse-openj9#18543

The exact logic we use to check if AOT loads are ever possible is as follows

If -Xshareclasses:none is NOT specified (since there is a default SCC even if you don't specify a name)
If -Xnoaot is NOT specified
If -Xaot:noload is NOT specified
then AOT loads are potentially possible.
KavinSatheeskumar added a commit to KavinSatheeskumar/openj9 that referenced this pull request Dec 11, 2025
Fixes issue:
eclipse-openj9#17918

Previously, there was an issue that when -Xnojit was set, AOT loads were disabled. This is because -Xnotjit disabled CHTable Ops, which were needed for AOT header validation. This PR

removes some of the logic to disable CHTable Ops and replaces with some logic to check whether AOT loads are ever possible. If they aren't then we disable AOT loads.

This PR borrows a lot from eclipse-openj9#18543

The exact logic we use to check if AOT loads are ever possible is as follows

If -Xshareclasses:none is NOT specified (since there is a default SCC even if you don't specify a name)
If -Xnoaot is NOT specified
If -Xaot:noload is NOT specified
then AOT loads are potentially possible.
@dsouzai

dsouzai commented Dec 12, 2025

Copy link
Copy Markdown
Contributor Author

Closing as incorrect.

@dsouzai dsouzai closed this Dec 12, 2025
KavinSatheeskumar added a commit to KavinSatheeskumar/openj9 that referenced this pull request Dec 12, 2025
Fixes issue:
eclipse-openj9#17918

Previously, there was an issue that when -Xnojit was set, AOT loads were disabled. This is because -Xnotjit disabled CHTable Ops, which were needed for AOT header validation. This PR

removes some of the logic to disable CHTable Ops and replaces with some logic to check whether AOT loads are ever possible. If they aren't then we disable AOT loads.

This PR borrows a lot from eclipse-openj9#18543

The exact logic we use to check if AOT loads are ever possible is as follows

If -Xshareclasses:none is NOT specified (since there is a default SCC even if you don't specify a name)
If -Xnoaot is NOT specified
If -Xaot:noload is NOT specified
then AOT loads are potentially possible.
KavinSatheeskumar added a commit to KavinSatheeskumar/openj9 that referenced this pull request Dec 15, 2025
Fixes issue:
eclipse-openj9#17918

Previously, there was an issue that when -Xnojit was set, AOT loads were disabled. This is because -Xnotjit disabled CHTable Ops, which were needed for AOT header validation. This PR

removes some of the logic to disable CHTable Ops and replaces with some logic to check whether AOT loads are ever possible. If they aren't then we disable AOT loads.

This PR borrows a lot from eclipse-openj9#18543

The exact logic we use to check if AOT loads are ever possible is as follows

If -Xshareclasses:none is NOT specified (since there is a default SCC even if you don't specify a name)
If -Xnoaot is NOT specified
If -Xaot:noload is NOT specified
then AOT loads are potentially possible.
KavinSatheeskumar added a commit to KavinSatheeskumar/openj9 that referenced this pull request Dec 15, 2025
Fixes issue:
eclipse-openj9#17918

Previously, there was an issue that when -Xnojit was set, AOT loads were disabled. This is because -Xnotjit disabled CHTable Ops, which were needed for AOT header validation.

This PR enforces that if -Xnojit is specified, then AOT compilations are prohibited but CHTable optimizations are still enabled. Otherwise if recompilations are disabled for any other reason, we also disable CHTable ops.

This PR borrows a lot from eclipse-openj9#18543
AditiS11 pushed a commit to AditiS11/openj9 that referenced this pull request Dec 29, 2025
Fixes issue:
eclipse-openj9#17918

Previously, there was an issue that when -Xnojit was set, AOT loads were disabled. This is because -Xnotjit disabled CHTable Ops, which were needed for AOT header validation.

This PR enforces that if -Xnojit is specified, then AOT compilations are prohibited but CHTable optimizations are still enabled. Otherwise if recompilations are disabled for any other reason, we also disable CHTable ops.

This PR borrows a lot from eclipse-openj9#18543
annaibm pushed a commit to annaibm/openj9 that referenced this pull request Mar 19, 2026
Fixes issue:
eclipse-openj9#17918

Previously, there was an issue that when -Xnojit was set, AOT loads were disabled. This is because -Xnotjit disabled CHTable Ops, which were needed for AOT header validation.

This PR enforces that if -Xnojit is specified, then AOT compilations are prohibited but CHTable optimizations are still enabled. Otherwise if recompilations are disabled for any other reason, we also disable CHTable ops.

This PR borrows a lot from eclipse-openj9#18543
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

-Xnojit option disables AOT

3 participants