< prev index next >

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

Print this page
rev 50076 : Fold Partial GC into Traversal GC


  19  * or visit www.oracle.com if you need additional information or have any
  20  * questions.
  21  *
  22  */
  23 
  24 #include "precompiled.hpp"
  25 
  26 #include "classfile/javaClasses.inline.hpp"
  27 #include "code/codeCache.hpp"
  28 #include "gc/shared/gcTraceTime.inline.hpp"
  29 #include "gc/shenandoah/brooksPointer.hpp"
  30 #include "gc/shenandoah/shenandoahConcurrentMark.inline.hpp"
  31 #include "gc/shenandoah/shenandoahCollectionSet.hpp"
  32 #include "gc/shenandoah/shenandoahFreeSet.hpp"
  33 #include "gc/shenandoah/shenandoahPhaseTimings.hpp"
  34 #include "gc/shenandoah/shenandoahMarkCompact.hpp"
  35 #include "gc/shenandoah/shenandoahBarrierSet.hpp"
  36 #include "gc/shenandoah/shenandoahHeapRegionSet.hpp"
  37 #include "gc/shenandoah/shenandoahHeap.hpp"
  38 #include "gc/shenandoah/shenandoahHeap.inline.hpp"
  39 #include "gc/shenandoah/shenandoahPartialGC.hpp"
  40 #include "gc/shenandoah/shenandoahRootProcessor.hpp"
  41 #include "gc/shenandoah/shenandoahTraversalGC.hpp"
  42 #include "gc/shenandoah/shenandoahUtils.hpp"
  43 #include "gc/shenandoah/shenandoahVerifier.hpp"
  44 #include "gc/shenandoah/shenandoahWorkerPolicy.hpp"
  45 #include "gc/shenandoah/vm_operations_shenandoah.hpp"
  46 #include "oops/oop.inline.hpp"
  47 #include "runtime/biasedLocking.hpp"
  48 #include "runtime/thread.hpp"
  49 #include "utilities/copy.hpp"
  50 #include "utilities/growableArray.hpp"
  51 #include "gc/shared/taskqueue.inline.hpp"
  52 #include "gc/shared/workgroup.hpp"
  53 
  54 class ShenandoahClearRegionStatusClosure: public ShenandoahHeapRegionClosure {
  55 private:
  56   ShenandoahHeap* const _heap;
  57 
  58 public:
  59   ShenandoahClearRegionStatusClosure() : _heap(ShenandoahHeap::heap()) {}


 111     {
 112       ShenandoahGCPhase phase(ShenandoahPhaseTimings::full_gc_heapdumps);
 113       heap->pre_full_gc_dump(_gc_timer);
 114     }
 115 
 116     {
 117       ShenandoahGCPhase prepare_phase(ShenandoahPhaseTimings::full_gc_prepare);
 118       // Full GC is supposed to recover from any GC state:
 119 
 120       // a1. Cancel evacuation, if in progress
 121       if (heap->is_evacuation_in_progress()) {
 122         heap->set_evacuation_in_progress(false);
 123       }
 124       assert(!heap->is_evacuation_in_progress(), "sanity");
 125 
 126       // a2. Cancel update-refs, if in progress
 127       if (heap->is_update_refs_in_progress()) {
 128         heap->set_update_refs_in_progress(false);
 129       }
 130       assert(!heap->is_update_refs_in_progress(), "sanity");
 131 
 132       // a3. Cancel concurrent partial GC, if in progress
 133       if (heap->is_concurrent_partial_in_progress()) {
 134         heap->partial_gc()->reset();
 135         heap->set_concurrent_partial_in_progress(false);
 136       }
 137 
 138       // a3. Cancel concurrent traversal GC, if in progress
 139       if (heap->is_concurrent_traversal_in_progress()) {
 140         heap->traversal_gc()->reset();
 141         heap->set_concurrent_traversal_in_progress(false);
 142       }
 143 
 144       // b. Cancel concurrent mark, if in progress
 145       if (heap->is_concurrent_mark_in_progress()) {
 146         heap->concurrentMark()->cancel();
 147         heap->stop_concurrent_marking();
 148       }
 149       assert(!heap->is_concurrent_mark_in_progress(), "sanity");
 150 
 151       // c. Reset the bitmaps for new marking
 152       heap->reset_next_mark_bitmap();
 153       assert(heap->is_next_bitmap_clear(), "sanity");
 154 
 155       // d. Abandon reference discovery and clear all discovered references.
 156       ReferenceProcessor* rp = heap->ref_processor();




  19  * or visit www.oracle.com if you need additional information or have any
  20  * questions.
  21  *
  22  */
  23 
  24 #include "precompiled.hpp"
  25 
  26 #include "classfile/javaClasses.inline.hpp"
  27 #include "code/codeCache.hpp"
  28 #include "gc/shared/gcTraceTime.inline.hpp"
  29 #include "gc/shenandoah/brooksPointer.hpp"
  30 #include "gc/shenandoah/shenandoahConcurrentMark.inline.hpp"
  31 #include "gc/shenandoah/shenandoahCollectionSet.hpp"
  32 #include "gc/shenandoah/shenandoahFreeSet.hpp"
  33 #include "gc/shenandoah/shenandoahPhaseTimings.hpp"
  34 #include "gc/shenandoah/shenandoahMarkCompact.hpp"
  35 #include "gc/shenandoah/shenandoahBarrierSet.hpp"
  36 #include "gc/shenandoah/shenandoahHeapRegionSet.hpp"
  37 #include "gc/shenandoah/shenandoahHeap.hpp"
  38 #include "gc/shenandoah/shenandoahHeap.inline.hpp"

  39 #include "gc/shenandoah/shenandoahRootProcessor.hpp"
  40 #include "gc/shenandoah/shenandoahTraversalGC.hpp"
  41 #include "gc/shenandoah/shenandoahUtils.hpp"
  42 #include "gc/shenandoah/shenandoahVerifier.hpp"
  43 #include "gc/shenandoah/shenandoahWorkerPolicy.hpp"
  44 #include "gc/shenandoah/vm_operations_shenandoah.hpp"
  45 #include "oops/oop.inline.hpp"
  46 #include "runtime/biasedLocking.hpp"
  47 #include "runtime/thread.hpp"
  48 #include "utilities/copy.hpp"
  49 #include "utilities/growableArray.hpp"
  50 #include "gc/shared/taskqueue.inline.hpp"
  51 #include "gc/shared/workgroup.hpp"
  52 
  53 class ShenandoahClearRegionStatusClosure: public ShenandoahHeapRegionClosure {
  54 private:
  55   ShenandoahHeap* const _heap;
  56 
  57 public:
  58   ShenandoahClearRegionStatusClosure() : _heap(ShenandoahHeap::heap()) {}


 110     {
 111       ShenandoahGCPhase phase(ShenandoahPhaseTimings::full_gc_heapdumps);
 112       heap->pre_full_gc_dump(_gc_timer);
 113     }
 114 
 115     {
 116       ShenandoahGCPhase prepare_phase(ShenandoahPhaseTimings::full_gc_prepare);
 117       // Full GC is supposed to recover from any GC state:
 118 
 119       // a1. Cancel evacuation, if in progress
 120       if (heap->is_evacuation_in_progress()) {
 121         heap->set_evacuation_in_progress(false);
 122       }
 123       assert(!heap->is_evacuation_in_progress(), "sanity");
 124 
 125       // a2. Cancel update-refs, if in progress
 126       if (heap->is_update_refs_in_progress()) {
 127         heap->set_update_refs_in_progress(false);
 128       }
 129       assert(!heap->is_update_refs_in_progress(), "sanity");






 130 
 131       // a3. Cancel concurrent traversal GC, if in progress
 132       if (heap->is_concurrent_traversal_in_progress()) {
 133         heap->traversal_gc()->reset();
 134         heap->set_concurrent_traversal_in_progress(false);
 135       }
 136 
 137       // b. Cancel concurrent mark, if in progress
 138       if (heap->is_concurrent_mark_in_progress()) {
 139         heap->concurrentMark()->cancel();
 140         heap->stop_concurrent_marking();
 141       }
 142       assert(!heap->is_concurrent_mark_in_progress(), "sanity");
 143 
 144       // c. Reset the bitmaps for new marking
 145       heap->reset_next_mark_bitmap();
 146       assert(heap->is_next_bitmap_clear(), "sanity");
 147 
 148       // d. Abandon reference discovery and clear all discovered references.
 149       ReferenceProcessor* rp = heap->ref_processor();


< prev index next >