< prev index next >

src/hotspot/share/gc/shenandoah/shenandoahRootProcessor.cpp

Print this page

 25 #include "precompiled.hpp"
 26 
 27 #include "classfile/classLoaderDataGraph.hpp"
 28 #include "classfile/stringTable.hpp"
 29 #include "classfile/systemDictionary.hpp"
 30 #include "code/codeCache.hpp"
 31 #include "gc/shenandoah/shenandoahClosures.inline.hpp"
 32 #include "gc/shenandoah/shenandoahConcurrentRoots.hpp"
 33 #include "gc/shenandoah/shenandoahRootProcessor.inline.hpp"
 34 #include "gc/shenandoah/shenandoahHeap.hpp"
 35 #include "gc/shenandoah/shenandoahPhaseTimings.hpp"
 36 #include "gc/shenandoah/shenandoahStringDedup.hpp"
 37 #include "gc/shenandoah/shenandoahTimingTracker.hpp"
 38 #include "gc/shenandoah/shenandoahVMOperations.hpp"
 39 #include "jfr/jfr.hpp"
 40 #include "memory/iterator.hpp"
 41 #include "memory/resourceArea.hpp"
 42 #include "memory/universe.hpp"
 43 #include "runtime/thread.hpp"
 44 #include "services/management.hpp"

 45 
 46 ShenandoahSerialRoot::ShenandoahSerialRoot(ShenandoahSerialRoot::OopsDo oops_do, ShenandoahPhaseTimings::GCParPhases phase) :
 47   _oops_do(oops_do), _phase(phase) {
 48 }
 49 
 50 void ShenandoahSerialRoot::oops_do(OopClosure* cl, uint worker_id) {
 51   if (_claimed.try_set()) {
 52     ShenandoahWorkerTimings* worker_times = ShenandoahHeap::heap()->phase_timings()->worker_times();
 53     ShenandoahWorkerTimingsTracker timer(worker_times, _phase, worker_id);
 54     _oops_do(cl);
 55   }
 56 }
 57 
 58 // Overwrite the second argument for SD::oops_do, don't include vm global oop storage.
 59 static void system_dictionary_oops_do(OopClosure* cl) {
 60   SystemDictionary::oops_do(cl, false);
 61 }
 62 
 63 ShenandoahSerialRoots::ShenandoahSerialRoots() :
 64   _universe_root(&Universe::oops_do, ShenandoahPhaseTimings::UniverseRoots),

 83 void ShenandoahWeakSerialRoot::weak_oops_do(BoolObjectClosure* is_alive, OopClosure* keep_alive, uint worker_id) {
 84   if (_claimed.try_set()) {
 85     ShenandoahWorkerTimings* worker_times = ShenandoahHeap::heap()->phase_timings()->worker_times();
 86     ShenandoahWorkerTimingsTracker timer(worker_times, _phase, worker_id);
 87     _weak_oops_do(is_alive, keep_alive);
 88   }
 89 }
 90 
 91 #if INCLUDE_JVMTI
 92 ShenandoahJVMTIWeakRoot::ShenandoahJVMTIWeakRoot() :
 93   ShenandoahWeakSerialRoot(&JvmtiExport::weak_oops_do, ShenandoahPhaseTimings::JVMTIWeakRoots) {
 94 }
 95 #endif // INCLUDE_JVMTI
 96 
 97 #if INCLUDE_JFR
 98 ShenandoahJFRWeakRoot::ShenandoahJFRWeakRoot() :
 99   ShenandoahWeakSerialRoot(&Jfr::weak_oops_do, ShenandoahPhaseTimings::JFRWeakRoots) {
100 }
101 #endif // INCLUDE_JFR
102 






103 void ShenandoahSerialWeakRoots::weak_oops_do(BoolObjectClosure* is_alive, OopClosure* keep_alive, uint worker_id) {
104   JVMTI_ONLY(_jvmti_weak_roots.weak_oops_do(is_alive, keep_alive, worker_id);)
105   JFR_ONLY(_jfr_weak_roots.weak_oops_do(is_alive, keep_alive, worker_id);)

106 }
107 
108 void ShenandoahSerialWeakRoots::weak_oops_do(OopClosure* cl, uint worker_id) {
109   AlwaysTrueClosure always_true;
110   weak_oops_do(&always_true, cl, worker_id);
111 }
112 
113 ShenandoahThreadRoots::ShenandoahThreadRoots(bool is_par) : _is_par(is_par) {
114   Threads::change_thread_claim_token();
115 }
116 
117 void ShenandoahThreadRoots::oops_do(OopClosure* oops_cl, CodeBlobClosure* code_cl, uint worker_id) {
118   ShenandoahWorkerTimings* worker_times = ShenandoahHeap::heap()->phase_timings()->worker_times();
119   ShenandoahWorkerTimingsTracker timer(worker_times, ShenandoahPhaseTimings::ThreadRoots, worker_id);
120   ResourceMark rm;
121   Threads::possibly_parallel_oops_do(_is_par, oops_cl, code_cl);
122 }
123 
124 void ShenandoahThreadRoots::threads_do(ThreadClosure* tc, uint worker_id) {
125   ShenandoahWorkerTimings* worker_times = ShenandoahHeap::heap()->phase_timings()->worker_times();

 25 #include "precompiled.hpp"
 26 
 27 #include "classfile/classLoaderDataGraph.hpp"
 28 #include "classfile/stringTable.hpp"
 29 #include "classfile/systemDictionary.hpp"
 30 #include "code/codeCache.hpp"
 31 #include "gc/shenandoah/shenandoahClosures.inline.hpp"
 32 #include "gc/shenandoah/shenandoahConcurrentRoots.hpp"
 33 #include "gc/shenandoah/shenandoahRootProcessor.inline.hpp"
 34 #include "gc/shenandoah/shenandoahHeap.hpp"
 35 #include "gc/shenandoah/shenandoahPhaseTimings.hpp"
 36 #include "gc/shenandoah/shenandoahStringDedup.hpp"
 37 #include "gc/shenandoah/shenandoahTimingTracker.hpp"
 38 #include "gc/shenandoah/shenandoahVMOperations.hpp"
 39 #include "jfr/jfr.hpp"
 40 #include "memory/iterator.hpp"
 41 #include "memory/resourceArea.hpp"
 42 #include "memory/universe.hpp"
 43 #include "runtime/thread.hpp"
 44 #include "services/management.hpp"
 45 #include "tsan/tsanOopMap.hpp"
 46 
 47 ShenandoahSerialRoot::ShenandoahSerialRoot(ShenandoahSerialRoot::OopsDo oops_do, ShenandoahPhaseTimings::GCParPhases phase) :
 48   _oops_do(oops_do), _phase(phase) {
 49 }
 50 
 51 void ShenandoahSerialRoot::oops_do(OopClosure* cl, uint worker_id) {
 52   if (_claimed.try_set()) {
 53     ShenandoahWorkerTimings* worker_times = ShenandoahHeap::heap()->phase_timings()->worker_times();
 54     ShenandoahWorkerTimingsTracker timer(worker_times, _phase, worker_id);
 55     _oops_do(cl);
 56   }
 57 }
 58 
 59 // Overwrite the second argument for SD::oops_do, don't include vm global oop storage.
 60 static void system_dictionary_oops_do(OopClosure* cl) {
 61   SystemDictionary::oops_do(cl, false);
 62 }
 63 
 64 ShenandoahSerialRoots::ShenandoahSerialRoots() :
 65   _universe_root(&Universe::oops_do, ShenandoahPhaseTimings::UniverseRoots),

 84 void ShenandoahWeakSerialRoot::weak_oops_do(BoolObjectClosure* is_alive, OopClosure* keep_alive, uint worker_id) {
 85   if (_claimed.try_set()) {
 86     ShenandoahWorkerTimings* worker_times = ShenandoahHeap::heap()->phase_timings()->worker_times();
 87     ShenandoahWorkerTimingsTracker timer(worker_times, _phase, worker_id);
 88     _weak_oops_do(is_alive, keep_alive);
 89   }
 90 }
 91 
 92 #if INCLUDE_JVMTI
 93 ShenandoahJVMTIWeakRoot::ShenandoahJVMTIWeakRoot() :
 94   ShenandoahWeakSerialRoot(&JvmtiExport::weak_oops_do, ShenandoahPhaseTimings::JVMTIWeakRoots) {
 95 }
 96 #endif // INCLUDE_JVMTI
 97 
 98 #if INCLUDE_JFR
 99 ShenandoahJFRWeakRoot::ShenandoahJFRWeakRoot() :
100   ShenandoahWeakSerialRoot(&Jfr::weak_oops_do, ShenandoahPhaseTimings::JFRWeakRoots) {
101 }
102 #endif // INCLUDE_JFR
103 
104 #if INCLUDE_TSAN
105 ShenandoahTSANWeakRoot::ShenandoahTSANWeakRoot() :
106   ShenandoahWeakSerialRoot(&TsanOopMap::weak_oops_do, ShenandoahPhaseTimings::TSANWeakRoots) {
107 }
108 #endif // INCLUDE_TSAN
109 
110 void ShenandoahSerialWeakRoots::weak_oops_do(BoolObjectClosure* is_alive, OopClosure* keep_alive, uint worker_id) {
111   JVMTI_ONLY(_jvmti_weak_roots.weak_oops_do(is_alive, keep_alive, worker_id);)
112   JFR_ONLY(_jfr_weak_roots.weak_oops_do(is_alive, keep_alive, worker_id);)
113   TSAN_ONLY(_tsan_weak_roots.weak_oops_do(is_alive, keep_alive, worker_id);)
114 }
115 
116 void ShenandoahSerialWeakRoots::weak_oops_do(OopClosure* cl, uint worker_id) {
117   AlwaysTrueClosure always_true;
118   weak_oops_do(&always_true, cl, worker_id);
119 }
120 
121 ShenandoahThreadRoots::ShenandoahThreadRoots(bool is_par) : _is_par(is_par) {
122   Threads::change_thread_claim_token();
123 }
124 
125 void ShenandoahThreadRoots::oops_do(OopClosure* oops_cl, CodeBlobClosure* code_cl, uint worker_id) {
126   ShenandoahWorkerTimings* worker_times = ShenandoahHeap::heap()->phase_timings()->worker_times();
127   ShenandoahWorkerTimingsTracker timer(worker_times, ShenandoahPhaseTimings::ThreadRoots, worker_id);
128   ResourceMark rm;
129   Threads::possibly_parallel_oops_do(_is_par, oops_cl, code_cl);
130 }
131 
132 void ShenandoahThreadRoots::threads_do(ThreadClosure* tc, uint worker_id) {
133   ShenandoahWorkerTimings* worker_times = ShenandoahHeap::heap()->phase_timings()->worker_times();
< prev index next >