RFR: 8319801: Recursive lightweight locking: aarch64 implementation [v9]
Andrew Haley
aph at openjdk.org
Thu Jan 25 13:03:38 UTC 2024
On Thu, 25 Jan 2024 11:45:58 GMT, Axel Boldt-Christmas <aboldtch at openjdk.org> wrote:
>> 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.
LOL! I think I originally wrote the old implementation. Mind you, it was a long time ago, and I know better now.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/16608#discussion_r1466342009
More information about the hotspot-dev
mailing list