# HG changeset patch # User stuefe # Date 1558443857 -7200 # Tue May 21 15:04:17 2019 +0200 # Node ID a363463c7ae4d15f1d5282020c94bcc2ed64204b # Parent 55bfc2eee3abf16c2cf6e63559f3ebc2e8f3ee80 [mq]: 8224485-Exceptions_log_exception_do_not_copy_stringStream diff -r 55bfc2eee3ab -r a363463c7ae4 src/hotspot/share/c1/c1_Runtime1.cpp --- a/src/hotspot/share/c1/c1_Runtime1.cpp Tue May 21 15:02:18 2019 +0530 +++ b/src/hotspot/share/c1/c1_Runtime1.cpp Tue May 21 15:04:17 2019 +0200 @@ -575,7 +575,7 @@ tempst.print("compiled method <%s>\n" " at PC" INTPTR_FORMAT " for thread " INTPTR_FORMAT, nm->method()->print_value_string(), p2i(pc), p2i(thread)); - Exceptions::log_exception(exception, tempst); + Exceptions::log_exception(exception, tempst.as_string()); } // for AbortVMOnException flag Exceptions::debug_check_abort(exception); diff -r 55bfc2eee3ab -r a363463c7ae4 src/hotspot/share/interpreter/bytecodeInterpreter.cpp --- a/src/hotspot/share/interpreter/bytecodeInterpreter.cpp Tue May 21 15:02:18 2019 +0530 +++ b/src/hotspot/share/interpreter/bytecodeInterpreter.cpp Tue May 21 15:04:17 2019 +0200 @@ -2871,7 +2871,7 @@ METHOD->print_value_string(), (int)(istate->bcp() - METHOD->code_base()), (int)continuation_bci, p2i(THREAD)); - Exceptions::log_exception(except_oop, tempst); + Exceptions::log_exception(except_oop, tempst.as_string()); } // for AbortVMOnException flag Exceptions::debug_check_abort(except_oop); @@ -2888,7 +2888,7 @@ METHOD->print_value_string(), (int)(istate->bcp() - METHOD->code_base()), p2i(THREAD)); - Exceptions::log_exception(except_oop, tempst); + Exceptions::log_exception(except_oop, tempst.as_string()); } // for AbortVMOnException flag Exceptions::debug_check_abort(except_oop); diff -r 55bfc2eee3ab -r a363463c7ae4 src/hotspot/share/interpreter/interpreterRuntime.cpp --- a/src/hotspot/share/interpreter/interpreterRuntime.cpp Tue May 21 15:02:18 2019 +0530 +++ b/src/hotspot/share/interpreter/interpreterRuntime.cpp Tue May 21 15:04:17 2019 +0200 @@ -543,7 +543,7 @@ tempst.print("interpreter method <%s>\n" " at bci %d for thread " INTPTR_FORMAT " (%s)", h_method->print_value_string(), current_bci, p2i(thread), thread->name()); - Exceptions::log_exception(h_exception, tempst); + Exceptions::log_exception(h_exception, tempst.as_string()); } // Don't go paging in something which won't be used. // else if (extable->length() == 0) { diff -r 55bfc2eee3ab -r a363463c7ae4 src/hotspot/share/jvmci/jvmciRuntime.cpp --- a/src/hotspot/share/jvmci/jvmciRuntime.cpp Tue May 21 15:02:18 2019 +0530 +++ b/src/hotspot/share/jvmci/jvmciRuntime.cpp Tue May 21 15:04:17 2019 +0200 @@ -311,7 +311,7 @@ tempst.print("compiled method <%s>\n" " at PC" INTPTR_FORMAT " for thread " INTPTR_FORMAT, cm->method()->print_value_string(), p2i(pc), p2i(thread)); - Exceptions::log_exception(exception, tempst); + Exceptions::log_exception(exception, tempst.as_string()); } // for AbortVMOnException flag NOT_PRODUCT(Exceptions::debug_check_abort(exception)); diff -r 55bfc2eee3ab -r a363463c7ae4 src/hotspot/share/utilities/exceptions.cpp --- a/src/hotspot/share/utilities/exceptions.cpp Tue May 21 15:02:18 2019 +0530 +++ b/src/hotspot/share/utilities/exceptions.cpp Tue May 21 15:04:17 2019 +0200 @@ -526,17 +526,17 @@ } // for logging exceptions -void Exceptions::log_exception(Handle exception, stringStream tempst) { +void Exceptions::log_exception(Handle exception, const char* message) { ResourceMark rm; - Symbol* message = java_lang_Throwable::detail_message(exception()); + Symbol* detail_message = java_lang_Throwable::detail_message(exception()); if (message != NULL) { log_info(exceptions)("Exception <%s: %s>\n thrown in %s", exception->print_value_string(), - message->as_C_string(), - tempst.as_string()); + detail_message->as_C_string(), + message); } else { log_info(exceptions)("Exception <%s>\n thrown in %s", exception->print_value_string(), - tempst.as_string()); + message); } } diff -r 55bfc2eee3ab -r a363463c7ae4 src/hotspot/share/utilities/exceptions.hpp --- a/src/hotspot/share/utilities/exceptions.hpp Tue May 21 15:02:18 2019 +0530 +++ b/src/hotspot/share/utilities/exceptions.hpp Tue May 21 15:04:17 2019 +0200 @@ -186,7 +186,7 @@ static void debug_check_abort(const char *value_string, const char* message = NULL); // for logging exceptions - static void log_exception(Handle exception, stringStream tempst); + static void log_exception(Handle exception, const char* message); };