RFR: 8325643: G1: Refactor G1FlushHumongousCandidateRemSets

Kim Barrett kbarrett at openjdk.org
Wed Feb 14 15:05:05 UTC 2024


On Tue, 13 Feb 2024 09:22:59 GMT, Albert Mingkun Yang <ayang at openjdk.org> wrote:

>> src/hotspot/share/gc/g1/g1RemSet.cpp line 1196:
>> 
>>> 1194: 
>>> 1195:       assert(r->rem_set()->is_empty(), "must be empty after flushing");
>>> 1196:       assert(r->rem_set()->is_complete(), "should still be after flushing");
>> 
>> I think these asserts belong inside the if-not-empty body. Both have already
>> been checked already in the empty-case, and there's nothing to change them.
>> Only the flushing in the if-not-empty body could change them.
>
> The intention is to have them as postconditions for all humongous candidates, before exiting this method. I can add a `// Postcondition` there to make it explicit. Or, do you still prefer having them inside the if?

OK.  Such a comment would be helpful, at least to me.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/17808#discussion_r1489624939


More information about the hotspot-gc-dev mailing list