mirror of
https://github.com/openjdk/jdk.git
synced 2025-09-21 19:44:41 +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
|
@ -339,6 +339,21 @@ bool ParallelScavengeHeap::is_in_reserved(const void* p) const {
|
|||
return false;
|
||||
}
|
||||
|
||||
bool ParallelScavengeHeap::is_scavengable(const void* addr) {
|
||||
return is_in_young((oop)addr);
|
||||
}
|
||||
|
||||
#ifdef ASSERT
|
||||
// Don't implement this by using is_in_young(). This method is used
|
||||
// in some cases to check that is_in_young() is correct.
|
||||
bool ParallelScavengeHeap::is_in_partial_collection(const void *p) {
|
||||
assert(is_in_reserved(p) || p == NULL,
|
||||
"Does not work if address is non-null and outside of the heap");
|
||||
// The order of the generations is perm (low addr), old, young (high addr)
|
||||
return p >= old_gen()->reserved().end();
|
||||
}
|
||||
#endif
|
||||
|
||||
// There are two levels of allocation policy here.
|
||||
//
|
||||
// When an allocation request fails, the requesting thread must invoke a VM
|
||||
|
|
|
@ -127,6 +127,12 @@ CollectorPolicy* collector_policy() const { return (CollectorPolicy*) _collector
|
|||
// collection.
|
||||
virtual bool is_maximal_no_gc() const;
|
||||
|
||||
// Return true if the reference points to an object that
|
||||
// can be moved in a partial collection. For currently implemented
|
||||
// generational collectors that means during a collection of
|
||||
// the young gen.
|
||||
virtual bool is_scavengable(const void* addr);
|
||||
|
||||
// Does this heap support heap inspection? (+PrintClassHistogram)
|
||||
bool supports_heap_inspection() const { return true; }
|
||||
|
||||
|
@ -143,6 +149,10 @@ CollectorPolicy* collector_policy() const { return (CollectorPolicy*) _collector
|
|||
return perm_gen()->reserved().contains(p);
|
||||
}
|
||||
|
||||
#ifdef ASSERT
|
||||
virtual bool is_in_partial_collection(const void *p);
|
||||
#endif
|
||||
|
||||
bool is_permanent(const void *p) const { // committed part
|
||||
return perm_gen()->is_in(p);
|
||||
}
|
||||
|
|
|
@ -51,7 +51,12 @@ inline void ParallelScavengeHeap::invoke_full_gc(bool maximum_compaction)
|
|||
}
|
||||
|
||||
inline bool ParallelScavengeHeap::is_in_young(oop p) {
|
||||
return young_gen()->is_in_reserved(p);
|
||||
// Assumes the the old gen address range is lower than that of the young gen.
|
||||
const void* loc = (void*) p;
|
||||
bool result = ((HeapWord*)p) >= young_gen()->reserved().start();
|
||||
assert(result == young_gen()->is_in_reserved(p),
|
||||
err_msg("incorrect test - result=%d, p=" PTR_FORMAT, result, (void*)p));
|
||||
return result;
|
||||
}
|
||||
|
||||
inline bool ParallelScavengeHeap::is_in_old_or_perm(oop p) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue