516 void oopDesc::release_float_field_put(int offset, jfloat contents) { OrderAccess::release_store(float_field_addr(offset), contents); } 517 518 jdouble oopDesc::double_field_acquire(int offset) const { return OrderAccess::load_acquire(double_field_addr(offset)); } 519 void oopDesc::release_double_field_put(int offset, jdouble contents) { OrderAccess::release_store(double_field_addr(offset), contents); } 520 521 address oopDesc::address_field_acquire(int offset) const { return (address) OrderAccess::load_ptr_acquire(address_field_addr(offset)); } 522 void oopDesc::release_address_field_put(int offset, address contents) { OrderAccess::release_store_ptr(address_field_addr(offset), contents); } 523 524 bool oopDesc::is_locked() const { 525 return mark()->is_locked(); 526 } 527 528 bool oopDesc::is_unlocked() const { 529 return mark()->is_unlocked(); 530 } 531 532 bool oopDesc::has_bias_pattern() const { 533 return mark()->has_bias_pattern(); 534 } 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 572 bool oopDesc::is_gc_marked() const { 573 return mark()->is_marked(); 574 } 575 576 bool oopDesc::is_scavengable() const { 577 return Universe::heap()->is_scavengable(this); 578 } 579 580 // Used by scavengers | 516 void oopDesc::release_float_field_put(int offset, jfloat contents) { OrderAccess::release_store(float_field_addr(offset), contents); } 517 518 jdouble oopDesc::double_field_acquire(int offset) const { return OrderAccess::load_acquire(double_field_addr(offset)); } 519 void oopDesc::release_double_field_put(int offset, jdouble contents) { OrderAccess::release_store(double_field_addr(offset), contents); } 520 521 address oopDesc::address_field_acquire(int offset) const { return (address) OrderAccess::load_ptr_acquire(address_field_addr(offset)); } 522 void oopDesc::release_address_field_put(int offset, address contents) { OrderAccess::release_store_ptr(address_field_addr(offset), contents); } 523 524 bool oopDesc::is_locked() const { 525 return mark()->is_locked(); 526 } 527 528 bool oopDesc::is_unlocked() const { 529 return mark()->is_unlocked(); 530 } 531 532 bool oopDesc::has_bias_pattern() const { 533 return mark()->has_bias_pattern(); 534 } 535 536 // used only for asserts and guarantees 537 inline bool oopDesc::is_oop(oop obj, bool ignore_mark_word) { 538 if (!check_obj_alignment(obj)) return false; 539 if (!Universe::heap()->is_in_reserved(obj)) return false; 540 // obj is aligned and accessible in heap 541 if (Universe::heap()->is_in_reserved(obj->klass_or_null())) return false; 542 543 // Header verification: the mark is typically non-NULL. If we're 544 // at a safepoint, it must not be null. 545 // Outside of a safepoint, the header could be changing (for example, 546 // another thread could be inflating a lock on this object). 547 if (ignore_mark_word) { 548 return true; 549 } 550 if (obj->mark() != NULL) { 551 return true; 552 } 553 return !SafepointSynchronize::is_at_safepoint(); 554 } 555 556 // used only for asserts and guarantees 557 inline bool oopDesc::is_oop_or_null(oop obj, bool ignore_mark_word) { 558 return obj == NULL ? true : is_oop(obj, ignore_mark_word); 559 } 560 561 #ifndef PRODUCT 562 // used only for asserts 563 bool oopDesc::is_unlocked_oop() const { 564 if (!Universe::heap()->is_in_reserved(this)) return false; 565 return mark()->is_unlocked(); 566 } 567 #endif // PRODUCT 568 569 // Used only for markSweep, scavenging 570 bool oopDesc::is_gc_marked() const { 571 return mark()->is_marked(); 572 } 573 574 bool oopDesc::is_scavengable() const { 575 return Universe::heap()->is_scavengable(this); 576 } 577 578 // Used by scavengers |