@@ -88,7 +88,7 @@ ReferenceProcessor::ReferenceProcessor(BoolObjectClosure* is_subject_to_discover
8888 uint mt_processing_degree,
8989 bool mt_discovery,
9090 uint mt_discovery_degree,
91- bool atomic_discovery ,
91+ bool concurrent_discovery ,
9292 BoolObjectClosure* is_alive_non_header) :
9393 _is_subject_to_discovery(is_subject_to_discovery),
9494 _discovering_refs(false ),
@@ -97,11 +97,11 @@ ReferenceProcessor::ReferenceProcessor(BoolObjectClosure* is_subject_to_discover
9797{
9898 assert (is_subject_to_discovery != NULL , " must be set" );
9999
100- _discovery_is_atomic = atomic_discovery ;
101- _discovery_is_mt = mt_discovery;
102- _num_queues = MAX2 (1U , mt_processing_degree);
103- _max_num_queues = MAX2 (_num_queues, mt_discovery_degree);
104- _discovered_refs = NEW_C_HEAP_ARRAY (DiscoveredList,
100+ _discovery_is_concurrent = concurrent_discovery ;
101+ _discovery_is_mt = mt_discovery;
102+ _num_queues = MAX2 (1U , mt_processing_degree);
103+ _max_num_queues = MAX2 (_num_queues, mt_discovery_degree);
104+ _discovered_refs = NEW_C_HEAP_ARRAY (DiscoveredList,
105105 _max_num_queues * number_of_subclasses_of_ref (), mtGC);
106106
107107 _discoveredSoftRefs = &_discovered_refs[0 ];
@@ -310,10 +310,10 @@ size_t ReferenceProcessor::process_discovered_list_work(DiscoveredList& refs_
310310 bool do_enqueue_and_clear) {
311311 DiscoveredListIterator iter (refs_list, keep_alive, is_alive);
312312 while (iter.has_next ()) {
313- iter.load_ptrs (DEBUG_ONLY (! discovery_is_atomic () /* allow_null_referent */ ));
313+ iter.load_ptrs (DEBUG_ONLY (discovery_is_concurrent () /* allow_null_referent */ ));
314314 if (iter.referent () == NULL ) {
315315 // Reference has been cleared since discovery; only possible if
316- // discovery is not atomic (checked by load_ptrs). Remove
316+ // discovery is concurrent (checked by load_ptrs). Remove
317317 // reference from list.
318318 log_dropped_ref (iter, " cleared" );
319319 iter.remove ();
@@ -866,7 +866,7 @@ inline bool ReferenceProcessor::set_discovered_link_st(HeapWord* discovered_addr
866866 oop next_discovered) {
867867 assert (!discovery_is_mt (), " must be" );
868868
869- if (discovery_is_atomic ()) {
869+ if (discovery_is_stw ()) {
870870 // Do a raw store here: the field will be visited later when processing
871871 // the discovered references.
872872 RawAccess<>::oop_store (discovered_addr, next_discovered);
@@ -883,7 +883,7 @@ inline bool ReferenceProcessor::set_discovered_link_mt(HeapWord* discovered_addr
883883
884884 // We must make sure this object is only enqueued once. Try to CAS into the discovered_addr.
885885 oop retest;
886- if (discovery_is_atomic ()) {
886+ if (discovery_is_stw ()) {
887887 // Try a raw store here, still making sure that we enqueue only once: the field
888888 // will be visited later when processing the discovered references.
889889 retest = RawAccess<>::oop_atomic_cmpxchg (discovered_addr, oop (NULL ), next_discovered);
@@ -894,16 +894,15 @@ inline bool ReferenceProcessor::set_discovered_link_mt(HeapWord* discovered_addr
894894}
895895
896896#ifndef PRODUCT
897- // Non-atomic (i.e. concurrent) discovery might allow us
898- // to observe j.l.References with NULL referents, being those
899- // cleared concurrently by mutators during (or after) discovery.
897+ // Concurrent discovery might allow us to observe j.l.References with NULL
898+ // referents, being those cleared concurrently by mutators during (or after) discovery.
900899void ReferenceProcessor::verify_referent (oop obj) {
901- bool da = discovery_is_atomic ();
900+ bool concurrent = discovery_is_concurrent ();
902901 oop referent = java_lang_ref_Reference::unknown_referent_no_keepalive (obj);
903- assert (da ? oopDesc::is_oop (referent) : oopDesc::is_oop_or_null (referent),
902+ assert (concurrent ? oopDesc::is_oop_or_null (referent) : oopDesc::is_oop (referent),
904903 " Bad referent " INTPTR_FORMAT " found in Reference "
905- INTPTR_FORMAT " during %satomic discovery " ,
906- p2i (referent), p2i (obj), da ? " " : " non-" );
904+ INTPTR_FORMAT " during %sconcurrent discovery " ,
905+ p2i (referent), p2i (obj), concurrent ? " " : " non-" );
907906}
908907#endif
909908
@@ -913,7 +912,7 @@ bool ReferenceProcessor::is_subject_to_discovery(oop const obj) const {
913912
914913// We mention two of several possible choices here:
915914// #0: if the reference object is not in the "originating generation"
916- // (or part of the heap being collected, indicated by our "span"
915+ // (or part of the heap being collected, indicated by our "span")
917916// we don't treat it specially (i.e. we scan it as we would
918917// a normal oop, treating its references as strong references).
919918// This means that references can't be discovered unless their
@@ -925,18 +924,18 @@ bool ReferenceProcessor::is_subject_to_discovery(oop const obj) const {
925924// the referent is in the generation (span) being currently collected
926925// then we can discover the reference object, provided
927926// the object has not already been discovered by
928- // a different concurrently running collector (as may be the
929- // case, for instance, if the reference object is in CMS and
930- // the referent in DefNewGeneration ), and provided the processing
927+ // a different concurrently running discoverer (as may be the
928+ // case, for instance, if the reference object is in G1 old gen and
929+ // the referent in G1 young gen ), and provided the processing
931930// of this reference object by the current collector will
932- // appear atomic to every other collector in the system.
933- // (Thus, for instance, a concurrent collector may not
931+ // appear atomically to every other discoverer in the system.
932+ // (Thus, for instance, a concurrent discoverer may not
934933// discover references in other generations even if the
935934// referent is in its own generation). This policy may,
936935// in certain cases, enqueue references somewhat sooner than
937936// might Policy #0 above, but at marginally increased cost
938937// and complexity in processing these references.
939- // We call this choice the "RefeferentBasedDiscovery " policy.
938+ // We call this choice the "ReferentBasedDiscovery " policy.
940939bool ReferenceProcessor::discover_reference (oop obj, ReferenceType rt) {
941940 // Make sure we are discovering refs (rather than processing discovered refs).
942941 if (!_discovering_refs || !RegisterReferences) {
@@ -1007,9 +1006,9 @@ bool ReferenceProcessor::discover_reference(oop obj, ReferenceType rt) {
10071006 verify_referent (obj);
10081007 // Discover if and only if EITHER:
10091008 // .. reference is in our span, OR
1010- // .. we are an atomic collector and referent is in our span
1009+ // .. we are a stw discoverer and referent is in our span
10111010 if (is_subject_to_discovery (obj) ||
1012- (discovery_is_atomic () &&
1011+ (discovery_is_stw () &&
10131012 is_subject_to_discovery (java_lang_ref_Reference::unknown_referent_no_keepalive (obj)))) {
10141013 } else {
10151014 return false ;
0 commit comments