< prev index next >

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

Print this page
rev 12551 : Refactor/consolidate/cleanup


 486     // Unload classes and purge SystemDictionary.
 487     bool purged_class = SystemDictionary::do_unloading(&is_alive, false);
 488     ParallelCleaningTask unlink_task(&is_alive, true, true, nworkers, purged_class);
 489     sh->workers()->run_task(&unlink_task, nworkers);
 490     ClassLoaderDataGraph::purge();
 491   }
 492   policy->record_phase_end(full_gc ?
 493                            ShenandoahCollectorPolicy::full_gc_mark_class_unloading :
 494                            ShenandoahCollectorPolicy::class_unloading);
 495 
 496   assert(task_queues()->is_empty(), "Should be empty");
 497 }
 498 
 499 #ifdef ASSERT
 500 template <class T>
 501 void ShenandoahVerifyRootsClosure1::do_oop_work(T* p) {
 502   T o = oopDesc::load_heap_oop(p);
 503   if (! oopDesc::is_null(o)) {
 504     oop obj = oopDesc::decode_heap_oop_not_null(o);
 505     if (! oopDesc::unsafe_equals(obj, ShenandoahBarrierSet::resolve_oop_static_not_null(obj))) {
 506       tty->print_cr("from-space marked: %s, to-space marked: %s, unload_classes: %s", BOOL_TO_STR(ShenandoahHeap::heap()->is_marked_current(obj)), BOOL_TO_STR(ShenandoahHeap::heap()->is_marked_current(ShenandoahBarrierSet::resolve_oop_static_not_null(obj))), BOOL_TO_STR(ShenandoahHeap::heap()->concurrentMark()->unload_classes()));
 507     }
 508     guarantee(oopDesc::unsafe_equals(obj, ShenandoahBarrierSet::resolve_oop_static_not_null(obj)), "oop must not be forwarded");
 509     guarantee(ShenandoahHeap::heap()->is_marked_current(obj), "oop must be marked");
 510   }
 511 }
 512 
 513 void ShenandoahVerifyRootsClosure1::do_oop(oop* p) {
 514   do_oop_work(p);
 515 }
 516 
 517 void ShenandoahVerifyRootsClosure1::do_oop(narrowOop* p) {
 518   do_oop_work(p);
 519 }
 520 
 521 void ShenandoahConcurrentMark::verify_roots() {
 522   ShenandoahVerifyRootsClosure1 cl;
 523   CodeBlobToOopClosure blobsCl(&cl, false);
 524   CLDToOopClosure cldCl(&cl);
 525   ClassLoaderDataGraph::clear_claimed_marks();
 526   ShenandoahRootProcessor rp(ShenandoahHeap::heap(), 1);
 527   rp.process_all_roots(&cl, &cl, &cldCl, &blobsCl, 0);
 528 
 529 }




 486     // Unload classes and purge SystemDictionary.
 487     bool purged_class = SystemDictionary::do_unloading(&is_alive, false);
 488     ParallelCleaningTask unlink_task(&is_alive, true, true, nworkers, purged_class);
 489     sh->workers()->run_task(&unlink_task, nworkers);
 490     ClassLoaderDataGraph::purge();
 491   }
 492   policy->record_phase_end(full_gc ?
 493                            ShenandoahCollectorPolicy::full_gc_mark_class_unloading :
 494                            ShenandoahCollectorPolicy::class_unloading);
 495 
 496   assert(task_queues()->is_empty(), "Should be empty");
 497 }
 498 
 499 #ifdef ASSERT
 500 template <class T>
 501 void ShenandoahVerifyRootsClosure1::do_oop_work(T* p) {
 502   T o = oopDesc::load_heap_oop(p);
 503   if (! oopDesc::is_null(o)) {
 504     oop obj = oopDesc::decode_heap_oop_not_null(o);
 505     if (! oopDesc::unsafe_equals(obj, ShenandoahBarrierSet::resolve_oop_static_not_null(obj))) {
 506       tty->print_cr("from-space marked: %s, to-space marked: %s, unload_classes: %s", BOOL_TO_STR(ShenandoahHeap::heap()->is_marked_next(obj)), BOOL_TO_STR(ShenandoahHeap::heap()->is_marked_next(ShenandoahBarrierSet::resolve_oop_static_not_null(obj))), BOOL_TO_STR(ShenandoahHeap::heap()->concurrentMark()->unload_classes()));
 507     }
 508     guarantee(oopDesc::unsafe_equals(obj, ShenandoahBarrierSet::resolve_oop_static_not_null(obj)), "oop must not be forwarded");
 509     guarantee(ShenandoahHeap::heap()->is_marked_next(obj), "oop must be marked");
 510   }
 511 }
 512 
 513 void ShenandoahVerifyRootsClosure1::do_oop(oop* p) {
 514   do_oop_work(p);
 515 }
 516 
 517 void ShenandoahVerifyRootsClosure1::do_oop(narrowOop* p) {
 518   do_oop_work(p);
 519 }
 520 
 521 void ShenandoahConcurrentMark::verify_roots() {
 522   ShenandoahVerifyRootsClosure1 cl;
 523   CodeBlobToOopClosure blobsCl(&cl, false);
 524   CLDToOopClosure cldCl(&cl);
 525   ClassLoaderDataGraph::clear_claimed_marks();
 526   ShenandoahRootProcessor rp(ShenandoahHeap::heap(), 1);
 527   rp.process_all_roots(&cl, &cl, &cldCl, &blobsCl, 0);
 528 
 529 }


< prev index next >