< prev index next >

src/hotspot/share/gc/z/zUnload.cpp

Print this page
rev 53848 : 8219469: ZGC: Extract functions out from ZNMethodTable into new ZNMethod class

*** 28,38 **** #include "code/codeCache.hpp" #include "code/dependencyContext.hpp" #include "gc/shared/gcBehaviours.hpp" #include "gc/shared/suspendibleThreadSet.hpp" #include "gc/z/zLock.inline.hpp" ! #include "gc/z/zNMethodTable.hpp" #include "gc/z/zOopClosures.hpp" #include "gc/z/zStat.hpp" #include "gc/z/zUnload.hpp" #include "oops/access.inline.hpp" --- 28,38 ---- #include "code/codeCache.hpp" #include "code/dependencyContext.hpp" #include "gc/shared/gcBehaviours.hpp" #include "gc/shared/suspendibleThreadSet.hpp" #include "gc/z/zLock.inline.hpp" ! #include "gc/z/zNMethod.hpp" #include "gc/z/zOopClosures.hpp" #include "gc/z/zStat.hpp" #include "gc/z/zUnload.hpp" #include "oops/access.inline.hpp"
*** 73,83 **** } public: virtual bool is_unloading(CompiledMethod* method) const { nmethod* const nm = method->as_nmethod(); ! ZReentrantLock* const lock = ZNMethodTable::lock_for_nmethod(nm); if (lock == NULL) { return is_unloading(nm); } else { ZLocker<ZReentrantLock> locker(lock); return is_unloading(nm); --- 73,83 ---- } public: virtual bool is_unloading(CompiledMethod* method) const { nmethod* const nm = method->as_nmethod(); ! ZReentrantLock* const lock = ZNMethod::lock_for_nmethod(nm); if (lock == NULL) { return is_unloading(nm); } else { ZLocker<ZReentrantLock> locker(lock); return is_unloading(nm);
*** 87,106 **** class ZCompiledICProtectionBehaviour : public CompiledICProtectionBehaviour { public: virtual bool lock(CompiledMethod* method) { nmethod* const nm = method->as_nmethod(); ! ZReentrantLock* const lock = ZNMethodTable::lock_for_nmethod(nm); if (lock != NULL) { lock->lock(); } return true; } virtual void unlock(CompiledMethod* method) { nmethod* const nm = method->as_nmethod(); ! ZReentrantLock* const lock = ZNMethodTable::lock_for_nmethod(nm); if (lock != NULL) { lock->unlock(); } } --- 87,106 ---- class ZCompiledICProtectionBehaviour : public CompiledICProtectionBehaviour { public: virtual bool lock(CompiledMethod* method) { nmethod* const nm = method->as_nmethod(); ! ZReentrantLock* const lock = ZNMethod::lock_for_nmethod(nm); if (lock != NULL) { lock->lock(); } return true; } virtual void unlock(CompiledMethod* method) { nmethod* const nm = method->as_nmethod(); ! ZReentrantLock* const lock = ZNMethod::lock_for_nmethod(nm); if (lock != NULL) { lock->unlock(); } }
*** 108,118 **** if (SafepointSynchronize::is_at_safepoint()) { return true; } nmethod* const nm = method->as_nmethod(); ! ZReentrantLock* const lock = ZNMethodTable::lock_for_nmethod(nm); return lock == NULL || lock->is_owned(); } }; ZUnload::ZUnload(ZWorkers* workers) : --- 108,118 ---- if (SafepointSynchronize::is_at_safepoint()) { return true; } nmethod* const nm = method->as_nmethod(); ! ZReentrantLock* const lock = ZNMethod::lock_for_nmethod(nm); return lock == NULL || lock->is_owned(); } }; ZUnload::ZUnload(ZWorkers* workers) :
*** 147,165 **** unloading_occurred = SystemDictionary::do_unloading(ZStatPhase::timer()); } Klass::clean_weak_klass_links(unloading_occurred); ! ZNMethodTable::unlink(_workers, unloading_occurred); DependencyContext::cleaning_end(); } void ZUnload::purge() { { SuspendibleThreadSetJoiner sts; ! ZNMethodTable::purge(_workers); } ClassLoaderDataGraph::purge(); CodeCache::purge_exception_caches(); } --- 147,165 ---- unloading_occurred = SystemDictionary::do_unloading(ZStatPhase::timer()); } Klass::clean_weak_klass_links(unloading_occurred); ! ZNMethod::unlink(_workers, unloading_occurred); DependencyContext::cleaning_end(); } void ZUnload::purge() { { SuspendibleThreadSetJoiner sts; ! ZNMethod::purge(_workers); } ClassLoaderDataGraph::purge(); CodeCache::purge_exception_caches(); }
< prev index next >