< prev index next >

src/hotspot/share/jvmci/jvmciRuntime.cpp

Print this page

        

*** 936,945 **** --- 936,947 ---- int exception_line = THREAD->exception_line(); CLEAR_PENDING_EXCEPTION; if (exception->is_a(SystemDictionary::ThreadDeath_klass())) { // Don't print anything if we are being killed. } else { + java_lang_Throwable::print(exception(), tty); + tty->cr(); java_lang_Throwable::print_stack_trace(exception, tty); // Clear and ignore any exceptions raised during printing CLEAR_PENDING_EXCEPTION; }
*** 1337,1358 **** // without any intervening modification of the system // dictionary. That means they were invalidly constructed. 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 JVMCICompileState* compile_state = JVMCIENV->compile_state(); --- 1339,1348 ----
*** 1370,1380 **** } HandleMark hm; JVMCIObject receiver = get_HotSpotJVMCIRuntime(JVMCIENV); if (JVMCIENV->has_pending_exception()) { ! fatal_exception_in_compile(JVMCIENV, thread, "Exception during HotSpotJVMCIRuntime initialization"); } JVMCIObject jvmci_method = JVMCIENV->get_jvmci_method(method, JVMCIENV); if (JVMCIENV->has_pending_exception()) { JVMCIENV->describe_pending_exception(true); compile_state->set_failure(false, "exception getting JVMCI wrapper method"); --- 1360,1372 ---- } 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; } JVMCIObject jvmci_method = JVMCIENV->get_jvmci_method(method, JVMCIENV); if (JVMCIENV->has_pending_exception()) { JVMCIENV->describe_pending_exception(true); compile_state->set_failure(false, "exception getting JVMCI wrapper method");
*** 1403,1415 **** } } else { assert(false, "JVMCICompiler.compileMethod should always return non-null"); } } else { ! // An uncaught exception here implies failure during compiler initialization. ! // The only sensible thing to do here is to exit the VM. ! fatal_exception_in_compile(JVMCIENV, thread, "Exception during JVMCI compiler initialization"); } if (compiler->is_bootstrapping()) { compiler->set_bootstrap_compilation_request_handled(); } } --- 1395,1409 ---- } } else { assert(false, "JVMCICompiler.compileMethod should always return non-null"); } } else { ! // An uncaught exception was thrown during compilation. Generally these ! // should be handled by the Java code in some useful way but if they leak ! // through to here report them instead of dying or silently ignoring them. ! JVMCIENV->describe_pending_exception(true); ! compile_state->set_failure(false, "unexpected exception thrown"); } if (compiler->is_bootstrapping()) { compiler->set_bootstrap_compilation_request_handled(); } }
*** 1424,1434 **** int orig_pc_offset, CodeBuffer* code_buffer, int frame_words, OopMapSet* oop_map_set, ExceptionHandlerTable* handler_table, - ImplicitExceptionTable* implicit_exception_table, AbstractCompiler* compiler, DebugInformationRecorder* debug_info, Dependencies* dependencies, int compile_id, bool has_unsafe_access, --- 1418,1427 ----
*** 1494,1511 **** // All buffers in the CodeBuffer are allocated in the CodeCache. // If the code buffer is created on each compile attempt // as in C2, then it must be freed. //code_buffer->free_blob(); } else { nm = nmethod::new_nmethod(method, compile_id, entry_bci, offsets, orig_pc_offset, debug_info, dependencies, code_buffer, frame_words, oop_map_set, ! handler_table, implicit_exception_table, compiler, comp_level, speculations, speculations_len, nmethod_mirror_index, nmethod_mirror_name, failed_speculations); --- 1487,1505 ---- // All buffers in the CodeBuffer are allocated in the CodeCache. // If the code buffer is created on each compile attempt // as in C2, then it must be freed. //code_buffer->free_blob(); } else { + ImplicitExceptionTable implicit_tbl; nm = nmethod::new_nmethod(method, compile_id, entry_bci, offsets, orig_pc_offset, debug_info, dependencies, code_buffer, frame_words, oop_map_set, ! handler_table, &implicit_tbl, compiler, comp_level, speculations, speculations_len, nmethod_mirror_index, nmethod_mirror_name, failed_speculations);
*** 1542,1568 **** } if (old != NULL ) { old->make_not_entrant(); } } ! ! LogTarget(Info, nmethod, install) lt; ! if (lt.is_enabled()) { ResourceMark rm; char *method_name = method->name_and_sig_as_C_string(); ! lt.print("Installing method (%d) %s [entry point: %p]", ! comp_level, method_name, nm->entry_point()); } // Allow the code to be executed method->set_code(method, nm); } else { ! LogTarget(Info, nmethod, install) lt; ! if (lt.is_enabled()) { ResourceMark rm; char *method_name = method->name_and_sig_as_C_string(); ! lt.print("Installing osr method (%d) %s @ %d", ! comp_level, method_name, entry_bci); } InstanceKlass::cast(method->method_holder())->add_osr_nmethod(nm); } } else { assert(!nmethod_mirror.is_hotspot() || data->get_nmethod_mirror(nm) == HotSpotJVMCI::resolve(nmethod_mirror), "must be"); --- 1536,1564 ---- } if (old != NULL ) { old->make_not_entrant(); } } ! if (TraceNMethodInstalls) { ResourceMark rm; char *method_name = method->name_and_sig_as_C_string(); ! ttyLocker ttyl; ! tty->print_cr("Installing method (%d) %s [entry point: %p]", ! comp_level, ! method_name, nm->entry_point()); } // Allow the code to be executed method->set_code(method, nm); } else { ! if (TraceNMethodInstalls ) { ResourceMark rm; char *method_name = method->name_and_sig_as_C_string(); ! ttyLocker ttyl; ! tty->print_cr("Installing osr method (%d) %s @ %d", ! comp_level, ! method_name, ! entry_bci); } InstanceKlass::cast(method->method_holder())->add_osr_nmethod(nm); } } else { assert(!nmethod_mirror.is_hotspot() || data->get_nmethod_mirror(nm) == HotSpotJVMCI::resolve(nmethod_mirror), "must be");
< prev index next >