8210061: ZGC: Remove STW weak processor mode

Reviewed-by: pliden, kbarrett
This commit is contained in:
Erik Österlund 2018-08-30 08:59:23 +02:00
parent a75b0f74fa
commit dd02aad6be
3 changed files with 4 additions and 87 deletions

View File

@ -69,11 +69,8 @@ static const ZStatSubPhase ZSubPhasePauseRootsStringTable("Pause Roots StringTab
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 ZSubPhasePauseWeakRootsVMWeakHandles("Pause Weak Roots VMWeakHandles");
static const ZStatSubPhase ZSubPhasePauseWeakRootsJNIWeakHandles("Pause Weak Roots JNIWeakHandles");
static const ZStatSubPhase ZSubPhasePauseWeakRootsJVMTIWeakExport("Pause Weak Roots JVMTIWeakExport");
static const ZStatSubPhase ZSubPhasePauseWeakRootsJFRWeak("Pause Weak Roots JFRWeak");
static const ZStatSubPhase ZSubPhasePauseWeakRootsStringTable("Pause Weak Roots StringTable");
static const ZStatSubPhase ZSubPhaseConcurrentWeakRoots("Concurrent Weak Roots");
static const ZStatSubPhase ZSubPhaseConcurrentWeakRootsVMWeakHandles("Concurrent Weak Roots VMWeakHandles");
@ -293,14 +290,8 @@ void ZRootsIterator::oops_do(OopClosure* cl, bool visit_jvmti_weak_export) {
}
ZWeakRootsIterator::ZWeakRootsIterator() :
_vm_weak_handles_iter(SystemDictionary::vm_weak_oop_storage()),
_jni_weak_handles_iter(JNIHandles::weak_global_handles()),
_string_table_iter(StringTable::weak_storage()),
_jvmti_weak_export(this),
_jfr_weak(this),
_vm_weak_handles(this),
_jni_weak_handles(this),
_string_table(this) {
_jfr_weak(this) {
assert(SafepointSynchronize::is_at_safepoint(), "Should be at safepoint");
ZStatTimer timer(ZSubPhasePauseWeakRootsSetup);
StringTable::reset_dead_counter();
@ -311,16 +302,6 @@ ZWeakRootsIterator::~ZWeakRootsIterator() {
StringTable::finish_dead_counter();
}
void ZWeakRootsIterator::do_vm_weak_handles(BoolObjectClosure* is_alive, OopClosure* cl) {
ZStatTimer timer(ZSubPhasePauseWeakRootsVMWeakHandles);
_vm_weak_handles_iter.weak_oops_do(is_alive, cl);
}
void ZWeakRootsIterator::do_jni_weak_handles(BoolObjectClosure* is_alive, OopClosure* cl) {
ZStatTimer timer(ZSubPhasePauseWeakRootsJNIWeakHandles);
_jni_weak_handles_iter.weak_oops_do(is_alive, cl);
}
void ZWeakRootsIterator::do_jvmti_weak_export(BoolObjectClosure* is_alive, OopClosure* cl) {
ZStatTimer timer(ZSubPhasePauseWeakRootsJVMTIWeakExport);
JvmtiExport::weak_oops_do(is_alive, cl);
@ -333,50 +314,11 @@ void ZWeakRootsIterator::do_jfr_weak(BoolObjectClosure* is_alive, OopClosure* cl
#endif
}
class ZStringTableDeadCounterBoolObjectClosure : public BoolObjectClosure {
private:
BoolObjectClosure* const _cl;
size_t _ndead;
public:
ZStringTableDeadCounterBoolObjectClosure(BoolObjectClosure* cl) :
_cl(cl),
_ndead(0) {}
~ZStringTableDeadCounterBoolObjectClosure() {
StringTable::inc_dead_counter(_ndead);
}
virtual bool do_object_b(oop obj) {
if (_cl->do_object_b(obj)) {
return true;
}
_ndead++;
return false;
}
};
void ZWeakRootsIterator::do_string_table(BoolObjectClosure* is_alive, OopClosure* cl) {
ZStatTimer timer(ZSubPhasePauseWeakRootsStringTable);
ZStringTableDeadCounterBoolObjectClosure counter_is_alive(is_alive);
_string_table_iter.weak_oops_do(&counter_is_alive, cl);
}
void ZWeakRootsIterator::weak_oops_do(BoolObjectClosure* is_alive, OopClosure* cl) {
ZStatTimer timer(ZSubPhasePauseWeakRoots);
if (ZWeakRoots) {
_jvmti_weak_export.weak_oops_do(is_alive, cl);
_jfr_weak.weak_oops_do(is_alive, cl);
if (!ZConcurrentVMWeakHandles) {
_vm_weak_handles.weak_oops_do(is_alive, cl);
}
if (!ZConcurrentJNIWeakGlobalHandles) {
_jni_weak_handles.weak_oops_do(is_alive, cl);
}
if (!ZConcurrentStringTable) {
_string_table.weak_oops_do(is_alive, cl);
}
}
}
@ -444,15 +386,9 @@ void ZConcurrentWeakRootsIterator::do_string_table(OopClosure* cl) {
void ZConcurrentWeakRootsIterator::oops_do(OopClosure* cl) {
ZStatTimer timer(ZSubPhaseConcurrentWeakRoots);
if (ZWeakRoots) {
if (ZConcurrentVMWeakHandles) {
_vm_weak_handles.oops_do(cl);
}
if (ZConcurrentJNIWeakGlobalHandles) {
_jni_weak_handles.oops_do(cl);
}
if (ZConcurrentStringTable) {
_string_table.oops_do(cl);
}
_vm_weak_handles.oops_do(cl);
_jni_weak_handles.oops_do(cl);
_string_table.oops_do(cl);
}
}

View File

@ -122,21 +122,11 @@ public:
class ZWeakRootsIterator {
private:
ZOopStorageIterator _vm_weak_handles_iter;
ZOopStorageIterator _jni_weak_handles_iter;
ZOopStorageIterator _string_table_iter;
void do_vm_weak_handles(BoolObjectClosure* is_alive, OopClosure* cl);
void do_jni_weak_handles(BoolObjectClosure* is_alive, OopClosure* cl);
void do_jvmti_weak_export(BoolObjectClosure* is_alive, OopClosure* cl);
void do_jfr_weak(BoolObjectClosure* is_alive, OopClosure* cl);
void do_string_table(BoolObjectClosure* is_alive, OopClosure* cl);
ZSerialWeakOopsDo<ZWeakRootsIterator, &ZWeakRootsIterator::do_jvmti_weak_export> _jvmti_weak_export;
ZSerialWeakOopsDo<ZWeakRootsIterator, &ZWeakRootsIterator::do_jfr_weak> _jfr_weak;
ZParallelWeakOopsDo<ZWeakRootsIterator, &ZWeakRootsIterator::do_vm_weak_handles> _vm_weak_handles;
ZParallelWeakOopsDo<ZWeakRootsIterator, &ZWeakRootsIterator::do_jni_weak_handles> _jni_weak_handles;
ZParallelWeakOopsDo<ZWeakRootsIterator, &ZWeakRootsIterator::do_string_table> _string_table;
public:
ZWeakRootsIterator();

View File

@ -82,15 +82,6 @@
diagnostic(bool, ZWeakRoots, true, \
"Treat JNI WeakGlobalRefs and StringTable as weak roots") \
\
diagnostic(bool, ZConcurrentStringTable, true, \
"Clean StringTable concurrently") \
\
diagnostic(bool, ZConcurrentVMWeakHandles, true, \
"Clean VM WeakHandles concurrently") \
\
diagnostic(bool, ZConcurrentJNIWeakGlobalHandles, true, \
"Clean JNI WeakGlobalRefs concurrently") \
\
diagnostic(bool, ZOptimizeLoadBarriers, true, \
"Apply load barrier optimizations") \
\