RFR: 8351748: Classes of method handles in AOT cache should be AOT-inited

Vladimir Ivanov vlivanov at openjdk.org
Thu Mar 13 16:53:59 UTC 2025


On Thu, 13 Mar 2025 05:17:04 GMT, Ioi Lam <iklam at openjdk.org> wrote:

> Could you elaborate how this can be done?

For `MethodHandle`s `DirectMethodHandle.shouldBeInitialized(Class)` determines whether a barrier is needed or not. It can be tweaked to behave conservatively during assembly phase and report `true` irrespective of whether the target class is initialized or not. (And it can take AOT-inited classes into account as well.) 

(`VarHandle`s use `Unsafe.shouldBeInitialized(Class)` directly.)

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

PR Comment: https://git.openjdk.org/jdk/pull/24004#issuecomment-2721973659


More information about the hotspot-runtime-dev mailing list