8254576: ZGC: Clean up timers in roots iterators
Reviewed-by: eosterlund, stefank
This commit is contained in:
parent
508c8a9585
commit
5d6a625543
@ -55,21 +55,11 @@
|
|||||||
#include "utilities/debug.hpp"
|
#include "utilities/debug.hpp"
|
||||||
|
|
||||||
static const ZStatSubPhase ZSubPhasePauseRootsJVMTIWeakExport("Pause Roots JVMTIWeakExport");
|
static const ZStatSubPhase ZSubPhasePauseRootsJVMTIWeakExport("Pause Roots JVMTIWeakExport");
|
||||||
|
|
||||||
static const ZStatSubPhase ZSubPhaseConcurrentRootsSetup("Concurrent Roots Setup");
|
|
||||||
static const ZStatSubPhase ZSubPhaseConcurrentRoots("Concurrent Roots");
|
|
||||||
static const ZStatSubPhase ZSubPhaseConcurrentRootsTeardown("Concurrent Roots Teardown");
|
|
||||||
static const ZStatSubPhase ZSubPhaseConcurrentRootsOopStorageSet("Concurrent Roots OopStorageSet");
|
static const ZStatSubPhase ZSubPhaseConcurrentRootsOopStorageSet("Concurrent Roots OopStorageSet");
|
||||||
static const ZStatSubPhase ZSubPhaseConcurrentRootsClassLoaderDataGraph("Concurrent Roots ClassLoaderDataGraph");
|
static const ZStatSubPhase ZSubPhaseConcurrentRootsClassLoaderDataGraph("Concurrent Roots ClassLoaderDataGraph");
|
||||||
static const ZStatSubPhase ZSubPhaseConcurrentRootsJavaThreads("Concurrent Roots Java Threads");
|
static const ZStatSubPhase ZSubPhaseConcurrentRootsJavaThreads("Concurrent Roots JavaThreads");
|
||||||
static const ZStatSubPhase ZSubPhaseConcurrentRootsCodeCache("Concurrent Roots CodeCache");
|
static const ZStatSubPhase ZSubPhaseConcurrentRootsCodeCache("Concurrent Roots CodeCache");
|
||||||
|
|
||||||
static const ZStatSubPhase ZSubPhasePauseWeakRootsSetup("Pause Weak Roots Setup");
|
|
||||||
static const ZStatSubPhase ZSubPhasePauseWeakRoots("Pause Weak Roots");
|
|
||||||
static const ZStatSubPhase ZSubPhasePauseWeakRootsTeardown("Pause Weak Roots Teardown");
|
|
||||||
static const ZStatSubPhase ZSubPhasePauseWeakRootsJVMTIWeakExport("Pause Weak Roots JVMTIWeakExport");
|
static const ZStatSubPhase ZSubPhasePauseWeakRootsJVMTIWeakExport("Pause Weak Roots JVMTIWeakExport");
|
||||||
|
|
||||||
static const ZStatSubPhase ZSubPhaseConcurrentWeakRoots("Concurrent Weak Roots");
|
|
||||||
static const ZStatSubPhase ZSubPhaseConcurrentWeakRootsOopStorageSet("Concurrent Weak Roots OopStorageSet");
|
static const ZStatSubPhase ZSubPhaseConcurrentWeakRootsOopStorageSet("Concurrent Weak Roots OopStorageSet");
|
||||||
|
|
||||||
template <typename T, void (T::*F)(ZRootsIteratorClosure*)>
|
template <typename T, void (T::*F)(ZRootsIteratorClosure*)>
|
||||||
@ -154,7 +144,6 @@ ZConcurrentRootsIterator::ZConcurrentRootsIterator(int cld_claim) :
|
|||||||
_class_loader_data_graph(this),
|
_class_loader_data_graph(this),
|
||||||
_java_threads(this),
|
_java_threads(this),
|
||||||
_code_cache(this) {
|
_code_cache(this) {
|
||||||
ZStatTimer timer(ZSubPhaseConcurrentRootsSetup);
|
|
||||||
ClassLoaderDataGraph::clear_claimed_marks(cld_claim);
|
ClassLoaderDataGraph::clear_claimed_marks(cld_claim);
|
||||||
if (!ClassUnloading) {
|
if (!ClassUnloading) {
|
||||||
ZNMethodTable::nmethods_do_begin();
|
ZNMethodTable::nmethods_do_begin();
|
||||||
@ -162,7 +151,6 @@ ZConcurrentRootsIterator::ZConcurrentRootsIterator(int cld_claim) :
|
|||||||
}
|
}
|
||||||
|
|
||||||
ZConcurrentRootsIterator::~ZConcurrentRootsIterator() {
|
ZConcurrentRootsIterator::~ZConcurrentRootsIterator() {
|
||||||
ZStatTimer timer(ZSubPhaseConcurrentRootsTeardown);
|
|
||||||
if (!ClassUnloading) {
|
if (!ClassUnloading) {
|
||||||
ZNMethodTable::nmethods_do_end();
|
ZNMethodTable::nmethods_do_end();
|
||||||
}
|
}
|
||||||
@ -179,12 +167,18 @@ void ZConcurrentRootsIterator::do_class_loader_data_graph(ZRootsIteratorClosure*
|
|||||||
ClassLoaderDataGraph::always_strong_cld_do(&cld_cl);
|
ClassLoaderDataGraph::always_strong_cld_do(&cld_cl);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ZConcurrentRootsIterator::do_code_cache(ZRootsIteratorClosure* cl) {
|
||||||
|
ZStatTimer timer(ZSubPhaseConcurrentRootsCodeCache);
|
||||||
|
ZNMethod::oops_do(cl, cl->should_disarm_nmethods());
|
||||||
|
}
|
||||||
|
|
||||||
class ZConcurrentRootsIteratorThreadClosure : public ThreadClosure {
|
class ZConcurrentRootsIteratorThreadClosure : public ThreadClosure {
|
||||||
private:
|
private:
|
||||||
ZRootsIteratorClosure* const _cl;
|
// The resource mark is needed because interpreter oop maps are
|
||||||
// The resource mark is needed because interpreter oop maps are not reused in concurrent mode.
|
// not reused in concurrent mode. Instead, they are temporary and
|
||||||
// Instead, they are temporary and resource allocated.
|
// resource allocated.
|
||||||
ResourceMark _rm;
|
ResourceMark _rm;
|
||||||
|
ZRootsIteratorClosure* const _cl;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
ZConcurrentRootsIteratorThreadClosure(ZRootsIteratorClosure* cl) :
|
ZConcurrentRootsIteratorThreadClosure(ZRootsIteratorClosure* cl) :
|
||||||
@ -195,11 +189,6 @@ public:
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
void ZConcurrentRootsIterator::do_code_cache(ZRootsIteratorClosure* cl) {
|
|
||||||
ZStatTimer timer(ZSubPhaseConcurrentRootsCodeCache);
|
|
||||||
ZNMethod::oops_do(cl, cl->should_disarm_nmethods());
|
|
||||||
}
|
|
||||||
|
|
||||||
void ZConcurrentRootsIterator::do_java_threads(ZRootsIteratorClosure* cl) {
|
void ZConcurrentRootsIterator::do_java_threads(ZRootsIteratorClosure* cl) {
|
||||||
ZStatTimer timer(ZSubPhaseConcurrentRootsJavaThreads);
|
ZStatTimer timer(ZSubPhaseConcurrentRootsJavaThreads);
|
||||||
ZConcurrentRootsIteratorThreadClosure thread_cl(cl);
|
ZConcurrentRootsIteratorThreadClosure thread_cl(cl);
|
||||||
@ -207,7 +196,6 @@ void ZConcurrentRootsIterator::do_java_threads(ZRootsIteratorClosure* cl) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void ZConcurrentRootsIterator::oops_do(ZRootsIteratorClosure* cl) {
|
void ZConcurrentRootsIterator::oops_do(ZRootsIteratorClosure* cl) {
|
||||||
ZStatTimer timer(ZSubPhaseConcurrentRoots);
|
|
||||||
_oop_storage_set.oops_do(cl);
|
_oop_storage_set.oops_do(cl);
|
||||||
_class_loader_data_graph.oops_do(cl);
|
_class_loader_data_graph.oops_do(cl);
|
||||||
_java_threads.oops_do(cl);
|
_java_threads.oops_do(cl);
|
||||||
@ -219,11 +207,6 @@ void ZConcurrentRootsIterator::oops_do(ZRootsIteratorClosure* cl) {
|
|||||||
ZWeakRootsIterator::ZWeakRootsIterator() :
|
ZWeakRootsIterator::ZWeakRootsIterator() :
|
||||||
_jvmti_weak_export(this) {
|
_jvmti_weak_export(this) {
|
||||||
assert(SafepointSynchronize::is_at_safepoint(), "Should be at safepoint");
|
assert(SafepointSynchronize::is_at_safepoint(), "Should be at safepoint");
|
||||||
ZStatTimer timer(ZSubPhasePauseWeakRootsSetup);
|
|
||||||
}
|
|
||||||
|
|
||||||
ZWeakRootsIterator::~ZWeakRootsIterator() {
|
|
||||||
ZStatTimer timer(ZSubPhasePauseWeakRootsTeardown);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void ZWeakRootsIterator::do_jvmti_weak_export(BoolObjectClosure* is_alive, ZRootsIteratorClosure* cl) {
|
void ZWeakRootsIterator::do_jvmti_weak_export(BoolObjectClosure* is_alive, ZRootsIteratorClosure* cl) {
|
||||||
@ -232,7 +215,6 @@ void ZWeakRootsIterator::do_jvmti_weak_export(BoolObjectClosure* is_alive, ZRoot
|
|||||||
}
|
}
|
||||||
|
|
||||||
void ZWeakRootsIterator::weak_oops_do(BoolObjectClosure* is_alive, ZRootsIteratorClosure* cl) {
|
void ZWeakRootsIterator::weak_oops_do(BoolObjectClosure* is_alive, ZRootsIteratorClosure* cl) {
|
||||||
ZStatTimer timer(ZSubPhasePauseWeakRoots);
|
|
||||||
_jvmti_weak_export.weak_oops_do(is_alive, cl);
|
_jvmti_weak_export.weak_oops_do(is_alive, cl);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -256,6 +238,5 @@ void ZConcurrentWeakRootsIterator::do_oop_storage_set(ZRootsIteratorClosure* cl)
|
|||||||
}
|
}
|
||||||
|
|
||||||
void ZConcurrentWeakRootsIterator::oops_do(ZRootsIteratorClosure* cl) {
|
void ZConcurrentWeakRootsIterator::oops_do(ZRootsIteratorClosure* cl) {
|
||||||
ZStatTimer timer(ZSubPhaseConcurrentWeakRoots);
|
|
||||||
_oop_storage_set.oops_do(cl);
|
_oop_storage_set.oops_do(cl);
|
||||||
}
|
}
|
||||||
|
@ -159,7 +159,6 @@ private:
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
ZWeakRootsIterator();
|
ZWeakRootsIterator();
|
||||||
~ZWeakRootsIterator();
|
|
||||||
|
|
||||||
void weak_oops_do(BoolObjectClosure* is_alive, ZRootsIteratorClosure* cl);
|
void weak_oops_do(BoolObjectClosure* is_alive, ZRootsIteratorClosure* cl);
|
||||||
void oops_do(ZRootsIteratorClosure* cl);
|
void oops_do(ZRootsIteratorClosure* cl);
|
||||||
|
Loading…
Reference in New Issue
Block a user