--- old/src/hotspot/share/gc/g1/heterogeneousHeapRegionManager.cpp 2020-01-03 17:56:51.421851942 +0800 +++ new/src/hotspot/share/gc/g1/heterogeneousHeapRegionManager.cpp 2020-01-03 17:56:51.423852014 +0800 @@ -158,14 +158,14 @@ return num_regions; } *res_idx = cur; - while (cur <= end_idx && !is_available(cur)) { + while (cur <= end_idx && is_unavailable_for_allocation(cur)) { cur++; } num_regions = cur - *res_idx; #ifdef ASSERT for (uint i = *res_idx; i < (*res_idx + num_regions); i++) { - assert(!is_available(i), "just checking"); + assert(is_unavailable_for_allocation(i), "just checking"); } assert(cur == end_idx + 1 || num_regions == 0 || is_available(cur), "The region at the current position %u must be available or at the end", cur); @@ -347,9 +347,9 @@ while (length_found < num && cur <= end) { HeapRegion* hr = _regions.get_by_index(cur); - if ((!empty_only && !is_available(cur)) || (is_available(cur) && hr != NULL && hr->is_empty())) { + if ((!empty_only && is_unavailable_for_allocation(cur)) || (is_available(cur) && hr != NULL && hr->is_empty())) { // This region is a potential candidate for allocation into. - if (!is_available(cur)) { + if (is_unavailable_for_allocation(cur)) { if(shrink_dram(1) == 1) { uint ret = expand_in_range(cur, cur, 1, NULL); assert(ret == 1, "We should be able to expand at this index"); @@ -371,7 +371,7 @@ for (uint i = found; i < (found + num); i++) { HeapRegion* hr = _regions.get_by_index(i); // sanity check - guarantee((!empty_only && !is_available(i)) || (is_available(i) && hr != NULL && hr->is_empty()), + guarantee((!empty_only && is_unavailable_for_allocation(i)) || (is_available(i) && hr != NULL && hr->is_empty()), "Found region sequence starting at " UINT32_FORMAT ", length " SIZE_FORMAT " that is not empty at " UINT32_FORMAT ". Hr is " PTR_FORMAT, found, num, i, p2i(hr)); }