8146246: JVMCICompiler::abort_on_pending_exception: assert(!thread->owns_locks()) failed: must release all locks when leaving VM
Reviewed-by: coleenp, kvn
This commit is contained in:
parent
360280b4ae
commit
148c6a3e77
@ -1784,6 +1784,20 @@ void java_lang_Throwable::print_stack_trace(Handle throwable, outputStream* st)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Print the throwable stack trace by calling the Java method java.lang.Throwable.printStackTrace().
|
||||||
|
*/
|
||||||
|
void java_lang_Throwable::java_printStackTrace(Handle throwable, TRAPS) {
|
||||||
|
assert(throwable->is_a(SystemDictionary::Throwable_klass()), "Throwable instance expected");
|
||||||
|
JavaValue result(T_VOID);
|
||||||
|
JavaCalls::call_virtual(&result,
|
||||||
|
throwable,
|
||||||
|
KlassHandle(THREAD, SystemDictionary::Throwable_klass()),
|
||||||
|
vmSymbols::printStackTrace_name(),
|
||||||
|
vmSymbols::void_method_signature(),
|
||||||
|
THREAD);
|
||||||
|
}
|
||||||
|
|
||||||
void java_lang_Throwable::fill_in_stack_trace(Handle throwable, const methodHandle& method, TRAPS) {
|
void java_lang_Throwable::fill_in_stack_trace(Handle throwable, const methodHandle& method, TRAPS) {
|
||||||
if (!StackTraceInThrowable) return;
|
if (!StackTraceInThrowable) return;
|
||||||
ResourceMark rm(THREAD);
|
ResourceMark rm(THREAD);
|
||||||
|
@ -554,6 +554,7 @@ class java_lang_Throwable: AllStatic {
|
|||||||
// Printing
|
// Printing
|
||||||
static void print(Handle throwable, outputStream* st);
|
static void print(Handle throwable, outputStream* st);
|
||||||
static void print_stack_trace(Handle throwable, outputStream* st);
|
static void print_stack_trace(Handle throwable, outputStream* st);
|
||||||
|
static void java_printStackTrace(Handle throwable, TRAPS);
|
||||||
// Debugging
|
// Debugging
|
||||||
friend class JavaClasses;
|
friend class JavaClasses;
|
||||||
};
|
};
|
||||||
|
@ -162,10 +162,7 @@ void JVMCICompiler::compile_method(const methodHandle& method, int entry_bci, JV
|
|||||||
Handle exception(THREAD, PENDING_EXCEPTION);
|
Handle exception(THREAD, PENDING_EXCEPTION);
|
||||||
CLEAR_PENDING_EXCEPTION;
|
CLEAR_PENDING_EXCEPTION;
|
||||||
|
|
||||||
{
|
java_lang_Throwable::java_printStackTrace(exception, THREAD);
|
||||||
ttyLocker ttyl;
|
|
||||||
java_lang_Throwable::print_stack_trace(exception, tty);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Something went wrong so disable compilation at this level
|
// Something went wrong so disable compilation at this level
|
||||||
method->set_not_compilable(CompLevel_full_optimization);
|
method->set_not_compilable(CompLevel_full_optimization);
|
||||||
@ -181,11 +178,7 @@ void JVMCICompiler::abort_on_pending_exception(Handle exception, const char* mes
|
|||||||
Thread* THREAD = Thread::current();
|
Thread* THREAD = Thread::current();
|
||||||
CLEAR_PENDING_EXCEPTION;
|
CLEAR_PENDING_EXCEPTION;
|
||||||
|
|
||||||
{
|
java_lang_Throwable::java_printStackTrace(exception, THREAD);
|
||||||
ttyLocker ttyl;
|
|
||||||
tty->print_raw_cr(message);
|
|
||||||
java_lang_Throwable::print_stack_trace(exception, tty);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Give other aborting threads to also print their stack traces.
|
// Give other aborting threads to also print their stack traces.
|
||||||
// This can be very useful when debugging class initialization
|
// This can be very useful when debugging class initialization
|
||||||
|
@ -432,8 +432,7 @@ void before_exit(JavaThread* thread) {
|
|||||||
if (HAS_PENDING_EXCEPTION) {
|
if (HAS_PENDING_EXCEPTION) {
|
||||||
Handle exception(THREAD, PENDING_EXCEPTION);
|
Handle exception(THREAD, PENDING_EXCEPTION);
|
||||||
CLEAR_PENDING_EXCEPTION;
|
CLEAR_PENDING_EXCEPTION;
|
||||||
ttyLocker ttyl;
|
java_lang_Throwable::java_printStackTrace(exception, THREAD);
|
||||||
java_lang_Throwable::print_stack_trace(exception, tty);
|
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user