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

Thomas Schatzl thomas.schatzl at oracle.com
Mon Sep 21 09:43:37 UTC 2020


Hi Stefan, Albert,

   thanks for your reviews.

On 18.09.20 22:09, Stefan Johansson wrote:
> 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 :)
> 
> -------------

Done. Waiting a bit to push.

Thanks,
   Thomas



More information about the hotspot-gc-dev mailing list