RFR: 8279910: G1: Simplify HeapRegionRemSet::add_reference

Albert Mingkun Yang ayang at openjdk.java.net
Mon Jan 17 14:50:32 UTC 2022


On Mon, 17 Jan 2022 14:31:41 GMT, Hamlin Li <mli at openjdk.org> wrote:

>> src/hotspot/share/gc/g1/heapRegionRemSet.inline.hpp line 126:
>> 
>>> 124: 
>>> 125: void HeapRegionRemSet::add_reference(OopOrNarrowOopStar from, uint tid) {
>>> 126:   assert(_state != Untracked, "must be");
>> 
>> I would prefer "precondition" in the assert msg.
>
> Thanks Albert for the suggestion, I kinda agree.
> But as the nearby code at line 122 uses "must be", so I will keep it for this case.

L122 is a general invariant while here is a precondition literally.

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

PR: https://git.openjdk.java.net/jdk/pull/7045



More information about the hotspot-gc-dev mailing list