Mercurial > hg > graal-jvmci-8
comparison src/share/vm/gc_implementation/g1/g1CollectedHeap.hpp @ 20377:a8ea2f110d87
8054819: Rename HeapRegionSeq to HeapRegionManager
Reviewed-by: jwilhelm, jmasa
author | tschatzl |
---|---|
date | Tue, 26 Aug 2014 09:36:53 +0200 |
parents | 439f0d76cff3 |
children | 227a9e5e4b4a |
comparison
equal
deleted
inserted
replaced
20359:4d3a43351904 | 20377:a8ea2f110d87 |
---|---|
31 #include "gc_implementation/g1/g1BiasedArray.hpp" | 31 #include "gc_implementation/g1/g1BiasedArray.hpp" |
32 #include "gc_implementation/g1/g1HRPrinter.hpp" | 32 #include "gc_implementation/g1/g1HRPrinter.hpp" |
33 #include "gc_implementation/g1/g1MonitoringSupport.hpp" | 33 #include "gc_implementation/g1/g1MonitoringSupport.hpp" |
34 #include "gc_implementation/g1/g1SATBCardTableModRefBS.hpp" | 34 #include "gc_implementation/g1/g1SATBCardTableModRefBS.hpp" |
35 #include "gc_implementation/g1/g1YCTypes.hpp" | 35 #include "gc_implementation/g1/g1YCTypes.hpp" |
36 #include "gc_implementation/g1/heapRegionSeq.hpp" | 36 #include "gc_implementation/g1/heapRegionManager.hpp" |
37 #include "gc_implementation/g1/heapRegionSet.hpp" | 37 #include "gc_implementation/g1/heapRegionSet.hpp" |
38 #include "gc_implementation/shared/hSpaceCounters.hpp" | 38 #include "gc_implementation/shared/hSpaceCounters.hpp" |
39 #include "gc_implementation/shared/parGCAllocBuffer.hpp" | 39 #include "gc_implementation/shared/parGCAllocBuffer.hpp" |
40 #include "memory/barrierSet.hpp" | 40 #include "memory/barrierSet.hpp" |
41 #include "memory/memRegion.hpp" | 41 #include "memory/memRegion.hpp" |
289 | 289 |
290 // Callback for region mapping changed events. | 290 // Callback for region mapping changed events. |
291 G1RegionMappingChangedListener _listener; | 291 G1RegionMappingChangedListener _listener; |
292 | 292 |
293 // The sequence of all heap regions in the heap. | 293 // The sequence of all heap regions in the heap. |
294 HeapRegionSeq _hrs; | 294 HeapRegionManager _hrm; |
295 | 295 |
296 // Alloc region used to satisfy mutator allocation requests. | 296 // Alloc region used to satisfy mutator allocation requests. |
297 MutatorAllocRegion _mutator_alloc_region; | 297 MutatorAllocRegion _mutator_alloc_region; |
298 | 298 |
299 // Alloc region used to satisfy allocation requests by the GC for | 299 // Alloc region used to satisfy allocation requests by the GC for |
427 // Clear RSets after a compaction. It also resets the GC time stamps. | 427 // Clear RSets after a compaction. It also resets the GC time stamps. |
428 void clear_rsets_post_compaction(); | 428 void clear_rsets_post_compaction(); |
429 | 429 |
430 // If the HR printer is active, dump the state of the regions in the | 430 // If the HR printer is active, dump the state of the regions in the |
431 // heap after a compaction. | 431 // heap after a compaction. |
432 void print_hrs_post_compaction(); | 432 void print_hrm_post_compaction(); |
433 | 433 |
434 double verify(bool guard, const char* msg); | 434 double verify(bool guard, const char* msg); |
435 void verify_before_gc(); | 435 void verify_before_gc(); |
436 void verify_after_gc(); | 436 void verify_after_gc(); |
437 | 437 |
713 // the in_cset_fast_test table. | 713 // the in_cset_fast_test table. |
714 void register_humongous_regions_with_in_cset_fast_test(); | 714 void register_humongous_regions_with_in_cset_fast_test(); |
715 // We register a region with the fast "in collection set" test. We | 715 // We register a region with the fast "in collection set" test. We |
716 // simply set to true the array slot corresponding to this region. | 716 // simply set to true the array slot corresponding to this region. |
717 void register_region_with_in_cset_fast_test(HeapRegion* r) { | 717 void register_region_with_in_cset_fast_test(HeapRegion* r) { |
718 _in_cset_fast_test.set_in_cset(r->hrs_index()); | 718 _in_cset_fast_test.set_in_cset(r->hrm_index()); |
719 } | 719 } |
720 | 720 |
721 // This is a fast test on whether a reference points into the | 721 // This is a fast test on whether a reference points into the |
722 // collection set or not. Assume that the reference | 722 // collection set or not. Assume that the reference |
723 // points into the heap. | 723 // points into the heap. |
1169 // allocation, via inlined code (by exporting the address of the top and | 1169 // allocation, via inlined code (by exporting the address of the top and |
1170 // end fields defining the extent of the contiguous allocation region.) | 1170 // end fields defining the extent of the contiguous allocation region.) |
1171 // But G1CollectedHeap doesn't yet support this. | 1171 // But G1CollectedHeap doesn't yet support this. |
1172 | 1172 |
1173 virtual bool is_maximal_no_gc() const { | 1173 virtual bool is_maximal_no_gc() const { |
1174 return _hrs.available() == 0; | 1174 return _hrm.available() == 0; |
1175 } | 1175 } |
1176 | 1176 |
1177 // The current number of regions in the heap. | 1177 // The current number of regions in the heap. |
1178 uint num_regions() const { return _hrs.length(); } | 1178 uint num_regions() const { return _hrm.length(); } |
1179 | 1179 |
1180 // The max number of regions in the heap. | 1180 // The max number of regions in the heap. |
1181 uint max_regions() const { return _hrs.max_length(); } | 1181 uint max_regions() const { return _hrm.max_length(); } |
1182 | 1182 |
1183 // The number of regions that are completely free. | 1183 // The number of regions that are completely free. |
1184 uint num_free_regions() const { return _hrs.num_free_regions(); } | 1184 uint num_free_regions() const { return _hrm.num_free_regions(); } |
1185 | 1185 |
1186 // The number of regions that are not completely free. | 1186 // The number of regions that are not completely free. |
1187 uint num_used_regions() const { return num_regions() - num_free_regions(); } | 1187 uint num_used_regions() const { return num_regions() - num_free_regions(); } |
1188 | 1188 |
1189 void verify_not_dirty_region(HeapRegion* hr) PRODUCT_RETURN; | 1189 void verify_not_dirty_region(HeapRegion* hr) PRODUCT_RETURN; |
1231 void verify_region_sets_optional() { } | 1231 void verify_region_sets_optional() { } |
1232 #endif // HEAP_REGION_SET_FORCE_VERIFY | 1232 #endif // HEAP_REGION_SET_FORCE_VERIFY |
1233 | 1233 |
1234 #ifdef ASSERT | 1234 #ifdef ASSERT |
1235 bool is_on_master_free_list(HeapRegion* hr) { | 1235 bool is_on_master_free_list(HeapRegion* hr) { |
1236 return _hrs.is_free(hr); | 1236 return _hrm.is_free(hr); |
1237 } | 1237 } |
1238 #endif // ASSERT | 1238 #endif // ASSERT |
1239 | 1239 |
1240 // Wrapper for the region list operations that can be called from | 1240 // Wrapper for the region list operations that can be called from |
1241 // methods outside this class. | 1241 // methods outside this class. |
1243 void secondary_free_list_add(FreeRegionList* list) { | 1243 void secondary_free_list_add(FreeRegionList* list) { |
1244 _secondary_free_list.add_ordered(list); | 1244 _secondary_free_list.add_ordered(list); |
1245 } | 1245 } |
1246 | 1246 |
1247 void append_secondary_free_list() { | 1247 void append_secondary_free_list() { |
1248 _hrs.insert_list_into_free_list(&_secondary_free_list); | 1248 _hrm.insert_list_into_free_list(&_secondary_free_list); |
1249 } | 1249 } |
1250 | 1250 |
1251 void append_secondary_free_list_if_not_empty_with_lock() { | 1251 void append_secondary_free_list_if_not_empty_with_lock() { |
1252 // If the secondary free list looks empty there's no reason to | 1252 // If the secondary free list looks empty there's no reason to |
1253 // take the lock and then try to append it. | 1253 // take the lock and then try to append it. |
1354 inline in_cset_state_t in_cset_state(const oop obj); | 1354 inline in_cset_state_t in_cset_state(const oop obj); |
1355 | 1355 |
1356 // Return "TRUE" iff the given object address is in the reserved | 1356 // Return "TRUE" iff the given object address is in the reserved |
1357 // region of g1. | 1357 // region of g1. |
1358 bool is_in_g1_reserved(const void* p) const { | 1358 bool is_in_g1_reserved(const void* p) const { |
1359 return _hrs.reserved().contains(p); | 1359 return _hrm.reserved().contains(p); |
1360 } | 1360 } |
1361 | 1361 |
1362 // Returns a MemRegion that corresponds to the space that has been | 1362 // Returns a MemRegion that corresponds to the space that has been |
1363 // reserved for the heap | 1363 // reserved for the heap |
1364 MemRegion g1_reserved() const { | 1364 MemRegion g1_reserved() const { |
1365 return _hrs.reserved(); | 1365 return _hrm.reserved(); |
1366 } | 1366 } |
1367 | 1367 |
1368 virtual bool is_in_closed_subset(const void* p) const; | 1368 virtual bool is_in_closed_subset(const void* p) const; |
1369 | 1369 |
1370 G1SATBCardTableLoggingModRefBS* g1_barrier_set() { | 1370 G1SATBCardTableLoggingModRefBS* g1_barrier_set() { |