8150085: Convert TraceClearedExceptions to Unified Loggin
Summary: Converted -XX:+TraceClearedExceptions to -Xlog:exceptions=debug
Reviewed-by: mockner, dholmes, coleenp
--- 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;