--- old/src/hotspot/share/gc/g1/heapRegionManager.inline.hpp 2018-10-03 10:33:06.965918361 +0200 +++ new/src/hotspot/share/gc/g1/heapRegionManager.inline.hpp 2018-10-03 10:33:06.552905833 +0200 @@ -47,6 +47,16 @@ return hr; } +inline HeapRegion* HeapRegionManager::at_or_null(uint index) const { + if (!is_available(index)) { + return NULL; + } + HeapRegion* hr = _regions.get_by_index(index); + assert(hr != NULL, "All available regions must have a HeapRegion but index %u has not.", index); + assert(hr->hrm_index() == index, "sanity"); + return hr; +} + inline HeapRegion* HeapRegionManager::next_region_in_humongous(HeapRegion* hr) const { uint index = hr->hrm_index(); assert(is_available(index), "pre-condition");