< prev index next >

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

Print this page




 538     heap->workers()->run_task(&prepare_task);
 539   }
 540 
 541   // Compute the new addresses for humongous objects
 542   {
 543     ShenandoahGCPhase phase(ShenandoahPhaseTimings::full_gc_calculate_addresses_humong);
 544     calculate_target_humongous_objects();
 545   }
 546 }
 547 
 548 class ShenandoahAdjustPointersClosure : public MetadataVisitingOopIterateClosure {
 549 private:
 550   ShenandoahHeap* const _heap;
 551   ShenandoahMarkingContext* const _ctx;
 552 
 553   template <class T>
 554   inline void do_oop_work(T* p) {
 555     T o = RawAccess<>::oop_load(p);
 556     if (!CompressedOops::is_null(o)) {
 557       oop obj = CompressedOops::decode_not_null(o);

 558       assert(_ctx->is_marked(obj), "must be marked");
 559       if (obj->is_forwarded()) {
 560         oop forw = obj->forwardee();
 561         RawAccess<IS_NOT_NULL>::oop_store(p, forw);
 562       }
 563     }
 564   }
 565 
 566 public:
 567   ShenandoahAdjustPointersClosure() :
 568     _heap(ShenandoahHeap::heap()),
 569     _ctx(ShenandoahHeap::heap()->complete_marking_context()) {}
 570 
 571   void do_oop(oop* p)       { do_oop_work(p); }
 572   void do_oop(narrowOop* p) { do_oop_work(p); }
 573 };
 574 
 575 class ShenandoahAdjustPointersObjectClosure : public ObjectClosure {
 576 private:
 577   ShenandoahHeap* const _heap;




 538     heap->workers()->run_task(&prepare_task);
 539   }
 540 
 541   // Compute the new addresses for humongous objects
 542   {
 543     ShenandoahGCPhase phase(ShenandoahPhaseTimings::full_gc_calculate_addresses_humong);
 544     calculate_target_humongous_objects();
 545   }
 546 }
 547 
 548 class ShenandoahAdjustPointersClosure : public MetadataVisitingOopIterateClosure {
 549 private:
 550   ShenandoahHeap* const _heap;
 551   ShenandoahMarkingContext* const _ctx;
 552 
 553   template <class T>
 554   inline void do_oop_work(T* p) {
 555     T o = RawAccess<>::oop_load(p);
 556     if (!CompressedOops::is_null(o)) {
 557       oop obj = CompressedOops::decode_not_null(o);
 558       assert_object_is_in_heap(p, obj);
 559       assert(_ctx->is_marked(obj), "must be marked");
 560       if (obj->is_forwarded()) {
 561         oop forw = obj->forwardee();
 562         RawAccess<IS_NOT_NULL>::oop_store(p, forw);
 563       }
 564     }
 565   }
 566 
 567 public:
 568   ShenandoahAdjustPointersClosure() :
 569     _heap(ShenandoahHeap::heap()),
 570     _ctx(ShenandoahHeap::heap()->complete_marking_context()) {}
 571 
 572   void do_oop(oop* p)       { do_oop_work(p); }
 573   void do_oop(narrowOop* p) { do_oop_work(p); }
 574 };
 575 
 576 class ShenandoahAdjustPointersObjectClosure : public ObjectClosure {
 577 private:
 578   ShenandoahHeap* const _heap;


< prev index next >