RFR: 8367743: G1: Use named constants for G1CSetCandidateGroup group ids

Albert Mingkun Yang ayang at openjdk.org
Tue Sep 16 12:11:22 UTC 2025


On Tue, 16 Sep 2025 10:04:52 GMT, Thomas Schatzl <tschatzl at openjdk.org> wrote:

> Hi all,
> 
>   please review this refactoring to use named constants for cset candidate group ids instead of raw integers.
> 
> Testing: gha, local compilation, use in another patch for weeks
> 
> Thanks,
>   Thomas

src/hotspot/share/gc/g1/g1ConcurrentMark.cpp line 3055:

> 3053:   size_t code_roots_bytes = r->rem_set()->code_roots_mem_size();
> 3054:   const char* remset_type = r->rem_set()->get_short_state_str();
> 3055:   uint cset_group_id     = G1CSetCandidateGroup::NoRemSetId;

I suggest rewriting the following lines to sth like:


uint id;
if (has_remset) {
  id = 
} else {
  id = no_remset_id;
}

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/27309#discussion_r2352260477


More information about the hotspot-gc-dev mailing list