< prev index next >

src/hotspot/share/gc/shenandoah/shenandoahHeap.hpp

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

@@ -36,20 +36,20 @@
 class ConcurrentGCTimer;
 class ShenandoahAsserts;
 class ShenandoahAllocTracker;
 class ShenandoahCollectorPolicy;
 class ShenandoahConnectionMatrix;
+class ShenandoahFastRegionSet;
 class ShenandoahPhaseTimings;
 class ShenandoahHeap;
 class ShenandoahHeapRegion;
 class ShenandoahHeapRegionClosure;
 class ShenandoahHeapRegionSet;
 class ShenandoahCollectionSet;
 class ShenandoahFreeSet;
 class ShenandoahConcurrentMark;
 class ShenandoahMarkCompact;
-class ShenandoahPartialGC;
 class ShenandoahPacer;
 class ShenandoahTraversalGC;
 class ShenandoahVerifier;
 class ShenandoahConcurrentThread;
 class ShenandoahMonitoringSupport;

@@ -177,44 +177,43 @@
     EVACUATION_BITPOS = 2,
 
     // Heap is under updating: needs SVRB/SVWB barriers.
     UPDATEREFS_BITPOS = 3,
 
-    // Heap is under partial collection
-    PARTIAL_BITPOS    = 4,
-
     // Heap is under traversal collection
-    TRAVERSAL_BITPOS  = 5,
+    TRAVERSAL_BITPOS  = 4,
   };
 
   enum GCState {
     STABLE        = 0,
     HAS_FORWARDED = 1 << HAS_FORWARDED_BITPOS,
     MARKING       = 1 << MARKING_BITPOS,
     EVACUATION    = 1 << EVACUATION_BITPOS,
     UPDATEREFS    = 1 << UPDATEREFS_BITPOS,
-    PARTIAL       = 1 << PARTIAL_BITPOS,
     TRAVERSAL     = 1 << TRAVERSAL_BITPOS,
   };
 
   enum ShenandoahDegenPoint {
     _degenerated_unset,
-    _degenerated_partial,
     _degenerated_traversal,
     _degenerated_outside_cycle,
     _degenerated_mark,
     _degenerated_evac,
     _degenerated_updaterefs,
     _DEGENERATED_LIMIT,
   };
 
+  enum GCCycleMode {
+    NONE,
+    MINOR,
+    MAJOR
+  };
+
   static const char* degen_point_to_string(ShenandoahDegenPoint point) {
     switch (point) {
       case _degenerated_unset:
         return "<UNSET>";
-      case _degenerated_partial:
-        return "Partial";
       case _degenerated_traversal:
         return "Traversal";
       case _degenerated_outside_cycle:
         return "Outside of Cycle";
       case _degenerated_mark:

@@ -248,11 +247,10 @@
 
   ShenandoahRegionIterator _update_refs_iterator;
 
   ShenandoahConcurrentMark* _scm;
   ShenandoahMarkCompact* _full_gc;
-  ShenandoahPartialGC* _partial_gc;
   ShenandoahTraversalGC* _traversal_gc;
   ShenandoahVerifier*  _verifier;
   ShenandoahPacer*  _pacer;
 
   ShenandoahConcurrentThread* _concurrent_gc_thread;

@@ -312,10 +310,12 @@
 
   MemoryPool* _memory_pool;
 
   ShenandoahEvacOOMHandler _oom_evac_handler;
 
+  ShenandoahSharedEnumFlag<GCCycleMode> _gc_cycle_mode;
+
 #ifdef ASSERT
   int     _heap_expansion_count;
 #endif
 
 public:

@@ -402,11 +402,11 @@
   inline ShenandoahHeapRegion* const heap_region_containing(const void* addr) const;
   inline size_t heap_region_index_containing(const void* addr) const;
   inline bool requires_marking(const void* entry) const;
 
   template <class T>
-  inline oop evac_update_with_forwarded(T* p, bool &evac);
+  inline oop evac_update_with_forwarded(T* p);
 
   template <class T>
   inline oop maybe_update_with_forwarded(T* p);
 
   template <class T>

@@ -437,11 +437,10 @@
   void set_evacuation_in_progress(bool in_progress);
   void set_update_refs_in_progress(bool in_progress);
   void set_degenerated_gc_in_progress(bool in_progress);
   void set_full_gc_in_progress(bool in_progress);
   void set_full_gc_move_in_progress(bool in_progress);
-  void set_concurrent_partial_in_progress(bool in_progress);
   void set_concurrent_traversal_in_progress(bool in_progress);
   void set_has_forwarded_objects(bool cond);
 
   void set_process_references(bool pr);
   void set_unload_classes(bool uc);

@@ -452,20 +451,23 @@
   inline bool is_update_refs_in_progress() const;
   inline bool is_evacuation_in_progress() const;
   inline bool is_degenerated_gc_in_progress() const;
   inline bool is_full_gc_in_progress() const;
   inline bool is_full_gc_move_in_progress() const;
-  inline bool is_concurrent_partial_in_progress() const;
   inline bool is_concurrent_traversal_in_progress() const;
   inline bool has_forwarded_objects() const;
   inline bool is_gc_in_progress_mask(uint mask) const;
 
   char gc_state() const;
 
   bool process_references() const;
   bool unload_classes() const;
 
+  bool is_minor_gc() const;
+  bool is_major_gc() const;
+  void set_cycle_mode(GCCycleMode gc_cycle_mode);
+
   inline bool region_in_collection_set(size_t region_index) const;
 
   // Mainly there to avoid accidentally calling the templated
   // method below with ShenandoahHeapRegion* which would be *wrong*.
   inline bool in_collection_set(ShenandoahHeapRegion* r) const;

@@ -481,13 +483,12 @@
   void set_complete_top_at_mark_start(HeapWord* region_base, HeapWord* addr);
   HeapWord* complete_top_at_mark_start(HeapWord* region_base);
 
   // Evacuates object src. Returns the evacuated object if this thread
   // succeeded, otherwise rolls back the evacuation and returns the
-  // evacuated object by the competing thread. 'succeeded' is an out
-  // param and set to true if this thread succeeded, otherwise to false.
-  inline oop  evacuate_object(oop src, Thread* thread, bool& evacuated);
+  // evacuated object by the competing thread.
+  inline oop  evacuate_object(oop src, Thread* thread);
   inline bool cancelled_concgc() const;
   inline bool check_cancelled_concgc_and_yield(bool sts_active = true);
   inline bool try_cancel_concgc();
   inline void clear_cancelled_concgc();
 

@@ -513,10 +514,11 @@
   void notify_alloc(size_t words, bool waste);
 
   void handle_heap_shrinkage(double shrink_before);
 
   void reset_next_mark_bitmap();
+  void reset_next_mark_bitmap_traversal();
 
   MarkBitMap* complete_mark_bit_map();
   MarkBitMap* next_mark_bit_map();
   inline bool is_marked_complete(oop obj) const;
   inline bool mark_next(oop obj) const;

@@ -545,11 +547,10 @@
   virtual GrowableArray<MemoryPool*> memory_pools();
 
   ShenandoahMonitoringSupport* monitoring_support();
   ShenandoahConcurrentMark* concurrentMark() { return _scm; }
   ShenandoahMarkCompact* full_gc() { return _full_gc; }
-  ShenandoahPartialGC* partial_gc();
   ShenandoahTraversalGC* traversal_gc();
   ShenandoahVerifier* verifier();
   ShenandoahPacer* pacer() const;
 
   ReferenceProcessor* ref_processor() { return _ref_processor;}

@@ -685,12 +686,10 @@
   void vmop_entry_init_mark();
   void vmop_entry_final_mark();
   void vmop_entry_final_evac();
   void vmop_entry_init_updaterefs();
   void vmop_entry_final_updaterefs();
-  void vmop_entry_init_partial();
-  void vmop_entry_final_partial();
   void vmop_entry_init_traversal();
   void vmop_entry_final_traversal();
   void vmop_entry_full(GCCause::Cause cause);
   void vmop_degenerated(ShenandoahDegenPoint point);
 

@@ -699,12 +698,10 @@
   void entry_init_mark();
   void entry_final_mark();
   void entry_final_evac();
   void entry_init_updaterefs();
   void entry_final_updaterefs();
-  void entry_init_partial();
-  void entry_final_partial();
   void entry_init_traversal();
   void entry_final_traversal();
   void entry_full(GCCause::Cause cause);
   void entry_degenerated(int point);
 

@@ -712,24 +709,22 @@
   // for concurrent operation.
   void entry_mark();
   void entry_preclean();
   void entry_cleanup();
   void entry_cleanup_bitmaps();
+  void entry_cleanup_traversal();
   void entry_evac();
   void entry_updaterefs();
-  void entry_partial();
   void entry_traversal();
 
 private:
   // Actual work for the phases
   void op_init_mark();
   void op_final_mark();
   void op_final_evac();
   void op_init_updaterefs();
   void op_final_updaterefs();
-  void op_init_partial();
-  void op_final_partial();
   void op_init_traversal();
   void op_final_traversal();
   void op_full(GCCause::Cause cause);
   void op_degenerated(ShenandoahDegenPoint point);
   void op_degenerated_fail();

@@ -739,11 +734,11 @@
   void op_preclean();
   void op_cleanup();
   void op_evac();
   void op_updaterefs();
   void op_cleanup_bitmaps();
-  void op_partial();
+  void op_cleanup_traversal();
   void op_traversal();
 
 private:
   void try_inject_alloc_failure();
   bool should_inject_alloc_failure();
< prev index next >