DO_DISCOVERED_AND_DISCOVERY handles non-strong refs that already-discovered (_discovered != null) but not "inactive" (still requires ref-processing).
However, that scenario can never occur.
stw-ref-processor mark all discovered refs inactive in STW-pause.
When conc-ref-processing is active, conc-ref-processor and stw-ref-processor work on objs belonging to young/old gen respectively. (Young regions or regions that are collection-candidates are in young-gen, and old-regions that are not collection-candidates are in old-gen.) After conc-ref-processing is complete, all discovered non-strong refs should be marked "inactive" insider the `remark` pause, not eligible for discovery any more.
Therefore, both ref-processors shouldn't see already-discovered and active refs.
However, that scenario can never occur.
stw-ref-processor mark all discovered refs inactive in STW-pause.
When conc-ref-processing is active, conc-ref-processor and stw-ref-processor work on objs belonging to young/old gen respectively. (Young regions or regions that are collection-candidates are in young-gen, and old-regions that are not collection-candidates are in old-gen.) After conc-ref-processing is complete, all discovered non-strong refs should be marked "inactive" insider the `remark` pause, not eligible for discovery any more.
Therefore, both ref-processors shouldn't see already-discovered and active refs.
- relates to
-
JDK-8138888 Remove ExtendedOopClosure::apply_to_weak_ref_discovered_field
- Resolved