RFR: 8330145: Serial: Refactor SerialHeap::scan_evacuated_objs [v2]

Thomas Schatzl tschatzl at openjdk.org
Mon Apr 22 09:51:31 UTC 2024


On Thu, 18 Apr 2024 17:02:14 GMT, Albert Mingkun Yang <ayang at openjdk.org> wrote:

>> Simple refactoring to extract oop-scanning logic from generation.
>
> Albert Mingkun Yang has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains four additional commits since the last revision:
> 
>  - Merge branch 'master' into s1-scan-evac-obj
>  - review
>  - Merge branch 'master' into s1-scan-evac-obj
>  - s1-scan-evac-obj

Changes requested by tschatzl (Reviewer).

src/hotspot/share/gc/serial/serialHeap.cpp line 782:

> 780:     oop_iterate_from(young_cl, young_gen()->to(), &_young_gen_saved_top);
> 781:     oop_iterate_from(old_cl, old_gen()->space(), &_old_gen_saved_top);
> 782:   } while (_young_gen_saved_top != young_gen()->to()->top());

Shouldn't this condition also consider changes to `_old_gen_saved_top`?

If an iteration only moves to the old gen (e.g. to-space is full, or just all objects are of the appropriate age), these newly copied objects ought to also be scanned again. Or is there a reason that this is not necessary?

Also the statement `young_gen()->to()` could be factored out into a local to remove one indirection level in the loop.

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

PR Review: https://git.openjdk.org/jdk/pull/18750#pullrequestreview-2014286220
PR Review Comment: https://git.openjdk.org/jdk/pull/18750#discussion_r1574459926


More information about the hotspot-gc-dev mailing list