< prev index next >

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

Print this page
rev 12549 : [mq]: fixparsync2.patch


 164       JNIHandles::weak_oops_do(&always_true, jni_weak_roots);
 165     }
 166   }
 167 
 168   {
 169     ShenandoahParPhaseTimesTracker timer(phase_times, ShenandoahPhaseTimes::ObjectSynchronizerRoots, worker_id);
 170     while(_om_iterator.parallel_oops_do(strong_roots));
 171   }
 172 
 173   // All threads execute the following. A specific chunk of buckets
 174   // from the StringTable are the individual tasks.
 175   if (weak_roots != NULL) {
 176     ShenandoahParPhaseTimesTracker timer(phase_times, ShenandoahPhaseTimes::StringTableRoots, worker_id);
 177     StringTable::possibly_parallel_oops_do(weak_roots);
 178   }
 179 }
 180 
 181 uint ShenandoahRootProcessor::n_workers() const {
 182   return _srs.n_threads();
 183 }









































 164       JNIHandles::weak_oops_do(&always_true, jni_weak_roots);
 165     }
 166   }
 167 
 168   {
 169     ShenandoahParPhaseTimesTracker timer(phase_times, ShenandoahPhaseTimes::ObjectSynchronizerRoots, worker_id);
 170     while(_om_iterator.parallel_oops_do(strong_roots));
 171   }
 172 
 173   // All threads execute the following. A specific chunk of buckets
 174   // from the StringTable are the individual tasks.
 175   if (weak_roots != NULL) {
 176     ShenandoahParPhaseTimesTracker timer(phase_times, ShenandoahPhaseTimes::StringTableRoots, worker_id);
 177     StringTable::possibly_parallel_oops_do(weak_roots);
 178   }
 179 }
 180 
 181 uint ShenandoahRootProcessor::n_workers() const {
 182   return _srs.n_threads();
 183 }
 184 
 185 ShenandoahRootEvacuator::ShenandoahRootEvacuator(ShenandoahHeap* heap, uint n_workers, ShenandoahCollectorPolicy::TimingPhase phase) :
 186   _process_strong_tasks(new SubTasksDone(SHENANDOAH_RP_PS_NumElements)),
 187   _srs(n_workers),
 188   _phase(phase),
 189   _codecache_iterator(CodeCache::parallel_iterator())
 190 {
 191   heap->shenandoahPolicy()->record_workers_start(_phase);
 192 }
 193 
 194 ShenandoahRootEvacuator::~ShenandoahRootEvacuator() {
 195   delete _process_strong_tasks;
 196   ShenandoahHeap::heap()->shenandoahPolicy()->record_workers_end(_phase);
 197 }
 198 
 199 void ShenandoahRootEvacuator::process_evacuate_roots(OopClosure* oops,
 200                                                      CodeBlobClosure* blobs,
 201                                                      uint worker_id) {
 202 
 203   ShenandoahPhaseTimes* phase_times = ShenandoahHeap::heap()->shenandoahPolicy()->phase_times();
 204   {
 205     bool is_par = n_workers() > 1;
 206     ResourceMark rm;
 207     ShenandoahParPhaseTimesTracker timer(phase_times, ShenandoahPhaseTimes::ThreadRoots, worker_id);
 208     Threads::possibly_parallel_oops_do(is_par, oops, NULL);
 209   }
 210 
 211   {
 212     ShenandoahParPhaseTimesTracker timer(phase_times, ShenandoahPhaseTimes::CodeCacheRoots, worker_id);
 213     while (_codecache_iterator.parallel_blobs_do(blobs));
 214   }
 215 
 216   _process_strong_tasks->all_tasks_completed(n_workers());
 217 }
 218 
 219 uint ShenandoahRootEvacuator::n_workers() const {
 220   return _srs.n_threads();
 221 }
 222 
< prev index next >