RFR: 8253303 G1: Move static initialization of G1FromCardCache to a proper location

Stefan Johansson sjohanss at openjdk.java.net
Fri Sep 18 20:09:12 UTC 2020


On Fri, 18 Sep 2020 11:17:08 GMT, Thomas Schatzl <tschatzl at openjdk.org> wrote:

> in src/hotspot/share/gc/g1/g1RemSet.cpp:
> 
>  488 void G1RemSet::initialize(uint max_reserved_regions) {
>  489 G1FromCardCache::initialize(num_par_rem_sets(), max_reserved_regions);
>  490 _scan_state->initialize(max_reserved_regions);
>  491 }
> 
> the static initialization is piggy-backed to G1RemSet instance initialization which is rather bad style. Fortunately
> there is only one G1RemSet instance and that method is only called once so no functional issue.
> This change moves the initialization call, and after a bit of analysis move some more related code to more appropriate
> places.
> Testing: local compilation, jtreg gc/g1, tier1-3 passed

Nice cleanup Thomas, consider it approved.

Just one minor thing before integrating.

src/hotspot/share/gc/g1/g1CollectedHeap.cpp line 1690:

> 1688:   _rem_set->initialize(max_reserved_regions());
> 1689:
> 1690:

Please remove this additional line before integrating, unless you added it for good reason :)

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

Marked as reviewed by sjohanss (Reviewer).

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



More information about the hotspot-gc-dev mailing list