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

David Holmes dholmes at openjdk.org
Wed Sep 24 01:56:29 UTC 2025


On Tue, 23 Sep 2025 21:53:46 GMT, Ioi Lam <iklam at openjdk.org> wrote:

>> 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

Okay - looks good.

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

Marked as reviewed by dholmes (Reviewer).

PR Review: https://git.openjdk.org/jdk/pull/27412#pullrequestreview-3260337425


More information about the hotspot-runtime-dev mailing list