From 4ae39b14819edbe2a7d742cfe73255bd38de5b4b Mon Sep 17 00:00:00 2001 From: Hamlin Li Date: Mon, 25 Jan 2021 01:06:33 +0000 Subject: [PATCH] 8260208: Improve dummy object filling condition in G1CollectedHeap::fill_archive_regions in cds Reviewed-by: tschatzl, iklam --- src/hotspot/share/gc/g1/g1CollectedHeap.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/hotspot/share/gc/g1/g1CollectedHeap.cpp b/src/hotspot/share/gc/g1/g1CollectedHeap.cpp index f510f36182b..8f33eac4443 100644 --- a/src/hotspot/share/gc/g1/g1CollectedHeap.cpp +++ b/src/hotspot/share/gc/g1/g1CollectedHeap.cpp @@ -705,7 +705,8 @@ void G1CollectedHeap::fill_archive_regions(MemRegion* ranges, size_t count) { // Fill the memory below the allocated range with dummy object(s), // if the region bottom does not match the range start, or if the previous // range ended within the same G1 region, and there is a gap. - if (start_address != bottom_address) { + assert(start_address >= bottom_address, "bottom address should not be greater than start address"); + if (start_address > bottom_address) { size_t fill_size = pointer_delta(start_address, bottom_address); G1CollectedHeap::fill_with_objects(bottom_address, fill_size); increase_used(fill_size * HeapWordSize);