diff --git a/src/hotspot/share/gc/g1/g1CollectedHeap.inline.hpp b/src/hotspot/share/gc/g1/g1CollectedHeap.inline.hpp index d268eef1d14..05d3a65fd59 100644 --- a/src/hotspot/share/gc/g1/g1CollectedHeap.inline.hpp +++ b/src/hotspot/share/gc/g1/g1CollectedHeap.inline.hpp @@ -209,7 +209,7 @@ G1HeapRegionAttr G1CollectedHeap::region_attr(uint idx) const { } void G1CollectedHeap::register_humongous_candidate_region_with_region_attr(uint index) { - _region_attr.set_humongous_candidate(index, region_at(index)->rem_set()->is_tracked()); + _region_attr.set_humongous_candidate(index); } void G1CollectedHeap::register_new_survivor_region_with_region_attr(HeapRegion* r) { diff --git a/src/hotspot/share/gc/g1/g1HeapRegionAttr.hpp b/src/hotspot/share/gc/g1/g1HeapRegionAttr.hpp index c385f82a3d5..7d2ab4f26ea 100644 --- a/src/hotspot/share/gc/g1/g1HeapRegionAttr.hpp +++ b/src/hotspot/share/gc/g1/g1HeapRegionAttr.hpp @@ -131,9 +131,11 @@ class G1HeapRegionAttrBiasedMappedArray : public G1BiasedMappedArrayset_new_survivor(); } - void set_humongous_candidate(uintptr_t index, bool remset_is_tracked) { + void set_humongous_candidate(uintptr_t index) { assert(get_by_index(index).is_default(), "Region attributes at index " INTPTR_FORMAT " should be default but is %s", index, get_by_index(index).get_type_str()); + // Humongous candidates must have complete remset. + const bool remset_is_tracked = true; set_by_index(index, G1HeapRegionAttr(G1HeapRegionAttr::HumongousCandidate, remset_is_tracked)); }