[master] RFR: 8302065: [Lilliput] Cleanups and touch-ups

Roman Kennke rkennke at openjdk.org
Thu Feb 9 10:31:15 UTC 2023


On Thu, 9 Feb 2023 09:34:10 GMT, Aleksey Shipilev <shade at openjdk.org> wrote:

>> Lilliput accumulated a couple of superfluous changes and could need some minor improvements.
>
> src/hotspot/cpu/x86/c2_MacroAssembler_x86.cpp line 815:
> 
>> 813:     if (UseFastLocking) {
>> 814:       // If the owner is ANONYMOUS, we need to fix it - in the slow-path.
>> 815:       testb(Address(tmpReg, OM_OFFSET_NO_MONITOR_VALUE_TAG(owner)), (int32_t) (intptr_t) ANONYMOUS_OWNER);
> 
> Sanity question: This would accept the monitor that has the lowest byte equal to `ANONYMOUS_OWNER`. Are we guaranteed that no monitor would ever have the lowest bit as `1`? Probably true, just checking the reason here.

Valid monitor owners can only be Thread* or ANONYMOUS or NULL (or stack-pointers, but only with stack-locking). Thread instances are allocated at least word-aligned, so no, 1 cannot be a valid monitor owner.

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

PR: https://git.openjdk.org/lilliput/pull/73


More information about the lilliput-dev mailing list