< prev index next >
src/hotspot/share/runtime/thread.cpp
Print this page
rev 48401 : 8194482: Fix SIGSEGV in print_threads_compiling.
*** 2944,2955 ****
// need to walk ciMetadata in current compile tasks to keep alive.
CompilerThread* ct = (CompilerThread*)this;
if (ct->env() != NULL) {
ct->env()->metadata_do(f);
}
! if (ct->task() != NULL) {
! ct->task()->metadata_do(f);
}
}
}
// Printing
--- 2944,2956 ----
// need to walk ciMetadata in current compile tasks to keep alive.
CompilerThread* ct = (CompilerThread*)this;
if (ct->env() != NULL) {
ct->env()->metadata_do(f);
}
! CompileTask* task = ct->task();
! if (task != NULL) {
! task->metadata_do(f);
}
}
}
// Printing
*** 2999,3012 ****
#ifndef PRODUCT
print_thread_state_on(st);
_safepoint_state->print_on(st);
#endif // PRODUCT
if (is_Compiler_thread()) {
! CompilerThread* ct = (CompilerThread*)this;
! if (ct->task() != NULL) {
st->print(" Compiling: ");
! ct->task()->print(st, NULL, true, false);
} else {
st->print(" No compile task");
}
st->cr();
}
--- 3000,3013 ----
#ifndef PRODUCT
print_thread_state_on(st);
_safepoint_state->print_on(st);
#endif // PRODUCT
if (is_Compiler_thread()) {
! CompileTask *task = ((CompilerThread*)this)->task();
! if (task != NULL) {
st->print(" Compiling: ");
! task->print(st, NULL, true, false);
} else {
st->print(" No compile task");
}
st->cr();
}
*** 4710,4722 ****
void Threads::print_threads_compiling(outputStream* st, char* buf, int buflen) {
ALL_JAVA_THREADS(thread) {
if (thread->is_Compiler_thread()) {
CompilerThread* ct = (CompilerThread*) thread;
! if (ct->task() != NULL) {
thread->print_name_on_error(st, buf, buflen);
! ct->task()->print(st, NULL, true, true);
}
}
}
}
--- 4711,4729 ----
void Threads::print_threads_compiling(outputStream* st, char* buf, int buflen) {
ALL_JAVA_THREADS(thread) {
if (thread->is_Compiler_thread()) {
CompilerThread* ct = (CompilerThread*) thread;
!
! // Keep task in local variable for NULL check.
! // ct->_task might be set to NULL by concurring compiler thread
! // because it completed the compilation. The task is never freed,
! // though, just returned to a free list.
! CompileTask* task = ct->task();
! if (task != NULL) {
thread->print_name_on_error(st, buf, buflen);
! task->print(st, NULL, true, true);
}
}
}
}
< prev index next >