< prev index next >
src/hotspot/share/gc/z/zUnload.cpp
Print this page
*** 34,44 ****
#include "gc/z/zOopClosures.hpp"
#include "gc/z/zStat.hpp"
#include "gc/z/zUnload.hpp"
#include "oops/access.inline.hpp"
! static const ZStatSubPhase ZSubPhaseConcurrentClassesUnload("Concurrent Classes Unload");
class ZIsUnloadingOopClosure : public OopClosure {
private:
ZPhantomIsAliveObjectClosure _is_alive;
bool _is_unloading;
--- 34,45 ----
#include "gc/z/zOopClosures.hpp"
#include "gc/z/zStat.hpp"
#include "gc/z/zUnload.hpp"
#include "oops/access.inline.hpp"
! static const ZStatSubPhase ZSubPhaseConcurrentClassesUnlink("Concurrent Classes Unlink");
! static const ZStatSubPhase ZSubPhaseConcurrentClassesPurge("Concurrent Classes Purge");
class ZIsUnloadingOopClosure : public OopClosure {
private:
ZPhantomIsAliveObjectClosure _is_alive;
bool _is_unloading;
*** 124,181 ****
CodeCache::increment_unloading_cycle();
DependencyContext::cleaning_start();
}
void ZUnload::unlink() {
SuspendibleThreadSetJoiner sts;
bool unloading_occurred;
{
MutexLocker ml(ClassLoaderDataGraph_lock);
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();
}
- class ZUnloadRendezvousClosure : public ThreadClosure {
- public:
- void do_thread(Thread* thread) {}
- };
-
- void ZUnload::unload() {
- if (!ClassUnloading) {
- return;
- }
-
- ZStatTimer timer(ZSubPhaseConcurrentClassesUnload);
-
- // Unlink stale metadata and nmethods
- unlink();
-
- // Make sure stale metadata and nmethods are no longer observable
- ZUnloadRendezvousClosure cl;
- Handshake::execute(&cl);
-
- // Purge stale metadata and nmethods that were unlinked
- purge();
- }
-
void ZUnload::finish() {
// Resize and verify metaspace
MetaspaceGC::compute_new_size();
MetaspaceUtils::verify_metrics();
}
--- 125,168 ----
CodeCache::increment_unloading_cycle();
DependencyContext::cleaning_start();
}
void ZUnload::unlink() {
+ if (!ClassUnloading) {
+ return;
+ }
+
+ ZStatTimer timer(ZSubPhaseConcurrentClassesUnlink);
SuspendibleThreadSetJoiner sts;
bool unloading_occurred;
{
MutexLocker ml(ClassLoaderDataGraph_lock);
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() {
+ if (!ClassUnloading) {
+ return;
+ }
+
+ ZStatTimer timer(ZSubPhaseConcurrentClassesPurge);
+
{
SuspendibleThreadSetJoiner sts;
ZNMethod::purge(_workers);
}
ClassLoaderDataGraph::purge();
CodeCache::purge_exception_caches();
}
void ZUnload::finish() {
// Resize and verify metaspace
MetaspaceGC::compute_new_size();
MetaspaceUtils::verify_metrics();
}
< prev index next >