src/share/vm/ci/ciEnv.cpp
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File hotspot-comp Cdiff src/share/vm/ci/ciEnv.cpp

src/share/vm/ci/ciEnv.cpp

Print this page
rev 5618 : 8023037: Race between ciEnv::register_method and nmethod::make_not_entrant_or_zombie
Reviewed-by: ?

*** 933,943 **** --- 933,945 ---- // To prevent compile queue updates. MutexLocker locker(MethodCompileQueue_lock, THREAD); // Prevent SystemDictionary::add_to_hierarchy from running // and invalidating our dependencies until we install this method. + // No safepoints are allowed. Otherwise, class redefinition can occur in between. MutexLocker ml(Compile_lock); + No_Safepoint_Verifier nsv; // Change in Jvmti state may invalidate compilation. if (!failing() && ( (!jvmti_can_hotswap_or_post_breakpoint() && JvmtiExport::can_hotswap_or_post_breakpoint()) ||
*** 999,1018 **** compiler, comp_level); // Free codeBlobs code_buffer->free_blob(); - // stress test 6243940 by immediately making the method - // non-entrant behind the system's back. This has serious - // side effects on the code cache and is not meant for - // general stress testing - if (nm != NULL && StressNonEntrant) { - MutexLockerEx pl(Patching_lock, Mutex::_no_safepoint_check_flag); - NativeJump::patch_verified_entry(nm->entry_point(), nm->verified_entry_point(), - SharedRuntime::get_handle_wrong_method_stub()); - } - if (nm == NULL) { // The CodeCache is full. Print out warning and disable compilation. record_failure("code cache is full"); { MutexUnlocker ml(Compile_lock); --- 1001,1010 ----
*** 1034,1069 **** if (TraceMethodReplacement && old != NULL) { ResourceMark rm; char *method_name = method->name_and_sig_as_C_string(); tty->print_cr("Replacing method %s", method_name); } ! 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 ", comp_level, method_name); } // 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); } method->method_holder()->add_osr_nmethod(nm); - } } } // JVMTI -- compiled method notification (must be done outside lock) if (nm != NULL) { --- 1026,1060 ---- if (TraceMethodReplacement && old != NULL) { ResourceMark rm; char *method_name = method->name_and_sig_as_C_string(); tty->print_cr("Replacing method %s", method_name); } ! 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 ", comp_level, method_name); } // 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); } method->method_holder()->add_osr_nmethod(nm); } } } // JVMTI -- compiled method notification (must be done outside lock) if (nm != NULL) {
src/share/vm/ci/ciEnv.cpp
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File