comparison src/share/vm/gc_implementation/g1/heapRegionManager.cpp @ 20417:d35872270666

8057658: Enable G1 FullGC extensions Summary: Refactored the G1 FullGC code to enable it to be extended. Reviewed-by: mgerdin, brutisso
author sjohanss
date Tue, 09 Sep 2014 00:05:25 +0200
parents b1266b08b994
children 7848fc12602b e5406a79ae90
comparison
equal deleted inserted replaced
20416:99f0593d8c9f 20417:d35872270666
64 return _free_list.contains(hr); 64 return _free_list.contains(hr);
65 } 65 }
66 #endif 66 #endif
67 67
68 HeapRegion* HeapRegionManager::new_heap_region(uint hrm_index) { 68 HeapRegion* HeapRegionManager::new_heap_region(uint hrm_index) {
69 HeapWord* bottom = G1CollectedHeap::heap()->bottom_addr_for_region(hrm_index); 69 G1CollectedHeap* g1h = G1CollectedHeap::heap();
70 HeapWord* bottom = g1h->bottom_addr_for_region(hrm_index);
70 MemRegion mr(bottom, bottom + HeapRegion::GrainWords); 71 MemRegion mr(bottom, bottom + HeapRegion::GrainWords);
71 assert(reserved().contains(mr), "invariant"); 72 assert(reserved().contains(mr), "invariant");
72 return new HeapRegion(hrm_index, G1CollectedHeap::heap()->bot_shared(), mr); 73 return g1h->allocator()->new_heap_region(hrm_index, g1h->bot_shared(), mr);
73 } 74 }
74 75
75 void HeapRegionManager::commit_regions(uint index, size_t num_regions) { 76 void HeapRegionManager::commit_regions(uint index, size_t num_regions) {
76 guarantee(num_regions > 0, "Must commit more than zero regions"); 77 guarantee(num_regions > 0, "Must commit more than zero regions");
77 guarantee(_num_committed + num_regions <= max_length(), "Cannot commit more than the maximum amount of regions"); 78 guarantee(_num_committed + num_regions <= max_length(), "Cannot commit more than the maximum amount of regions");