RFR: 8316746: Top of lock-stack does not match the unlocked object [v3]

Richard Reingruber rrich at openjdk.org
Thu Nov 2 16:45:05 UTC 2023


On Sun, 29 Oct 2023 17:46:55 GMT, Martin Doerr <mdoerr at openjdk.org> wrote:

>> It took me quite a long journey to figure out that C2 OSR goes wrong only in the test "vmTestbase/nsk/jdi/StepEvent" because the interpreter fills the slots in a different order as expected by C2. (Interpreter and C1 don't care about it.)
>> I've reimplemented the search loop in `monitorenter`, improved comments and cleaned up the related code a bit. The test is passing with this change.
>
> Martin Doerr has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Add regression test.

The code in this PR is a lot easier to follow than the baseline version and it looks correct to me.
I tried to understand what's actually wrong with the baseline but gave up. Do you know where precisely the bug is?

Anyway, thanks for fixing this!
Richard.

src/hotspot/cpu/ppc/templateTable_ppc_64.cpp line 4191:

> 4189:   // ------------------------------------------------------------------------------
> 4190:   // Find a free slot in the monitor block.
> 4191:   // Note: The order of the monitors is important for C2 OSR which derives the

You should refer to the decl. of the `interpreter_frame_monitor_*` where the expected order is specified.

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

Marked as reviewed by rrich (Reviewer).

PR Review: https://git.openjdk.org/jdk/pull/16406#pullrequestreview-1710629030
PR Review Comment: https://git.openjdk.org/jdk/pull/16406#discussion_r1380353248


More information about the hotspot-compiler-dev mailing list