From 5ede5b47d4291a18acc16833978ded038332cf9c Mon Sep 17 00:00:00 2001 From: Thomas Schatzl Date: Thu, 21 Aug 2025 09:18:58 +0000 Subject: [PATCH] 8364650: G1: Use InvalidCSetIndex instead of UINT_MAX for "invalid" sentinel value of young_index_in_cset Reviewed-by: ayang, iwalulya --- src/hotspot/share/gc/g1/g1HeapRegion.cpp | 2 +- src/hotspot/share/gc/g1/g1HeapRegion.hpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/hotspot/share/gc/g1/g1HeapRegion.cpp b/src/hotspot/share/gc/g1/g1HeapRegion.cpp index 03610ab520b..86b22486517 100644 --- a/src/hotspot/share/gc/g1/g1HeapRegion.cpp +++ b/src/hotspot/share/gc/g1/g1HeapRegion.cpp @@ -245,7 +245,7 @@ G1HeapRegion::G1HeapRegion(uint hrm_index, _parsable_bottom(nullptr), _garbage_bytes(0), _incoming_refs(0), - _young_index_in_cset(-1), + _young_index_in_cset(InvalidCSetIndex), _surv_rate_group(nullptr), _age_index(G1SurvRateGroup::InvalidAgeIndex), _node_index(G1NUMA::UnknownNodeIndex), diff --git a/src/hotspot/share/gc/g1/g1HeapRegion.hpp b/src/hotspot/share/gc/g1/g1HeapRegion.hpp index 1962d3173b7..7d49633d0bc 100644 --- a/src/hotspot/share/gc/g1/g1HeapRegion.hpp +++ b/src/hotspot/share/gc/g1/g1HeapRegion.hpp @@ -496,10 +496,10 @@ public: void set_index_in_opt_cset(uint index) { _index_in_opt_cset = index; } void clear_index_in_opt_cset() { _index_in_opt_cset = InvalidCSetIndex; } - uint young_index_in_cset() const { return _young_index_in_cset; } + uint young_index_in_cset() const { return _young_index_in_cset; } void clear_young_index_in_cset() { _young_index_in_cset = 0; } void set_young_index_in_cset(uint index) { - assert(index != UINT_MAX, "just checking"); + assert(index != InvalidCSetIndex, "just checking"); assert(index != 0, "just checking"); assert(is_young(), "pre-condition"); _young_index_in_cset = index;