On Mon, 15 Jul 2024 08:41:01 GMT, Alan Bateman <al...@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

Reply via email to