On Wed, 20 Mar 2024 22:41:05 GMT, Leonid Mesnik <lmes...@openjdk.org> wrote:

>> 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.

This is needed to avoid using the `EscapeBarrier` for unmounted virtual threads.
But you are right there is a duplication here - thanks.
The following check can be removed:

+GetOwnedMonitorInfoClosure::do_vthread(Handle target_h) {
+  if (_target_jt == nullptr) {
+    _result = JVMTI_ERROR_NONE;
+    return;
+  }

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

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

Reply via email to