On Wed, 29 Apr 2026 00:09:42 GMT, Dean Long <[email protected]> wrote:
>> Serguei Spitsyn has updated the pull request incrementally with one
>> additional commit since the last revision:
>>
>> review: a call to OrderAccess::storestore is added
>
> src/hotspot/share/prims/jvmtiImpl.cpp line 503:
>
>> 501: // Must ensure the content of the buffered value is visible
>> 502: // before publishing the buffered value oop
>> 503: OrderAccess::storestore(); }
>
> A storestore() seems necessary before publishing the jobject to other
> threads, if copy_to() is used. But why can't we do this instead:
>
> oop obj_copy = src.read(_calling_thread);
> if (obj_copy == nullptr) {
> _result = JVMTI_ERROR_OUT_OF_MEMORY;
> } else {
> _value.l = JNIHandles::make_local(_calling_thread, obj_copy);
> }
Thanks!
> But why can't we do this instead:
The `src` is an object of the `BufferedValuePayload` class which does not have
the `read(TRAPS)` function.
I was thinking to introduce such function but have a doubt there is a strong
need for that.
-------------
PR Review Comment:
https://git.openjdk.org/valhalla/pull/2363#discussion_r3158413853