8077403: Remove guarantee from GenCollectedHeap::is_in()

Reviewed-by: mgerdin, jmasa
This commit is contained in:
Bengt Rutisson 2015-04-14 11:24:03 +02:00
parent 06b8ac7d74
commit 8e2f1d5560
3 changed files with 5 additions and 43 deletions

View File

@ -170,27 +170,11 @@ size_t ParallelScavengeHeap::max_capacity() const {
}
bool ParallelScavengeHeap::is_in(const void* p) const {
if (young_gen()->is_in(p)) {
return true;
}
if (old_gen()->is_in(p)) {
return true;
}
return false;
return young_gen()->is_in(p) || old_gen()->is_in(p);
}
bool ParallelScavengeHeap::is_in_reserved(const void* p) const {
if (young_gen()->is_in_reserved(p)) {
return true;
}
if (old_gen()->is_in_reserved(p)) {
return true;
}
return false;
return young_gen()->is_in_reserved(p) || old_gen()->is_in_reserved(p);
}
bool ParallelScavengeHeap::is_scavengable(const void* addr) {

View File

@ -239,22 +239,11 @@ class CollectedHeap : public CHeapObj<mtInternal> {
}
// Returns "TRUE" iff "p" points into the committed areas of the heap.
// Since this method can be expensive in general, we restrict its
// use to assertion checking only.
// This method can be expensive so avoid using it in performance critical
// code.
virtual bool is_in(const void* p) const = 0;
bool is_in_or_null(const void* p) const {
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);
}
DEBUG_ONLY(bool is_in_or_null(const void* p) const { return p == NULL || is_in(p); })
// Let's define some terms: a "closed" subset of a heap is one that
//

View File

@ -906,17 +906,6 @@ bool GenCollectedHeap::is_in_young(oop p) {
// Returns "TRUE" iff "p" points into the committed areas of the heap.
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);
}