< prev index next >

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

Print this page
rev 58162 : 8239926: Shenandoah: Shenandoah needs to mark nmethod's metadata


 193                                                  ShenandoahPhaseTimings::Phase phase,
 194                                                  bool include_concurrent_roots,
 195                                                  bool include_concurrent_code_roots) :
 196   ShenandoahRootProcessor(phase),
 197   _thread_roots(n_workers > 1),
 198   _include_concurrent_roots(include_concurrent_roots),
 199   _include_concurrent_code_roots(include_concurrent_code_roots) {
 200 }
 201 
 202 void ShenandoahRootEvacuator::roots_do(uint worker_id, OopClosure* oops) {
 203   MarkingCodeBlobClosure blobsCl(oops, CodeBlobToOopClosure::FixRelocations);
 204   ShenandoahCodeBlobAndDisarmClosure blobs_and_disarm_Cl(oops);
 205   CodeBlobToOopClosure* codes_cl = ShenandoahConcurrentRoots::can_do_concurrent_class_unloading() ?
 206                                    static_cast<CodeBlobToOopClosure*>(&blobs_and_disarm_Cl) :
 207                                    static_cast<CodeBlobToOopClosure*>(&blobsCl);
 208   AlwaysTrueClosure always_true;
 209 
 210   _serial_roots.oops_do(oops, worker_id);
 211   _serial_weak_roots.weak_oops_do(oops, worker_id);
 212   if (_include_concurrent_roots) {
 213     CLDToOopClosure clds(oops, ClassLoaderData::_claim_strong);
 214     _vm_roots.oops_do<OopClosure>(oops, worker_id);
 215     _cld_roots.cld_do(&clds, worker_id);
 216     _weak_roots.oops_do<OopClosure>(oops, worker_id);
 217     _dedup_roots.oops_do(&always_true, oops, worker_id);
 218   }
 219 
 220   if (_include_concurrent_code_roots) {


 221     _code_roots.code_blobs_do(codes_cl, worker_id);
 222     _thread_roots.oops_do(oops, NULL, worker_id);
 223   } else {
 224     _thread_roots.oops_do(oops, codes_cl, worker_id);
 225   }
 226 }
 227 
 228 ShenandoahRootUpdater::ShenandoahRootUpdater(uint n_workers, ShenandoahPhaseTimings::Phase phase) :
 229   ShenandoahRootProcessor(phase),
 230   _thread_roots(n_workers > 1) {
 231 }
 232 
 233 ShenandoahRootAdjuster::ShenandoahRootAdjuster(uint n_workers, ShenandoahPhaseTimings::Phase phase) :
 234   ShenandoahRootProcessor(phase),
 235   _thread_roots(n_workers > 1) {
 236   assert(ShenandoahHeap::heap()->is_full_gc_in_progress(), "Full GC only");
 237 }
 238 
 239 void ShenandoahRootAdjuster::roots_do(uint worker_id, OopClosure* oops) {
 240   CodeBlobToOopClosure code_blob_cl(oops, CodeBlobToOopClosure::FixRelocations);




 193                                                  ShenandoahPhaseTimings::Phase phase,
 194                                                  bool include_concurrent_roots,
 195                                                  bool include_concurrent_code_roots) :
 196   ShenandoahRootProcessor(phase),
 197   _thread_roots(n_workers > 1),
 198   _include_concurrent_roots(include_concurrent_roots),
 199   _include_concurrent_code_roots(include_concurrent_code_roots) {
 200 }
 201 
 202 void ShenandoahRootEvacuator::roots_do(uint worker_id, OopClosure* oops) {
 203   MarkingCodeBlobClosure blobsCl(oops, CodeBlobToOopClosure::FixRelocations);
 204   ShenandoahCodeBlobAndDisarmClosure blobs_and_disarm_Cl(oops);
 205   CodeBlobToOopClosure* codes_cl = ShenandoahConcurrentRoots::can_do_concurrent_class_unloading() ?
 206                                    static_cast<CodeBlobToOopClosure*>(&blobs_and_disarm_Cl) :
 207                                    static_cast<CodeBlobToOopClosure*>(&blobsCl);
 208   AlwaysTrueClosure always_true;
 209 
 210   _serial_roots.oops_do(oops, worker_id);
 211   _serial_weak_roots.weak_oops_do(oops, worker_id);
 212   if (_include_concurrent_roots) {

 213     _vm_roots.oops_do<OopClosure>(oops, worker_id);

 214     _weak_roots.oops_do<OopClosure>(oops, worker_id);
 215     _dedup_roots.oops_do(&always_true, oops, worker_id);
 216   }
 217 
 218   if (_include_concurrent_code_roots) {
 219     CLDToOopClosure clds(oops, ClassLoaderData::_claim_strong);
 220     _cld_roots.cld_do(&clds, worker_id);
 221     _code_roots.code_blobs_do(codes_cl, worker_id);
 222     _thread_roots.oops_do(oops, NULL, worker_id);
 223   } else {
 224     _thread_roots.oops_do(oops, codes_cl, worker_id);
 225   }
 226 }
 227 
 228 ShenandoahRootUpdater::ShenandoahRootUpdater(uint n_workers, ShenandoahPhaseTimings::Phase phase) :
 229   ShenandoahRootProcessor(phase),
 230   _thread_roots(n_workers > 1) {
 231 }
 232 
 233 ShenandoahRootAdjuster::ShenandoahRootAdjuster(uint n_workers, ShenandoahPhaseTimings::Phase phase) :
 234   ShenandoahRootProcessor(phase),
 235   _thread_roots(n_workers > 1) {
 236   assert(ShenandoahHeap::heap()->is_full_gc_in_progress(), "Full GC only");
 237 }
 238 
 239 void ShenandoahRootAdjuster::roots_do(uint worker_id, OopClosure* oops) {
 240   CodeBlobToOopClosure code_blob_cl(oops, CodeBlobToOopClosure::FixRelocations);


< prev index next >