-
Notifications
You must be signed in to change notification settings - Fork 6.2k
8348322: AOT cache creation crashes with "All cached hidden classes must be aot-linkable" when AOTInvokeDynamicLinking is disabled #23546
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…ust be aot-linkable" when AOTInvokeDynamicLinking is disabled
|
👋 Welcome back ccheung! A progress list of the required criteria for merging this PR into |
|
@calvinccheung This change now passes all automated pre-integration checks. ℹ️ This project also has non-automated pre-integration requirements. Please see the file CONTRIBUTING.md for details. After integration, the commit message for the final commit will be: You can use pull request commands such as /summary, /contributor and /issue to adjust it as needed. At the time when this comment was updated there had been 71 new commits pushed to the
As there are no conflicts, your changes will automatically be rebased on top of these commits when integrating. If you prefer to avoid this automatic rebasing, please check the documentation for the /integrate command for further details. ➡️ To integrate this PR with the above commit message to the |
|
@calvinccheung The following label will be automatically applied to this pull request:
When this pull request is ready to be reviewed, an "RFR" email will be sent to the corresponding mailing list. If you would like to change these labels, use the /label pull request command. |
|
/contributor add iklam |
|
@calvinccheung |
Webrevs
|
iklam
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
matias9927
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good overall but I had some comments. Are there any remaining uses of is_dumping_invokedynamic()? I see several cases were replaced and I'm wondering if it's even being used anymore.
| // classes that are used in the implementation of MethodHandles. | ||
| // Archived MethodHandles are required for higher-level optimizations such as AOT resolution of invokedynamic | ||
| // and dynamic proxies. | ||
| bool CDSConfig::is_dumping_method_handles() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks like it does the same check as is_initing_classes_at_dump_time() and is very similar to is_dumping_invokedynamic(). Maybe you can combine these methods to avoid duplicate code?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I removed the CDSConfig::is_initing_classes_at_dump_time() since the conditions are the same as CDSConfig::is_dumping_method_handles(). All the calls to CDSConfig::is_initing_classes_at_dump_time() have been updated accordingly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should keep is_initing_classes_at_dump_time(), because it's used as a precondition for archiving initialized Java mirrors. Putting such code inside is_dumping_method_handles() would not make sense.
In fact, archived method handles require the ability to store initialized mirrors (for the hidden classes). So I think we should change is_dumping_method_handles() to this:
// When we can dump initialized classes mirrors, we automatically enable the archiving of MethodHandles.
// This will in turn enable the archiving of MethodTypes and hidden classes that are used in the
// implementation of MethodHandles. Note: these hidden classes need to be stored in the initialized state,
// as we don't have a mechanism to trigger their initialization on-demand.
// Archived MethodHandles are required for higher-level optimizations such as AOT resolution of invokedynamic
// and dynamic proxies.
bool CDSConfig::is_dumping_method_handles() {
return is_initing_classes_at_dump_time();
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added back the CDSConfig::is_initing_classes_at_dump_time() function and reverted most of previous changes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The three changes in aotArtifactFinder.cpp should also be reverted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed.
Yes, it is still being used in several places. |
matias9927
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks!
iklam
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
|
@iklam @matias9927 Thanks for the review! /integrate |
|
Going to push as commit c4b516d.
Your commit was automatically rebased without conflicts. |
|
@calvinccheung Pushed as commit c4b516d. 💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored. |
This changeset fixes a crash during AOT cache creation when
AOTInvokeDynamicLinkingis disabled.Changes in
cdsHeapVerifier.cppis required to avoid error such as the following during AOT cache creation:Per Ioi's suggestions, added the
CDSConfig::is_dumping_method_handles()so that most of the calls toCDSConfig::is_dumping_aot_linked_classes()andCDSConfig::is_dumping_invokedynamic()could be replaced with the new function.Passed tiers 1 - 3 testing.
Progress
Issue
Reviewers
Contributors
<iklam@openjdk.org>Reviewing
Using
gitCheckout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/23546/head:pull/23546$ git checkout pull/23546Update a local copy of the PR:
$ git checkout pull/23546$ git pull https://git.openjdk.org/jdk.git pull/23546/headUsing Skara CLI tools
Checkout this PR locally:
$ git pr checkout 23546View PR using the GUI difftool:
$ git pr show -t 23546Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/23546.diff
Using Webrev
Link to Webrev Comment