RFR: 8335480: Only deoptimize threads if needed when closing shared arena [v2]

Alan Bateman alanb at openjdk.org
Mon Jul 15 08:43:54 UTC 2024


On Mon, 15 Jul 2024 08:38:59 GMT, Uwe Schindler <uschindler at openjdk.org> wrote:

>> src/hotspot/share/prims/scopedMemoryAccess.cpp line 179:
>> 
>>> 177:         //
>>> 178:         // The safepoint at which we're stopped may be in between the liveness check
>>> 179:         // and actual memory access, but is itself 'outside' of @Scoped code
>> 
>> 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 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.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/20158#discussion_r1677489415


More information about the core-libs-dev mailing list