< prev index next >

src/hotspot/share/oops/oop.inline.hpp

Print this page

        

*** 64,74 **** } } template <class T> void oop_store(volatile T* p, oop v) { update_barrier_set_pre((T*)p, v); // cast away volatile ! // Used by release_obj_field_put, so use release_store_ptr. oopDesc::release_encode_store_heap_oop(p, v); // When using CMS we must mark the card corresponding to p as dirty // with release sematics to prevent that CMS sees the dirty card but // not the new value v at p due to reordering of the two // stores. Note that CMS has a concurrent precleaning phase, where --- 64,74 ---- } } template <class T> void oop_store(volatile T* p, oop v) { update_barrier_set_pre((T*)p, v); // cast away volatile ! // Used by release_obj_field_put, so use release_store. oopDesc::release_encode_store_heap_oop(p, v); // When using CMS we must mark the card corresponding to p as dirty // with release sematics to prevent that CMS sees the dirty card but // not the new value v at p due to reordering of the two // stores. Note that CMS has a concurrent precleaning phase, where
*** 88,98 **** // Implementation of all inlined member functions defined in oop.hpp // We need a separate file to avoid circular references void oopDesc::release_set_mark(markOop m) { ! OrderAccess::release_store_ptr(&_mark, m); } markOop oopDesc::cas_set_mark(markOop new_mark, markOop old_mark) { return Atomic::cmpxchg(new_mark, &_mark, old_mark); } --- 88,98 ---- // Implementation of all inlined member functions defined in oop.hpp // We need a separate file to avoid circular references void oopDesc::release_set_mark(markOop m) { ! OrderAccess::release_store(&_mark, m); } markOop oopDesc::cas_set_mark(markOop new_mark, markOop old_mark) { return Atomic::cmpxchg(new_mark, &_mark, old_mark); }
*** 122,132 **** // Workaround for non-const load_acquire parameter. const volatile narrowKlass* addr = &_metadata._compressed_klass; volatile narrowKlass* xaddr = const_cast<volatile narrowKlass*>(addr); return Klass::decode_klass(OrderAccess::load_acquire(xaddr)); } else { ! return (Klass*)OrderAccess::load_ptr_acquire(&_metadata._klass); } } Klass** oopDesc::klass_addr() { // Only used internally and with CMS and will not work with --- 122,132 ---- // Workaround for non-const load_acquire parameter. const volatile narrowKlass* addr = &_metadata._compressed_klass; volatile narrowKlass* xaddr = const_cast<volatile narrowKlass*>(addr); return Klass::decode_klass(OrderAccess::load_acquire(xaddr)); } else { ! return OrderAccess::load_acquire(&_metadata._klass); } } Klass** oopDesc::klass_addr() { // Only used internally and with CMS and will not work with
*** 159,169 **** CHECK_SET_KLASS(k); if (UseCompressedClassPointers) { OrderAccess::release_store(compressed_klass_addr(), Klass::encode_klass_not_null(k)); } else { ! OrderAccess::release_store_ptr(klass_addr(), k); } } #undef CHECK_SET_KLASS --- 159,169 ---- CHECK_SET_KLASS(k); if (UseCompressedClassPointers) { OrderAccess::release_store(compressed_klass_addr(), Klass::encode_klass_not_null(k)); } else { ! OrderAccess::release_store(klass_addr(), k); } } #undef CHECK_SET_KLASS
*** 359,384 **** *p = encode_heap_oop(v); } // Store heap oop as is for volatile fields. void oopDesc::release_store_heap_oop(volatile oop* p, oop v) { ! OrderAccess::release_store_ptr(p, v); } void oopDesc::release_store_heap_oop(volatile narrowOop* p, narrowOop v) { OrderAccess::release_store(p, v); } void oopDesc::release_encode_store_heap_oop_not_null(volatile narrowOop* p, oop v) { // heap oop is not pointer sized. OrderAccess::release_store(p, encode_heap_oop_not_null(v)); } void oopDesc::release_encode_store_heap_oop_not_null(volatile oop* p, oop v) { ! OrderAccess::release_store_ptr(p, v); } void oopDesc::release_encode_store_heap_oop(volatile oop* p, oop v) { ! OrderAccess::release_store_ptr(p, v); } void oopDesc::release_encode_store_heap_oop(volatile narrowOop* p, oop v) { OrderAccess::release_store(p, encode_heap_oop(v)); } --- 359,384 ---- *p = encode_heap_oop(v); } // Store heap oop as is for volatile fields. void oopDesc::release_store_heap_oop(volatile oop* p, oop v) { ! OrderAccess::release_store(p, v); } void oopDesc::release_store_heap_oop(volatile narrowOop* p, narrowOop v) { OrderAccess::release_store(p, v); } void oopDesc::release_encode_store_heap_oop_not_null(volatile narrowOop* p, oop v) { // heap oop is not pointer sized. OrderAccess::release_store(p, encode_heap_oop_not_null(v)); } void oopDesc::release_encode_store_heap_oop_not_null(volatile oop* p, oop v) { ! OrderAccess::release_store(p, v); } void oopDesc::release_encode_store_heap_oop(volatile oop* p, oop v) { ! OrderAccess::release_store(p, v); } void oopDesc::release_encode_store_heap_oop(volatile narrowOop* p, oop v) { OrderAccess::release_store(p, encode_heap_oop(v)); }
*** 386,400 **** // not headers. oop oopDesc::atomic_exchange_oop(oop exchange_value, volatile HeapWord *dest) { if (UseCompressedOops) { // encode exchange value from oop to T narrowOop val = encode_heap_oop(exchange_value); ! narrowOop old = (narrowOop)Atomic::xchg(val, (narrowOop*)dest); // decode old from T to oop return decode_heap_oop(old); } else { ! return (oop)Atomic::xchg_ptr(exchange_value, (oop*)dest); } } oop oopDesc::atomic_compare_exchange_oop(oop exchange_value, volatile HeapWord *dest, --- 386,400 ---- // not headers. oop oopDesc::atomic_exchange_oop(oop exchange_value, volatile HeapWord *dest) { if (UseCompressedOops) { // encode exchange value from oop to T narrowOop val = encode_heap_oop(exchange_value); ! narrowOop old = Atomic::xchg(val, (narrowOop*)dest); // decode old from T to oop return decode_heap_oop(old); } else { ! return Atomic::xchg(exchange_value, (oop*)dest); } } oop oopDesc::atomic_compare_exchange_oop(oop exchange_value, volatile HeapWord *dest,
*** 445,459 **** Metadata* oopDesc::metadata_field(int offset) const { return *metadata_field_addr(offset); } void oopDesc::metadata_field_put(int offset, Metadata* value) { *metadata_field_addr(offset) = value; } Metadata* oopDesc::metadata_field_acquire(int offset) const { ! return (Metadata*)OrderAccess::load_ptr_acquire(metadata_field_addr(offset)); } void oopDesc::release_metadata_field_put(int offset, Metadata* value) { ! OrderAccess::release_store_ptr(metadata_field_addr(offset), value); } jbyte oopDesc::byte_field(int offset) const { return (jbyte) *byte_field_addr(offset); } void oopDesc::byte_field_put(int offset, jbyte contents) { *byte_field_addr(offset) = (jint) contents; } --- 445,459 ---- Metadata* oopDesc::metadata_field(int offset) const { return *metadata_field_addr(offset); } void oopDesc::metadata_field_put(int offset, Metadata* value) { *metadata_field_addr(offset) = value; } Metadata* oopDesc::metadata_field_acquire(int offset) const { ! return OrderAccess::load_acquire(metadata_field_addr(offset)); } void oopDesc::release_metadata_field_put(int offset, Metadata* value) { ! OrderAccess::release_store(metadata_field_addr(offset), value); } jbyte oopDesc::byte_field(int offset) const { return (jbyte) *byte_field_addr(offset); } void oopDesc::byte_field_put(int offset, jbyte contents) { *byte_field_addr(offset) = (jint) contents; }
*** 483,494 **** oop oopDesc::obj_field_acquire(int offset) const { return UseCompressedOops ? decode_heap_oop((narrowOop) OrderAccess::load_acquire(obj_field_addr<narrowOop>(offset))) ! : decode_heap_oop((oop) ! OrderAccess::load_ptr_acquire(obj_field_addr<oop>(offset))); } void oopDesc::release_obj_field_put(int offset, oop value) { UseCompressedOops ? oop_store((volatile narrowOop*)obj_field_addr<narrowOop>(offset), value) : oop_store((volatile oop*) obj_field_addr<oop>(offset), value); --- 483,494 ---- oop oopDesc::obj_field_acquire(int offset) const { return UseCompressedOops ? decode_heap_oop((narrowOop) OrderAccess::load_acquire(obj_field_addr<narrowOop>(offset))) ! : decode_heap_oop( ! OrderAccess::load_acquire(obj_field_addr<oop>(offset))); } void oopDesc::release_obj_field_put(int offset, oop value) { UseCompressedOops ? oop_store((volatile narrowOop*)obj_field_addr<narrowOop>(offset), value) : oop_store((volatile oop*) obj_field_addr<oop>(offset), value);
*** 516,527 **** void oopDesc::release_float_field_put(int offset, jfloat contents) { OrderAccess::release_store(float_field_addr(offset), contents); } jdouble oopDesc::double_field_acquire(int offset) const { return OrderAccess::load_acquire(double_field_addr(offset)); } void oopDesc::release_double_field_put(int offset, jdouble contents) { OrderAccess::release_store(double_field_addr(offset), contents); } ! address oopDesc::address_field_acquire(int offset) const { return (address) OrderAccess::load_ptr_acquire(address_field_addr(offset)); } ! void oopDesc::release_address_field_put(int offset, address contents) { OrderAccess::release_store_ptr(address_field_addr(offset), contents); } bool oopDesc::is_locked() const { return mark()->is_locked(); } --- 516,527 ---- void oopDesc::release_float_field_put(int offset, jfloat contents) { OrderAccess::release_store(float_field_addr(offset), contents); } jdouble oopDesc::double_field_acquire(int offset) const { return OrderAccess::load_acquire(double_field_addr(offset)); } void oopDesc::release_double_field_put(int offset, jdouble contents) { OrderAccess::release_store(double_field_addr(offset), contents); } ! address oopDesc::address_field_acquire(int offset) const { return OrderAccess::load_acquire(address_field_addr(offset)); } ! void oopDesc::release_address_field_put(int offset, address contents) { OrderAccess::release_store(address_field_addr(offset), contents); } bool oopDesc::is_locked() const { return mark()->is_locked(); }
< prev index next >