RFR: 8330145: Serial: Refactor SerialHeap::scan_evacuated_objs

Albert Mingkun Yang ayang at openjdk.org
Fri Apr 12 14:46:43 UTC 2024


On Fri, 12 Apr 2024 14:29:11 GMT, Guoxiong Li <gli at openjdk.org> wrote:

>> Both closures can advance `top`s in young/old gen. However, the postcondition of `oop_iterate_from` is all newly evacuated objs in the corresponding space are scanned.
>
> Ohh, I see. The old-gen is scaned finally, so the objects in old-gen are totally processed. But the to-space of the young-gen is firstly scaned, so we need to judge it.
> 
> What about `while (!young_gen()->no_allocs_since_save_marks())`? But it is OK now.

That should also work; identical asm I assume.

(The double negation (`!` and `no_`) makes it slightly less readable, so I went for this `break` approach.)

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

PR Review Comment: https://git.openjdk.org/jdk/pull/18750#discussion_r1562649802


More information about the hotspot-gc-dev mailing list