< prev index next >

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

Print this page
rev 13431 : imported patch remove_cmpxchg_ptr_users

*** 92,102 **** 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 (markOop) Atomic::cmpxchg_ptr(new_mark, &_mark, old_mark); } void oopDesc::init_mark() { set_mark(markOopDesc::prototype_for_object(this)); } --- 92,102 ---- 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); } void oopDesc::init_mark() { set_mark(markOopDesc::prototype_for_object(this)); }
*** 406,423 **** } // encode exchange and compare value from oop to T narrowOop val = encode_heap_oop(exchange_value); narrowOop cmp = encode_heap_oop(compare_value); ! narrowOop old = (narrowOop) Atomic::cmpxchg(val, (narrowOop*)dest, cmp); // decode old from T to oop return decode_heap_oop(old); } else { if (prebarrier) { update_barrier_set_pre((oop*)dest, exchange_value); } ! return (oop)Atomic::cmpxchg_ptr(exchange_value, (oop*)dest, compare_value); } } // In order to put or get a field out of an instance, must first check // if the field has been compressed and uncompress it. --- 406,423 ---- } // encode exchange and compare value from oop to T narrowOop val = encode_heap_oop(exchange_value); narrowOop cmp = encode_heap_oop(compare_value); ! narrowOop old = Atomic::cmpxchg(val, (narrowOop*)dest, cmp); // decode old from T to oop return decode_heap_oop(old); } else { if (prebarrier) { update_barrier_set_pre((oop*)dest, exchange_value); } ! return Atomic::cmpxchg(exchange_value, (oop*)dest, compare_value); } } // In order to put or get a field out of an instance, must first check // if the field has been compressed and uncompress it.
*** 614,624 **** assert(forwardPtrMark->decode_pointer() == p, "encoding must be reversable"); assert(sizeof(markOop) == sizeof(intptr_t), "CAS below requires this."); while (!oldMark->is_marked()) { ! curMark = (markOop)Atomic::cmpxchg_ptr(forwardPtrMark, &_mark, oldMark); assert(is_forwarded(), "object should have been forwarded"); if (curMark == oldMark) { return NULL; } // If the CAS was unsuccessful then curMark->is_marked() --- 614,624 ---- assert(forwardPtrMark->decode_pointer() == p, "encoding must be reversable"); assert(sizeof(markOop) == sizeof(intptr_t), "CAS below requires this."); while (!oldMark->is_marked()) { ! curMark = Atomic::cmpxchg(forwardPtrMark, &_mark, oldMark); assert(is_forwarded(), "object should have been forwarded"); if (curMark == oldMark) { return NULL; } // If the CAS was unsuccessful then curMark->is_marked()
< prev index next >