mirror of
https://github.com/openjdk/jdk.git
synced 2025-09-20 19:14: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
|
@ -711,15 +711,6 @@ void GenCollectedHeap::set_par_threads(int t) {
|
|||
_gen_process_strong_tasks->set_n_threads(t);
|
||||
}
|
||||
|
||||
class AssertIsPermClosure: public OopClosure {
|
||||
public:
|
||||
void do_oop(oop* p) {
|
||||
assert((*p) == NULL || (*p)->is_perm(), "Referent should be perm.");
|
||||
}
|
||||
void do_oop(narrowOop* p) { ShouldNotReachHere(); }
|
||||
};
|
||||
static AssertIsPermClosure assert_is_perm_closure;
|
||||
|
||||
void GenCollectedHeap::
|
||||
gen_process_strong_roots(int level,
|
||||
bool younger_gens_as_roots,
|
||||
|
@ -962,6 +953,13 @@ void GenCollectedHeap::do_full_collection(bool clear_all_soft_refs,
|
|||
}
|
||||
}
|
||||
|
||||
bool GenCollectedHeap::is_in_young(oop p) {
|
||||
bool result = ((HeapWord*)p) < _gens[_n_gens - 1]->reserved().start();
|
||||
assert(result == _gens[0]->is_in_reserved(p),
|
||||
err_msg("incorrect test - result=%d, p=" PTR_FORMAT, result, (void*)p));
|
||||
return result;
|
||||
}
|
||||
|
||||
// Returns "TRUE" iff "p" points into the allocated area of the heap.
|
||||
bool GenCollectedHeap::is_in(const void* p) const {
|
||||
#ifndef ASSERT
|
||||
|
@ -984,10 +982,16 @@ bool GenCollectedHeap::is_in(const void* p) const {
|
|||
return false;
|
||||
}
|
||||
|
||||
// Returns "TRUE" iff "p" points into the allocated area of the heap.
|
||||
bool GenCollectedHeap::is_in_youngest(void* p) {
|
||||
return _gens[0]->is_in(p);
|
||||
#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 GenCollectedHeap::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 young (low addr), old, perm (high addr)
|
||||
return p < _gens[_n_gens - 2]->reserved().end() && p != NULL;
|
||||
}
|
||||
#endif
|
||||
|
||||
void GenCollectedHeap::oop_iterate(OopClosure* cl) {
|
||||
for (int i = 0; i < _n_gens; i++) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue