RFR: 8368182: AOT cache creation fails with class defined by JNI [v2]

Ioi Lam iklam at openjdk.org
Tue Sep 23 21:53:46 UTC 2025


> The AOT cache should store only classes from known locations (modules file, classpath, module path). Classes defined by JNI should be excluded.
> 
> However, the `ik->set_shared_classpath_index(0)` call in classLoader.cpp had the incorrect side effect of allowing all classes defined by JNI to be stored in the AOT configuration file at the end of the training run. This causes failure when we use the AOT configuration file to create the AOT cache.
> 
> The fix is to set the `shared_classpath_index` of such classes to -1 so they are excluded.
> 
> Also, `LambdaFormInvokers::regenerate_holder_classes()` needs to be updated to specify a non-null code source, so that the regenerated holder classes are not excluded.

Ioi Lam has updated the pull request incrementally with two additional commits since the last revision:

 - Forgot to check in code that was supposed in the last changeset
 - @dholmes-ora review comments; also cleaned up code and fixed incorrect comment

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

Changes:
  - all: https://git.openjdk.org/jdk/pull/27412/files
  - new: https://git.openjdk.org/jdk/pull/27412/files/c4af945c..01c07e69

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

  Stats: 4 lines in 1 file changed: 0 ins; 0 del; 4 mod
  Patch: https://git.openjdk.org/jdk/pull/27412.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/27412/head:pull/27412

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


More information about the hotspot-runtime-dev mailing list