Skip to content
Permalink
Browse files
8269574: C2: Avoid redundant uncommon traps in GraphKit::builtin_thro…
…w() for JVMTI exception events

Backport-of: 72530ef666ce2ace899cf34faefe715539d1ee25
  • Loading branch information
reinrich committed Aug 3, 2021
1 parent de808a5 commit a575f5c0900a048e39fcc61988e8963451f6d6e9
Showing with 7 additions and 7 deletions.
  1. +7 −7 src/hotspot/share/opto/graphKit.cpp
@@ -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.
@@ -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'",

1 comment on commit a575f5c

@openjdk-notifier

This comment has been minimized.

Copy link

@openjdk-notifier openjdk-notifier bot commented on a575f5c Aug 3, 2021

Please sign in to comment.