1.1 --- a/src/share/vm/gc_implementation/g1/g1CollectedHeap.hpp Wed Apr 08 10:32:16 2015 -0400 1.2 +++ b/src/share/vm/gc_implementation/g1/g1CollectedHeap.hpp Wed Apr 15 12:16:01 2015 -0400 1.3 @@ -233,7 +233,6 @@ 1.4 // It keeps track of the humongous regions. 1.5 HeapRegionSet _humongous_set; 1.6 1.7 - void clear_humongous_is_live_table(); 1.8 void eagerly_reclaim_humongous_regions(); 1.9 1.10 // The number of regions we could create by expansion. 1.11 @@ -303,22 +302,26 @@ 1.12 // Helper for monitoring and management support. 1.13 G1MonitoringSupport* _g1mm; 1.14 1.15 - // Records whether the region at the given index is kept live by roots or 1.16 - // references from the young generation. 1.17 - class HumongousIsLiveBiasedMappedArray : public G1BiasedMappedArray<bool> { 1.18 + // Records whether the region at the given index is (still) a 1.19 + // candidate for eager reclaim. Only valid for humongous start 1.20 + // regions; other regions have unspecified values. Humongous start 1.21 + // regions are initialized at start of collection pause, with 1.22 + // candidates removed from the set as they are found reachable from 1.23 + // roots or the young generation. 1.24 + class HumongousReclaimCandidates : public G1BiasedMappedArray<bool> { 1.25 protected: 1.26 bool default_value() const { return false; } 1.27 public: 1.28 void clear() { G1BiasedMappedArray<bool>::clear(); } 1.29 - void set_live(uint region) { 1.30 - set_by_index(region, true); 1.31 + void set_candidate(uint region, bool value) { 1.32 + set_by_index(region, value); 1.33 } 1.34 - bool is_live(uint region) { 1.35 + bool is_candidate(uint region) { 1.36 return get_by_index(region); 1.37 } 1.38 }; 1.39 1.40 - HumongousIsLiveBiasedMappedArray _humongous_is_live; 1.41 + HumongousReclaimCandidates _humongous_reclaim_candidates; 1.42 // Stores whether during humongous object registration we found candidate regions. 1.43 // If not, we can skip a few steps. 1.44 bool _has_humongous_reclaim_candidates; 1.45 @@ -655,18 +658,15 @@ 1.46 virtual void gc_prologue(bool full); 1.47 virtual void gc_epilogue(bool full); 1.48 1.49 + // Modify the reclaim candidate set and test for presence. 1.50 + // These are only valid for starts_humongous regions. 1.51 + inline void set_humongous_reclaim_candidate(uint region, bool value); 1.52 + inline bool is_humongous_reclaim_candidate(uint region); 1.53 + 1.54 + // Remove from the reclaim candidate set. Also remove from the 1.55 + // collection set so that later encounters avoid the slow path. 1.56 inline void set_humongous_is_live(oop obj); 1.57 1.58 - bool humongous_is_live(uint region) { 1.59 - return _humongous_is_live.is_live(region); 1.60 - } 1.61 - 1.62 - // Returns whether the given region (which must be a humongous (start) region) 1.63 - // is to be considered conservatively live regardless of any other conditions. 1.64 - bool humongous_region_is_always_live(uint index); 1.65 - // Returns whether the given region (which must be a humongous (start) region) 1.66 - // is considered a candidate for eager reclamation. 1.67 - bool humongous_region_is_candidate(uint index); 1.68 // Register the given region to be part of the collection set. 1.69 inline void register_humongous_region_with_in_cset_fast_test(uint index); 1.70 // Register regions with humongous objects (actually on the start region) in