src/share/vm/prims/jvmtiEventController.cpp
Print this page
rev 1132 : add jvmtiThreadState::set_should_post_on_exceptions
@@ -80,11 +80,11 @@
static const jlong EARLY_EVENT_BITS = CLASS_FILE_LOAD_HOOK_BIT |
VM_START_BIT | VM_INIT_BIT | VM_DEATH_BIT | NATIVE_METHOD_BIND_BIT |
THREAD_START_BIT | THREAD_END_BIT |
DYNAMIC_CODE_GENERATED_BIT;
static const jlong GLOBAL_EVENT_BITS = ~THREAD_FILTERED_EVENT_BITS;
-
+static const jlong SHOULD_POST_ON_EXCEPTIONS_BITS = EXCEPTION_BITS | METHOD_EXIT_BIT | FRAME_POP_BIT;
///////////////////////////////////////////////////////////////
//
// JvmtiEventEnabled
//
@@ -509,11 +509,16 @@
enter_interp_only_mode(state);
} else {
leave_interp_only_mode(state);
}
}
+
+ // update the JavaThread cached value for thread-specific should_post_on_exceptions value
+ bool should_post_on_exceptions = (any_env_enabled & SHOULD_POST_ON_EXCEPTIONS_BITS) != 0;
+ state->set_should_post_on_exceptions(should_post_on_exceptions);
}
+
return any_env_enabled;
}
// Compute truly enabled events - meaning if the event can and could be
@@ -613,10 +618,14 @@
}
}
// set global truly enabled, that is, any thread in any environment
JvmtiEventController::_universal_global_event_enabled.set_bits(any_env_thread_enabled);
+
+ // set global should_post_on_exceptions
+ JvmtiExport::set_should_post_on_exceptions((any_env_thread_enabled & SHOULD_POST_ON_EXCEPTIONS_BITS) != 0);
+
}
EC_TRACE(("JVMTI [-] # recompute enabled - after %llx", any_env_thread_enabled));
}