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

8269574: C2: Avoid redundant uncommon traps in GraphKit::builtin_throw() for JVMTI exception events #4623

Conversation

reinrich
Copy link
Member

@reinrich reinrich commented Jun 29, 2021

This change moves the first uncommon trap in GraphKit::builtin_throw() to the block where it is actually needed because it has a return statement.

Other paths reach the second uncommon trap at the end of GraphKit::builtin_throw(). On these paths the first UCT is not needed.

The change improves performance if the VM can post exceptions to JVMTI agents.
E.g. I found that the change improves the score for the compiler.compiler benchmark of SPECjvm2008 by 4% if the JDWP agent is loaded (see attachment in JBS).

Note that with the change we can trap with Deoptimization::Action_maybe_recompile if we don't throw a preallocated exception where before we would have trapped with Deoptimization::Action_none if it was for posting the exception to JVMTI. I'd think this is preferable.

The fix passed our CI testing: JCK and JTREG, also in Xcomp mode, SPECjvm2008, SPECjbb2015, Renaissance Suite,
SAP specific tests with fastdebug and release builds on all platforms.


Progress

  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue
  • Change must be properly reviewed

Issue

  • JDK-8269574: C2: Avoid redundant uncommon traps in GraphKit::builtin_throw() for JVMTI exception events

Reviewers

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.java.net/jdk pull/4623/head:pull/4623
$ git checkout pull/4623

Update a local copy of the PR:
$ git checkout pull/4623
$ git pull https://git.openjdk.java.net/jdk pull/4623/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 4623

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

Using diff file

Download this PR as a diff file:
https://git.openjdk.java.net/jdk/pull/4623.diff

@bridgekeeper
Copy link

bridgekeeper bot commented Jun 29, 2021

👋 Welcome back rrich! 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 Jun 29, 2021

@reinrich 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 Jun 29, 2021
@reinrich reinrich changed the title 8269574: C2: Avoid redundant uncommon traps in GraphKit::builtin_throw for JVMTI exception events 8269574: C2: Avoid redundant uncommon traps in GraphKit::builtin_throw() for JVMTI exception events Jun 29, 2021
@reinrich reinrich marked this pull request as ready for review June 30, 2021 08:09
@openjdk openjdk bot added the rfr Pull request is ready for review label Jun 30, 2021
@mlbridge
Copy link

mlbridge bot commented Jun 30, 2021

Webrevs

Copy link
Contributor

@vnkozlov vnkozlov left a comment

Choose a reason for hiding this comment

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

Good. Let me run some tests before push.

@openjdk
Copy link

openjdk bot commented Jun 30, 2021

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

8269574: C2: Avoid redundant uncommon traps in GraphKit::builtin_throw() for JVMTI exception events

Reviewed-by: kvn, roland, neliasso

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 50 new commits pushed to the master branch:

  • de61328: 8225559: assertion error at TransTypes.visitApply
  • 82bfc5d: 8268960: com/sun/net/httpserver/Headers.java: Ensure mutators normalize keys and disallow null for keys and values
  • 18f356a: 8267307: Introduce new client property for XAWT: xawt.mwm_decor_title
  • 54a9c3e: 8133873: Simplify {Register,Unregister}NMethodOopClosure
  • 06d2620: 8268298: jdk/jfr/api/consumer/log/TestVerbosity.java fails: unexpected log message
  • d89e630: 8266746: C1: Replace UnsafeGetRaw with UnsafeGet when setting up OSR entry block
  • 4660f72: 8268870: Remove dead code in metaspaceShared
  • 9def3b0: Merge
  • 9ac63a6: 8262841: Clarify the behavior of PhantomReference::refersTo
  • aba6c55: 8269703: ProblemList vmTestbase/nsk/jvmti/scenarios/sampling/SP07/sp07t002/TestDescription.java on Windows-X64 with -Xcomp
  • ... and 40 more: https://git.openjdk.java.net/jdk/compare/a97715755d01b88ad9e4cf32f10ca5a3f2fda898...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 Jun 30, 2021
@vnkozlov
Copy link
Contributor

tier1-3 testing passed clean.

You need second review.

@reinrich
Copy link
Member Author

reinrich commented Jul 1, 2021

tier1-3 testing passed clean.

You need second review.

Thank you for reviewing and testing. I'll wait for another review.

Copy link
Contributor

@rwestrel rwestrel 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.

@reinrich
Copy link
Member Author

reinrich commented Jul 1, 2021

Looks good to me.

Thanks!

Copy link

@neliasso neliasso 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.

@reinrich
Copy link
Member Author

reinrich commented Jul 2, 2021

Looks good.

Thanks Nils!

@reinrich
Copy link
Member Author

reinrich commented Jul 7, 2021

/integrate

@openjdk
Copy link

openjdk bot commented Jul 7, 2021

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

Your commit was automatically rebased without conflicts.

@openjdk openjdk bot closed this Jul 7, 2021
@openjdk openjdk bot added integrated Pull request has been integrated and removed ready Pull request is ready to be integrated rfr Pull request is ready for review labels Jul 7, 2021
@openjdk
Copy link

openjdk bot commented Jul 7, 2021

@reinrich Pushed as commit 72530ef.

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

@reinrich reinrich deleted the 8269574_Avoid_redundant_uncommon_trap_in_GraphKit__builtin_throw_for_JVMTI_exception_events branch May 9, 2022 22:32
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
Development

Successfully merging this pull request may close these issues.

4 participants