comparison src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp @ 3377:2aa9ddbb9e60

7041789: 30% perf regression with c2/arm following 7017732 Summary: Implement a more accurate is_scavengable() Reviewed-by: stefank, jcoomes, ysr
author jmasa
date Tue, 03 May 2011 10:30:34 -0700
parents 78542e2b5e35
children 69293e516993
comparison
equal deleted inserted replaced
3373:688202ef6306 3377:2aa9ddbb9e60
424 } 424 }
425 425
426 void G1CollectedHeap::stop_conc_gc_threads() { 426 void G1CollectedHeap::stop_conc_gc_threads() {
427 _cg1r->stop(); 427 _cg1r->stop();
428 _cmThread->stop(); 428 _cmThread->stop();
429 }
430
431 #ifdef ASSERT
432 // A region is added to the collection set as it is retired
433 // so an address p can point to a region which will be in the
434 // collection set but has not yet been retired. This method
435 // therefore is only accurate during a GC pause after all
436 // regions have been retired. It is used for debugging
437 // to check if an nmethod has references to objects that can
438 // be move during a partial collection. Though it can be
439 // inaccurate, it is sufficient for G1 because the conservative
440 // implementation of is_scavengable() for G1 will indicate that
441 // all nmethods must be scanned during a partial collection.
442 bool G1CollectedHeap::is_in_partial_collection(const void* p) {
443 HeapRegion* hr = heap_region_containing(p);
444 return hr != NULL && hr->in_collection_set();
445 }
446 #endif
447
448 // Returns true if the reference points to an object that
449 // can move in an incremental collecction.
450 bool G1CollectedHeap::is_scavengable(const void* p) {
451 G1CollectedHeap* g1h = G1CollectedHeap::heap();
452 G1CollectorPolicy* g1p = g1h->g1_policy();
453 HeapRegion* hr = heap_region_containing(p);
454 if (hr == NULL) {
455 // perm gen (or null)
456 return false;
457 } else {
458 return !hr->isHumongous();
459 }
429 } 460 }
430 461
431 void G1CollectedHeap::check_ct_logs_at_safepoint() { 462 void G1CollectedHeap::check_ct_logs_at_safepoint() {
432 DirtyCardQueueSet& dcqs = JavaThread::dirty_card_queue_set(); 463 DirtyCardQueueSet& dcqs = JavaThread::dirty_card_queue_set();
433 CardTableModRefBS* ct_bs = (CardTableModRefBS*)barrier_set(); 464 CardTableModRefBS* ct_bs = (CardTableModRefBS*)barrier_set();