hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.cpp
changeset 28212 647b7d0efb88
parent 28033 ab63acbd99ec
child 28214 0b2894b5e67c
equal deleted inserted replaced
28211:f3a2bc065255 28212:647b7d0efb88
  1606 
  1606 
  1607   set_did_compact(true);
  1607   set_did_compact(true);
  1608 
  1608 
  1609   // If the collection is being acquired from the background
  1609   // If the collection is being acquired from the background
  1610   // collector, there may be references on the discovered
  1610   // collector, there may be references on the discovered
  1611   // references lists that have NULL referents (being those
  1611   // references lists.  Abandon those references, since some
  1612   // that were concurrently cleared by a mutator) or
  1612   // of them may have become unreachable after concurrent
  1613   // that are no longer active (having been enqueued concurrently
  1613   // discovery; the STW compacting collector will redo discovery
  1614   // by the mutator).
  1614   // more precisely, without being subject to floating garbage.
  1615   // Scrub the list of those references because Mark-Sweep-Compact
  1615   // Leaving otherwise unreachable references in the discovered
  1616   // code assumes referents are not NULL and that all discovered
  1616   // lists would require special handling.
  1617   // Reference objects are active.
  1617   ref_processor()->disable_discovery();
  1618   ref_processor()->clean_up_discovered_references();
  1618   ref_processor()->abandon_partial_discovery();
       
  1619   ref_processor()->verify_no_references_recorded();
  1619 
  1620 
  1620   if (first_state > Idling) {
  1621   if (first_state > Idling) {
  1621     save_heap_summary();
  1622     save_heap_summary();
  1622   }
  1623   }
  1623 
  1624 
  1679   ReferenceProcessorAtomicMutator rp_mut_atomic(ref_processor(), true);
  1680   ReferenceProcessorAtomicMutator rp_mut_atomic(ref_processor(), true);
  1680   // Temporarily make reference _discovery_ single threaded (non-MT)
  1681   // Temporarily make reference _discovery_ single threaded (non-MT)
  1681   ReferenceProcessorMTDiscoveryMutator rp_mut_discovery(ref_processor(), false);
  1682   ReferenceProcessorMTDiscoveryMutator rp_mut_discovery(ref_processor(), false);
  1682 
  1683 
  1683   ref_processor()->set_enqueuing_is_done(false);
  1684   ref_processor()->set_enqueuing_is_done(false);
  1684   ref_processor()->enable_discovery(false /*verify_disabled*/, false /*check_no_refs*/);
  1685   ref_processor()->enable_discovery();
  1685   ref_processor()->setup_policy(clear_all_soft_refs);
  1686   ref_processor()->setup_policy(clear_all_soft_refs);
  1686   // If an asynchronous collection finishes, the _modUnionTable is
  1687   // If an asynchronous collection finishes, the _modUnionTable is
  1687   // all clear.  If we are assuming the collection from an asynchronous
  1688   // all clear.  If we are assuming the collection from an asynchronous
  1688   // collection, clear the _modUnionTable.
  1689   // collection, clear the _modUnionTable.
  1689   assert(_collectorState != Idling || _modUnionTable.isAllClear(),
  1690   assert(_collectorState != Idling || _modUnionTable.isAllClear(),
  2996     // acquire locks for subsequent manipulations
  2997     // acquire locks for subsequent manipulations
  2997     MutexLockerEx x(bitMapLock(),
  2998     MutexLockerEx x(bitMapLock(),
  2998                     Mutex::_no_safepoint_check_flag);
  2999                     Mutex::_no_safepoint_check_flag);
  2999     checkpointRootsInitialWork();
  3000     checkpointRootsInitialWork();
  3000     // enable ("weak") refs discovery
  3001     // enable ("weak") refs discovery
  3001     rp->enable_discovery(true /*verify_disabled*/, true /*check_no_refs*/);
  3002     rp->enable_discovery();
  3002     _collectorState = Marking;
  3003     _collectorState = Marking;
  3003   }
  3004   }
  3004   SpecializationStats::print();
  3005   SpecializationStats::print();
  3005 }
  3006 }
  3006 
  3007