On Wed, 20 Mar 2024 22:03:30 GMT, Serguei Spitsyn <sspit...@openjdk.org> wrote:

>> The `JvmtiHandshake` and `JvmtiUnitedHandshakeClosure` classes were 
>> introduced in the JDK 22 to unify/simplify the JVM TI functions supporting 
>> implementation of the virtual threads. This enhancement is to refactor JVM 
>> TI functions `GetOwnedMonitorInfo` and `GetOwnedMonitorStackDepthInfo` on 
>> the base of `JvmtiHandshake and `JvmtiUnitedHandshakeClosure` classes.
>> 
>> Testing:
>>  - Ran mach5 tiers 1-6
>
> Serguei Spitsyn has updated the pull request incrementally with one 
> additional commit since the last revision:
> 
>   review: work around problem for vthreads in 
> EscapeBarrier::deoptimize_objects

src/hotspot/share/prims/jvmtiEnv.cpp line 1366:

> 1364:   }
> 1365: 
> 1366:   if (java_thread != nullptr) {

I am not sure why this check is needed at this level. It is duplication.The 
GetOwnedMonitorInfoClosure::do_vthread checks if thread is null (no-op for 
unmounted threads). 
Currently, the unmounted threads can't own monitor. But if it's changed we need 
to update this check as well as the implementation of handshakes.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/18332#discussion_r1532988358

Reply via email to