RFR: 8364343: Virtual Thread transition management needs to be independent of JVM TI [v9]
Patricio Chilano Mateo
pchilanomate at openjdk.org
Wed Nov 26 22:51:58 UTC 2025
On Tue, 25 Nov 2025 23:27:47 GMT, Coleen Phillimore <coleenp at openjdk.org> wrote:
>> Patricio Chilano Mateo has updated the pull request incrementally with one additional commit since the last revision:
>>
>> missing to initialize _is_disabler_at_start
>
> src/hotspot/share/prims/jvmtiEnvBase.cpp line 1772:
>
>> 1770:
>> 1771: assert(java_thread != nullptr, "sanity check");
>> 1772: assert(!java_thread->is_in_VTMS_transition(), "sanity check");
>
> Why don't you need these asserts anymore?
We can’t assert this because it could be temporarily set by the target while trying to transition. Previously we had two fields in JavaThread, `_VTMS_transition_mark` and `_is_in_VTMS_transition`. `_VTMS_transition_mark` was set first (checked by the disabler), and if transitions were disabled we waited. Once the transition could start we set `_is_in_VTMS_transition`.
Going over the changes I see I removed one assert in `JvmtiEnvBase::get_vthread_jvf` that should be okay to keep, so I restored it. Also added an assert in `JavaThread::is_in_VTMS_transition()` (now `is_in_vthread_transition`) to verify that if it’s accessed from another thread then it has to be done from a safe context where the value will not change right after checking.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/28361#discussion_r2566664593
More information about the graal-dev
mailing list