522 if (!Universe::heap()->is_in_reserved(obj)) return false;
523 // obj is aligned and accessible in heap
524 if (Universe::heap()->is_in_reserved(obj->klass_or_null())) return false;
525
526 // Header verification: the mark is typically non-NULL. If we're
527 // at a safepoint, it must not be null.
528 // Outside of a safepoint, the header could be changing (for example,
529 // another thread could be inflating a lock on this object).
530 if (ignore_mark_word) {
531 return true;
532 }
533 if (mark() != NULL) {
534 return true;
535 }
536 return !SafepointSynchronize::is_at_safepoint();
537 }
538
539
540 // used only for asserts
541 bool oopDesc::is_oop_or_null(bool ignore_mark_word) const {
542 return this == NULL ? true : is_oop(ignore_mark_word);
543 }
544
545 #ifndef PRODUCT
546 // used only for asserts
547 bool oopDesc::is_unlocked_oop() const {
548 if (!Universe::heap()->is_in_reserved(this)) return false;
549 return mark()->is_unlocked();
550 }
551 #endif // PRODUCT
552
553 // Used only for markSweep, scavenging
554 bool oopDesc::is_gc_marked() const {
555 return mark()->is_marked();
556 }
557
558 bool oopDesc::is_scavengable() const {
559 return Universe::heap()->is_scavengable(this);
560 }
561
562 // Used by scavengers
|
522 if (!Universe::heap()->is_in_reserved(obj)) return false;
523 // obj is aligned and accessible in heap
524 if (Universe::heap()->is_in_reserved(obj->klass_or_null())) return false;
525
526 // Header verification: the mark is typically non-NULL. If we're
527 // at a safepoint, it must not be null.
528 // Outside of a safepoint, the header could be changing (for example,
529 // another thread could be inflating a lock on this object).
530 if (ignore_mark_word) {
531 return true;
532 }
533 if (mark() != NULL) {
534 return true;
535 }
536 return !SafepointSynchronize::is_at_safepoint();
537 }
538
539
540 // used only for asserts
541 bool oopDesc::is_oop_or_null(bool ignore_mark_word) const {
542 return (this == NULL) || is_oop(ignore_mark_word);
543 }
544
545 #ifndef PRODUCT
546 // used only for asserts
547 bool oopDesc::is_unlocked_oop() const {
548 if (!Universe::heap()->is_in_reserved(this)) return false;
549 return mark()->is_unlocked();
550 }
551 #endif // PRODUCT
552
553 // Used only for markSweep, scavenging
554 bool oopDesc::is_gc_marked() const {
555 return mark()->is_marked();
556 }
557
558 bool oopDesc::is_scavengable() const {
559 return Universe::heap()->is_scavengable(this);
560 }
561
562 // Used by scavengers
|