RFR: 8330145: Serial: Refactor SerialHeap::scan_evacuated_objs

Albert Mingkun Yang ayang at openjdk.org
Fri Apr 12 14:11:42 UTC 2024


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

>> The old-gen-iteration should have ensured no alloc in old-gen, so only young-gen requires rechecking.
>
> 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.

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

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


More information about the hotspot-gc-dev mailing list