RFR: 8244684: G1 abuses StarTask to also include partial objarray scan tasks

Kim Barrett kim.barrett at oracle.com
Mon May 11 18:11:29 UTC 2020


Please review this cleanup of the parallel task queue usage by G1 non-full
collections.  It currently uses queues with StarTask elements, except not
really.  The oop* case is extended via an additional tag to also cover
partial array scanning tasks.  This is accomplished by casting between oop
and oop* and using misaligned oop* values.

A pair of new classes is added to address this.  PartialArrayScanTask wraps
the source oop for a partial array scan.  ScannerTask is a discriminated
union of oop*, narrowOop*, and PartialArrayScan, using a 2bit low tag in the
relevant pointers.  This provides an easier to understand and safer API,
without any performance cost.

This change also updates related nomenclature; there were a lot of places
using "ref" / "reference" for these extended StarTasks, which isn't really
appropriate for the partial array tasks.  So we now use "task" consistently.

Followup RFEs should look at making a similar change to ParallelGC, which
does the same sort of thing.  And now that the support for this new task
type is in a shared place (rather than two private variants in G1 and
ParallelGC non-full collection classes) it might be worthwhile changing
other places to use ScannerTask queues rather than separate queues for
StarTasks and ObjArrayTasks.

CR:
https://bugs.openjdk.java.net/browse/JDK-8244684

Webrev:
https://cr.openjdk.java.net/~kbarrett/8244684/open.00/

Testing:
mach5 tier1-5





More information about the hotspot-gc-dev mailing list