RFR: 8293613: need to properly handle and hide tmp VTMS transitions [v3]

Serguei Spitsyn sspitsyn at openjdk.org
Tue Sep 20 22:19:55 UTC 2022


On Mon, 19 Sep 2022 20:19:10 GMT, Chris Plummer <cjplummer at openjdk.org> wrote:

>> Serguei Spitsyn has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   fixed typo in VirtualThread.c
>
> src/hotspot/share/prims/jvmtiEnvBase.cpp line 713:
> 
>> 711:   if (!jt->is_in_tmp_VTMS_transition()) {
>> 712:     jvf = check_and_skip_hidden_frames(jt, jvf);
>> 713:   }
> 
> I think this comment needs some help. It's hard to match it up with what the code is doing. I think you are saying you want to avoid skipping hidden frames when in transition, although if that's the case, it's not clear to me why not skipping is ok.
> 
> Also is skipping (or not skipping) ok regardless of the JvmtiEnvBase::is_cthread_with_continuation() result?

Thank you for reviewing and the comment, Chris.
I agree, this part and related comment is kind of obscure.
I'll think how to make the comment better.
In fact, all temporary VTMS transitions do temporary switch the `JavaThread` identity from virtual thread to carrier. There is no need to skip frames because there are no real carrier thread frames at the top. Moreover, any attempt to skip frames which are in transition works incorrectly and gives an empty stack. The check `JvmtiEnvBase::is_cthread_with_continuation()` is needed to make sure we have a deal with a continuation. There is no need to skip frames otherwise.

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

PR: https://git.openjdk.org/jdk/pull/10321


More information about the serviceability-dev mailing list