mirror of
https://github.com/openjdk/jdk.git
synced 2025-09-20 19:14:38 +02:00
8077403: Remove guarantee from GenCollectedHeap::is_in()
Reviewed-by: mgerdin, jmasa
This commit is contained in:
parent
06b8ac7d74
commit
8e2f1d5560
3 changed files with 5 additions and 43 deletions
|
@ -170,27 +170,11 @@ size_t ParallelScavengeHeap::max_capacity() const {
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ParallelScavengeHeap::is_in(const void* p) const {
|
bool ParallelScavengeHeap::is_in(const void* p) const {
|
||||||
if (young_gen()->is_in(p)) {
|
return young_gen()->is_in(p) || old_gen()->is_in(p);
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (old_gen()->is_in(p)) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ParallelScavengeHeap::is_in_reserved(const void* p) const {
|
bool ParallelScavengeHeap::is_in_reserved(const void* p) const {
|
||||||
if (young_gen()->is_in_reserved(p)) {
|
return young_gen()->is_in_reserved(p) || old_gen()->is_in_reserved(p);
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (old_gen()->is_in_reserved(p)) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ParallelScavengeHeap::is_scavengable(const void* addr) {
|
bool ParallelScavengeHeap::is_scavengable(const void* addr) {
|
||||||
|
|
|
@ -239,22 +239,11 @@ class CollectedHeap : public CHeapObj<mtInternal> {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Returns "TRUE" iff "p" points into the committed areas of the heap.
|
// Returns "TRUE" iff "p" points into the committed areas of the heap.
|
||||||
// Since this method can be expensive in general, we restrict its
|
// This method can be expensive so avoid using it in performance critical
|
||||||
// use to assertion checking only.
|
// code.
|
||||||
virtual bool is_in(const void* p) const = 0;
|
virtual bool is_in(const void* p) const = 0;
|
||||||
|
|
||||||
bool is_in_or_null(const void* p) const {
|
DEBUG_ONLY(bool is_in_or_null(const void* p) const { return p == NULL || is_in(p); })
|
||||||
return p == NULL || is_in(p);
|
|
||||||
}
|
|
||||||
|
|
||||||
bool is_in_place(Metadata** p) {
|
|
||||||
return !Universe::heap()->is_in(p);
|
|
||||||
}
|
|
||||||
bool is_in_place(oop* p) { return Universe::heap()->is_in(p); }
|
|
||||||
bool is_in_place(narrowOop* p) {
|
|
||||||
oop o = oopDesc::load_decode_heap_oop_not_null(p);
|
|
||||||
return Universe::heap()->is_in((const void*)o);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Let's define some terms: a "closed" subset of a heap is one that
|
// Let's define some terms: a "closed" subset of a heap is one that
|
||||||
//
|
//
|
||||||
|
|
|
@ -906,17 +906,6 @@ bool GenCollectedHeap::is_in_young(oop p) {
|
||||||
|
|
||||||
// Returns "TRUE" iff "p" points into the committed areas of the heap.
|
// Returns "TRUE" iff "p" points into the committed areas of the heap.
|
||||||
bool GenCollectedHeap::is_in(const void* p) const {
|
bool GenCollectedHeap::is_in(const void* p) const {
|
||||||
#ifndef ASSERT
|
|
||||||
guarantee(VerifyBeforeGC ||
|
|
||||||
VerifyDuringGC ||
|
|
||||||
VerifyBeforeExit ||
|
|
||||||
VerifyDuringStartup ||
|
|
||||||
PrintAssembly ||
|
|
||||||
tty->count() != 0 || // already printing
|
|
||||||
VerifyAfterGC ||
|
|
||||||
VMError::fatal_error_in_progress(), "too expensive");
|
|
||||||
|
|
||||||
#endif
|
|
||||||
return _young_gen->is_in(p) || _old_gen->is_in(p);
|
return _young_gen->is_in(p) || _old_gen->is_in(p);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue