RFR: 8377658: G1: Cleanup g1ConcurrentMark.cpp for stricter warning flags

Stefan Karlsson stefank at openjdk.org
Fri Feb 13 14:15:05 UTC 2026


On Fri, 13 Feb 2026 13:58:54 GMT, Leo Korinth <lkorinth at openjdk.org> wrote:

>> src/hotspot/share/oops/constantPool.hpp line 558:
>> 
>>> 556:     BSMAttributeEntry* bsme = bsm_attribute_entry(bsmai);
>>> 557:     assert(j < bsme->argument_count(), "oob");
>>> 558:     return bsm_attribute_entry(bsmai)->argument(static_cast<u2>(j));
>> 
>> It is unclear if this is the right change or if the `j` should be changed to `u2` and the call sites fixed.
>
> In some way, I guess the call sites should be fixed. In other ways I feel that this is a perfect place to stop. By stopping here I can reason using the above assert that `j` is indeed a `u2` (as the type of `bsme->argument_count()` is a u2). If I change the type of `j` I do not know where to stop. I think it would be better with a checked_cast though.
> 
> If you want me to continue following the u2 type, you kind of also need to tell me where to stop. After looking at this again, I still come to the conclusion that this is probably a good place to stop.

I'm leaving that decision to you and the maintainers of this code.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/29701#discussion_r2804421962


More information about the hotspot-dev mailing list