RFR: 8203028: Simplify reference processing in light of JDK-8175797

Kim Barrett kim.barrett at oracle.com
Mon May 14 01:32:47 UTC 2018

Please review this simplification of reference processing, taking
advantage of the changes made by JDK-8175797, which made
Reference.enqueue() ensure the referent was cleared before adding the
reference to the queue.

GC scanning of Reference objects no longer treats the next field as
special; it is just an ordinary object field. It didn't need to be
treated specially before, but because it was often examined for other
reasons it was potentially more efficient or convenient to do so. That
rationale no longer holds, because it is now only involved in
determining whether FinalReferences are active.

Various additional simplifications in the core of reference
processing, eliminating the use of the next field except when dealing
with FinalReferences.  In particular, most of the phase2 difference
between STW and concurrent collectors has been eliminated, since we
no longer need to deal with a concurrently enqueued reference that
retains its (live) referent.

Rewrote internal comment describing states for java.lang.ref.Reference.



Mach5 jdk-tier1-4, hs-tier1-7

More information about the hotspot-gc-dev mailing list