8208611: Refactor SATBMarkQueue filtering to allow GC-specific filters
Kim Barrett
kim.barrett at oracle.com
Tue Jul 31 23:07:02 UTC 2018
Please review this change to the implementation of SATB mark queue
filtering to permit a GC-specific filter to be provided. This is a
preliminary step toward being able to share (most of) the SATB mark
queue code between G1 and Shenandoah.
We introduce a new abstract class, SATBMarkQueueFilter, which is
responsible for filtering a queue. A SATBMarkQueueSet contains the
filter object, which is constructed and installed by the GC-specific
initialization of the qset.
The former filter function has been changed to be a function template,
with a function argument that provides the filter-out / retain
decision. The GC-specific filter object calls that template with an
appropriate function for the GC.
For G1, it all gets nicely inlined (with gcc; I haven't looked at the
generated code for other compilers), so the only overhead for this
refactoring is the replacement of a (possibly inlined, but probably
not) ordinary function call with a virtual function call per buffer
completion.
CR:
https://bugs.openjdk.java.net/browse/JDK-8208611
Webrev:
http://cr.openjdk.java.net/~kbarrett/8208611/open.00/
Testing:
mach5 tier1-3, hs-tier4-5.
More information about the hotspot-gc-dev
mailing list