479 return mark_raw().displaced_mark_helper(); 480 } 481 482 void oopDesc::set_displaced_mark_raw(markWord m) { 483 mark_raw().set_displaced_mark_helper(m); 484 } 485 486 // Supports deferred calling of obj->klass(). 487 class DeferredObjectToKlass { 488 const oopDesc* _obj; 489 490 public: 491 DeferredObjectToKlass(const oopDesc* obj) : _obj(obj) {} 492 493 // Implicitly convertible to const Klass*. 494 operator const Klass*() const { 495 return _obj->klass(); 496 } 497 }; 498 499 bool oopDesc::mark_must_be_preserved(markWord m) const { 500 // There's a circular dependency between oop.inline.hpp and 501 // markWord.inline.hpp because markWord::must_be_preserved wants to call 502 // oopDesc::klass(). This could be solved by calling klass() here. However, 503 // not all paths inside must_be_preserved calls klass(). Defer the call until 504 // the klass is actually needed. 505 return m.must_be_preserved(DeferredObjectToKlass(this)); 506 } 507 508 bool oopDesc::mark_must_be_preserved_for_promotion_failure(markWord m) const { 509 return m.must_be_preserved_for_promotion_failure(DeferredObjectToKlass(this)); 510 } 511 512 #endif // SHARE_OOPS_OOP_INLINE_HPP | 479 return mark_raw().displaced_mark_helper(); 480 } 481 482 void oopDesc::set_displaced_mark_raw(markWord m) { 483 mark_raw().set_displaced_mark_helper(m); 484 } 485 486 // Supports deferred calling of obj->klass(). 487 class DeferredObjectToKlass { 488 const oopDesc* _obj; 489 490 public: 491 DeferredObjectToKlass(const oopDesc* obj) : _obj(obj) {} 492 493 // Implicitly convertible to const Klass*. 494 operator const Klass*() const { 495 return _obj->klass(); 496 } 497 }; 498 499 bool oopDesc::mark_must_be_preserved() const { 500 return mark_must_be_preserved(mark_raw()); 501 } 502 503 bool oopDesc::mark_must_be_preserved(markWord m) const { 504 // There's a circular dependency between oop.inline.hpp and 505 // markWord.inline.hpp because markWord::must_be_preserved wants to call 506 // oopDesc::klass(). This could be solved by calling klass() here. However, 507 // not all paths inside must_be_preserved calls klass(). Defer the call until 508 // the klass is actually needed. 509 return m.must_be_preserved(DeferredObjectToKlass(this)); 510 } 511 512 bool oopDesc::mark_must_be_preserved_for_promotion_failure(markWord m) const { 513 return m.must_be_preserved_for_promotion_failure(DeferredObjectToKlass(this)); 514 } 515 516 #endif // SHARE_OOPS_OOP_INLINE_HPP |