RFR: 8328285: GetOwnedMonitorInfo functions should use JvmtiHandshake [v4]
Leonid Mesnik
lmesnik at openjdk.org
Thu Mar 21 01:13:23 UTC 2024
On Thu, 21 Mar 2024 01:01:22 GMT, Serguei Spitsyn <sspitsyn at openjdk.org> wrote:
>> 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;
> + }
>
> I've replaced it with an assert:
>
> assert(_target_jt != nullptr, "sanity check");
Thanks, that should work!
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/18332#discussion_r1533118435
More information about the hotspot-dev
mailing list