Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

8316179: Use consistent naming for lightweight locking in MacroAssembler #15709

Closed

Conversation

stefank
Copy link
Member

@stefank stefank commented Sep 13, 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.


Progress

  • Change must be properly reviewed (1 review required, with at least 1 Reviewer)
  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue

Issue

  • JDK-8316179: Use consistent naming for lightweight locking in MacroAssembler (Enhancement - P4)

Reviewers

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/15709/head:pull/15709
$ git checkout pull/15709

Update a local copy of the PR:
$ git checkout pull/15709
$ git pull https://git.openjdk.org/jdk.git pull/15709/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 15709

View PR using the GUI difftool:
$ git pr show -t 15709

Using diff file

Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/15709.diff

Webrev

Link to Webrev Comment

@bridgekeeper
Copy link

bridgekeeper bot commented Sep 13, 2023

👋 Welcome back stefank! A progress list of the required criteria for merging this PR into master will be added to the body of your pull request. There are additional pull request commands available for use with this pull request.

@openjdk openjdk bot changed the title Use consistent naming for MacroAssembler lightweight locking 8316179: Use consistent naming for lightweight locking in MacroAssembler Sep 13, 2023
@openjdk
Copy link

openjdk bot commented Sep 13, 2023

@stefank The primary solved issue for a PR is set through the PR title. Since the current title does not contain an issue reference, it will now be updated.

@openjdk
Copy link

openjdk bot commented Sep 13, 2023

@stefank The following label will be automatically applied to this pull request:

  • hotspot

When this pull request is ready to be reviewed, an "RFR" email will be sent to the corresponding mailing list. If you would like to change these labels, use the /label pull request command.

@openjdk openjdk bot added the hotspot hotspot-dev@openjdk.org label Sep 13, 2023
@stefank stefank marked this pull request as ready for review September 13, 2023 11:13
@openjdk openjdk bot added the rfr Pull request is ready for review label Sep 13, 2023
@mlbridge
Copy link

mlbridge bot commented Sep 13, 2023

Webrevs

Copy link
Contributor

@rkennke rkennke left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me, thank you!

@openjdk
Copy link

openjdk bot commented Sep 13, 2023

@stefank This change now passes all automated pre-integration checks.

ℹ️ This project also has non-automated pre-integration requirements. Please see the file CONTRIBUTING.md for details.

After integration, the commit message for the final commit will be:

8316179: Use consistent naming for lightweight locking in MacroAssembler

Reviewed-by: rkennke, coleenp, dholmes

You can use pull request commands such as /summary, /contributor and /issue to adjust it as needed.

At the time when this comment was updated there had been 41 new commits pushed to the master branch:

  • 11d431b: 8316228: jcmd tests are broken by 8314828
  • eb37c7e: 8315971: ProblemList containers/docker/TestMemoryAwareness.java on linux-all
  • 23fab11: 8314828: Mark 3 jcmd command-line options test as vm.flagless
  • 1741d13: 8315726: Open source several AWT applet tests
  • 92ad4a2: 8315789: Minor HexFormat performance improvements
  • ce93d27: 6228794: java.text.ChoiceFormat pattern behavior is not well documented.
  • 3b0a6d2: 8314226: Series of colon-style fallthrough switch cases with guards compiled incorrectly
  • ff240a9: 8316087: Test SignedLoggerFinderTest.java is still failing
  • a731a24: 8315934: RISC-V: Disable conservative fences per vendor
  • b3dad24: 8316021: Serial: Remove unused Generation::post_compact
  • ... and 31 more: https://git.openjdk.org/jdk/compare/fda142ff6cfefa12ec1ea4d4eb48b3c1b285bc04...master

As there are no conflicts, your changes will automatically be rebased on top of these commits when integrating. If you prefer to avoid this automatic rebasing, please check the documentation for the /integrate command for further details.

➡️ To integrate this PR with the above commit message to the master branch, type /integrate in a new comment.

@openjdk openjdk bot added the ready Pull request is ready to be integrated label Sep 13, 2023
Copy link
Contributor

@coleenp coleenp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks really good to me. Thanks.

Copy link
Member

@dholmes-ora dholmes-ora left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This makes a lot of sense!

Looks good.

Thanks

@stefank
Copy link
Member Author

stefank commented Sep 14, 2023

Thanks @rkennke @coleenp @dholmes-ora for reviewing!

@stefank
Copy link
Member Author

stefank commented Sep 14, 2023

/integrate

@openjdk
Copy link

openjdk bot commented Sep 14, 2023

Going to push as commit 639ba13.
Since your change was applied there have been 41 commits pushed to the master branch:

  • 11d431b: 8316228: jcmd tests are broken by 8314828
  • eb37c7e: 8315971: ProblemList containers/docker/TestMemoryAwareness.java on linux-all
  • 23fab11: 8314828: Mark 3 jcmd command-line options test as vm.flagless
  • 1741d13: 8315726: Open source several AWT applet tests
  • 92ad4a2: 8315789: Minor HexFormat performance improvements
  • ce93d27: 6228794: java.text.ChoiceFormat pattern behavior is not well documented.
  • 3b0a6d2: 8314226: Series of colon-style fallthrough switch cases with guards compiled incorrectly
  • ff240a9: 8316087: Test SignedLoggerFinderTest.java is still failing
  • a731a24: 8315934: RISC-V: Disable conservative fences per vendor
  • b3dad24: 8316021: Serial: Remove unused Generation::post_compact
  • ... and 31 more: https://git.openjdk.org/jdk/compare/fda142ff6cfefa12ec1ea4d4eb48b3c1b285bc04...master

Your commit was automatically rebased without conflicts.

@openjdk openjdk bot added the integrated Pull request has been integrated label Sep 14, 2023
@openjdk openjdk bot closed this Sep 14, 2023
@openjdk openjdk bot removed ready Pull request is ready to be integrated rfr Pull request is ready for review labels Sep 14, 2023
@openjdk
Copy link

openjdk bot commented Sep 14, 2023

@stefank Pushed as commit 639ba13.

💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
hotspot hotspot-dev@openjdk.org integrated Pull request has been integrated
4 participants