RFR: 8316181: Move the fast locking implementation out of the .ad files [v3]

Stefan Karlsson stefank at openjdk.org
Thu Sep 14 07:26:06 UTC 2023


> Some platforms put the fast locking implementation in the `C2_MacroAssembler` class, while others have it in the .ad files. I'd like to propose that we unify this a bit and move the code out of the .ad files.
> 
> The benefit is consistency between the platforms but also that it is easier to work with the C++ code when it is in plain C++ files and not in the .ad files.
> 
> The implementation is a pure copy of the code except that the section:
> 
>     C2_MacroAssembler _masm(&cbuf);
>     Register oop = as_Register($object$$reg);
>     Register box = as_Register($box$$reg);
>     Register disp_hdr = as_Register($tmp$$reg);
>     Register tmp = as_Register($tmp2$$reg);
> 
> 
> has been replaced with:
> 
>   Register oop = objectReg;
>   Register box = boxReg;
>   Register disp_hdr = tmpReg;
>   Register tmp = tmp2Reg;
> 
> 
> and the references to `__ ` have been removed.
> 
> This change affects AArch64 and RISC-V
> 
> Tested with tier1-3 on AArch64
> 
> This PR depends on #15709

Stefan Karlsson has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains four additional commits since the last revision:

 - Merge remote-tracking branch 'upstream/master' into fast_locking_unification
 - Move fast lock/unlock out of riscv.ad
 - Move fast lock/unlock out of aarch64.ad
 - Use consistent naming for MacroAssembler lightweight locking

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

Changes:
  - all: https://git.openjdk.org/jdk/pull/15712/files
  - new: https://git.openjdk.org/jdk/pull/15712/files/0efabfe1..00fa4e18

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jdk&pr=15712&range=02
 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=15712&range=01-02

  Stats: 6188 lines in 769 files changed: 3394 ins; 1904 del; 890 mod
  Patch: https://git.openjdk.org/jdk/pull/15712.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/15712/head:pull/15712

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


More information about the hotspot-compiler-dev mailing list