On Fri, 12 Dec 2025 09:51:51 GMT, Stefan Johansson <[email protected]> wrote:
>> src/hotspot/share/gc/parallel/psParallelCompact.cpp line 2279: >> >>> 2277: markWord mark = safe_mark_prototype(cur_addr, remaining_words); >>> 2278: >>> 2279: closure.do_addr(cur_addr, obj_size, mark); >> >> The fact that `do_addr` calls a function named `words_remaining()` and the >> current code calculates a `remaining_words` feels a bit messy and it's not >> immediately obvious that this is correct. Is there a reason why this can't >> be handled from withing the `do_addr` function? > > Yes, I agree, we overlooked that we had that information inside `do_addr`. The remaining_words here are the remaining words in the "from"/"source" region, while the `words_remaining()` inside `do_addr` are the words remaining in the "to"/"destination" region. We could rename remaining_words to something like `from_words_remaining`? The reason we can't handle this in `do_addr` is because obj_size can be larger than the words we have remaining in the from region. ------------- PR Review Comment: https://git.openjdk.org/valhalla/pull/1785#discussion_r2613611071
