RFR(M): 8195103: Refactor ReduceInitialCardMarks to not assume all GCs use card marks

Erik Österlund erik.osterlund at oracle.com
Tue Jan 16 09:42:06 UTC 2018


Hi,

The current interface between the compilers and GC regarding the 
ReduceInitialCardMarks optimization lives in the CollectedHeap. However, 
the optimization is relevant only for collectors with a card mark 
barrier set (CardTableModRefBS). Therefore, this interface ought to be 
moved into CardTableModRef so that code gets less messy when a collector 
does not use card marking. In the process, the 
CollectedHeap::pre_initialize member function was removed (as it was 
only used for initializing ReduceInitialCardMarks).

The optimization needs to check if an object is in young or not. This 
question is now asked to the barrier set rather than the heap. For all 
collectors except G1, this has been implemented by forwarding the 
question to the corresponding heap (inlined member function), which is 
what was done before. For G1, I chose to instead look at the card value 
and see if it is a young card, which should give the same answer.

Bug:
https://bugs.openjdk.java.net/browse/JDK-8195103

Webrev:
http://cr.openjdk.java.net/~eosterlund/8195103/webrev.00/

Testing: mach5 hs-tier1-5

Thanks,
/Erik


More information about the hotspot-compiler-dev mailing list