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

Stefan Karlsson stefank at openjdk.org
Wed Sep 13 11:19:05 UTC 2023


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.

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

Commit messages:
 - Use consistent naming for MacroAssembler lightweight locking

Changes: https://git.openjdk.org/jdk/pull/15709/files
 Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=15709&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8316179
  Stats: 78 lines in 29 files changed: 0 ins; 0 del; 78 mod
  Patch: https://git.openjdk.org/jdk/pull/15709.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/15709/head:pull/15709

PR: https://git.openjdk.org/jdk/pull/15709


More information about the hotspot-dev mailing list