Mercurial > hg > truffle
comparison src/share/vm/prims/jvmtiExport.cpp @ 342:37f87013dfd8
6711316: Open source the Garbage-First garbage collector
Summary: First mercurial integration of the code for the Garbage-First garbage collector.
Reviewed-by: apetrusenko, iveresov, jmasa, sgoldman, tonyp, ysr
author | ysr |
---|---|
date | Thu, 05 Jun 2008 15:57:56 -0700 |
parents | a61af66fc99e |
children | ea20d7ce26b0 2b4230d1e589 |
comparison
equal
deleted
inserted
replaced
189:0b27f3512f9e | 342:37f87013dfd8 |
---|---|
2431 // if "full" is false it probably means this is a scavenge of the young | 2431 // if "full" is false it probably means this is a scavenge of the young |
2432 // generation. However it could turn out that a "full" GC is required | 2432 // generation. However it could turn out that a "full" GC is required |
2433 // so we record the number of collections so that it can be checked in | 2433 // so we record the number of collections so that it can be checked in |
2434 // the destructor. | 2434 // the destructor. |
2435 if (!_full) { | 2435 if (!_full) { |
2436 if (Universe::heap()->kind() == CollectedHeap::GenCollectedHeap) { | 2436 _invocation_count = Universe::heap()->total_full_collections(); |
2437 GenCollectedHeap* gch = GenCollectedHeap::heap(); | |
2438 assert(gch->n_gens() == 2, "configuration not recognized"); | |
2439 _invocation_count = (unsigned int)gch->get_gen(1)->stat_record()->invocations; | |
2440 } else { | |
2441 #ifndef SERIALGC | |
2442 assert(Universe::heap()->kind() == CollectedHeap::ParallelScavengeHeap, "checking"); | |
2443 _invocation_count = PSMarkSweep::total_invocations(); | |
2444 #else // SERIALGC | |
2445 fatal("SerialGC only supported in this configuration."); | |
2446 #endif // SERIALGC | |
2447 } | |
2448 } | 2437 } |
2449 | 2438 |
2450 // Do clean up tasks that need to be done at a safepoint | 2439 // Do clean up tasks that need to be done at a safepoint |
2451 JvmtiEnvBase::check_for_periodic_clean_up(); | 2440 JvmtiEnvBase::check_for_periodic_clean_up(); |
2452 } | 2441 } |
2464 | 2453 |
2465 // we might have initially started out doing a scavenge of the young | 2454 // we might have initially started out doing a scavenge of the young |
2466 // generation but could have ended up doing a "full" GC - check the | 2455 // generation but could have ended up doing a "full" GC - check the |
2467 // GC count to see. | 2456 // GC count to see. |
2468 if (!_full) { | 2457 if (!_full) { |
2469 if (Universe::heap()->kind() == CollectedHeap::GenCollectedHeap) { | 2458 _full = (_invocation_count != Universe::heap()->total_full_collections()); |
2470 GenCollectedHeap* gch = GenCollectedHeap::heap(); | |
2471 if (_invocation_count != (unsigned int)gch->get_gen(1)->stat_record()->invocations) { | |
2472 _full = true; | |
2473 } | |
2474 } else { | |
2475 #ifndef SERIALGC | |
2476 if (_invocation_count != PSMarkSweep::total_invocations()) { | |
2477 _full = true; | |
2478 } | |
2479 #else // SERIALGC | |
2480 fatal("SerialGC only supported in this configuration."); | |
2481 #endif // SERIALGC | |
2482 } | |
2483 } | 2459 } |
2484 | 2460 |
2485 // Full collection probably means the perm generation has been GC'ed | 2461 // Full collection probably means the perm generation has been GC'ed |
2486 // so we clear the breakpoint cache. | 2462 // so we clear the breakpoint cache. |
2487 if (_full) { | 2463 if (_full) { |