mirror of
https://github.com/openjdk/jdk.git
synced 2025-09-21 11:34:38 +02:00
7041789: 30% perf regression with c2/arm following 7017732
Implement a more accurate is_scavengable() Reviewed-by: stefank, jcoomes, ysr
This commit is contained in:
parent
8cdd97938c
commit
6819e3739e
12 changed files with 132 additions and 36 deletions
|
@ -428,6 +428,37 @@ void G1CollectedHeap::stop_conc_gc_threads() {
|
|||
_cmThread->stop();
|
||||
}
|
||||
|
||||
#ifdef ASSERT
|
||||
// A region is added to the collection set as it is retired
|
||||
// so an address p can point to a region which will be in the
|
||||
// collection set but has not yet been retired. This method
|
||||
// therefore is only accurate during a GC pause after all
|
||||
// regions have been retired. It is used for debugging
|
||||
// to check if an nmethod has references to objects that can
|
||||
// be move during a partial collection. Though it can be
|
||||
// inaccurate, it is sufficient for G1 because the conservative
|
||||
// implementation of is_scavengable() for G1 will indicate that
|
||||
// all nmethods must be scanned during a partial collection.
|
||||
bool G1CollectedHeap::is_in_partial_collection(const void* p) {
|
||||
HeapRegion* hr = heap_region_containing(p);
|
||||
return hr != NULL && hr->in_collection_set();
|
||||
}
|
||||
#endif
|
||||
|
||||
// Returns true if the reference points to an object that
|
||||
// can move in an incremental collecction.
|
||||
bool G1CollectedHeap::is_scavengable(const void* p) {
|
||||
G1CollectedHeap* g1h = G1CollectedHeap::heap();
|
||||
G1CollectorPolicy* g1p = g1h->g1_policy();
|
||||
HeapRegion* hr = heap_region_containing(p);
|
||||
if (hr == NULL) {
|
||||
// perm gen (or null)
|
||||
return false;
|
||||
} else {
|
||||
return !hr->isHumongous();
|
||||
}
|
||||
}
|
||||
|
||||
void G1CollectedHeap::check_ct_logs_at_safepoint() {
|
||||
DirtyCardQueueSet& dcqs = JavaThread::dirty_card_queue_set();
|
||||
CardTableModRefBS* ct_bs = (CardTableModRefBS*)barrier_set();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue