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

Vladimir Kozlov kvn at openjdk.org
Fri Jan 12 23:16:18 UTC 2024


On Fri, 12 Jan 2024 15:06:33 GMT, Daniel Lundén <dlunden at openjdk.org> wrote:

>> 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.
>
> 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".

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

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


More information about the hotspot-compiler-dev mailing list