Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8316179

Use consistent naming for lightweight locking in MacroAssembler

XMLWordPrintable

    • b16

        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 pure C++ files). That part will be handled as a separate PR.

              stefank Stefan Karlsson
              stefank Stefan Karlsson
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Created:
                Updated:
                Resolved: