RFR: 8328313: Archived module graph should allow identical --module-path to be specified during dump time and run time [v9]
David Holmes
dholmes at openjdk.org
Wed Oct 2 02:16:42 UTC 2024
On Tue, 1 Oct 2024 17:30:10 GMT, Calvin Cheung <ccheung at openjdk.org> wrote:
>> Prior to this patch, if `--module-path` is specified in the command line:
>> during CDS dump time, full module graph will not be included in the CDS archive;
>> during run time, full module graph will not be used.
>>
>> With this patch, the full module graph will be included in the CDS archive with the `--module-path` option. During run time, if the same `--module-path` option is specified, the archived module graph will be used.
>>
>> The checking of module paths between dump time and run time is more lenient compared with the checking of class paths; the ordering of the modules is unimportant, duplicate module names are ignored.
>> E.g. the following is considered a match:
>> dump time runtime
>> m1,m2 m2,m1
>> m1,m2 m1,m2,m2
>>
>> I included some [notes](https://bugs.openjdk.org/browse/JDK-8328313?focusedId=14699275&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-14699275) in the bug report regarding some changes in the corelib classes.
>
> Calvin Cheung has updated the pull request incrementally with one additional commit since the last revision:
>
> trailing whitespace
Nothing further from me on the VM side. Just a couple of minor nits.
Thanks
src/hotspot/share/cds/filemap.cpp line 974:
> 972: if (header()->has_full_module_graph() && !matched_module_paths) {
> 973: CDSConfig::stop_using_optimized_module_handling();
> 974: log_info(cds)("optimized module handling: disabled because mismatched module paths");
Suggestion:
log_info(cds)("optimized module handling: disabled because of mismatched module paths");
src/hotspot/share/cds/heapShared.cpp line 885:
> 883: ClassLoaderExt::num_module_paths() > 0) {
> 884: // ArchivedModuleGraph was created with a --module-path that's different than the runtime --module-path.
> 885: // Thus, it might contain references to modules that do not exist in runtime. We cannot use it.
Suggestion:
// Thus, it might contain references to modules that do not exist at runtime. We cannot use it.
src/hotspot/share/classfile/classLoaderExt.cpp line 123:
> 121:
> 122: // Sort the module paths before storing into CDS archive for simpler
> 123: // checking during runtime.
Suggestion:
// checking at runtime.
-------------
Marked as reviewed by dholmes (Reviewer).
PR Review: https://git.openjdk.org/jdk/pull/21048#pullrequestreview-2341785448
PR Review Comment: https://git.openjdk.org/jdk/pull/21048#discussion_r1783757502
PR Review Comment: https://git.openjdk.org/jdk/pull/21048#discussion_r1783754320
PR Review Comment: https://git.openjdk.org/jdk/pull/21048#discussion_r1783758610
More information about the core-libs-dev
mailing list