RFR: 8325635: Serial: Inline verify_used_region_at_save_marks [v2]
Stefan Karlsson
stefank at openjdk.org
Mon Feb 12 14:09:53 UTC 2024
On Mon, 12 Feb 2024 13:26:16 GMT, Albert Mingkun Yang <ayang at openjdk.org> wrote:
>> Trivial signature update.
>
> Albert Mingkun Yang has updated the pull request incrementally with one additional commit since the last revision:
>
> review
Changes requested by stefank (Reviewer).
src/hotspot/share/gc/serial/cardTableRS.cpp line 46:
> 44: p2i(urasm.start()), p2i(urasm.end()), p2i(ur.start()), p2i(ur.end()));
> 45: }
> 46: #endif
Having the ASSERT blocks makes this code messier than it have to be, IMHO. I would prefer if this was changed to:
void CardTableRS::scan_old_to_young_refs(TenuredSpace* sp) {
const MemRegion ur = sp->used_region();
const MemRegion urasm = sp->used_region_at_save_marks();
assert(ur.contains(urasm),
"Did you forget to call save_marks()? "
"[" PTR_FORMAT ", " PTR_FORMAT ") is not contained in "
"[" PTR_FORMAT ", " PTR_FORMAT ")",
p2i(urasm.start()), p2i(urasm.end()), p2i(ur.start()), p2i(ur.end()));
if (!urasm.is_empty()) {
OldGenScanClosure cl(SerialHeap::heap()->young_gen());
non_clean_card_iterate(sp, urasm, &cl);
}
}
-------------
PR Review: https://git.openjdk.org/jdk/pull/17807#pullrequestreview-1875322869
PR Review Comment: https://git.openjdk.org/jdk/pull/17807#discussion_r1486232493
More information about the hotspot-gc-dev
mailing list