RFR: 8334421: assert(!oldbox->is_unbalanced()) failed: this should not be called for unbalanced region

Vladimir Ivanov vlivanov at openjdk.org
Mon Jun 24 23:37:11 UTC 2024


On Mon, 24 Jun 2024 23:22:34 GMT, Vladimir Kozlov <kvn at openjdk.org> wrote:

> [JDK-8324969](https://bugs.openjdk.org/browse/JDK-8324969) changes was not complete. When Escape Analysis tries to determine if lock can be eliminated it looks only if corresponding object does not escape. I does not take into account if coarsening locks elimination already happened and created unbalanced regions.
> 
> Added check that not-escaped object is not referenced from an unbalanced region before marking or eliminating corresponding locks.
> 
> Dump additional information for coarsened locks when debugging.
> 
> New regression test was added
> 
> Tested tier1-5,stress,xcomp

Looks good.

src/hotspot/share/opto/escape.cpp line 3505:

> 3503: // all compiled code paths have corresponding Lock/Unlock pairs.
> 3504: bool ConnectionGraph::can_eliminate_lock(AbstractLockNode* alock) {
> 3505:   BoxLockNode* box = alock->box_node()->as_BoxLock();

The definition can be moved under `EliminateNestedLocks` guard.

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

Marked as reviewed by vlivanov (Reviewer).

PR Review: https://git.openjdk.org/jdk/pull/19870#pullrequestreview-2136989927
PR Review Comment: https://git.openjdk.org/jdk/pull/19870#discussion_r1651769062


More information about the hotspot-compiler-dev mailing list