RFR: 8367601: Remove held_monitor_count

Patricio Chilano Mateo pchilanomate at openjdk.org
Tue Sep 30 15:53:49 UTC 2025


On Tue, 30 Sep 2025 09:43:51 GMT, Fredrik Bredberg <fbredberg at openjdk.org> wrote:

> Since we have removed all other locking modes than lightweight locking (see: [JDK-8344261](https://bugs.openjdk.org/browse/JDK-8344261)), we no longer need:
> - `_held_monitor_count`
> - `_parent_held_monitor_count`
> - `_jni_monitor_count`
> 
> This PR removes them from shared code as well as from `X86`, `AArch64`, `PowerPC` and `RISC-V`.
> They are not present in other platforms.
> 
> Tested tier1-7 (on supported platforms) without seeing any problems that can be traced to this code change.
> `PowerPC` and `RISC-V` has been sanity checked using QEMU.

src/hotspot/share/runtime/continuationFreezeThaw.cpp line 1742:

> 1740:     log_develop_debug(continuations)("PINNED due to critical section");
> 1741:     verify_continuation(cont.continuation());
> 1742:     freeze_result res = entry->is_pinned() ? freeze_pinned_cs : freeze_pinned_monitor;

We can remove this and always return freeze_pinned_cs. We should remove freeze_pinned_monitor (there is a matching definition in Continuation.java).

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

PR Review Comment: https://git.openjdk.org/jdk/pull/27570#discussion_r2392098950


More information about the graal-dev mailing list