RFR: 8322296: Introduce CardWord for word iteration on CardTable
Thomas Schatzl
tschatzl at openjdk.org
Wed Dec 20 10:47:48 UTC 2023
On Mon, 18 Dec 2023 14:15:58 GMT, Albert Mingkun Yang <ayang at openjdk.org> wrote:
> Simple adding a new type for card-word in `CardTable` in order to avoid repeating the same logic/typedef in card based collectors.
Lgtm.
I noticed that the parallel gc card scanning does not use the word-based scan. Something for a different CR (if not just reusing the scanning for all collectors in some way).
src/hotspot/share/gc/shared/cardTable.hpp line 43:
> 41: STATIC_ASSERT(sizeof(CardValue) == 1);
> 42:
> 43: using CardWord = uintptr_t;
Not really convinced this is a good name, but I do not have a good alternative either right now.
src/hotspot/share/gc/shared/cardTable.hpp line 75:
> 73: };
> 74:
> 75: static const CardWord clean_card_word = (CardWord)(-1);
I would somewhat (not strongly) prefer if this constant explicitly constructed this value out of `clean_card` values. Or some static assert that the value is as expected.
Maybe this is not worth the effort though.
-------------
Marked as reviewed by tschatzl (Reviewer).
PR Review: https://git.openjdk.org/jdk/pull/17144#pullrequestreview-1790631152
PR Review Comment: https://git.openjdk.org/jdk/pull/17144#discussion_r1432552215
PR Review Comment: https://git.openjdk.org/jdk/pull/17144#discussion_r1432551332
More information about the hotspot-gc-dev
mailing list