RFR: 8279910: G1: Simplify HeapRegionRemSet::add_reference

Albert Mingkun Yang ayang at openjdk.java.net
Fri Jan 14 14:47:28 UTC 2022


On Wed, 12 Jan 2022 08:29:29 GMT, Hamlin Li <mli at openjdk.org> wrote:

> HeapRegionRemSet::add_reference checks "state == Untracked" and return if true; it's called at G1RebuildRemSetClosure::do_oop_work and G1ConcurrentRefineOopClosure::do_oop_work respectively.
> 
> The check in HeapRegionRemSet::add_reference could be replaced with an assert, and move the check up to one of the caller G1RebuildRemSetClosure::do_oop_work.

Marked as reviewed by ayang (Reviewer).

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.

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

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



More information about the hotspot-gc-dev mailing list