RFR: 8300127: Serial: Remove unnecessary from-space iteration in DefNewGeneration::oop_since_save_marks_iterate [v2]
Y. Srinivas Ramakrishna
ysr at openjdk.org
Wed Jan 25 21:08:31 UTC 2023
On Wed, 25 Jan 2023 20:12:04 GMT, Albert Mingkun Yang <ayang at openjdk.org> wrote:
>> Converting no-ops to assertions in young-gen obj iteration.
>>
>> Test: hotspot_gc
>
> Albert Mingkun Yang has updated the pull request incrementally with one additional commit since the last revision:
>
> review
LGTM.
src/hotspot/share/gc/serial/defNewGeneration.inline.hpp line 96:
> 94: // No allocation in eden and from spaces, so no iteration required.
> 95: assert(eden()->saved_mark_at_top(), "inv");
> 96: assert(from()->saved_mark_at_top(), "inv");
Instead of "inv", you could say "No allocation expected in {Eden|From}" (repsectivley).
Glad the assertions were added.
I can't imagine that this would make much of a difference in performance since the calls to eden and from's oop_since_save_marks_iterate would return immediately without doing any work, but I agree it's good to have the assertions as a check against unintended behavior.
-------------
Marked as reviewed by ysr (Reviewer).
PR: https://git.openjdk.org/jdk/pull/11995
More information about the hotspot-gc-dev
mailing list