8366688: G1: Rename G1HeapRegionRemSet::is_added_to_cset_group() to has_cset_group()

Reviewed-by: ayang, iwalulya
This commit is contained in:
Thomas Schatzl 2025-09-04 07:03:28 +00:00
parent 49fd6a0cb4
commit 222ae365c8
8 changed files with 18 additions and 18 deletions

View File

@ -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

View File

@ -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);

View File

@ -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();
}

View File

@ -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();
}

View File

@ -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<mtGC> {
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();
}

View File

@ -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");

View File

@ -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();

View File

@ -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();