diff --git a/src/hotspot/share/gc/g1/g1CardSet.cpp b/src/hotspot/share/gc/g1/g1CardSet.cpp index 5286a764996..f5b9bf2aebe 100644 --- a/src/hotspot/share/gc/g1/g1CardSet.cpp +++ b/src/hotspot/share/gc/g1/g1CardSet.cpp @@ -783,7 +783,7 @@ G1AddCardResult G1CardSet::add_card(uintptr_t card) { { uint region_idx = card_region >> config()->log2_card_regions_per_heap_region(); G1HeapRegion* r = G1CollectedHeap::heap()->region_at(region_idx); - assert(!r->rem_set()->is_added_to_cset_group() || + assert(!r->rem_set()->has_cset_group() || r->rem_set()->cset_group()->card_set() != this, "Should not be sharing a cardset"); } #endif diff --git a/src/hotspot/share/gc/g1/g1CollectionSet.cpp b/src/hotspot/share/gc/g1/g1CollectionSet.cpp index 1e836e3efa2..2e10412cebf 100644 --- a/src/hotspot/share/gc/g1/g1CollectionSet.cpp +++ b/src/hotspot/share/gc/g1/g1CollectionSet.cpp @@ -115,7 +115,7 @@ void G1CollectionSet::add_old_region(G1HeapRegion* hr) { "Precondition, actively building cset or adding optional later on"); assert(hr->is_old(), "the region should be old"); - assert(!hr->rem_set()->is_added_to_cset_group(), "Should have already uninstalled group remset"); + assert(!hr->rem_set()->has_cset_group(), "Should have already uninstalled group remset"); assert(!hr->in_collection_set(), "should not already be in the collection set"); _g1h->register_old_region_with_region_attr(hr); diff --git a/src/hotspot/share/gc/g1/g1ConcurrentMark.cpp b/src/hotspot/share/gc/g1/g1ConcurrentMark.cpp index f37ede6940e..5e42bf71882 100644 --- a/src/hotspot/share/gc/g1/g1ConcurrentMark.cpp +++ b/src/hotspot/share/gc/g1/g1ConcurrentMark.cpp @@ -3054,7 +3054,7 @@ bool G1PrintRegionLivenessInfoClosure::do_heap_region(G1HeapRegion* r) { const char* remset_type = r->rem_set()->get_short_state_str(); uint cset_group_id = 0; - if (r->rem_set()->is_added_to_cset_group()) { + if (r->rem_set()->has_cset_group()) { cset_group_id = r->rem_set()->cset_group_id(); } diff --git a/src/hotspot/share/gc/g1/g1HeapRegionRemSet.cpp b/src/hotspot/share/gc/g1/g1HeapRegionRemSet.cpp index 7852bb7e8e3..b05a60234e2 100644 --- a/src/hotspot/share/gc/g1/g1HeapRegionRemSet.cpp +++ b/src/hotspot/share/gc/g1/g1HeapRegionRemSet.cpp @@ -63,7 +63,7 @@ G1HeapRegionRemSet::G1HeapRegionRemSet(G1HeapRegion* hr) : _state(Untracked) { } G1HeapRegionRemSet::~G1HeapRegionRemSet() { - assert(!is_added_to_cset_group(), "Still assigned to a CSet group"); + assert(!has_cset_group(), "Still assigned to a CSet group"); } void G1HeapRegionRemSet::clear_fcc() { @@ -76,7 +76,7 @@ void G1HeapRegionRemSet::clear(bool only_cardset, bool keep_tracked) { } clear_fcc(); - if (is_added_to_cset_group()) { + if (has_cset_group()) { card_set()->clear(); assert(card_set()->occupied() == 0, "Should be clear."); } @@ -90,13 +90,13 @@ void G1HeapRegionRemSet::clear(bool only_cardset, bool keep_tracked) { void G1HeapRegionRemSet::reset_table_scanner() { _code_roots.reset_table_scanner(); - if (is_added_to_cset_group()) { + if (has_cset_group()) { card_set()->reset_table_scanner(); } } G1MonotonicArenaMemoryStats G1HeapRegionRemSet::card_set_memory_stats() const { - assert(is_added_to_cset_group(), "pre-condition"); + assert(has_cset_group(), "pre-condition"); return cset_group()->card_set_memory_stats(); } diff --git a/src/hotspot/share/gc/g1/g1HeapRegionRemSet.hpp b/src/hotspot/share/gc/g1/g1HeapRegionRemSet.hpp index d2d502636fa..32008f7f20d 100644 --- a/src/hotspot/share/gc/g1/g1HeapRegionRemSet.hpp +++ b/src/hotspot/share/gc/g1/g1HeapRegionRemSet.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2025, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -57,12 +57,12 @@ class G1HeapRegionRemSet : public CHeapObj { void clear_fcc(); G1CardSet* card_set() { - assert(is_added_to_cset_group(), "pre-condition"); + assert(has_cset_group(), "pre-condition"); return cset_group()->card_set(); } const G1CardSet* card_set() const { - assert(is_added_to_cset_group(), "pre-condition"); + assert(has_cset_group(), "pre-condition"); return cset_group()->card_set(); } @@ -71,7 +71,7 @@ public: ~G1HeapRegionRemSet(); bool cardset_is_empty() const { - return !is_added_to_cset_group() || card_set()->is_empty(); + return !has_cset_group() || card_set()->is_empty(); } void install_cset_group(G1CSetCandidateGroup* cset_group) { @@ -83,7 +83,7 @@ public: void uninstall_cset_group(); - bool is_added_to_cset_group() const { + bool has_cset_group() const { return _cset_group != nullptr; } @@ -96,7 +96,7 @@ public: } uint cset_group_id() const { - assert(is_added_to_cset_group(), "pre-condition"); + assert(has_cset_group(), "pre-condition"); return cset_group()->group_id(); } @@ -118,7 +118,7 @@ public: inline static void iterate_for_merge(G1CardSet* card_set, CardOrRangeVisitor& cl); size_t occupied() { - assert(is_added_to_cset_group(), "pre-condition"); + assert(has_cset_group(), "pre-condition"); return card_set()->occupied(); } diff --git a/src/hotspot/share/gc/g1/g1HeapRegionRemSet.inline.hpp b/src/hotspot/share/gc/g1/g1HeapRegionRemSet.inline.hpp index 428586e160a..ff927959289 100644 --- a/src/hotspot/share/gc/g1/g1HeapRegionRemSet.inline.hpp +++ b/src/hotspot/share/gc/g1/g1HeapRegionRemSet.inline.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2025, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -125,7 +125,7 @@ uintptr_t G1HeapRegionRemSet::to_card(OopOrNarrowOopStar from) const { } void G1HeapRegionRemSet::add_reference(OopOrNarrowOopStar from, uint tid) { - assert(is_added_to_cset_group(), "pre-condition"); + assert(has_cset_group(), "pre-condition"); assert(_state != Untracked, "must be"); diff --git a/src/hotspot/share/gc/g1/g1RemSetSummary.cpp b/src/hotspot/share/gc/g1/g1RemSetSummary.cpp index cf032bc5d17..49cc993dac2 100644 --- a/src/hotspot/share/gc/g1/g1RemSetSummary.cpp +++ b/src/hotspot/share/gc/g1/g1RemSetSummary.cpp @@ -228,7 +228,7 @@ public: // Accumulate card set details for regions that are assigned to single region // groups. G1HeapRegionRemSet::mem_size() includes the size of the code roots - if (hrrs->is_added_to_cset_group() && hrrs->cset_group()->length() == 1) { + if (hrrs->has_cset_group() && hrrs->cset_group()->length() == 1) { G1CardSet* card_set = hrrs->cset_group()->card_set(); rs_mem_sz = hrrs->mem_size() + card_set->mem_size(); diff --git a/src/hotspot/share/gc/g1/g1RemSetTrackingPolicy.cpp b/src/hotspot/share/gc/g1/g1RemSetTrackingPolicy.cpp index a5c8882e057..7b8d92b8fe4 100644 --- a/src/hotspot/share/gc/g1/g1RemSetTrackingPolicy.cpp +++ b/src/hotspot/share/gc/g1/g1RemSetTrackingPolicy.cpp @@ -108,7 +108,7 @@ void G1RemSetTrackingPolicy::update_after_rebuild(G1HeapRegion* r) { size_t remset_bytes = r->rem_set()->mem_size(); size_t occupied = 0; // per region cardset details only valid if group contains a single region. - if (r->rem_set()->is_added_to_cset_group() && + if (r->rem_set()->has_cset_group() && r->rem_set()->cset_group()->length() == 1 ) { G1CardSet *card_set = r->rem_set()->cset_group()->card_set(); remset_bytes += card_set->mem_size();