< prev index next >

src/share/vm/gc_implementation/g1/g1RootProcessor.cpp

Print this page




  99     MonitorLockerEx ml(&_lock, Mutex::_no_safepoint_check_flag);
 100     _lock.notify_all();
 101   }
 102 }
 103 
 104 void G1RootProcessor::wait_until_all_strong_classes_discovered() {
 105   uint n_workers = _g1h->n_par_threads();
 106   assert(ClassUnloadingWithConcurrentMark, "Currently only needed when doing G1 Class Unloading");
 107 
 108   if ((uint)_n_workers_discovered_strong_classes != n_workers) {
 109     MonitorLockerEx ml(&_lock, Mutex::_no_safepoint_check_flag);
 110     while ((uint)_n_workers_discovered_strong_classes != n_workers) {
 111       _lock.wait(Mutex::_no_safepoint_check_flag, 0, false);
 112     }
 113   }
 114 }
 115 
 116 G1RootProcessor::G1RootProcessor(G1CollectedHeap* g1h) :
 117     _g1h(g1h),
 118     _process_strong_tasks(new SubTasksDone(G1RP_PS_NumElements)),
 119     _srs(g1h),
 120     _lock(Mutex::leaf, "G1 Root Scanning barrier lock", false, Monitor::_safepoint_check_never),
 121     _n_workers_discovered_strong_classes(0) {}
 122 
 123 void G1RootProcessor::evacuate_roots(OopClosure* scan_non_heap_roots,
 124                                      OopClosure* scan_non_heap_weak_roots,
 125                                      CLDClosure* scan_strong_clds,
 126                                      CLDClosure* scan_weak_clds,
 127                                      bool trace_metadata,
 128                                      uint worker_i) {
 129   // First scan the shared roots.
 130   double ext_roots_start = os::elapsedTime();
 131   G1GCPhaseTimes* phase_times = _g1h->g1_policy()->phase_times();
 132 
 133   BufferingOopClosure buf_scan_non_heap_roots(scan_non_heap_roots);
 134   BufferingOopClosure buf_scan_non_heap_weak_roots(scan_non_heap_weak_roots);
 135 
 136   OopClosure* const weak_roots = &buf_scan_non_heap_weak_roots;
 137   OopClosure* const strong_roots = &buf_scan_non_heap_roots;
 138 
 139   // CodeBlobClosures are not interoperable with BufferingOopClosures




  99     MonitorLockerEx ml(&_lock, Mutex::_no_safepoint_check_flag);
 100     _lock.notify_all();
 101   }
 102 }
 103 
 104 void G1RootProcessor::wait_until_all_strong_classes_discovered() {
 105   uint n_workers = _g1h->n_par_threads();
 106   assert(ClassUnloadingWithConcurrentMark, "Currently only needed when doing G1 Class Unloading");
 107 
 108   if ((uint)_n_workers_discovered_strong_classes != n_workers) {
 109     MonitorLockerEx ml(&_lock, Mutex::_no_safepoint_check_flag);
 110     while ((uint)_n_workers_discovered_strong_classes != n_workers) {
 111       _lock.wait(Mutex::_no_safepoint_check_flag, 0, false);
 112     }
 113   }
 114 }
 115 
 116 G1RootProcessor::G1RootProcessor(G1CollectedHeap* g1h) :
 117     _g1h(g1h),
 118     _process_strong_tasks(new SubTasksDone(G1RP_PS_NumElements)),
 119     _srs(),
 120     _lock(Mutex::leaf, "G1 Root Scanning barrier lock", false, Monitor::_safepoint_check_never),
 121     _n_workers_discovered_strong_classes(0) {}
 122 
 123 void G1RootProcessor::evacuate_roots(OopClosure* scan_non_heap_roots,
 124                                      OopClosure* scan_non_heap_weak_roots,
 125                                      CLDClosure* scan_strong_clds,
 126                                      CLDClosure* scan_weak_clds,
 127                                      bool trace_metadata,
 128                                      uint worker_i) {
 129   // First scan the shared roots.
 130   double ext_roots_start = os::elapsedTime();
 131   G1GCPhaseTimes* phase_times = _g1h->g1_policy()->phase_times();
 132 
 133   BufferingOopClosure buf_scan_non_heap_roots(scan_non_heap_roots);
 134   BufferingOopClosure buf_scan_non_heap_weak_roots(scan_non_heap_weak_roots);
 135 
 136   OopClosure* const weak_roots = &buf_scan_non_heap_weak_roots;
 137   OopClosure* const strong_roots = &buf_scan_non_heap_roots;
 138 
 139   // CodeBlobClosures are not interoperable with BufferingOopClosures


< prev index next >