RFR: 8319801: Recursive lightweight locking: aarch64 implementation [v9]

Axel Boldt-Christmas aboldtch at openjdk.org
Thu Jan 25 07:47:29 UTC 2024


On Wed, 24 Jan 2024 17:25:20 GMT, Coleen Phillimore <coleenp at openjdk.org> wrote:

>> Axel Boldt-Christmas has updated the pull request incrementally with two additional commits since the last revision:
>> 
>>  - Preloads markWord unconditionally
>>  - Revert "Add preload_mark to MacroAssembler::lightweight_lock"
>>    
>>    This reverts commit 8950f503aa5dba0e203613bd9737ea0d50388ca3.
>
> src/hotspot/cpu/aarch64/c2_MacroAssembler_aarch64.cpp line 381:
> 
>> 379:     assert(oopDesc::mark_offset_in_bytes() == 0, "required to avoid lea");
>> 380:     orr(t, mark, markWord::unlocked_value);
>> 381:     // Release to satisfy the JMM.
> 
> I don't know what this comment is trying to say.
> in the cmpxchg, is 't' the address of the markWord?

The `Release to satisfy the JMM.`? It refers to the CAS only having release semantics, which is enough to satisfy the java memory model.

t contains the new value which is `t = mark | 0b01` 
mark is the markWord (value not address) loaded above `ldr(mark, Address(obj, oopDesc::mark_offset_in_bytes()));`
obj is the address of the object and because `oopDesc::mark_offset_in_bytes() ==0` it is also the address of the markWord.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/16608#discussion_r1465956986


More information about the hotspot-dev mailing list