-
Notifications
You must be signed in to change notification settings - Fork 6.2k
8373392: Replace CDS object subgraphs with @AOTSafeClassInitializer #28736
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
base: master
Are you sure you want to change the base?
8373392: Replace CDS object subgraphs with @AOTSafeClassInitializer #28736
Conversation
|
👋 Welcome back iklam! A progress list of the required criteria for merging this PR into |
|
@iklam 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 6 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 |
|
@iklam The following labels 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 lists. If you would like to change these labels, use the /label pull request command. |
liach
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.
Is IntegerCache.cache the only field that need to be adjusted according to system properties after loading from AOT archive?
|
|
||
| @AOTRuntimeSetup | ||
| private static void runtimeSetup() { | ||
| // to generate a reasonably random and well-mixed SALT, use an arbitrary |
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.
| // to generate a reasonably random and well-mixed SALT, use an arbitrary | |
| // to generate a reasonably random and well-mixed SALT, use an arbitrary |
I think so. The cache size for all other Number types are fixed and cannot be modified by the command-line. |
liach
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.
The Java code changes look reasonable.
In legacy CDS, Java objects used by certain classes are computed ahead of time using "object subgraphs"
jdk/src/hotspot/share/cds/heapShared.cpp
Lines 168 to 171 in 1bbbce7
Examples of subgraphs:
java.lang.Integer$IntegerCache::cachejdk.internal.module.ArchivedBootLayer::bootLayerThe implementation requires special code (in both Java and C++) to be executed when a CDS archive is created or loaded. As a result, we have an execution model that's difficult to implement/extend and the behavior is hard to understand.
To move towards the AOT Cache Snapshot Model (JDK-8365645) we should replace the subgraphs with the use of
@AOTSafeClassInitializer, and if necessary,@AOTRuntimeSetup. This will simplify the current implementation, and make it possible to extend AOT-initializations to more core classes.Note, the use of
@AOTSafeClassInitializerrequires-XX:+AOTClassLinking. For the time being, we retain the old CDS object subgraph code to cover the-XX:-AOTClassLinkingcases. Such code will be marked with comments like/* Legacy CDS archive support (to be deprecated) */. All future AOT creation of Java objects will be done with@AOTSafeClassInitializer.Progress
Issue
Reviewers
Reviewing
Using
gitCheckout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/28736/head:pull/28736$ git checkout pull/28736Update a local copy of the PR:
$ git checkout pull/28736$ git pull https://git.openjdk.org/jdk.git pull/28736/headUsing Skara CLI tools
Checkout this PR locally:
$ git pr checkout 28736View PR using the GUI difftool:
$ git pr show -t 28736Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/28736.diff
Using Webrev
Link to Webrev Comment