changeset 10624:45a4f459be06

8150085: Convert TraceClearedExceptions to Unified Loggin Summary: Converted -XX:+TraceClearedExceptions to -Xlog:exceptions=debug Reviewed-by: mockner, dholmes, coleenp
author rprotacio
date Tue, 15 Mar 2016 15:43:04 -0400
parents a4658c91d553
children 4aa1760ab75c
files src/share/vm/runtime/globals.hpp src/share/vm/utilities/exceptions.cpp
diffstat 2 files changed, 5 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/vm/runtime/globals.hpp	Tue Mar 15 15:29:42 2016 +0100
+++ b/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/src/share/vm/utilities/exceptions.cpp	Tue Mar 15 15:29:42 2016 +0100
+++ b/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;