RFR: 8319801: Recursive lightweight locking: aarch64 implementation [v9]
Axel Boldt-Christmas
aboldtch at openjdk.org
Thu Jan 25 11:50:49 UTC 2024
On Thu, 25 Jan 2024 11:04:35 GMT, Andrew Haley <aph 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 277:
>
>> 275: orr(mark, mark, markWord::unlocked_value);
>> 276: eor(t, mark, markWord::unlocked_value);
>> 277: // Acquire to satisfy the JMM.
>
> This comment is borderline unnecessary, IMO. Acquiring a lock implies an acquire barrier, releasing a lock implies a release barrier. Roach motel semantics imply that no more barriers are required or helpful. Anyone who is programming at the level needed to understand this code should already know the basic facts.
Fair. The comment was more to signal `Only Acquire` and `Only Release` as it differs from how it used to be implement where both enter and exit had explicit acquire+release.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/16608#discussion_r1466251522
More information about the hotspot-dev
mailing list