< prev index next >

src/share/vm/code/nmethod.cpp

Print this page
rev 12906 : [mq]: gc_interface

*** 39,48 **** --- 39,49 ---- #include "logging/log.hpp" #include "memory/resourceArea.hpp" #include "oops/methodData.hpp" #include "oops/oop.inline.hpp" #include "prims/jvmtiImpl.hpp" + #include "runtime/access.inline.hpp" #include "runtime/atomic.hpp" #include "runtime/orderAccess.inline.hpp" #include "runtime/os.hpp" #include "runtime/sharedRuntime.hpp" #include "runtime/sweeper.hpp"
*** 407,421 **** #endif _oops_do_mark_link = NULL; _jmethod_id = NULL; _osr_link = NULL; - if (UseG1GC) { _unloading_next = NULL; - } else { _scavenge_root_link = NULL; - } _scavenge_root_state = 0; #if INCLUDE_RTM_OPT _rtm_state = NoRTM; #endif #if INCLUDE_JVMCI --- 408,419 ----
*** 595,610 **** _deopt_mh_handler_begin = (address) this + deoptimize_mh_offset; code_buffer->copy_code_and_locs_to(this); code_buffer->copy_values_to(this); if (ScavengeRootsInCode) { - if (detect_scavenge_root_oops()) { - CodeCache::add_scavenge_root_nmethod(this); - } Universe::heap()->register_nmethod(this); } ! debug_only(verify_scavenge_root_oops()); CodeCache::commit(this); } if (PrintNativeNMethods || PrintDebugInfo || PrintRelocations || PrintDependencies) { ttyLocker ttyl; // keep the following output all in one block --- 593,605 ---- _deopt_mh_handler_begin = (address) this + deoptimize_mh_offset; code_buffer->copy_code_and_locs_to(this); code_buffer->copy_values_to(this); if (ScavengeRootsInCode) { Universe::heap()->register_nmethod(this); } ! debug_only(Universe::heap()->verify_nmethod_roots(this)); CodeCache::commit(this); } if (PrintNativeNMethods || PrintDebugInfo || PrintRelocations || PrintDependencies) { ttyLocker ttyl; // keep the following output all in one block
*** 750,765 **** // Copy contents of ScopeDescRecorder to nmethod code_buffer->copy_values_to(this); debug_info->copy_to(this); dependencies->copy_to(this); if (ScavengeRootsInCode) { - if (detect_scavenge_root_oops()) { - CodeCache::add_scavenge_root_nmethod(this); - } Universe::heap()->register_nmethod(this); } ! debug_only(verify_scavenge_root_oops()); CodeCache::commit(this); // Copy contents of ExceptionHandlerTable to nmethod handler_table->copy_to(this); --- 745,757 ---- // Copy contents of ScopeDescRecorder to nmethod code_buffer->copy_values_to(this); debug_info->copy_to(this); dependencies->copy_to(this); if (ScavengeRootsInCode) { Universe::heap()->register_nmethod(this); } ! debug_only(Universe::heap()->verify_nmethod_roots(this)); CodeCache::commit(this); // Copy contents of ExceptionHandlerTable to nmethod handler_table->copy_to(this);
*** 1525,1535 **** #if INCLUDE_JVMCI bool nmethod::do_unloading_jvmci(BoolObjectClosure* is_alive, bool unloading_occurred) { bool is_unloaded = false; // Follow JVMCI method - BarrierSet* bs = Universe::heap()->barrier_set(); if (_jvmci_installed_code != NULL) { if (_jvmci_installed_code->is_a(HotSpotNmethod::klass()) && HotSpotNmethod::isDefault(_jvmci_installed_code)) { if (!is_alive->do_object_b(_jvmci_installed_code)) { clear_jvmci_installed_code(); } --- 1517,1526 ----
*** 1540,1552 **** } } if (_speculation_log != NULL) { if (!is_alive->do_object_b(_speculation_log)) { ! bs->write_ref_nmethod_pre(&_speculation_log, this); ! _speculation_log = NULL; ! bs->write_ref_nmethod_post(&_speculation_log, this); } } return is_unloaded; } #endif --- 1531,1541 ---- } } if (_speculation_log != NULL) { if (!is_alive->do_object_b(_speculation_log)) { ! NMethodAccess<>::oop_store_at(this, in_bytes(byte_offset_of(nmethod, _speculation_log)), NULL); } } return is_unloaded; } #endif
*** 2136,2146 **** } VerifyOopsClosure voc(this); oops_do(&voc); assert(voc.ok(), "embedded oops must be OK"); ! verify_scavenge_root_oops(); verify_scopes(); } --- 2125,2135 ---- } VerifyOopsClosure voc(this); oops_do(&voc); assert(voc.ok(), "embedded oops must be OK"); ! Universe::heap()->verify_nmethod_roots(this); verify_scopes(); }
*** 2226,2239 **** } virtual void do_oop(narrowOop* p) { ShouldNotReachHere(); } }; void nmethod::verify_scavenge_root_oops() { - if (UseG1GC) { - return; - } - if (!on_scavenge_root_list()) { // Actually look inside, to verify the claim that it's clean. DebugScavengeRoot debug_scavenge_root(this); oops_do(&debug_scavenge_root); if (!debug_scavenge_root.ok()) --- 2215,2224 ----
*** 2912,2925 **** // safepoint or while holding the CodeCache_lock assert(CodeCache_lock->is_locked() || SafepointSynchronize::is_at_safepoint(), "should be performed under a lock for consistency"); if (_jvmci_installed_code != NULL) { // This must be done carefully to maintain nmethod remembered sets properly ! BarrierSet* bs = Universe::heap()->barrier_set(); ! bs->write_ref_nmethod_pre(&_jvmci_installed_code, this); ! _jvmci_installed_code = NULL; ! bs->write_ref_nmethod_post(&_jvmci_installed_code, this); } } void nmethod::maybe_invalidate_installed_code() { assert(Patching_lock->is_locked() || --- 2897,2907 ---- // safepoint or while holding the CodeCache_lock assert(CodeCache_lock->is_locked() || SafepointSynchronize::is_at_safepoint(), "should be performed under a lock for consistency"); if (_jvmci_installed_code != NULL) { // This must be done carefully to maintain nmethod remembered sets properly ! NMethodAccess<>::oop_store_at(this, in_bytes(byte_offset_of(nmethod, _jvmci_installed_code)), NULL); } } void nmethod::maybe_invalidate_installed_code() { assert(Patching_lock->is_locked() ||
*** 3004,3009 **** } jio_snprintf(buf, buflen, "noInstalledCode"); return buf; } #endif - --- 2986,2990 ----
< prev index next >