< prev index next >

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

Print this page

        

*** 67,76 **** --- 67,79 ---- static const ZStatSubPhase ZSubPhasePauseWeakRootsJVMTIWeakExport("Pause Weak Roots JVMTIWeakExport"); static const ZStatSubPhase ZSubPhasePauseWeakRootsTrace("Pause Weak Roots Trace"); static const ZStatSubPhase ZSubPhasePauseWeakRootsSymbolTable("Pause Weak Roots SymbolTable"); static const ZStatSubPhase ZSubPhasePauseWeakRootsStringTable("Pause Weak Roots StringTable"); + static const ZStatSubPhase ZSubPhaseConcurrentWeakRoots("Concurrent Weak Roots"); + static const ZStatSubPhase ZSubPhaseConcurrentWeakRootsJNIWeakHandles("Concurrent Weak Roots JNIWeakHandles"); + template <typename T, void (T::*F)(OopClosure*)> ZSerialOopsDo<T, F>::ZSerialOopsDo(T* iter) : _iter(iter), _claimed(false) {}
*** 294,304 **** --- 297,309 ---- void ZWeakRootsIterator::unlink_or_oops_do(BoolObjectClosure* is_alive, OopClosure* cl) { ZStatTimer timer(ZSubPhasePauseWeakRoots); _symbol_table.unlink_or_oops_do(is_alive, cl); if (ZWeakRoots) { + if (!ZConcurrentJNIWeakGlobalHandles) { _jni_weak_handles.unlink_or_oops_do(is_alive, cl); + } _jvmti_weak_export.unlink_or_oops_do(is_alive, cl); _trace.unlink_or_oops_do(is_alive, cl); _string_table.unlink_or_oops_do(is_alive, cl); } }
*** 306,315 **** --- 311,342 ---- void ZWeakRootsIterator::oops_do(OopClosure* cl) { AlwaysTrueClosure always_alive; unlink_or_oops_do(&always_alive, cl); } + void ZConcurrentWeakRootsIterator::do_jni_weak_handles(OopClosure* cl) { + ZStatTimer timer(ZSubPhaseConcurrentWeakRootsJNIWeakHandles); + _par_state.oops_do(cl); + } + + ZConcurrentWeakRootsIterator::ZConcurrentWeakRootsIterator() : + _par_state(JNIHandles::weak_global_handles()), + _jni_weak_handles(this) { + } + + ZConcurrentWeakRootsIterator::~ZConcurrentWeakRootsIterator() { + } + + void ZConcurrentWeakRootsIterator::oops_do(OopClosure* cl) { + ZStatTimer timer(ZSubPhaseConcurrentWeakRoots); + if (ZWeakRoots) { + if (ZConcurrentJNIWeakGlobalHandles) { + _jni_weak_handles.oops_do(cl); + } + } + } + ZThreadRootsIterator::ZThreadRootsIterator() : _threads(this) { assert(SafepointSynchronize::is_at_safepoint(), "Should be at safepoint"); ZStatTimer timer(ZSubPhasePauseRootsSetup); Threads::change_thread_claim_parity();
< prev index next >