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

Matias Saavedra Silva matsaave at openjdk.org
Fri Nov 22 18:33:54 UTC 2024


> 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 with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains six additional commits since the last revision:

 - Removed unnecessary mark pointer
 - Abstracted serialization code and adjusted tests
 - Merge branch 'master' into native_access_8342089
 - Cleanup
 - Added regression test
 - 8342089: Require --enable-native-access to be the same between CDS dump time and run time

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

Changes:
  - all: https://git.openjdk.org/jdk/pull/22305/files
  - new: https://git.openjdk.org/jdk/pull/22305/files/b403a7ca..7823705f

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jdk&pr=22305&range=01
 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=22305&range=00-01

  Stats: 95235 lines in 1643 files changed: 44799 ins; 42095 del; 8341 mod
  Patch: https://git.openjdk.org/jdk/pull/22305.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/22305/head:pull/22305

PR: https://git.openjdk.org/jdk/pull/22305


More information about the hotspot-runtime-dev mailing list