RFR: 8316179: Use consistent naming for lightweight locking in MacroAssembler

Roman Kennke rkennke at openjdk.org
Wed Sep 13 11:31:48 UTC 2023


On Wed, 13 Sep 2023 11:00:13 GMT, Stefan Karlsson <stefank at openjdk.org> wrote:

> Different platforms uses different names for the `MacroAssembler` functions that implement the lightweight fast locking/unlocking code. I propose that we use consistent naming for all platforms.
> 
> These are the current names for the lightweight-locking functions:
> * AArch64, ppc, riscv: `fast_lock`
> * x86: `fast_lock_impl`
> * arm: `fast_lock_2`
> 
> Note that x86 and arm uses different names and the likely reason for that is that the `C2_MacroAssembler` subclass also implements a fast_lock function in that class, on those platforms.
> 
> The fast_lock function in `C2_MacroAssembler` deals with the fast locking for all `LockingMode` implementations (monitor, legacy, and lightweight), while the `MacroAssembler::fast_lock*` functions only implement the lightweight locking implementation.
> 
> I therefore propose that we use the name `MacroAssembler::lightweight_lock` on all platforms.
> 
> *Note* that this is a small cleanup to update the names. The reason why I'm looking into this is that I want to move the C2 fast locking code out of the AArch64 (and other platforms) .ad file into C++ files to make it consistent with the x64 code structure (and to get better IDE support when the code is in plain C++ files). In that restructuring of the code I'm introducing `C2_MacroAssembler::fast_lock` functions that currently name-clash / shadow the `MacroAssembler::fast_lock` functions.

Looks good to me, thank you!

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

Marked as reviewed by rkennke (Reviewer).

PR Review: https://git.openjdk.org/jdk/pull/15709#pullrequestreview-1624316275


More information about the hotspot-dev mailing list