< prev index next >

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

Print this page

 687   bool  _evac_in_progress;
 688   Thread* const _thread;
 689 
 690 public:
 691   ShenandoahEvacUpdateCleanupOopStorageRootsClosure();
 692   void do_oop(oop* p);
 693   void do_oop(narrowOop* p);
 694 };
 695 
 696 ShenandoahEvacUpdateCleanupOopStorageRootsClosure::ShenandoahEvacUpdateCleanupOopStorageRootsClosure() :
 697   _heap(ShenandoahHeap::heap()),
 698   _mark_context(ShenandoahHeap::heap()->marking_context()),
 699   _evac_in_progress(ShenandoahHeap::heap()->is_evacuation_in_progress()),
 700   _thread(Thread::current()) {
 701 }
 702 
 703 void ShenandoahEvacUpdateCleanupOopStorageRootsClosure::do_oop(oop* p) {
 704   const oop obj = RawAccess<>::oop_load(p);
 705   if (!CompressedOops::is_null(obj)) {
 706     if (!_mark_context->is_marked(obj)) {
 707       shenandoah_assert_correct(p, obj);
 708       ShenandoahHeap::atomic_clear_oop(p, obj);
 709     } else if (_evac_in_progress && _heap->in_collection_set(obj)) {
 710       oop resolved = ShenandoahBarrierSet::resolve_forwarded_not_null(obj);
 711       if (resolved == obj) {
 712         resolved = _heap->evacuate_object(obj, _thread);
 713       }
 714       ShenandoahHeap::atomic_update_oop(resolved, p, obj);
 715       assert(_heap->cancelled_gc() ||
 716              _mark_context->is_marked(resolved) && !_heap->in_collection_set(resolved),
 717              "Sanity");
 718     }
 719   }
 720 }
 721 
 722 void ShenandoahEvacUpdateCleanupOopStorageRootsClosure::do_oop(narrowOop* p) {
 723   ShouldNotReachHere();
 724 }
 725 
 726 class ShenandoahIsCLDAliveClosure : public CLDClosure {
 727 public:

 687   bool  _evac_in_progress;
 688   Thread* const _thread;
 689 
 690 public:
 691   ShenandoahEvacUpdateCleanupOopStorageRootsClosure();
 692   void do_oop(oop* p);
 693   void do_oop(narrowOop* p);
 694 };
 695 
 696 ShenandoahEvacUpdateCleanupOopStorageRootsClosure::ShenandoahEvacUpdateCleanupOopStorageRootsClosure() :
 697   _heap(ShenandoahHeap::heap()),
 698   _mark_context(ShenandoahHeap::heap()->marking_context()),
 699   _evac_in_progress(ShenandoahHeap::heap()->is_evacuation_in_progress()),
 700   _thread(Thread::current()) {
 701 }
 702 
 703 void ShenandoahEvacUpdateCleanupOopStorageRootsClosure::do_oop(oop* p) {
 704   const oop obj = RawAccess<>::oop_load(p);
 705   if (!CompressedOops::is_null(obj)) {
 706     if (!_mark_context->is_marked(obj)) {
 707       // shenandoah_assert_correct(p, obj);
 708       ShenandoahHeap::atomic_clear_oop(p, obj);
 709     } else if (_evac_in_progress && _heap->in_collection_set(obj)) {
 710       oop resolved = ShenandoahBarrierSet::resolve_forwarded_not_null(obj);
 711       if (resolved == obj) {
 712         resolved = _heap->evacuate_object(obj, _thread);
 713       }
 714       ShenandoahHeap::atomic_update_oop(resolved, p, obj);
 715       assert(_heap->cancelled_gc() ||
 716              _mark_context->is_marked(resolved) && !_heap->in_collection_set(resolved),
 717              "Sanity");
 718     }
 719   }
 720 }
 721 
 722 void ShenandoahEvacUpdateCleanupOopStorageRootsClosure::do_oop(narrowOop* p) {
 723   ShouldNotReachHere();
 724 }
 725 
 726 class ShenandoahIsCLDAliveClosure : public CLDClosure {
 727 public:
< prev index next >