hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp
changeset 25070 ec13ac30b16d
parent 24941 4ebbe176a7b1
child 25350 6423a57e5451
equal deleted inserted replaced
24943:1a5de4af4ffe 25070:ec13ac30b16d
   431   assert(hr != NULL, "invariant");
   431   assert(hr != NULL, "invariant");
   432   hr->set_next_dirty_cards_region(NULL);
   432   hr->set_next_dirty_cards_region(NULL);
   433   return hr;
   433   return hr;
   434 }
   434 }
   435 
   435 
   436 void G1CollectedHeap::stop_conc_gc_threads() {
       
   437   _cg1r->stop();
       
   438   _cmThread->stop();
       
   439   if (G1StringDedup::is_enabled()) {
       
   440     G1StringDedup::stop();
       
   441   }
       
   442 }
       
   443 
       
   444 #ifdef ASSERT
   436 #ifdef ASSERT
   445 // A region is added to the collection set as it is retired
   437 // A region is added to the collection set as it is retired
   446 // so an address p can point to a region which will be in the
   438 // so an address p can point to a region which will be in the
   447 // collection set but has not yet been retired.  This method
   439 // collection set but has not yet been retired.  This method
   448 // therefore is only accurate during a GC pause after all
   440 // therefore is only accurate during a GC pause after all
  2172 
  2164 
  2173   return JNI_OK;
  2165   return JNI_OK;
  2174 }
  2166 }
  2175 
  2167 
  2176 void G1CollectedHeap::stop() {
  2168 void G1CollectedHeap::stop() {
  2177 #if 0
  2169   // Stop all concurrent threads. We do this to make sure these threads
  2178   // Stopping concurrent worker threads is currently disabled until
  2170   // do not continue to execute and access resources (e.g. gclog_or_tty)
  2179   // some bugs in concurrent mark has been resolve. Without fixing
       
  2180   // those bugs first we risk haning during VM exit when trying to
       
  2181   // stop these threads.
       
  2182 
       
  2183   // Abort any ongoing concurrent root region scanning and stop all
       
  2184   // concurrent threads. We do this to make sure these threads do
       
  2185   // not continue to execute and access resources (e.g. gclog_or_tty)
       
  2186   // that are destroyed during shutdown.
  2171   // that are destroyed during shutdown.
  2187   _cm->root_regions()->abort();
  2172   _cg1r->stop();
  2188   _cm->root_regions()->wait_until_scan_finished();
  2173   _cmThread->stop();
  2189   stop_conc_gc_threads();
  2174   if (G1StringDedup::is_enabled()) {
  2190 #endif
  2175     G1StringDedup::stop();
       
  2176   }
  2191 }
  2177 }
  2192 
  2178 
  2193 size_t G1CollectedHeap::conservative_max_heap_alignment() {
  2179 size_t G1CollectedHeap::conservative_max_heap_alignment() {
  2194   return HeapRegion::max_region_size();
  2180   return HeapRegion::max_region_size();
  2195 }
  2181 }