8202081: Introduce CollectedHeap::is_oop()
Reviewed-by: eosterlund, rkennke
This commit is contained in:
parent
0bf983846e
commit
04e986f200
@ -172,6 +172,22 @@ bool CollectedHeap::request_concurrent_phase(const char* phase) {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool CollectedHeap::is_oop(oop object) const {
|
||||||
|
if (!check_obj_alignment(object)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!is_in_reserved(object)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (is_in_reserved(object->klass_or_null())) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
// Memory state functions.
|
// Memory state functions.
|
||||||
|
|
||||||
|
|
||||||
|
@ -591,6 +591,8 @@ class CollectedHeap : public CHeapObj<mtInternal> {
|
|||||||
virtual oop pin_object(JavaThread* thread, oop obj);
|
virtual oop pin_object(JavaThread* thread, oop obj);
|
||||||
virtual void unpin_object(JavaThread* thread, oop obj);
|
virtual void unpin_object(JavaThread* thread, oop obj);
|
||||||
|
|
||||||
|
virtual bool is_oop(oop object) const;
|
||||||
|
|
||||||
// Non product verification and debugging.
|
// Non product verification and debugging.
|
||||||
#ifndef PRODUCT
|
#ifndef PRODUCT
|
||||||
// Support for PromotionFailureALot. Return true if it's time to cause a
|
// Support for PromotionFailureALot. Return true if it's time to cause a
|
||||||
|
@ -122,10 +122,9 @@ unsigned int oopDesc::new_hash(juint seed) {
|
|||||||
|
|
||||||
// used only for asserts and guarantees
|
// used only for asserts and guarantees
|
||||||
bool oopDesc::is_oop(oop obj, bool ignore_mark_word) {
|
bool oopDesc::is_oop(oop obj, bool ignore_mark_word) {
|
||||||
if (!check_obj_alignment(obj)) return false;
|
if (!Universe::heap()->is_oop(obj)) {
|
||||||
if (!Universe::heap()->is_in_reserved(obj)) return false;
|
return false;
|
||||||
// obj is aligned and accessible in heap
|
}
|
||||||
if (Universe::heap()->is_in_reserved(obj->klass_or_null())) return false;
|
|
||||||
|
|
||||||
// Header verification: the mark is typically non-NULL. If we're
|
// Header verification: the mark is typically non-NULL. If we're
|
||||||
// at a safepoint, it must not be null.
|
// at a safepoint, it must not be null.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user