--- old/src/hotspot/share/gc/g1/g1Allocator.cpp 2018-10-18 14:45:39.438951237 +0200 +++ new/src/hotspot/share/gc/g1/g1Allocator.cpp 2018-10-18 14:45:39.114937325 +0200 @@ -31,6 +31,7 @@ #include "gc/g1/heapRegion.inline.hpp" #include "gc/g1/heapRegionSet.inline.hpp" #include "gc/g1/heapRegionType.hpp" +#include "gc/shared/fill.hpp" #include "utilities/align.hpp" G1Allocator::G1Allocator(G1CollectedHeap* heap) : @@ -406,10 +407,10 @@ HeapWord* new_top = old_top + word_size; size_t remainder = pointer_delta(_max, new_top); if ((new_top > _max) || - ((new_top < _max) && (remainder < CollectedHeap::min_fill_size()))) { + ((new_top < _max) && (remainder < Fill::min_size()))) { if (old_top != _max) { size_t fill_size = pointer_delta(_max, old_top); - CollectedHeap::fill_with_object(old_top, fill_size); + Fill::range(old_top, fill_size); _summary_bytes_used += fill_size * HeapWordSize; } _allocation_region->set_top(_max); @@ -450,18 +451,17 @@ HeapWord* newtop = align_up(currtop, end_alignment_in_bytes); size_t fill_size = pointer_delta(newtop, currtop); if (fill_size != 0) { - if (fill_size < CollectedHeap::min_fill_size()) { + if (fill_size < Fill::min_size()) { // If the required fill is smaller than we can represent, // bump up to the next aligned address. We know we won't exceed the current // region boundary because the max supported alignment is smaller than the min // region size, and because the allocation code never leaves space smaller than - // the min_fill_size at the top of the current allocation region. - newtop = align_up(currtop + CollectedHeap::min_fill_size(), - end_alignment_in_bytes); + // the Fill::min_size() at the top of the current allocation region. + newtop = align_up(currtop + Fill::min_size(), end_alignment_in_bytes); fill_size = pointer_delta(newtop, currtop); } HeapWord* fill = archive_mem_allocate(fill_size); - CollectedHeap::fill_with_objects(fill, fill_size); + Fill::range(fill, fill_size); } }