RFR: 8328285: GetOwnedMonitorInfo functions should use JvmtiHandshake [v2]

Patricio Chilano Mateo pchilanomate at openjdk.org
Wed Mar 20 02:33:22 UTC 2024


On Tue, 19 Mar 2024 00:10:32 GMT, Serguei Spitsyn <sspitsyn at 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: correct one comment

Looks good to me.

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

> 1366:   if (java_thread != nullptr) {
> 1367:     Handle thread_handle(calling_thread, thread_oop);
> 1368:     EscapeBarrier eb(true, calling_thread, java_thread);

I see that now we will execute the EscapeBarrier code for the vthread case too. We actually had to disable that for virtual threads since it doesn't work (8285739 and 8305625). But we only addressed the case when targeting all threads and not the single thread one. We would need to add the same check in EscapeBarrier::deoptimize_objects(int d1, int d2) to skip a thread with mounted continuation.

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

PR Review: https://git.openjdk.org/jdk/pull/18332#pullrequestreview-1947846211
PR Review Comment: https://git.openjdk.org/jdk/pull/18332#discussion_r1531444319


More information about the serviceability-dev mailing list