< prev index next >

src/share/vm/gc_implementation/g1/g1CollectedHeap.hpp

Print this page
rev 7993 : [mq]: fix

@@ -214,11 +214,10 @@
   HeapRegionSet _old_set;
 
   // It keeps track of the humongous regions.
   HeapRegionSet _humongous_set;
 
-  void clear_humongous_is_live_table();
   void eagerly_reclaim_humongous_regions();
 
   // The number of regions we could create by expansion.
   uint _expansion_regions;
 

@@ -284,26 +283,32 @@
   void abandon_gc_alloc_regions();
 
   // Helper for monitoring and management support.
   G1MonitoringSupport* _g1mm;
 
-  // Records whether the region at the given index is kept live by roots or
-  // references from the young generation.
-  class HumongousIsLiveBiasedMappedArray : public G1BiasedMappedArray<bool> {
+  // Records whether the region at the given index is (still) a
+  // candidate for eager reclaim.  Only valid for humongous start
+  // regions; other regions have unspecified values.  Initialized at
+  // start of collection pause, with candidates removed as they are
+  // found reachable from roots or the young generation.
+  class HumongousReclaimCandidates : public G1BiasedMappedArray<bool> {
    protected:
     bool default_value() const { return false; }
    public:
     void clear() { G1BiasedMappedArray<bool>::clear(); }
-    void set_live(uint region) {
+    void add_candidate(uint region) {
       set_by_index(region, true);
     }
-    bool is_live(uint region) {
+    void remove_candidate(uint region) {
+      set_by_index(region, false);
+    }
+    bool is_candidate(uint region) {
       return get_by_index(region);
     }
   };
 
-  HumongousIsLiveBiasedMappedArray _humongous_is_live;
+  HumongousReclaimCandidates _humongous_reclaim_candidates;
   // Stores whether during humongous object registration we found candidate regions.
   // If not, we can skip a few steps.
   bool _has_humongous_reclaim_candidates;
 
   volatile unsigned _gc_time_stamp;

@@ -632,20 +637,25 @@
   virtual void gc_prologue(bool full);
   virtual void gc_epilogue(bool full);
 
   inline void set_humongous_is_live(oop obj);
 
-  bool humongous_is_live(uint region) {
-    return _humongous_is_live.is_live(region);
+  void add_humongous_reclaim_candidate(uint region) {
+    assert(_hrm.at(region)->is_starts_humongous(), "Must start a humongous object");
+    _humongous_reclaim_candidates.add_candidate(region);
+  }
+
+  void remove_humongous_reclaim_candidate(uint region) {
+    assert(_hrm.at(region)->is_starts_humongous(), "Must start a humongous object");
+    _humongous_reclaim_candidates.remove_candidate(region);
+  }
+
+  bool is_humongous_reclaim_candidate(uint region) {
+    assert(_hrm.at(region)->is_starts_humongous(), "Must start a humongous object");
+    return _humongous_reclaim_candidates.is_candidate(region);
   }
 
-  // Returns whether the given region (which must be a humongous (start) region)
-  // is to be considered conservatively live regardless of any other conditions.
-  bool humongous_region_is_always_live(uint index);
-  // Returns whether the given region (which must be a humongous (start) region)
-  // is considered a candidate for eager reclamation.
-  bool humongous_region_is_candidate(uint index);
   // Register the given region to be part of the collection set.
   inline void register_humongous_region_with_cset(uint index);
   // Register regions with humongous objects (actually on the start region) in
   // the in_cset_fast_test table.
   void register_humongous_regions_with_cset();
< prev index next >