Mercurial > hg > truffle
comparison src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp @ 17992:a45a4f5a9609
8044796: G1: Enable G1CollectedHeap::stop()
Reviewed-by: brutisso, sjohanss
author | pliden |
---|---|
date | Fri, 13 Jun 2014 13:46:06 +0200 |
parents | 8e20ef014b08 |
children | 52b4284cb496 0982ec23da03 e2ed74d2e054 |
comparison
equal
deleted
inserted
replaced
17991:a07a3a29df67 | 17992:a45a4f5a9609 |
---|---|
428 head); | 428 head); |
429 } while (hr != head); | 429 } while (hr != head); |
430 assert(hr != NULL, "invariant"); | 430 assert(hr != NULL, "invariant"); |
431 hr->set_next_dirty_cards_region(NULL); | 431 hr->set_next_dirty_cards_region(NULL); |
432 return hr; | 432 return hr; |
433 } | |
434 | |
435 void G1CollectedHeap::stop_conc_gc_threads() { | |
436 _cg1r->stop(); | |
437 _cmThread->stop(); | |
438 if (G1StringDedup::is_enabled()) { | |
439 G1StringDedup::stop(); | |
440 } | |
441 } | 433 } |
442 | 434 |
443 #ifdef ASSERT | 435 #ifdef ASSERT |
444 // A region is added to the collection set as it is retired | 436 // A region is added to the collection set as it is retired |
445 // so an address p can point to a region which will be in the | 437 // so an address p can point to a region which will be in the |
2184 | 2176 |
2185 return JNI_OK; | 2177 return JNI_OK; |
2186 } | 2178 } |
2187 | 2179 |
2188 void G1CollectedHeap::stop() { | 2180 void G1CollectedHeap::stop() { |
2189 #if 0 | 2181 // Stop all concurrent threads. We do this to make sure these threads |
2190 // Stopping concurrent worker threads is currently disabled until | 2182 // do not continue to execute and access resources (e.g. gclog_or_tty) |
2191 // some bugs in concurrent mark has been resolve. Without fixing | |
2192 // those bugs first we risk haning during VM exit when trying to | |
2193 // stop these threads. | |
2194 | |
2195 // Abort any ongoing concurrent root region scanning and stop all | |
2196 // concurrent threads. We do this to make sure these threads do | |
2197 // not continue to execute and access resources (e.g. gclog_or_tty) | |
2198 // that are destroyed during shutdown. | 2183 // that are destroyed during shutdown. |
2199 _cm->root_regions()->abort(); | 2184 _cg1r->stop(); |
2200 _cm->root_regions()->wait_until_scan_finished(); | 2185 _cmThread->stop(); |
2201 stop_conc_gc_threads(); | 2186 if (G1StringDedup::is_enabled()) { |
2202 #endif | 2187 G1StringDedup::stop(); |
2188 } | |
2203 } | 2189 } |
2204 | 2190 |
2205 size_t G1CollectedHeap::conservative_max_heap_alignment() { | 2191 size_t G1CollectedHeap::conservative_max_heap_alignment() { |
2206 return HeapRegion::max_region_size(); | 2192 return HeapRegion::max_region_size(); |
2207 } | 2193 } |