comparison src/share/vm/memory/genCollectedHeap.cpp @ 3979:4dfb2df418f2

6484982: G1: process references during evacuation pauses Summary: G1 now uses two reference processors - one is used by concurrent marking and the other is used by STW GCs (both full and incremental evacuation pauses). In an evacuation pause, the reference processor is embedded into the closures used to scan objects. Doing so causes causes reference objects to be 'discovered' by the reference processor. At the end of the evacuation pause, these discovered reference objects are processed - preserving (and copying) referent objects (and their reachable graphs) as appropriate. Reviewed-by: ysr, jwilhelm, brutisso, stefank, tonyp
author johnc
date Thu, 22 Sep 2011 10:57:37 -0700
parents c2bf0120ee5d
children 53074c2c4600
comparison
equal deleted inserted replaced
3978:f0ecbe78fc7b 3979:4dfb2df418f2
597 ReferenceProcessor* rp = _gens[i]->ref_processor(); 597 ReferenceProcessor* rp = _gens[i]->ref_processor();
598 // If the discovery of ("weak") refs in this generation is 598 // If the discovery of ("weak") refs in this generation is
599 // atomic wrt other collectors in this configuration, we 599 // atomic wrt other collectors in this configuration, we
600 // are guaranteed to have empty discovered ref lists. 600 // are guaranteed to have empty discovered ref lists.
601 if (rp->discovery_is_atomic()) { 601 if (rp->discovery_is_atomic()) {
602 rp->verify_no_references_recorded(); 602 rp->enable_discovery(true /*verify_disabled*/, true /*verify_no_refs*/);
603 rp->enable_discovery();
604 rp->setup_policy(do_clear_all_soft_refs); 603 rp->setup_policy(do_clear_all_soft_refs);
605 } else { 604 } else {
606 // collect() below will enable discovery as appropriate 605 // collect() below will enable discovery as appropriate
607 } 606 }
608 _gens[i]->collect(full, do_clear_all_soft_refs, size, is_tlab); 607 _gens[i]->collect(full, do_clear_all_soft_refs, size, is_tlab);