RFR: 8330145: Serial: Refactor SerialHeap::scan_evacuated_objs

Albert Mingkun Yang ayang at openjdk.org
Thu Apr 18 08:52:59 UTC 2024


On Thu, 18 Apr 2024 08:25:53 GMT, Thomas Schatzl <tschatzl at openjdk.org> wrote:

>> Simple refactoring to extract oop-scanning logic from generation.
>
> src/hotspot/share/gc/serial/serialHeap.cpp line 793:
> 
>> 791:       oop_iterate_from(old_cl, old_gen()->space(), saved_top);
>> 792:       old_gen()->set_saved_mark_word();
>> 793:     }
> 
> I am really not sure this inlining makes the code more readable. The old code had a nice structure that showed exactly what it has been doing without going too much into detail. Maybe the naming wasn't obvious, but although now obviously this code does the same, the overview is lost imo.

The new code places accesses to saved-mark-word and iteration on the same level, also makes it obvious that one doesn't need to redundant `no_allocs_since_save_marks` call on old-gen.

What "overview" do you think is lost?

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

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


More information about the hotspot-gc-dev mailing list