--- a/src/hotspot/share/gc/z/zRootsIterator.cpp Wed Sep 19 09:24:40 2018 -0700
+++ b/src/hotspot/share/gc/z/zRootsIterator.cpp Wed Sep 19 19:12:18 2018 +0200
@@ -73,25 +73,25 @@
static const ZStatSubPhase ZSubPhaseConcurrentWeakRootsJNIWeakHandles("Concurrent Weak Roots JNIWeakHandles");
static const ZStatSubPhase ZSubPhaseConcurrentWeakRootsStringTable("Concurrent Weak Roots StringTable");
-template <typename T, void (T::*F)(OopClosure*)>
+template <typename T, void (T::*F)(ZRootsIteratorClosure*)>
ZSerialOopsDo<T, F>::ZSerialOopsDo(T* iter) :
_iter(iter),
_claimed(false) {}
-template <typename T, void (T::*F)(OopClosure*)>
-void ZSerialOopsDo<T, F>::oops_do(OopClosure* cl) {
+template <typename T, void (T::*F)(ZRootsIteratorClosure*)>
+void ZSerialOopsDo<T, F>::oops_do(ZRootsIteratorClosure* cl) {
if (!_claimed && Atomic::cmpxchg(true, &_claimed, false) == false) {
(_iter->*F)(cl);
}
}
-template <typename T, void (T::*F)(OopClosure*)>
+template <typename T, void (T::*F)(ZRootsIteratorClosure*)>
ZParallelOopsDo<T, F>::ZParallelOopsDo(T* iter) :
_iter(iter),
_completed(false) {}
-template <typename T, void (T::*F)(OopClosure*)>
-void ZParallelOopsDo<T, F>::oops_do(OopClosure* cl) {
+template <typename T, void (T::*F)(ZRootsIteratorClosure*)>
+void ZParallelOopsDo<T, F>::oops_do(ZRootsIteratorClosure* cl) {
if (!_completed) {
(_iter->*F)(cl);
if (!_completed) {
@@ -100,25 +100,25 @@
}
}
-template <typename T, void (T::*F)(BoolObjectClosure*, OopClosure*)>
+template <typename T, void (T::*F)(BoolObjectClosure*, ZRootsIteratorClosure*)>
ZSerialWeakOopsDo<T, F>::ZSerialWeakOopsDo(T* iter) :
_iter(iter),
_claimed(false) {}
-template <typename T, void (T::*F)(BoolObjectClosure*, OopClosure*)>
-void ZSerialWeakOopsDo<T, F>::weak_oops_do(BoolObjectClosure* is_alive, OopClosure* cl) {
+template <typename T, void (T::*F)(BoolObjectClosure*, ZRootsIteratorClosure*)>
+void ZSerialWeakOopsDo<T, F>::weak_oops_do(BoolObjectClosure* is_alive, ZRootsIteratorClosure* cl) {
if (!_claimed && Atomic::cmpxchg(true, &_claimed, false) == false) {
(_iter->*F)(is_alive, cl);
}
}
-template <typename T, void (T::*F)(BoolObjectClosure*, OopClosure*)>
+template <typename T, void (T::*F)(BoolObjectClosure*, ZRootsIteratorClosure*)>
ZParallelWeakOopsDo<T, F>::ZParallelWeakOopsDo(T* iter) :
_iter(iter),
_completed(false) {}
-template <typename T, void (T::*F)(BoolObjectClosure*, OopClosure*)>
-void ZParallelWeakOopsDo<T, F>::weak_oops_do(BoolObjectClosure* is_alive, OopClosure* cl) {
+template <typename T, void (T::*F)(BoolObjectClosure*, ZRootsIteratorClosure*)>
+void ZParallelWeakOopsDo<T, F>::weak_oops_do(BoolObjectClosure* is_alive, ZRootsIteratorClosure* cl) {
if (!_completed) {
(_iter->*F)(is_alive, cl);
if (!_completed) {
@@ -158,80 +158,60 @@
Threads::assert_all_threads_claimed();
}
-void ZRootsIterator::do_universe(OopClosure* cl) {
+void ZRootsIterator::do_universe(ZRootsIteratorClosure* cl) {
ZStatTimer timer(ZSubPhasePauseRootsUniverse);
Universe::oops_do(cl);
}
-void ZRootsIterator::do_jni_handles(OopClosure* cl) {
+void ZRootsIterator::do_jni_handles(ZRootsIteratorClosure* cl) {
ZStatTimer timer(ZSubPhasePauseRootsJNIHandles);
_jni_handles_iter.oops_do(cl);
}
-void ZRootsIterator::do_object_synchronizer(OopClosure* cl) {
+void ZRootsIterator::do_object_synchronizer(ZRootsIteratorClosure* cl) {
ZStatTimer timer(ZSubPhasePauseRootsObjectSynchronizer);
ObjectSynchronizer::oops_do(cl);
}
-void ZRootsIterator::do_management(OopClosure* cl) {
+void ZRootsIterator::do_management(ZRootsIteratorClosure* cl) {
ZStatTimer timer(ZSubPhasePauseRootsManagement);
Management::oops_do(cl);
}
-void ZRootsIterator::do_jvmti_export(OopClosure* cl) {
+void ZRootsIterator::do_jvmti_export(ZRootsIteratorClosure* cl) {
ZStatTimer timer(ZSubPhasePauseRootsJVMTIExport);
JvmtiExport::oops_do(cl);
}
-void ZRootsIterator::do_jvmti_weak_export(OopClosure* cl) {
+void ZRootsIterator::do_jvmti_weak_export(ZRootsIteratorClosure* cl) {
ZStatTimer timer(ZSubPhasePauseRootsJVMTIWeakExport);
AlwaysTrueClosure always_alive;
JvmtiExport::weak_oops_do(&always_alive, cl);
}
-void ZRootsIterator::do_system_dictionary(OopClosure* cl) {
+void ZRootsIterator::do_system_dictionary(ZRootsIteratorClosure* cl) {
ZStatTimer timer(ZSubPhasePauseRootsSystemDictionary);
SystemDictionary::oops_do(cl);
}
-void ZRootsIterator::do_class_loader_data_graph(OopClosure* cl) {
+void ZRootsIterator::do_class_loader_data_graph(ZRootsIteratorClosure* cl) {
ZStatTimer timer(ZSubPhasePauseRootsClassLoaderDataGraph);
CLDToOopClosure cld_cl(cl);
ClassLoaderDataGraph::cld_do(&cld_cl);
}
-class ZRootsIteratorThreadClosure : public ThreadClosure {
-private:
- OopClosure* const _cl;
-
-public:
- ZRootsIteratorThreadClosure(OopClosure* cl) :
- _cl(cl) {}
-
- virtual void do_thread(Thread* thread) {
- if (thread->is_Java_thread()) {
- // Update thread local address bad mask
- ZThreadLocalData::set_address_bad_mask(thread, ZAddressBadMask);
- }
-
- // Process thread oops
- thread->oops_do(_cl, NULL);
- }
-};
-
-void ZRootsIterator::do_threads(OopClosure* cl) {
+void ZRootsIterator::do_threads(ZRootsIteratorClosure* cl) {
ZStatTimer timer(ZSubPhasePauseRootsThreads);
ResourceMark rm;
- ZRootsIteratorThreadClosure thread_cl(cl);
- Threads::possibly_parallel_threads_do(true, &thread_cl);
+ Threads::possibly_parallel_threads_do(true, cl);
}
-void ZRootsIterator::do_code_cache(OopClosure* cl) {
+void ZRootsIterator::do_code_cache(ZRootsIteratorClosure* cl) {
ZStatTimer timer(ZSubPhasePauseRootsCodeCache);
ZNMethodTable::oops_do(cl);
}
-void ZRootsIterator::oops_do(OopClosure* cl, bool visit_jvmti_weak_export) {
+void ZRootsIterator::oops_do(ZRootsIteratorClosure* cl, bool visit_jvmti_weak_export) {
ZStatTimer timer(ZSubPhasePauseRoots);
_universe.oops_do(cl);
_object_synchronizer.oops_do(cl);
@@ -258,25 +238,25 @@
ZStatTimer timer(ZSubPhasePauseWeakRootsTeardown);
}
-void ZWeakRootsIterator::do_jvmti_weak_export(BoolObjectClosure* is_alive, OopClosure* cl) {
+void ZWeakRootsIterator::do_jvmti_weak_export(BoolObjectClosure* is_alive, ZRootsIteratorClosure* cl) {
ZStatTimer timer(ZSubPhasePauseWeakRootsJVMTIWeakExport);
JvmtiExport::weak_oops_do(is_alive, cl);
}
-void ZWeakRootsIterator::do_jfr_weak(BoolObjectClosure* is_alive, OopClosure* cl) {
+void ZWeakRootsIterator::do_jfr_weak(BoolObjectClosure* is_alive, ZRootsIteratorClosure* cl) {
#if INCLUDE_JFR
ZStatTimer timer(ZSubPhasePauseWeakRootsJFRWeak);
Jfr::weak_oops_do(is_alive, cl);
#endif
}
-void ZWeakRootsIterator::weak_oops_do(BoolObjectClosure* is_alive, OopClosure* cl) {
+void ZWeakRootsIterator::weak_oops_do(BoolObjectClosure* is_alive, ZRootsIteratorClosure* cl) {
ZStatTimer timer(ZSubPhasePauseWeakRoots);
_jvmti_weak_export.weak_oops_do(is_alive, cl);
_jfr_weak.weak_oops_do(is_alive, cl);
}
-void ZWeakRootsIterator::oops_do(OopClosure* cl) {
+void ZWeakRootsIterator::oops_do(ZRootsIteratorClosure* cl) {
AlwaysTrueClosure always_alive;
weak_oops_do(&always_alive, cl);
}
@@ -295,27 +275,27 @@
StringTable::finish_dead_counter();
}
-void ZConcurrentWeakRootsIterator::do_vm_weak_handles(OopClosure* cl) {
+void ZConcurrentWeakRootsIterator::do_vm_weak_handles(ZRootsIteratorClosure* cl) {
ZStatTimer timer(ZSubPhaseConcurrentWeakRootsVMWeakHandles);
_vm_weak_handles_iter.oops_do(cl);
}
-void ZConcurrentWeakRootsIterator::do_jni_weak_handles(OopClosure* cl) {
+void ZConcurrentWeakRootsIterator::do_jni_weak_handles(ZRootsIteratorClosure* cl) {
ZStatTimer timer(ZSubPhaseConcurrentWeakRootsJNIWeakHandles);
_jni_weak_handles_iter.oops_do(cl);
}
-class ZStringTableDeadCounterOopClosure : public OopClosure {
+class ZStringTableDeadCounterClosure : public ZRootsIteratorClosure {
private:
- OopClosure* const _cl;
- size_t _ndead;
+ ZRootsIteratorClosure* const _cl;
+ size_t _ndead;
public:
- ZStringTableDeadCounterOopClosure(OopClosure* cl) :
+ ZStringTableDeadCounterClosure(ZRootsIteratorClosure* cl) :
_cl(cl),
_ndead(0) {}
- ~ZStringTableDeadCounterOopClosure() {
+ ~ZStringTableDeadCounterClosure() {
StringTable::inc_dead_counter(_ndead);
}
@@ -331,13 +311,13 @@
}
};
-void ZConcurrentWeakRootsIterator::do_string_table(OopClosure* cl) {
+void ZConcurrentWeakRootsIterator::do_string_table(ZRootsIteratorClosure* cl) {
ZStatTimer timer(ZSubPhaseConcurrentWeakRootsStringTable);
- ZStringTableDeadCounterOopClosure counter_cl(cl);
+ ZStringTableDeadCounterClosure counter_cl(cl);
_string_table_iter.oops_do(&counter_cl);
}
-void ZConcurrentWeakRootsIterator::oops_do(OopClosure* cl) {
+void ZConcurrentWeakRootsIterator::oops_do(ZRootsIteratorClosure* cl) {
ZStatTimer timer(ZSubPhaseConcurrentWeakRoots);
_vm_weak_handles.oops_do(cl);
_jni_weak_handles.oops_do(cl);
@@ -356,13 +336,13 @@
Threads::assert_all_threads_claimed();
}
-void ZThreadRootsIterator::do_threads(OopClosure* cl) {
+void ZThreadRootsIterator::do_threads(ZRootsIteratorClosure* cl) {
ZStatTimer timer(ZSubPhasePauseRootsThreads);
ResourceMark rm;
Threads::possibly_parallel_oops_do(true, cl, NULL);
}
-void ZThreadRootsIterator::oops_do(OopClosure* cl) {
+void ZThreadRootsIterator::oops_do(ZRootsIteratorClosure* cl) {
ZStatTimer timer(ZSubPhasePauseRoots);
_threads.oops_do(cl);
}