Skip to content

Commit

Permalink
8269574: C2: Avoid redundant uncommon traps in GraphKit::builtin_thro…
Browse files Browse the repository at this point in the history
…w() for JVMTI exception events

Reviewed-by: kvn, roland, neliasso
  • Loading branch information
reinrich committed Jul 7, 2021
1 parent 3d090e7 commit 72530ef
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/hotspot/share/opto/graphKit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -529,13 +529,6 @@ void GraphKit::uncommon_trap_if_should_post_on_exceptions(Deoptimization::DeoptR
void GraphKit::builtin_throw(Deoptimization::DeoptReason reason, Node* arg) {
bool must_throw = true;

if (env()->jvmti_can_post_on_exceptions()) {
// check if we must post exception events, take uncommon trap if so
uncommon_trap_if_should_post_on_exceptions(reason, must_throw);
// here if should_post_on_exceptions is false
// continue on with the normal codegen
}

// If this particular condition has not yet happened at this
// bytecode, then use the uncommon trap mechanism, and allow for
// a future recompilation if several traps occur here.
Expand Down Expand Up @@ -598,6 +591,13 @@ void GraphKit::builtin_throw(Deoptimization::DeoptReason reason, Node* arg) {
}
if (failing()) { stop(); return; } // exception allocation might fail
if (ex_obj != NULL) {
if (env()->jvmti_can_post_on_exceptions()) {
// check if we must post exception events, take uncommon trap if so
uncommon_trap_if_should_post_on_exceptions(reason, must_throw);
// here if should_post_on_exceptions is false
// continue on with the normal codegen
}

// Cheat with a preallocated exception object.
if (C->log() != NULL)
C->log()->elem("hot_throw preallocated='1' reason='%s'",
Expand Down

7 comments on commit 72530ef

@openjdk-notifier
Copy link

Choose a reason for hiding this comment

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

@reinrich
Copy link
Member Author

Choose a reason for hiding this comment

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

/backport jdk17u

@openjdk
Copy link

@openjdk openjdk bot commented on 72530ef Jul 14, 2021

Choose a reason for hiding this comment

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

@reinrich the backport was successfully created on the branch reinrich-backport-72530ef6 in my personal fork of openjdk/jdk17u. To create a pull request with this backport targeting openjdk/jdk17u:master, just click the following link:

➡️ Create pull request

The title of the pull request is automatically filled in correctly and below you find a suggestion for the pull request body:

Hi all,

this pull request contains a backport of commit 72530ef6 from the openjdk/jdk repository.

The commit being backported was authored by Richard Reingruber on 7 Jul 2021 and was reviewed by Vladimir Kozlov, Roland Westrelin and Nils Eliasson.

Thanks!

If you need to update the source branch of the pull then run the following commands in a local clone of your personal fork of openjdk/jdk17u:

$ git fetch https://github.com/openjdk-bots/jdk17u reinrich-backport-72530ef6:reinrich-backport-72530ef6
$ git checkout reinrich-backport-72530ef6
# make changes
$ git add paths/to/changed/files
$ git commit --message 'Describe additional changes made'
$ git push https://github.com/openjdk-bots/jdk17u reinrich-backport-72530ef6

@reinrich
Copy link
Member Author

Choose a reason for hiding this comment

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

/backport jdk11u

@openjdk
Copy link

@openjdk openjdk bot commented on 72530ef Sep 15, 2021

Choose a reason for hiding this comment

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

@reinrich the backport was successfully created on the branch reinrich-backport-72530ef6 in my personal fork of openjdk/jdk11u. To create a pull request with this backport targeting openjdk/jdk11u:master, just click the following link:

➡️ Create pull request

The title of the pull request is automatically filled in correctly and below you find a suggestion for the pull request body:

Hi all,

this pull request contains a backport of commit 72530ef6 from the openjdk/jdk repository.

The commit being backported was authored by Richard Reingruber on 7 Jul 2021 and was reviewed by Vladimir Kozlov, Roland Westrelin and Nils Eliasson.

Thanks!

If you need to update the source branch of the pull then run the following commands in a local clone of your personal fork of openjdk/jdk11u:

$ git fetch https://github.com/openjdk-bots/jdk11u reinrich-backport-72530ef6:reinrich-backport-72530ef6
$ git checkout reinrich-backport-72530ef6
# make changes
$ git add paths/to/changed/files
$ git commit --message 'Describe additional changes made'
$ git push https://github.com/openjdk-bots/jdk11u reinrich-backport-72530ef6

@reinrich
Copy link
Member Author

Choose a reason for hiding this comment

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

/backport jdk11u-dev

@openjdk
Copy link

@openjdk openjdk bot commented on 72530ef Sep 15, 2021

Choose a reason for hiding this comment

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

@reinrich the backport was successfully created on the branch reinrich-backport-72530ef6 in my personal fork of openjdk/jdk11u-dev. To create a pull request with this backport targeting openjdk/jdk11u-dev:master, just click the following link:

➡️ Create pull request

The title of the pull request is automatically filled in correctly and below you find a suggestion for the pull request body:

Hi all,

this pull request contains a backport of commit 72530ef6 from the openjdk/jdk repository.

The commit being backported was authored by Richard Reingruber on 7 Jul 2021 and was reviewed by Vladimir Kozlov, Roland Westrelin and Nils Eliasson.

Thanks!

If you need to update the source branch of the pull then run the following commands in a local clone of your personal fork of openjdk/jdk11u-dev:

$ git fetch https://github.com/openjdk-bots/jdk11u-dev reinrich-backport-72530ef6:reinrich-backport-72530ef6
$ git checkout reinrich-backport-72530ef6
# make changes
$ git add paths/to/changed/files
$ git commit --message 'Describe additional changes made'
$ git push https://github.com/openjdk-bots/jdk11u-dev reinrich-backport-72530ef6

Please sign in to comment.