8225492: Update JVMCI

Reviewed-by: iveresov, kvn
This commit is contained in:
Doug Simon 2019-06-10 15:55:11 -07:00
parent 712996ae87
commit 3c5ff8db74
2 changed files with 16 additions and 13 deletions

View file

@ -1339,6 +1339,18 @@ JVMCI::CodeInstallResult JVMCIRuntime::validate_compile_task_dependencies(Depend
return JVMCI::dependencies_invalid;
}
// Reports a pending exception and exits the VM.
static void fatal_exception_in_compile(JVMCIEnv* JVMCIENV, JavaThread* thread, const char* msg) {
// Only report a fatal JVMCI compilation exception once
static volatile int report_init_failure = 0;
if (!report_init_failure && Atomic::cmpxchg(1, &report_init_failure, 0) == 0) {
tty->print_cr("%s:", msg);
JVMCIENV->describe_pending_exception(true);
}
JVMCIENV->clear_pending_exception();
before_exit(thread);
vm_exit(-1);
}
void JVMCIRuntime::compile_method(JVMCIEnv* JVMCIENV, JVMCICompiler* compiler, const methodHandle& method, int entry_bci) {
JVMCI_EXCEPTION_CONTEXT
@ -1360,9 +1372,7 @@ void JVMCIRuntime::compile_method(JVMCIEnv* JVMCIENV, JVMCICompiler* compiler, c
HandleMark hm;
JVMCIObject receiver = get_HotSpotJVMCIRuntime(JVMCIENV);
if (JVMCIENV->has_pending_exception()) {
JVMCIENV->describe_pending_exception(true);
compile_state->set_failure(false, "exception getting HotSpotJVMCIRuntime object");
return;
fatal_exception_in_compile(JVMCIENV, thread, "Exception during HotSpotJVMCIRuntime initialization");
}
JVMCIObject jvmci_method = JVMCIENV->get_jvmci_method(method, JVMCIENV);
if (JVMCIENV->has_pending_exception()) {
@ -1397,16 +1407,7 @@ void JVMCIRuntime::compile_method(JVMCIEnv* JVMCIENV, JVMCICompiler* compiler, c
} else {
// An uncaught exception here implies failure during compiler initialization.
// The only sensible thing to do here is to exit the VM.
// Only report initialization failure once
static volatile int report_init_failure = 0;
if (!report_init_failure && Atomic::cmpxchg(1, &report_init_failure, 0) == 0) {
tty->print_cr("Exception during JVMCI compiler initialization:");
JVMCIENV->describe_pending_exception(true);
}
JVMCIENV->clear_pending_exception();
before_exit((JavaThread*) THREAD);
vm_exit(-1);
fatal_exception_in_compile(JVMCIENV, thread, "Exception during JVMCI compiler initialization");
}
if (compiler->is_bootstrapping()) {
compiler->set_bootstrap_compilation_request_handled();