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

Calvin Cheung ccheung at openjdk.org
Mon Nov 25 22:16:42 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

Just couple of suggestions on function name and arg.

src/hotspot/share/runtime/arguments.hpp line 465:

> 463: 
> 464:   static bool is_internal_module_property(const char* option);
> 465:   static bool is_non_cds_compatible_internal_module_property(const char* property);

Suggestion on the function name:
    `is_incompatible_cds_internal_module_property`

src/hotspot/share/runtime/arguments.hpp line 466:

> 464:   static bool is_internal_module_property(const char* option);
> 465:   static bool is_non_cds_compatible_internal_module_property(const char* property);
> 466:   static bool internal_module_property_helper(const char* property, bool check_for_cds);

Instead of `bool check_for_cds`, how about `bool check_all`?
If you choose to rename that, you'll need to change the checking of the bool inside the function and also flip the bool value at the callsites.

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

PR Review: https://git.openjdk.org/jdk/pull/22305#pullrequestreview-2459738020
PR Review Comment: https://git.openjdk.org/jdk/pull/22305#discussion_r1857411455
PR Review Comment: https://git.openjdk.org/jdk/pull/22305#discussion_r1857411499


More information about the hotspot-runtime-dev mailing list