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

Daniel Lundén dlunden at openjdk.org
Mon Jan 15 09:35:20 UTC 2024


On Fri, 12 Jan 2024 23:13:56 GMT, Vladimir Kozlov <kvn at openjdk.org> wrote:

>> Thanks @vnkozlov. Do you know if we can directly use `can_represent` instead, and not take `sync_stack_slots()` into account? The field `_inmask` in `BoxLockNode` seems to only specify a single register (one bit in the mask).
>
> I think your current code is correct.
> 
> On x64 `sync_stack_slots` defined as 2 (takes 2 bits in regmask) in  `x86_64.ad` and as 1 in `x86_32.ad`. On most 64 bit platforms it is also 2 slots, from what I see. But we can't guarantee that some platforms will not have bigger value. We can't use last odd bit on 64 bit platform in regmask - it is taking anyway already by "infinite stack flag".

Yes, that is my intuition as well. Therefore, I'm left wondering if the [construction of `_inmask`](https://github.com/dlunde/jdk/blob/9ab6e561780aee0f2cc2f06cd40ec487d60fe39c/src/hotspot/share/opto/locknode.cpp#L51) in the `BoxLockNode` constructor is incorrect, as it always just sets a single bit in the mask (no matter the value of `sync_stack_slots()`). Should we perhaps change it to instead set the range [ reg, reg + sync_stack_slots() ) in `_inmask`?

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

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


More information about the hotspot-compiler-dev mailing list