hotspot/src/share/vm/gc_implementation/g1/heapRegionManager.cpp
changeset 26839 021bfc544c6f
parent 26321 18d281f5acae
child 26846 7d4376f8560e
equal deleted inserted replaced
26838:344fb68e970a 26839:021bfc544c6f
    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");