RFR: 8351748: Add class init barrier to AOT-cached Method/Var Handles [v2]

Vladimir Ivanov vlivanov at openjdk.org
Tue Mar 18 23:23:13 UTC 2025


On Tue, 18 Mar 2025 03:55:01 GMT, Ioi Lam <iklam at openjdk.org> wrote:

>> Whenever we store a MethodHandle in the AOT cache, we need to make sure that the class of this method is aot-initialized. Otherwise, the JVM might execute a BSM without first initializing the class of this BSM.
>> 
>> Please see the bug report for detail analysis.
>> 
>> I also fixed a problem in related logging code.
>
> Ioi Lam 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:
> 
>  - clean up
>  - Merge branch 'master' into 8351748-classes-of-cached-method-handles-should-be-aot-inited
>  - Added CDS::needsClassInitBarrier() for adding init barriers to cached Method/Var Handles
>  - Merge branch 'master' into 8351748-classes-of-cached-method-handles-should-be-aot-inited
>  - Experiment: always include init barriers in cached MethodHandle/VarHandle
>  - 8351748: Classes of method handles in the AOT cache should be AOT-initialized

Looks good.

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

Marked as reviewed by vlivanov (Reviewer).

PR Review: https://git.openjdk.org/jdk/pull/24004#pullrequestreview-2696511107


More information about the hotspot-runtime-dev mailing list