RFR: 8368307: Shenandoah: get_next_bit_impl should special case weak and strong mark bits [v2]

William Kemper wkemper at openjdk.org
Fri Sep 26 15:13:57 UTC 2025


On Fri, 26 Sep 2025 08:33:24 GMT, Kelvin Nilsen <kdnilsen at openjdk.org> wrote:

>> This does not fix a correctness issue.  This represents a "special" case optimization.
>> 
>> Basically, if either the first weak-mark or first strong-mark bits are set, we want to take this fast path to the return statement.  The code is not wrong if we fail to take this fast path.  It is simply less efficient.
>> 
>> I noticed that the intent of this function is to return the index of the next set bit, regardless of whether it is a weak-mark bit or a strong-mark bit, when I was writing a unit test for this function as part of https://github.com/openjdk/jdk/pull/27353.
>> 
>> In that PR, we introduce a new function complementary function, get_last_bit_impl(), and we use the 0x03 search pattern in that code.  So this fix mirrors the behavior of the new function.
>
> I'll fix this comment.

Got i t, thank you!

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

PR Review Comment: https://git.openjdk.org/jdk/pull/27476#discussion_r2382711211


More information about the hotspot-gc-dev mailing list