@@ -923,52 +923,30 @@ class G1CollectedHeap : public CollectedHeap {
923923
924924 // ("Weak") Reference processing support.
925925 //
926- // G1 has 2 instances of the reference processor class. One
927- // (_ref_processor_cm) handles reference object discovery
928- // and subsequent processing during concurrent marking cycles.
926+ // G1 has 2 instances of the reference processor class.
929927 //
930- // The other (_ref_processor_stw ) handles reference object
931- // discovery and processing during full GCs and incremental
932- // evacuation pauses .
928+ // One (_ref_processor_cm ) handles reference object discovery and subsequent
929+ // processing during concurrent marking cycles. Discovery is enabled/disabled
930+ // at the start/end of a concurrent marking cycle .
933931 //
934- // During an incremental pause, reference discovery will be
935- // temporarily disabled for _ref_processor_cm and will be
936- // enabled for _ref_processor_stw. At the end of the evacuation
937- // pause references discovered by _ref_processor_stw will be
938- // processed and discovery will be disabled. The previous
939- // setting for reference object discovery for _ref_processor_cm
940- // will be re-instated.
932+ // The other (_ref_processor_stw) handles reference object discovery and
933+ // processing during incremental evacuation pauses and full GC pauses.
941934 //
942- // At the start of marking:
943- // * Discovery by the CM ref processor is verified to be inactive
944- // and it's discovered lists are empty.
945- // * Discovery by the CM ref processor is then enabled.
935+ // ## Incremental evacuation pauses
946936 //
947- // At the end of marking:
948- // * Any references on the CM ref processor's discovered
949- // lists are processed (possibly MT).
937+ // STW ref processor discovery is enabled/disabled at the start/end of an
938+ // incremental evacuation pause. No particular handling of the CM ref
939+ // processor is needed, apart from treating the discovered references as
940+ // roots; CM discovery does not need to be temporarily disabled as all
941+ // marking threads are paused during incremental evacuation pauses.
950942 //
951- // At the start of full GC we:
952- // * Disable discovery by the CM ref processor and
953- // empty CM ref processor's discovered lists
954- // (without processing any entries).
955- // * Verify that the STW ref processor is inactive and it's
956- // discovered lists are empty.
957- // * Temporarily set STW ref processor discovery as single threaded.
958- // * Temporarily clear the STW ref processor's _is_alive_non_header
959- // field.
960- // * Finally enable discovery by the STW ref processor.
943+ // ## Full GC pauses
961944 //
962- // The STW ref processor is used to record any discovered
963- // references during the full GC.
964- //
965- // At the end of a full GC we:
966- // * Enqueue any reference objects discovered by the STW ref processor
967- // that have non-live referents. This has the side-effect of
968- // making the STW ref processor inactive by disabling discovery.
969- // * Verify that the CM ref processor is still inactive
970- // and no references have been placed on it's discovered
971- // lists (also checked as a precondition during concurrent start).
945+ // We abort any ongoing concurrent marking cycle, disable CM discovery, and
946+ // temporarily substitute a new closure for the STW ref processor's
947+ // _is_alive_non_header field (old value is restored after the full GC). Then
948+ // STW ref processor discovery is enabled, and marking & compaction
949+ // commences.
972950
973951 // The (stw) reference processor...
974952 ReferenceProcessor* _ref_processor_stw;
0 commit comments