comparison src/share/vm/gc_implementation/g1/g1CollectedHeap.hpp @ 20304:a22acf6d7598

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 2c6ef90f030a
children 755930f931e3
comparison
equal deleted inserted replaced
20303:c512f38a5139 20304:a22acf6d7598
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
1375 void collection_set_iterate(HeapRegionClosure* blk); 1375 void collection_set_iterate(HeapRegionClosure* blk);
1376 1376
1377 // As above but starting from region r 1377 // As above but starting from region r
1378 void collection_set_iterate_from(HeapRegion* r, HeapRegionClosure *blk); 1378 void collection_set_iterate_from(HeapRegion* r, HeapRegionClosure *blk);
1379 1379
1380 // Returns the first (lowest address) compactible space in the heap. 1380 HeapRegion* next_compaction_region(const HeapRegion* from) const;
1381 virtual CompactibleSpace* first_compactible_space();
1382 1381
1383 // A CollectedHeap will contain some number of spaces. This finds the 1382 // A CollectedHeap will contain some number of spaces. This finds the
1384 // space containing a given address, or else returns NULL. 1383 // space containing a given address, or else returns NULL.
1385 virtual Space* space_containing(const void* addr) const; 1384 virtual Space* space_containing(const void* addr) const;
1386 1385