RFR: 8322996: BoxLockNode creation fails with assert(reg < CHUNK_SIZE) failed: sanity [v3]

Vladimir Kozlov kvn at openjdk.org
Thu Jan 11 20:11:00 UTC 2024


On Thu, 11 Jan 2024 16:50:52 GMT, Daniel Lundén <dlunden at openjdk.org> wrote:

>> This changeset fixes an issue where deeply nested synchronized statements triggered an assert in C2.
>> 
>> Changes:
>> - Bail out on compilation when we create a `BoxLockNode` with a slot index that cannot fit in a `RegMask`. This is similar to how we handle the case when we do not have space to represent arguments in [`opto/matcher.cpp`](https://github.com/openjdk/jdk/blob/58b01dce054c50bcb5a28aad4c1b574acaa90f6d/src/hotspot/share/opto/matcher.cpp#L314-L318)
>> - Add a regression test.
>> 
>> Testing:
>> - [GitHub Actions](https://github.com/dlunde/jdk/actions/runs/7446998688)
>> - tier1, tier2, tier3, tier4, and tier5 on windows-x64, linux-x64, linux-aarch64, macosx-x64, and macosx-aarch64
>
> Daniel Lundén has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Remove superfluous -TieredCompilation

src/hotspot/share/opto/locknode.hpp line 66:

> 64:     return (int)reg < (int)(RegMask::CHUNK_SIZE - 1 - Compile::current()->sync_stack_slots());
> 65:   }
> 66: 

I think it should be in `regmask.hpp` together with other `can_represent_*` methods. Then you don't need part of the comment about those methods.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/17370#discussion_r1449340301


More information about the hotspot-compiler-dev mailing list