-
Notifications
You must be signed in to change notification settings - Fork 6.2k
8244778: Archive full module graph in CDS #80
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
|
/cc core-libs |
|
👋 Welcome back iklam! A progress list of the required criteria for merging this PR into |
|
@iklam |
|
@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 |
|
/reviewer add lfoltan,coleenp,alanb,mchung |
|
@iklam Reviewer Reviewer Reviewer |
eaa9125 to
89f3327
Compare
|
@iklam This change now passes all automated pre-integration checks. In addition to the automated checks, the change must also fulfill all project specific requirements After integration, the commit message will be:
There are currently no new commits on the ➡️ To integrate this PR with the above commit message to the |
Webrevs
|
|
In response to Lois Foltain's comments on [email protected]:
I renamed the functions to
Arbitrary user code cannot be executed during -Xshare:dump. The only way to do it is to use a JVMTI agent, which requires specifying |
|
/label remove build,hotspot |
|
/cc hotspot-runtime |
|
@iklam The |
|
@iklam |
|
/label remove security |
|
@iklam |
erikj79
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.
Build changes look good.
lfoltan
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.
Thanks Ioi for addressing my review comments. Overall, looks great!
|
Ok thanks! So many emails ... |
cl4es
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.
Excellent work!
Only a few minor comments inline, which you can choose to ignore.
| assert(DumpSharedSpaces, "must be"); | ||
| assert_valid(loader_data); | ||
| if (loader_data != NULL) { | ||
| // We can't create hashtables at dump time because the hashcode dependes on the |
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.
dependes -> depends
| if (loader_data != NULL) { | ||
| // We can't create hashtables at dump time because the hashcode dependes on the | ||
| // address of the Symbols, which may be relocated at run time due to ASLR. | ||
| // So we store the packages/modules in a Arrays. At run time, we create |
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.
run time -> runtime
a Arrays -> Arrays
| if (klass == SystemDictionary::ClassLoader_klass() || // ClassLoader::loader_data is malloc'ed. | ||
| klass == SystemDictionary::Module_klass() || // Module::module_entry is malloc'ed | ||
| // The next 3 classes are used to implement java.lang.invoke, and are not used directly in | ||
| // regular Java code. The implementation of java.lang.invoke uses generated anonymoys classes |
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.
pre-existing: anonymoys
| assert(UseSharedSpaces && MetaspaceShared::use_full_module_graph(), "must be"); | ||
|
|
||
| // We don't want the classes used by the archived full module graph to be redefined by JVMTI. | ||
| // Luckily, such classes are loaded in the JVMTI "early" phase, and CDS is disable if a JVMTI |
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.
disabled
| {"java/lang/Character$CharacterCache", "archivedCache"}, | ||
| {"java/util/jar/Attributes$Name", "KNOWN_NAMES"}, | ||
| {"sun/util/locale/BaseLocale", "constantBaseLocales"}, | ||
| {"java/lang/Integer$IntegerCache", 0, "archivedCache"}, |
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.
Could the changes here be simplified or clarified? I think the new field should be a bool, or we could instead introduce a new array for the fields archived only when archiving the full module graph (the field is ignored on iteration over closed_archive_subgraph_entry_fields anyhow)
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 split out the new fields into a separate array as you suggested. Also fixed the typos you found. See commit e987110.
|
/integrate |
Restore looks like this now: ``` 0x0000000106e4dfcc: movk x9, #0x5e4, lsl openjdk#16 0x0000000106e4dfd0: movk x9, #0x1, lsl openjdk#32 0x0000000106e4dfd4: blr x9 0x0000000106e4dfd8: ldp x2, x3, [sp, openjdk#16] 0x0000000106e4dfdc: ldp x4, x5, [sp, openjdk#32] 0x0000000106e4dfe0: ldp x6, x7, [sp, openjdk#48] 0x0000000106e4dfe4: ldp x8, x9, [sp, openjdk#64] 0x0000000106e4dfe8: ldp x10, x11, [sp, openjdk#80] 0x0000000106e4dfec: ldp x12, x13, [sp, openjdk#96] 0x0000000106e4dff0: ldp x14, x15, [sp, openjdk#112] 0x0000000106e4dff4: ldp x16, x17, [sp, openjdk#128] 0x0000000106e4dff8: ldp x0, x1, [sp], openjdk#144 0x0000000106e4dffc: ldp xzr, x19, [sp], openjdk#16 0x0000000106e4e000: ldp x22, x23, [sp, openjdk#16] 0x0000000106e4e004: ldp x24, x25, [sp, openjdk#32] 0x0000000106e4e008: ldp x26, x27, [sp, openjdk#48] 0x0000000106e4e00c: ldp x28, x29, [sp, openjdk#64] 0x0000000106e4e010: ldp x30, xzr, [sp, openjdk#80] 0x0000000106e4e014: ldp x20, x21, [sp], openjdk#96 0x0000000106e4e018: ldur x12, [x29, #-24] 0x0000000106e4e01c: ldr x22, [x12, openjdk#16] 0x0000000106e4e020: add x22, x22, #0x30 0x0000000106e4e024: ldr x8, [x28, openjdk#8] ```
* Use JOL to compute size of AllocObject and enforce this as minimum object size * Include array overhead in total
This is the same patch as 8244778-archive-full-module-graph.v03 published in [email protected].
The rest of the review will continue on GitHub. I will add new commits to respond to comments to the above e-mail.
Progress
Issue
Reviewers
Download
$ git fetch https://git.openjdk.java.net/jdk pull/80/head:pull/80$ git checkout pull/80