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

Backport-of: 72530ef
  • Loading branch information
reinrich committed Sep 21, 2021
1 parent 0d49433 commit 9accd6b
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 @@ -525,13 +525,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 @@ -594,6 +587,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

1 comment on commit 9accd6b

@openjdk-notifier
Copy link

Choose a reason for hiding this comment

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

Please sign in to comment.