RFR: 8330145: Serial: Refactor SerialHeap::scan_evacuated_objs

Guoxiong Li gli at openjdk.org
Fri Apr 12 14:31:41 UTC 2024


On Fri, 12 Apr 2024 14:09:17 GMT, Albert Mingkun Yang <ayang at openjdk.org> wrote:

>> Both new-gen `YoungGenScanClosure` and old -gen `OldGenScanClosure` use the methods `ScavengeHelper::try_scavenge` and `DefNewGeneration::copy_to_survivor_space` to evacuate objects. The `DefNewGeneration::copy_to_survivor_space` may promote objects to old-gen. Do I miss anything or misunderstand it?
>
> 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.

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

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


More information about the hotspot-gc-dev mailing list