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

William Kemper wkemper at openjdk.org
Thu Sep 25 23:59:22 UTC 2025


On Wed, 24 Sep 2025 21:31:24 GMT, Kelvin Nilsen <kdnilsen at openjdk.org> wrote:

> Check for weak bit or strong bit when giving special handling to the next bit found in first position of word.

Changes requested by wkemper (Reviewer).

src/hotspot/share/gc/shenandoah/shenandoahMarkBitMap.inline.hpp line 138:

> 136:     idx_t index = to_words_align_down(l_index);
> 137:     bm_word_t cword = (map(index) ^ flip) >> bit_in_word(l_index);
> 138:     if ((cword & 0x03) != 0) {

Can we update the comment below to indicate that we are checking the first two bits because of strong and weak marking? 

Is there a risk here that dependents of this method will now start treating objects that are only weakly reachable as alive? Or does this fix a bug that caused us to miss such objects?

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

PR Review: https://git.openjdk.org/jdk/pull/27476#pullrequestreview-3269751140
PR Review Comment: https://git.openjdk.org/jdk/pull/27476#discussion_r2380554607


More information about the hotspot-gc-dev mailing list