Mercurial > hg > truffle
comparison src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.cpp @ 2125:7246a374a9f2
6458402: 3 jvmti tests fail with CMS and +ExplicitGCInvokesConcurrent
Summary: Make JvmtiGCMark safe to run non-safepoint and instrument CMS
Reviewed-by: ysr, dcubed
author | kamg |
---|---|
date | Mon, 10 Jan 2011 17:14:53 -0500 |
parents | 6cd6d394f280 |
children | ffd725ff6943 |
comparison
equal
deleted
inserted
replaced
2124:e31d8c656c5b | 2125:7246a374a9f2 |
---|---|
3476 // be approximate -- we'll do a catch up phase subsequently.] | 3476 // be approximate -- we'll do a catch up phase subsequently.] |
3477 void CMSCollector::checkpointRootsInitial(bool asynch) { | 3477 void CMSCollector::checkpointRootsInitial(bool asynch) { |
3478 assert(_collectorState == InitialMarking, "Wrong collector state"); | 3478 assert(_collectorState == InitialMarking, "Wrong collector state"); |
3479 check_correct_thread_executing(); | 3479 check_correct_thread_executing(); |
3480 TraceCMSMemoryManagerStats tms(_collectorState); | 3480 TraceCMSMemoryManagerStats tms(_collectorState); |
3481 | |
3481 ReferenceProcessor* rp = ref_processor(); | 3482 ReferenceProcessor* rp = ref_processor(); |
3482 SpecializationStats::clear(); | 3483 SpecializationStats::clear(); |
3483 assert(_restart_addr == NULL, "Control point invariant"); | 3484 assert(_restart_addr == NULL, "Control point invariant"); |
3484 if (asynch) { | 3485 if (asynch) { |
3485 // acquire locks for subsequent manipulations | 3486 // acquire locks for subsequent manipulations |
5938 } else { | 5939 } else { |
5939 rp->enqueue_discovered_references(NULL); | 5940 rp->enqueue_discovered_references(NULL); |
5940 } | 5941 } |
5941 rp->verify_no_references_recorded(); | 5942 rp->verify_no_references_recorded(); |
5942 assert(!rp->discovery_enabled(), "should have been disabled"); | 5943 assert(!rp->discovery_enabled(), "should have been disabled"); |
5943 | |
5944 // JVMTI object tagging is based on JNI weak refs. If any of these | |
5945 // refs were cleared then JVMTI needs to update its maps and | |
5946 // maybe post ObjectFrees to agents. | |
5947 JvmtiExport::cms_ref_processing_epilogue(); | |
5948 } | 5944 } |
5949 | 5945 |
5950 #ifndef PRODUCT | 5946 #ifndef PRODUCT |
5951 void CMSCollector::check_correct_thread_executing() { | 5947 void CMSCollector::check_correct_thread_executing() { |
5952 Thread* t = Thread::current(); | 5948 Thread* t = Thread::current(); |
6303 TraceTime t("GC", PrintGC, !PrintGCDetails, gclog_or_tty); | 6299 TraceTime t("GC", PrintGC, !PrintGCDetails, gclog_or_tty); |
6304 TraceCollectorStats tcs(counters()); | 6300 TraceCollectorStats tcs(counters()); |
6305 | 6301 |
6306 switch (op) { | 6302 switch (op) { |
6307 case CMS_op_checkpointRootsInitial: { | 6303 case CMS_op_checkpointRootsInitial: { |
6304 SvcGCMarker sgcm(SvcGCMarker::OTHER); | |
6308 checkpointRootsInitial(true); // asynch | 6305 checkpointRootsInitial(true); // asynch |
6309 if (PrintGC) { | 6306 if (PrintGC) { |
6310 _cmsGen->printOccupancy("initial-mark"); | 6307 _cmsGen->printOccupancy("initial-mark"); |
6311 } | 6308 } |
6312 break; | 6309 break; |
6313 } | 6310 } |
6314 case CMS_op_checkpointRootsFinal: { | 6311 case CMS_op_checkpointRootsFinal: { |
6312 SvcGCMarker sgcm(SvcGCMarker::OTHER); | |
6315 checkpointRootsFinal(true, // asynch | 6313 checkpointRootsFinal(true, // asynch |
6316 false, // !clear_all_soft_refs | 6314 false, // !clear_all_soft_refs |
6317 false); // !init_mark_was_synchronous | 6315 false); // !init_mark_was_synchronous |
6318 if (PrintGC) { | 6316 if (PrintGC) { |
6319 _cmsGen->printOccupancy("remark"); | 6317 _cmsGen->printOccupancy("remark"); |