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