hotspot/src/share/vm/runtime/thread.cpp
changeset 35216 71c463a17b3b
parent 35201 996db89f378e
child 35222 fc89375d788d
--- a/hotspot/src/share/vm/runtime/thread.cpp	Tue Dec 22 19:33:01 2015 +0000
+++ b/hotspot/src/share/vm/runtime/thread.cpp	Tue Dec 22 16:29:48 2015 -0500
@@ -38,6 +38,7 @@
 #include "interpreter/linkResolver.hpp"
 #include "interpreter/oopMapCache.hpp"
 #include "jvmtifiles/jvmtiEnv.hpp"
+#include "logging/log.hpp"
 #include "logging/logConfiguration.hpp"
 #include "memory/metaspaceShared.hpp"
 #include "memory/oopFactory.hpp"
@@ -2062,10 +2063,7 @@
       frame caller_fr = last_frame().sender(&map);
       assert(caller_fr.is_compiled_frame(), "what?");
       if (caller_fr.is_deoptimized_frame()) {
-        if (TraceExceptions) {
-          ResourceMark rm;
-          tty->print_cr("deferred async exception at compiled safepoint");
-        }
+        log_info(exceptions)("deferred async exception at compiled safepoint");
         return;
       }
     }
@@ -2091,14 +2089,15 @@
       // We cannot call Exceptions::_throw(...) here because we cannot block
       set_pending_exception(_pending_async_exception, __FILE__, __LINE__);
 
-      if (TraceExceptions) {
+      if (log_is_enabled(Info, exceptions)) {
         ResourceMark rm;
-        tty->print("Async. exception installed at runtime exit (" INTPTR_FORMAT ")", p2i(this));
-        if (has_last_Java_frame()) {
-          frame f = last_frame();
-          tty->print(" (pc: " INTPTR_FORMAT " sp: " INTPTR_FORMAT " )", p2i(f.pc()), p2i(f.sp()));
-        }
-        tty->print_cr(" of type: %s", _pending_async_exception->klass()->external_name());
+        outputStream* logstream = LogHandle(exceptions)::info_stream();
+        logstream->print("Async. exception installed at runtime exit (" INTPTR_FORMAT ")", p2i(this));
+          if (has_last_Java_frame()) {
+            frame f = last_frame();
+           logstream->print(" (pc: " INTPTR_FORMAT " sp: " INTPTR_FORMAT " )", p2i(f.pc()), p2i(f.sp()));
+          }
+        logstream->print_cr(" of type: %s", _pending_async_exception->klass()->external_name());
       }
       _pending_async_exception = NULL;
       clear_has_async_exception();
@@ -2214,9 +2213,10 @@
       // Set async. pending exception in thread.
       set_pending_async_exception(java_throwable);
 
-      if (TraceExceptions) {
-        ResourceMark rm;
-        tty->print_cr("Pending Async. exception installed of type: %s", _pending_async_exception->klass()->external_name());
+      if (log_is_enabled(Info, exceptions)) {
+         ResourceMark rm;
+        log_info(exceptions)("Pending Async. exception installed of type: %s",
+                             InstanceKlass::cast(_pending_async_exception->klass())->external_name());
       }
       // for AbortVMOnException flag
       Exceptions::debug_check_abort(_pending_async_exception->klass()->external_name());