diff -r af47e0398606 src/hotspot/share/c1/c1_Runtime1.cpp --- a/src/hotspot/share/c1/c1_Runtime1.cpp Wed Jun 05 16:01:00 2019 +0200 +++ b/src/hotspot/share/c1/c1_Runtime1.cpp Tue Jun 11 18:00:52 2019 +0200 @@ -571,7 +571,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 af47e0398606 src/hotspot/share/code/codeHeapState.cpp --- a/src/hotspot/share/code/codeHeapState.cpp Wed Jun 05 16:01:00 2019 +0200 +++ b/src/hotspot/share/code/codeHeapState.cpp Tue Jun 11 18:00:52 2019 +0200 @@ -91,7 +91,7 @@ /* _anyst name of the stream as used in the code */ \ /* _outst stream where final output will go to */ \ ResourceMark rm; \ - bufferedStream _sstobj = bufferedStream(4*K); \ + bufferedStream _sstobj(4*K); \ bufferedStream* _sstbuf = &_sstobj; \ outputStream* _outbuf = _outst; \ bufferedStream* _anyst = &_sstobj; /* any stream. Use this to just print - no buffer flush. */ diff -r af47e0398606 src/hotspot/share/compiler/compileBroker.cpp --- a/src/hotspot/share/compiler/compileBroker.cpp Wed Jun 05 16:01:00 2019 +0200 +++ b/src/hotspot/share/compiler/compileBroker.cpp Tue Jun 11 18:00:52 2019 +0200 @@ -197,7 +197,7 @@ void log_compile(JavaThread* thread, CompileTask* task) { StringLogMessage lm; - stringStream sstr = lm.stream(); + stringStream sstr(lm.buffer(), lm.size()); // msg.time_stamp().update_to(tty->time_stamp().ticks()); task->print(&sstr, NULL, true, false); log(thread, "%s", (const char*)lm); diff -r af47e0398606 src/hotspot/share/interpreter/bytecodeInterpreter.cpp --- a/src/hotspot/share/interpreter/bytecodeInterpreter.cpp Wed Jun 05 16:01:00 2019 +0200 +++ b/src/hotspot/share/interpreter/bytecodeInterpreter.cpp Tue Jun 11 18:00:52 2019 +0200 @@ -2870,7 +2870,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); @@ -2887,7 +2887,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 af47e0398606 src/hotspot/share/interpreter/interpreterRuntime.cpp --- a/src/hotspot/share/interpreter/interpreterRuntime.cpp Wed Jun 05 16:01:00 2019 +0200 +++ b/src/hotspot/share/interpreter/interpreterRuntime.cpp Tue Jun 11 18:00:52 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 af47e0398606 src/hotspot/share/jvmci/jvmciRuntime.cpp --- a/src/hotspot/share/jvmci/jvmciRuntime.cpp Wed Jun 05 16:01:00 2019 +0200 +++ b/src/hotspot/share/jvmci/jvmciRuntime.cpp Tue Jun 11 18:00:52 2019 +0200 @@ -284,7 +284,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 af47e0398606 src/hotspot/share/utilities/events.hpp --- a/src/hotspot/share/utilities/events.hpp Wed Jun 05 16:01:00 2019 +0200 +++ b/src/hotspot/share/utilities/events.hpp Tue Jun 11 18:00:52 2019 +0200 @@ -136,11 +136,6 @@ // A simple wrapper class for fixed size text messages. class StringLogMessage : public FormatBuffer<256> { - public: - // Wrap this buffer in a stringStream. - stringStream stream() { - return stringStream(_buf, size()); - } }; // A simple ring buffer of fixed size text messages. diff -r af47e0398606 src/hotspot/share/utilities/exceptions.cpp --- a/src/hotspot/share/utilities/exceptions.cpp Wed Jun 05 16:01:00 2019 +0200 +++ b/src/hotspot/share/utilities/exceptions.cpp Tue Jun 11 18:00:52 2019 +0200 @@ -527,17 +527,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()); - if (message != NULL) { + Symbol* detail_message = java_lang_Throwable::detail_message(exception()); + if (detail_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 af47e0398606 src/hotspot/share/utilities/exceptions.hpp --- a/src/hotspot/share/utilities/exceptions.hpp Wed Jun 05 16:01:00 2019 +0200 +++ b/src/hotspot/share/utilities/exceptions.hpp Tue Jun 11 18:00:52 2019 +0200 @@ -185,7 +185,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); }; diff -r af47e0398606 src/hotspot/share/utilities/ostream.hpp --- a/src/hotspot/share/utilities/ostream.hpp Wed Jun 05 16:01:00 2019 +0200 +++ b/src/hotspot/share/utilities/ostream.hpp Tue Jun 11 18:00:52 2019 +0200 @@ -42,6 +42,10 @@ // This allows for redirection via -XX:+DisplayVMOutputToStdout and // -XX:+DisplayVMOutputToStderr class outputStream : public ResourceObj { + private: + outputStream(const outputStream&); + outputStream& operator=(const outputStream&); + protected: int _indentation; // current indentation int _width; // width of the page