218 HeapRegionSet _old_set; |
218 HeapRegionSet _old_set; |
219 |
219 |
220 // It keeps track of the humongous regions. |
220 // It keeps track of the humongous regions. |
221 HeapRegionSet _humongous_set; |
221 HeapRegionSet _humongous_set; |
222 |
222 |
223 void clear_humongous_is_live_table(); |
|
224 void eagerly_reclaim_humongous_regions(); |
223 void eagerly_reclaim_humongous_regions(); |
225 |
224 |
226 // The number of regions we could create by expansion. |
225 // The number of regions we could create by expansion. |
227 uint _expansion_regions; |
226 uint _expansion_regions; |
228 |
227 |
288 void abandon_gc_alloc_regions(); |
287 void abandon_gc_alloc_regions(); |
289 |
288 |
290 // Helper for monitoring and management support. |
289 // Helper for monitoring and management support. |
291 G1MonitoringSupport* _g1mm; |
290 G1MonitoringSupport* _g1mm; |
292 |
291 |
293 // Records whether the region at the given index is kept live by roots or |
292 // Records whether the region at the given index is (still) a |
294 // references from the young generation. |
293 // candidate for eager reclaim. Only valid for humongous start |
295 class HumongousIsLiveBiasedMappedArray : public G1BiasedMappedArray<bool> { |
294 // regions; other regions have unspecified values. Humongous start |
|
295 // regions are initialized at start of collection pause, with |
|
296 // candidates removed from the set as they are found reachable from |
|
297 // roots or the young generation. |
|
298 class HumongousReclaimCandidates : public G1BiasedMappedArray<bool> { |
296 protected: |
299 protected: |
297 bool default_value() const { return false; } |
300 bool default_value() const { return false; } |
298 public: |
301 public: |
299 void clear() { G1BiasedMappedArray<bool>::clear(); } |
302 void clear() { G1BiasedMappedArray<bool>::clear(); } |
300 void set_live(uint region) { |
303 void set_candidate(uint region, bool value) { |
301 set_by_index(region, true); |
304 set_by_index(region, value); |
302 } |
305 } |
303 bool is_live(uint region) { |
306 bool is_candidate(uint region) { |
304 return get_by_index(region); |
307 return get_by_index(region); |
305 } |
308 } |
306 }; |
309 }; |
307 |
310 |
308 HumongousIsLiveBiasedMappedArray _humongous_is_live; |
311 HumongousReclaimCandidates _humongous_reclaim_candidates; |
309 // Stores whether during humongous object registration we found candidate regions. |
312 // Stores whether during humongous object registration we found candidate regions. |
310 // If not, we can skip a few steps. |
313 // If not, we can skip a few steps. |
311 bool _has_humongous_reclaim_candidates; |
314 bool _has_humongous_reclaim_candidates; |
312 |
315 |
313 volatile unsigned _gc_time_stamp; |
316 volatile unsigned _gc_time_stamp; |
641 |
644 |
642 // Do anything common to GC's. |
645 // Do anything common to GC's. |
643 void gc_prologue(bool full); |
646 void gc_prologue(bool full); |
644 void gc_epilogue(bool full); |
647 void gc_epilogue(bool full); |
645 |
648 |
|
649 // Modify the reclaim candidate set and test for presence. |
|
650 // These are only valid for starts_humongous regions. |
|
651 inline void set_humongous_reclaim_candidate(uint region, bool value); |
|
652 inline bool is_humongous_reclaim_candidate(uint region); |
|
653 |
|
654 // Remove from the reclaim candidate set. Also remove from the |
|
655 // collection set so that later encounters avoid the slow path. |
646 inline void set_humongous_is_live(oop obj); |
656 inline void set_humongous_is_live(oop obj); |
647 |
657 |
648 bool humongous_is_live(uint region) { |
|
649 return _humongous_is_live.is_live(region); |
|
650 } |
|
651 |
|
652 // Returns whether the given region (which must be a humongous (start) region) |
|
653 // is to be considered conservatively live regardless of any other conditions. |
|
654 bool humongous_region_is_always_live(uint index); |
|
655 // Returns whether the given region (which must be a humongous (start) region) |
|
656 // is considered a candidate for eager reclamation. |
|
657 bool humongous_region_is_candidate(uint index); |
|
658 // Register the given region to be part of the collection set. |
658 // Register the given region to be part of the collection set. |
659 inline void register_humongous_region_with_cset(uint index); |
659 inline void register_humongous_region_with_cset(uint index); |
660 // Register regions with humongous objects (actually on the start region) in |
660 // Register regions with humongous objects (actually on the start region) in |
661 // the in_cset_fast_test table. |
661 // the in_cset_fast_test table. |
662 void register_humongous_regions_with_cset(); |
662 void register_humongous_regions_with_cset(); |