RFR: 8335480: Only deoptimize threads if needed when closing shared arena [v2]
Uwe Schindler
uschindler at openjdk.org
Mon Jul 15 08:53:52 UTC 2024
On Mon, 15 Jul 2024 08:41:01 GMT, Alan Bateman <alanb at openjdk.org> wrote:
>> This is the whole magic around the shared arena. It is not public API and internal to Hotspot/VM:
>> - https://github.com/openjdk/jdk/blob/a96de6d8d273d75a6500e10ed06faab9955f893b/src/java.base/share/classes/jdk/internal/misc/X-ScopedMemoryAccess.java.template#L117-L119
>> - https://github.com/openjdk/jdk/blob/a96de6d8d273d75a6500e10ed06faab9955f893b/src/hotspot/share/prims/scopedMemoryAccess.cpp#L143-L149
>
>> what is `@Scoped code`? I don't see that annotation mentioned here: https://docs.oracle.com/en/java/javase/22/docs/api/java.base/java/lang/ScopedValue.html
>
> This is nothing to do with scoped values, instead this is an annotation declared in jdk.internal.misc.ScopedMemoryAccess that is known to the VM.
Basically if the VM is inside a `@Scoped` method and it starts a thread-local handshake, it will deoptimize top-most frame of all those threads so they can do the "isAlive" check.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/20158#discussion_r1677501161
More information about the core-libs-dev
mailing list