< prev index next >

src/hotspot/share/oops/method.cpp

Print this page
rev 54697 : imported patch 8221734-v2-merge
rev 54698 : imported patch 8221734-v2

*** 99,109 **** set_vtable_index(Method::garbage_vtable_index); // Fix and bury in Method* set_interpreter_entry(NULL); // sets i2i entry and from_int set_adapter_entry(NULL); ! Method::unlink_code(this); if (access_flags.is_native()) { clear_native_function(); set_signature_handler(NULL); } --- 99,109 ---- set_vtable_index(Method::garbage_vtable_index); // Fix and bury in Method* set_interpreter_entry(NULL); // sets i2i entry and from_int set_adapter_entry(NULL); ! Method::clear_code(); // from_c/from_i get set to c2i/i2i if (access_flags.is_native()) { clear_native_function(); set_signature_handler(NULL); }
*** 930,940 **** CompilationPolicy::policy()->disable_compilation(this); assert(!CompilationPolicy::can_be_osr_compiled(this, comp_level), "sanity check"); } // Revert to using the interpreter and clear out the nmethod ! void Method::locked_unlink_code() { // this may be NULL if c2i adapters have not been made yet // Only should happen at allocate time. if (adapter() == NULL) { _from_compiled_entry = NULL; } else { --- 930,940 ---- CompilationPolicy::policy()->disable_compilation(this); assert(!CompilationPolicy::can_be_osr_compiled(this, comp_level), "sanity check"); } // Revert to using the interpreter and clear out the nmethod ! void Method::clear_code() { // this may be NULL if c2i adapters have not been made yet // Only should happen at allocate time. if (adapter() == NULL) { _from_compiled_entry = NULL; } else {
*** 945,967 **** OrderAccess::storestore(); _code = NULL; } void Method::unlink_code(Method *method, CompiledMethod *compare) { ! if (method != NULL) { ! MutexLocker ml(CompiledMethod_lock->owned_by_self() ? NULL : CompiledMethod_lock, Mutex::_no_safepoint_check_flag); ! if (method->code() != compare && method->from_compiled_entry() != compare->verified_entry_point()) { return; } ! method->locked_unlink_code(); } } void Method::unlink_code(Method *method) { if (method != NULL) { MutexLocker ml(CompiledMethod_lock->owned_by_self() ? NULL : CompiledMethod_lock, Mutex::_no_safepoint_check_flag); ! method->locked_unlink_code(); } } #if INCLUDE_CDS // Called by class data sharing to remove any entry points (which are not shared) --- 945,968 ---- OrderAccess::storestore(); _code = NULL; } void Method::unlink_code(Method *method, CompiledMethod *compare) { ! if (method == NULL) { return; } ! MutexLocker ml(CompiledMethod_lock->owned_by_self() ? NULL : CompiledMethod_lock, Mutex::_no_safepoint_check_flag); ! if (method->code() == compare || ! method->from_compiled_entry() == compare->verified_entry_point()) { ! method->clear_code(); } } void Method::unlink_code(Method *method) { if (method != NULL) { MutexLocker ml(CompiledMethod_lock->owned_by_self() ? NULL : CompiledMethod_lock, Mutex::_no_safepoint_check_flag); ! method->clear_code(); } } #if INCLUDE_CDS // Called by class data sharing to remove any entry points (which are not shared)
*** 1180,1190 **** return code == NULL || (code->method() == NULL) || (code->method() == (Method*)this && !code->is_osr_method()); } // Install compiled code. Instantly it can execute. void Method::set_code(const methodHandle& mh, CompiledMethod *code) { ! MutexLocker pl(Patching_lock, Mutex::_no_safepoint_check_flag); assert( code, "use clear_code to remove code" ); assert( mh->check_code(), "" ); guarantee(mh->adapter() != NULL, "Adapter blob must already exist!"); --- 1181,1191 ---- return code == NULL || (code->method() == NULL) || (code->method() == (Method*)this && !code->is_osr_method()); } // Install compiled code. Instantly it can execute. void Method::set_code(const methodHandle& mh, CompiledMethod *code) { ! MutexLocker pl(CompiledMethod_lock, Mutex::_no_safepoint_check_flag); assert( code, "use clear_code to remove code" ); assert( mh->check_code(), "" ); guarantee(mh->adapter() != NULL, "Adapter blob must already exist!");
< prev index next >