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

8296170: Refactor stack-locking path in C2_MacroAssembler::fast_unlock() #10936

Closed
wants to merge 4 commits into from

Conversation

rkennke
Copy link
Contributor

@rkennke rkennke commented Nov 1, 2022

The code in C2_MacroAssembler::fast_unlock() has several (minor) issues:

  • The stack-locking path for x86_32 is not under UseHeavyMonitors - it would be executed even when stack-locking is disabled.
  • The stack-locking paths are the same for x86_32 and x86_64 - they can be merged into a common path.
  • In x86_32 path, we call get_thread(boxReg) which is totally bogus because we clear boxReg right afterwards with xorptr(boxReg, boxReg).
  • In x86_32 path, the CheckSucc label is identical to the DONE label, and in-fact CheckSucc is only ever really used in the x86_64 path and can be moved there.

Testing:

  • tier1 (x86_32, x86_64)
  • tier2 (x86_32, x86_64)

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-8296170: Refactor stack-locking path in C2_MacroAssembler::fast_unlock()

Reviewers

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 10936

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

Using diff file

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

@bridgekeeper
Copy link

bridgekeeper bot commented Nov 1, 2022

👋 Welcome back rkennke! 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
Copy link

openjdk bot commented Nov 1, 2022

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

  • hotspot-compiler

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-compiler hotspot-compiler-dev@openjdk.org label Nov 1, 2022
@rkennke rkennke marked this pull request as ready for review November 2, 2022 11:37
@openjdk openjdk bot added the rfr Pull request is ready for review label Nov 2, 2022
@mlbridge
Copy link

mlbridge bot commented Nov 2, 2022

Webrevs

}
#endif

// TODO: Comment still valid?
Copy link
Member

Choose a reason for hiding this comment

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

We have the same comment here:

// DONE_LABEL is a hot target - we'd really like to place it at the

And it seems to be there from the beginning:
https://hg.openjdk.java.net/jdk/jdk/annotate/74aaad871363/hotspot/src/cpu/x86/vm/x86_32.ad#l3441

I think instead of adding a TODO, we should either completely remove the comments or file a follow-up enhancement to investigate.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I decided to remove the TODO. If we were to optimize this, then there are probably lower-hanging fruits like looking at the subsequent branch after the DONE_LABEL where we jump around the counting code.

Copy link
Member

@TobiHartmann TobiHartmann left a comment

Choose a reason for hiding this comment

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

Looks reasonable to me but I'm not an expert in that code.

@openjdk
Copy link

openjdk bot commented Nov 16, 2022

@rkennke 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:

8296170: Refactor stack-locking path in C2_MacroAssembler::fast_unlock()

Reviewed-by: thartmann, phh

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 no new commits pushed to the master branch. If another commit should be pushed before you perform the /integrate command, your PR will be automatically rebased. If you prefer to avoid any potential 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 Nov 16, 2022
Copy link
Member

@phohensee phohensee left a comment

Choose a reason for hiding this comment

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

The changes net to no change to the executed code, so also lgtm.

There is, however, a pre-submit linux-x86 tier1 test failure that should be resolved.

@rkennke
Copy link
Contributor Author

rkennke commented Nov 16, 2022

The changes net to no change to the executed code, so also lgtm.

There is, however, a pre-submit linux-x86 tier1 test failure that should be resolved.

Yes, that is a known issue. #11065 should fix it, I will pull in latest master and let GHA run again.

@rkennke
Copy link
Contributor Author

rkennke commented Nov 17, 2022

Thanks for reviewing! GHA is green now, let's
/integrate

@openjdk
Copy link

openjdk bot commented Nov 17, 2022

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

  • 502fa3e: 8296912: C2: CreateExNode::Identity fails with assert(i < _max) failed: oob: i=1, _max=1
  • 5795c76: 8296222: SwingEventMonitor - installListeners(Component , int ) - CELLEDITOR - bug
  • b9d6e83: 8296906: VMError::controlled_crash crashes with wrong code and address
  • cd9c688: 8276064: CheckCastPP with raw oop input floats below a safepoint
  • d61720a: 8218885: Restore pop_frame and force_early_return functionality for Graal
  • dd9aa72: 8296083: javax/swing/JTree/6263446/bug6263446.java fails intermittently on a VM
  • cc44419: 8295407: C2 crash: Error: ShouldNotReachHere() in multiple vector tests with -XX:-MonomorphicArrayCheck -XX:-UncommonNullCast
  • e2269fd: 8296968: Update langtools tests to use @enablePreview
  • 2159170: 8296453: Simplify resource_area uses in ClassPathDirEntry::open_stream
  • 95c390e: 8296956: [JVMCI] HotSpotResolvedJavaFieldImpl.getIndex returns wrong value
  • ... and 8 more: https://git.openjdk.org/jdk/compare/8752bb4be8ff71b57ddc262fde73fb3102a1a179...master

Your commit was automatically rebased without conflicts.

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

openjdk bot commented Nov 17, 2022

@rkennke Pushed as commit e81359f.

💡 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-compiler hotspot-compiler-dev@openjdk.org integrated Pull request has been integrated
3 participants