src/share/vm/opto/runtime.cpp

Print this page
rev 1122 : refactored to check all 3 can_post_exception bits and other Dan comments

@@ -808,11 +808,12 @@
     fatal("Native mathod should not have path to exception handling");
   } else {
     // we are switching to old paradigm: search for exception handler in caller_frame
     // instead in exception handler of caller_frame.sender()
 
-    if (JvmtiExport::can_post_exceptions()) {
+    // We only need to deoptimize if we exceptions can really cause some event notification
+    if (thread->should_post_on_exceptions_flag()) {
       // "Full-speed catching" is not necessary here,
       // since we're notifying the VM on every catch.
       // Force deoptimization and the rest of the lookup
       // will be fine.
       deoptimize_caller_frame(thread, true);

@@ -1206,5 +1207,6 @@
 JRT_LEAF(void, OptoRuntime::zap_dead_native_locals_C(JavaThread* thread))
   zap_dead_java_or_native_locals(thread, is_native_frame);
 JRT_END
 
 # endif
+