8224487: outputStream should not be copyable
Reviewed-by: kbarrett, coleenp
This commit is contained in:
parent
b1de49766f
commit
2257bae7a2
@ -575,7 +575,7 @@ JRT_ENTRY_NO_ASYNC(static address, exception_handler_for_pc_helper(JavaThread* t
|
|||||||
tempst.print("compiled method <%s>\n"
|
tempst.print("compiled method <%s>\n"
|
||||||
" at PC" INTPTR_FORMAT " for thread " INTPTR_FORMAT,
|
" at PC" INTPTR_FORMAT " for thread " INTPTR_FORMAT,
|
||||||
nm->method()->print_value_string(), p2i(pc), p2i(thread));
|
nm->method()->print_value_string(), p2i(pc), p2i(thread));
|
||||||
Exceptions::log_exception(exception, tempst);
|
Exceptions::log_exception(exception, tempst.as_string());
|
||||||
}
|
}
|
||||||
// for AbortVMOnException flag
|
// for AbortVMOnException flag
|
||||||
Exceptions::debug_check_abort(exception);
|
Exceptions::debug_check_abort(exception);
|
||||||
|
@ -124,7 +124,7 @@
|
|||||||
size_t _nlockedflush = 0; \
|
size_t _nlockedflush = 0; \
|
||||||
size_t _nflush_bytes = 0; \
|
size_t _nflush_bytes = 0; \
|
||||||
size_t _capacity = _capa; \
|
size_t _capacity = _capa; \
|
||||||
bufferedStream _sstobj = bufferedStream(_capa); \
|
bufferedStream _sstobj(_capa); \
|
||||||
bufferedStream* _sstbuf = &_sstobj; \
|
bufferedStream* _sstbuf = &_sstobj; \
|
||||||
outputStream* _outbuf = _outst; \
|
outputStream* _outbuf = _outst; \
|
||||||
bufferedStream* _anyst = &_sstobj; /* any stream. Use this to just print - no buffer flush. */
|
bufferedStream* _anyst = &_sstobj; /* any stream. Use this to just print - no buffer flush. */
|
||||||
|
@ -192,7 +192,7 @@ class CompilationLog : public StringEventLog {
|
|||||||
|
|
||||||
void log_compile(JavaThread* thread, CompileTask* task) {
|
void log_compile(JavaThread* thread, CompileTask* task) {
|
||||||
StringLogMessage lm;
|
StringLogMessage lm;
|
||||||
stringStream sstr = lm.stream();
|
stringStream sstr(lm.buffer(), lm.size());
|
||||||
// msg.time_stamp().update_to(tty->time_stamp().ticks());
|
// msg.time_stamp().update_to(tty->time_stamp().ticks());
|
||||||
task->print(&sstr, NULL, true, false);
|
task->print(&sstr, NULL, true, false);
|
||||||
log(thread, "%s", (const char*)lm);
|
log(thread, "%s", (const char*)lm);
|
||||||
|
@ -2871,7 +2871,7 @@ run:
|
|||||||
METHOD->print_value_string(),
|
METHOD->print_value_string(),
|
||||||
(int)(istate->bcp() - METHOD->code_base()),
|
(int)(istate->bcp() - METHOD->code_base()),
|
||||||
(int)continuation_bci, p2i(THREAD));
|
(int)continuation_bci, p2i(THREAD));
|
||||||
Exceptions::log_exception(except_oop, tempst);
|
Exceptions::log_exception(except_oop, tempst.as_string());
|
||||||
}
|
}
|
||||||
// for AbortVMOnException flag
|
// for AbortVMOnException flag
|
||||||
Exceptions::debug_check_abort(except_oop);
|
Exceptions::debug_check_abort(except_oop);
|
||||||
@ -2888,7 +2888,7 @@ run:
|
|||||||
METHOD->print_value_string(),
|
METHOD->print_value_string(),
|
||||||
(int)(istate->bcp() - METHOD->code_base()),
|
(int)(istate->bcp() - METHOD->code_base()),
|
||||||
p2i(THREAD));
|
p2i(THREAD));
|
||||||
Exceptions::log_exception(except_oop, tempst);
|
Exceptions::log_exception(except_oop, tempst.as_string());
|
||||||
}
|
}
|
||||||
// for AbortVMOnException flag
|
// for AbortVMOnException flag
|
||||||
Exceptions::debug_check_abort(except_oop);
|
Exceptions::debug_check_abort(except_oop);
|
||||||
|
@ -543,7 +543,7 @@ JRT_ENTRY(address, InterpreterRuntime::exception_handler_for_exception(JavaThrea
|
|||||||
tempst.print("interpreter method <%s>\n"
|
tempst.print("interpreter method <%s>\n"
|
||||||
" at bci %d for thread " INTPTR_FORMAT " (%s)",
|
" at bci %d for thread " INTPTR_FORMAT " (%s)",
|
||||||
h_method->print_value_string(), current_bci, p2i(thread), thread->name());
|
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.
|
// Don't go paging in something which won't be used.
|
||||||
// else if (extable->length() == 0) {
|
// else if (extable->length() == 0) {
|
||||||
|
@ -311,7 +311,7 @@ JRT_ENTRY_NO_ASYNC(static address, exception_handler_for_pc_helper(JavaThread* t
|
|||||||
tempst.print("compiled method <%s>\n"
|
tempst.print("compiled method <%s>\n"
|
||||||
" at PC" INTPTR_FORMAT " for thread " INTPTR_FORMAT,
|
" at PC" INTPTR_FORMAT " for thread " INTPTR_FORMAT,
|
||||||
cm->method()->print_value_string(), p2i(pc), p2i(thread));
|
cm->method()->print_value_string(), p2i(pc), p2i(thread));
|
||||||
Exceptions::log_exception(exception, tempst);
|
Exceptions::log_exception(exception, tempst.as_string());
|
||||||
}
|
}
|
||||||
// for AbortVMOnException flag
|
// for AbortVMOnException flag
|
||||||
NOT_PRODUCT(Exceptions::debug_check_abort(exception));
|
NOT_PRODUCT(Exceptions::debug_check_abort(exception));
|
||||||
|
@ -108,7 +108,8 @@ void UnloadingEventLog::log(Thread* thread, InstanceKlass* ik) {
|
|||||||
int index = compute_log_index();
|
int index = compute_log_index();
|
||||||
_records[index].thread = thread;
|
_records[index].thread = thread;
|
||||||
_records[index].timestamp = timestamp;
|
_records[index].timestamp = timestamp;
|
||||||
stringStream st = _records[index].data.stream();
|
stringStream st(_records[index].data.buffer(),
|
||||||
|
_records[index].data.size());
|
||||||
st.print("Unloading class " INTPTR_FORMAT " ", p2i(ik));
|
st.print("Unloading class " INTPTR_FORMAT " ", p2i(ik));
|
||||||
ik->name()->print_value_on(&st);
|
ik->name()->print_value_on(&st);
|
||||||
}
|
}
|
||||||
@ -121,7 +122,8 @@ void ExceptionsEventLog::log(Thread* thread, Handle h_exception, const char* mes
|
|||||||
int index = compute_log_index();
|
int index = compute_log_index();
|
||||||
_records[index].thread = thread;
|
_records[index].thread = thread;
|
||||||
_records[index].timestamp = timestamp;
|
_records[index].timestamp = timestamp;
|
||||||
stringStream st = _records[index].data.stream();
|
stringStream st(_records[index].data.buffer(),
|
||||||
|
_records[index].data.size());
|
||||||
st.print("Exception <");
|
st.print("Exception <");
|
||||||
h_exception->print_value_on(&st);
|
h_exception->print_value_on(&st);
|
||||||
st.print("%s%s> (" INTPTR_FORMAT ") \n"
|
st.print("%s%s> (" INTPTR_FORMAT ") \n"
|
||||||
|
@ -137,11 +137,6 @@ template <class T> class EventLogBase : public EventLog {
|
|||||||
// A simple wrapper class for fixed size text messages.
|
// A simple wrapper class for fixed size text messages.
|
||||||
template <size_t bufsz>
|
template <size_t bufsz>
|
||||||
class FormatStringLogMessage : public FormatBuffer<bufsz> {
|
class FormatStringLogMessage : public FormatBuffer<bufsz> {
|
||||||
public:
|
|
||||||
// Wrap this buffer in a stringStream.
|
|
||||||
stringStream stream() {
|
|
||||||
return stringStream(this->_buf, this->size());
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
typedef FormatStringLogMessage<256> StringLogMessage;
|
typedef FormatStringLogMessage<256> StringLogMessage;
|
||||||
typedef FormatStringLogMessage<512> ExtendedStringLogMessage;
|
typedef FormatStringLogMessage<512> ExtendedStringLogMessage;
|
||||||
|
@ -526,17 +526,17 @@ void Exceptions::debug_check_abort_helper(Handle exception, const char* message)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// for logging exceptions
|
// for logging exceptions
|
||||||
void Exceptions::log_exception(Handle exception, stringStream tempst) {
|
void Exceptions::log_exception(Handle exception, const char* message) {
|
||||||
ResourceMark rm;
|
ResourceMark rm;
|
||||||
Symbol* message = java_lang_Throwable::detail_message(exception());
|
Symbol* detail_message = java_lang_Throwable::detail_message(exception());
|
||||||
if (message != NULL) {
|
if (detail_message != NULL) {
|
||||||
log_info(exceptions)("Exception <%s: %s>\n thrown in %s",
|
log_info(exceptions)("Exception <%s: %s>\n thrown in %s",
|
||||||
exception->print_value_string(),
|
exception->print_value_string(),
|
||||||
message->as_C_string(),
|
detail_message->as_C_string(),
|
||||||
tempst.as_string());
|
message);
|
||||||
} else {
|
} else {
|
||||||
log_info(exceptions)("Exception <%s>\n thrown in %s",
|
log_info(exceptions)("Exception <%s>\n thrown in %s",
|
||||||
exception->print_value_string(),
|
exception->print_value_string(),
|
||||||
tempst.as_string());
|
message);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -186,7 +186,7 @@ class Exceptions {
|
|||||||
static void debug_check_abort(const char *value_string, const char* message = NULL);
|
static void debug_check_abort(const char *value_string, const char* message = NULL);
|
||||||
|
|
||||||
// for logging exceptions
|
// for logging exceptions
|
||||||
static void log_exception(Handle exception, stringStream tempst);
|
static void log_exception(Handle exception, const char* message);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -42,6 +42,10 @@ DEBUG_ONLY(class ResourceMark;)
|
|||||||
// This allows for redirection via -XX:+DisplayVMOutputToStdout and
|
// This allows for redirection via -XX:+DisplayVMOutputToStdout and
|
||||||
// -XX:+DisplayVMOutputToStderr
|
// -XX:+DisplayVMOutputToStderr
|
||||||
class outputStream : public ResourceObj {
|
class outputStream : public ResourceObj {
|
||||||
|
private:
|
||||||
|
outputStream(const outputStream&);
|
||||||
|
outputStream& operator=(const outputStream&);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
int _indentation; // current indentation
|
int _indentation; // current indentation
|
||||||
int _width; // width of the page
|
int _width; // width of the page
|
||||||
|
Loading…
x
Reference in New Issue
Block a user