RFR: 8342089: Require --enable-native-access to be the same between CDS dump time and run time [v6]

David Holmes dholmes at openjdk.org
Tue Nov 26 00:28:38 UTC 2024


On Mon, 25 Nov 2024 20:59:37 GMT, Matias Saavedra Silva <matsaave at openjdk.org> wrote:

>> Applications that use JNI or FFM need to use the `--enable-native-access` flag, or include the Enable-Native-Access attribute in their JAR files. Currently, the CDS archive cannot use optimized module handling when `--enable-native-access` is specified, so such applications do not support CDS. 
>> 
>> This patch no longer disables optimized module graph so long as the `--enable-native-access` is consistent between dump time and runtime. The modules list provided by the option is stored in the RO region of the CDS archive. Verified with tier 1-5 tests and a new regression test.
>
> Matias Saavedra Silva has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Cleanup

Updates look good, still a couple of nits.

Thanks

src/hotspot/share/classfile/modules.cpp line 580:

> 578:   if (runtime_flag == nullptr) {
> 579:     if (archived_flag != nullptr) {
> 580:       log_info(cds)("Value for property %s: %s specified during dump time but not during runtime", property, archived_flag);

I still think "Mismatched values for property" can be used for all three cases.

test/hotspot/jtreg/runtime/cds/appcds/jigsaw/module/EnableNativeAccessCDS.java line 60:

> 58:             "-version");
> 59:         oa.shouldHaveExitValue(0)
> 60:         .shouldContain("use_full_module_graph = true");

Please align dot operators on all of these.

-------------

Changes requested by dholmes (Reviewer).

PR Review: https://git.openjdk.org/jdk/pull/22305#pullrequestreview-2459872454
PR Review Comment: https://git.openjdk.org/jdk/pull/22305#discussion_r1857498944
PR Review Comment: https://git.openjdk.org/jdk/pull/22305#discussion_r1857505658


More information about the hotspot-runtime-dev mailing list