57 }
58 }
59
60 void G1RootProcessor::wait_until_all_strong_classes_discovered() {
61 assert(ClassUnloadingWithConcurrentMark, "Currently only needed when doing G1 Class Unloading");
62
63 if ((uint)_n_workers_discovered_strong_classes != n_workers()) {
64 MonitorLockerEx ml(&_lock, Mutex::_no_safepoint_check_flag);
65 while ((uint)_n_workers_discovered_strong_classes != n_workers()) {
66 _lock.wait(Mutex::_no_safepoint_check_flag, 0, false);
67 }
68 }
69 }
70
71 G1RootProcessor::G1RootProcessor(G1CollectedHeap* g1h, uint n_workers) :
72 _g1h(g1h),
73 _process_strong_tasks(G1RP_PS_NumElements),
74 _srs(n_workers),
75 _lock(Mutex::leaf, "G1 Root Scanning barrier lock", false, Monitor::_safepoint_check_never),
76 _par_state_string(StringTable::weak_storage()),
77 _n_workers_discovered_strong_classes(0) {}
78
79 void G1RootProcessor::evacuate_roots(G1ParScanThreadState* pss, uint worker_i) {
80 G1GCPhaseTimes* phase_times = _g1h->g1_policy()->phase_times();
81
82 G1EvacPhaseTimesTracker timer(phase_times, pss, G1GCPhaseTimes::ExtRootScan, worker_i);
83
84 G1EvacuationRootClosures* closures = pss->closures();
85 process_java_roots(closures, phase_times, worker_i);
86
87 // This is the point where this worker thread will not find more strong CLDs/nmethods.
88 // Report this so G1 can synchronize the strong and weak CLDs/nmethods processing.
89 if (closures->trace_metadata()) {
90 worker_has_discovered_all_strong_classes();
91 }
92
93 process_vm_roots(closures, phase_times, worker_i);
94 process_string_table_roots(closures, phase_times, worker_i);
95
96 {
97 // Now the CM ref_processor roots.
|
57 }
58 }
59
60 void G1RootProcessor::wait_until_all_strong_classes_discovered() {
61 assert(ClassUnloadingWithConcurrentMark, "Currently only needed when doing G1 Class Unloading");
62
63 if ((uint)_n_workers_discovered_strong_classes != n_workers()) {
64 MonitorLockerEx ml(&_lock, Mutex::_no_safepoint_check_flag);
65 while ((uint)_n_workers_discovered_strong_classes != n_workers()) {
66 _lock.wait(Mutex::_no_safepoint_check_flag, 0, false);
67 }
68 }
69 }
70
71 G1RootProcessor::G1RootProcessor(G1CollectedHeap* g1h, uint n_workers) :
72 _g1h(g1h),
73 _process_strong_tasks(G1RP_PS_NumElements),
74 _srs(n_workers),
75 _lock(Mutex::leaf, "G1 Root Scanning barrier lock", false, Monitor::_safepoint_check_never),
76 _par_state_string(StringTable::weak_storage()),
77 _n_workers_discovered_strong_classes(0) {
78 StringTable::reset_dead_counter();
79 }
80
81 G1RootProcessor::~G1RootProcessor() {
82 StringTable::finish_dead_counter();
83 }
84
85 void G1RootProcessor::evacuate_roots(G1ParScanThreadState* pss, uint worker_i) {
86 G1GCPhaseTimes* phase_times = _g1h->g1_policy()->phase_times();
87
88 G1EvacPhaseTimesTracker timer(phase_times, pss, G1GCPhaseTimes::ExtRootScan, worker_i);
89
90 G1EvacuationRootClosures* closures = pss->closures();
91 process_java_roots(closures, phase_times, worker_i);
92
93 // This is the point where this worker thread will not find more strong CLDs/nmethods.
94 // Report this so G1 can synchronize the strong and weak CLDs/nmethods processing.
95 if (closures->trace_metadata()) {
96 worker_has_discovered_all_strong_classes();
97 }
98
99 process_vm_roots(closures, phase_times, worker_i);
100 process_string_table_roots(closures, phase_times, worker_i);
101
102 {
103 // Now the CM ref_processor roots.
|