RFR: 8325643: G1: Refactor G1FlushHumongousCandidateRemSets

Albert Mingkun Yang ayang at openjdk.org
Tue Feb 13 09:25:58 UTC 2024


On Mon, 12 Feb 2024 19:02:40 GMT, Kim Barrett <kbarrett at openjdk.org> wrote:

>> Simple refactoring to ensure both paths are checked regarding remset status.
>
> 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?

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

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


More information about the hotspot-gc-dev mailing list