comparison src/share/vm/gc_implementation/g1/g1CollectedHeap.hpp @ 20295:3f2894c5052e

8048112: G1 Full GC needs to support the case when the very first region is not available Summary: Refactor preparation for compaction during Full GC so that it lazily initializes the first compaction point. This also avoids problems later when the first region may not be committed. Also reviewed by K. Barrett. Reviewed-by: brutisso
author tschatzl
date Mon, 21 Jul 2014 10:00:31 +0200
parents e0954897238a
children a3953c777565
comparison
equal deleted inserted replaced
20294:dd219eaec9cc 20295:3f2894c5052e
1165 virtual bool is_maximal_no_gc() const { 1165 virtual bool is_maximal_no_gc() const {
1166 return _g1_storage.uncommitted_size() == 0; 1166 return _g1_storage.uncommitted_size() == 0;
1167 } 1167 }
1168 1168
1169 // The total number of regions in the heap. 1169 // The total number of regions in the heap.
1170 uint n_regions() { return _hrs.length(); } 1170 uint n_regions() const { return _hrs.length(); }
1171 1171
1172 // The max number of regions in the heap. 1172 // The max number of regions in the heap.
1173 uint max_regions() { return _hrs.max_length(); } 1173 uint max_regions() const { return _hrs.max_length(); }
1174 1174
1175 // The number of regions that are completely free. 1175 // The number of regions that are completely free.
1176 uint free_regions() { return _free_list.length(); } 1176 uint free_regions() const { return _free_list.length(); }
1177 1177
1178 // The number of regions that are not completely free. 1178 // The number of regions that are not completely free.
1179 uint used_regions() { return n_regions() - free_regions(); } 1179 uint used_regions() const { return n_regions() - free_regions(); }
1180 1180
1181 // The number of regions available for "regular" expansion. 1181 // The number of regions available for "regular" expansion.
1182 uint expansion_regions() { return _expansion_regions; } 1182 uint expansion_regions() const { return _expansion_regions; }
1183 1183
1184 // Factory method for HeapRegion instances. It will return NULL if 1184 // Factory method for HeapRegion instances. It will return NULL if
1185 // the allocation fails. 1185 // the allocation fails.
1186 HeapRegion* new_heap_region(uint hrs_index, HeapWord* bottom); 1186 HeapRegion* new_heap_region(uint hrs_index, HeapWord* bottom);
1187 1187
1399 void collection_set_iterate(HeapRegionClosure* blk); 1399 void collection_set_iterate(HeapRegionClosure* blk);
1400 1400
1401 // As above but starting from region r 1401 // As above but starting from region r
1402 void collection_set_iterate_from(HeapRegion* r, HeapRegionClosure *blk); 1402 void collection_set_iterate_from(HeapRegion* r, HeapRegionClosure *blk);
1403 1403
1404 // Returns the first (lowest address) compactible space in the heap. 1404 HeapRegion* next_compaction_region(const HeapRegion* from) const;
1405 virtual CompactibleSpace* first_compactible_space();
1406 1405
1407 // A CollectedHeap will contain some number of spaces. This finds the 1406 // A CollectedHeap will contain some number of spaces. This finds the
1408 // space containing a given address, or else returns NULL. 1407 // space containing a given address, or else returns NULL.
1409 virtual Space* space_containing(const void* addr) const; 1408 virtual Space* space_containing(const void* addr) const;
1410 1409