File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -172,6 +172,22 @@ bool CollectedHeap::request_concurrent_phase(const char* phase) {
172172 return false ;
173173}
174174
175+ bool CollectedHeap::is_oop (oop object) const {
176+ if (!check_obj_alignment (object)) {
177+ return false ;
178+ }
179+
180+ if (!is_in_reserved (object)) {
181+ return false ;
182+ }
183+
184+ if (is_in_reserved (object->klass_or_null ())) {
185+ return false ;
186+ }
187+
188+ return true ;
189+ }
190+
175191// Memory state functions.
176192
177193
Original file line number Diff line number Diff line change @@ -591,6 +591,8 @@ class CollectedHeap : public CHeapObj<mtInternal> {
591591 virtual oop pin_object (JavaThread* thread, oop obj);
592592 virtual void unpin_object (JavaThread* thread, oop obj);
593593
594+ virtual bool is_oop (oop object) const ;
595+
594596 // Non product verification and debugging.
595597#ifndef PRODUCT
596598 // Support for PromotionFailureALot. Return true if it's time to cause a
Original file line number Diff line number Diff line change @@ -122,10 +122,9 @@ unsigned int oopDesc::new_hash(juint seed) {
122122
123123// used only for asserts and guarantees
124124bool oopDesc::is_oop (oop obj, bool ignore_mark_word) {
125- if (!check_obj_alignment (obj)) return false ;
126- if (!Universe::heap ()->is_in_reserved (obj)) return false ;
127- // obj is aligned and accessible in heap
128- if (Universe::heap ()->is_in_reserved (obj->klass_or_null ())) return false ;
125+ if (!Universe::heap ()->is_oop (obj)) {
126+ return false ;
127+ }
129128
130129 // Header verification: the mark is typically non-NULL. If we're
131130 // at a safepoint, it must not be null.
You can’t perform that action at this time.
0 commit comments