8150085: Convert TraceClearedExceptions to Unified Loggin
authorrprotacio
Tue, 15 Mar 2016 15:43:04 -0400
changeset 37110 0c468eab5c66
parent 37107 e89fc0bf4ecb
child 37111 98572401ab0a
8150085: Convert TraceClearedExceptions to Unified Loggin Summary: Converted -XX:+TraceClearedExceptions to -Xlog:exceptions=debug Reviewed-by: mockner, dholmes, coleenp
hotspot/src/share/vm/runtime/globals.hpp
hotspot/src/share/vm/utilities/exceptions.cpp
--- a/hotspot/src/share/vm/runtime/globals.hpp	Tue Mar 15 15:29:42 2016 +0100
+++ b/hotspot/src/share/vm/runtime/globals.hpp	Tue Mar 15 15:43:04 2016 -0400
@@ -1466,9 +1466,6 @@
   develop(bool, TraceCompiledIC, false,                                     \
           "Trace changes of compiled IC")                                   \
                                                                             \
-  develop(bool, TraceClearedExceptions, false,                              \
-          "Print when an exception is forcibly cleared")                    \
-                                                                            \
   /* gc */                                                                  \
                                                                             \
   product(bool, UseSerialGC, false,                                         \
--- a/hotspot/src/share/vm/utilities/exceptions.cpp	Tue Mar 15 15:29:42 2016 +0100
+++ b/hotspot/src/share/vm/utilities/exceptions.cpp	Tue Mar 15 15:43:04 2016 -0400
@@ -52,11 +52,11 @@
 }
 
 void ThreadShadow::clear_pending_exception() {
-  if (TraceClearedExceptions) {
-    if (_pending_exception != NULL) {
-      tty->print_cr("Thread::clear_pending_exception: cleared exception:");
-      _pending_exception->print();
-    }
+  if (_pending_exception != NULL && log_is_enabled(Debug, exceptions)) {
+    ResourceMark rm;
+    outputStream* logst = LogHandle(exceptions)::debug_stream();
+    logst->print("Thread::clear_pending_exception: cleared exception:");
+    _pending_exception->print_on(logst);
   }
   _pending_exception = NULL;
   _exception_file    = NULL;