63 markOop forwardPtrMark = markOopDesc::encode_pointer_as_mark(p); 64 markOop curMark; 65 66 assert(forwardPtrMark->decode_pointer() == p, "encoding must be reversable"); 67 assert(sizeof(markOop) == sizeof(intptr_t), "CAS below requires this."); 68 69 while (!oldMark->is_marked()) { 70 curMark = (markOop)Atomic::cmpxchg_ptr(forwardPtrMark, &_mark, oldMark); 71 assert(is_forwarded(), "object should have been forwarded"); 72 if (curMark == oldMark) { 73 return NULL; 74 } 75 // If the CAS was unsuccessful then curMark->is_marked() 76 // should return true as another thread has CAS'd in another 77 // forwarding pointer. 78 oldMark = curMark; 79 } 80 return forwardee(); 81 } 82 83 inline void oopDesc::update_header(ParCompactionManager* cm) { 84 PSParallelCompact::adjust_klass(cm, klass()); 85 } 86 87 #endif // SHARE_VM_OOPS_OOP_PCGC_INLINE_HPP | 63 markOop forwardPtrMark = markOopDesc::encode_pointer_as_mark(p); 64 markOop curMark; 65 66 assert(forwardPtrMark->decode_pointer() == p, "encoding must be reversable"); 67 assert(sizeof(markOop) == sizeof(intptr_t), "CAS below requires this."); 68 69 while (!oldMark->is_marked()) { 70 curMark = (markOop)Atomic::cmpxchg_ptr(forwardPtrMark, &_mark, oldMark); 71 assert(is_forwarded(), "object should have been forwarded"); 72 if (curMark == oldMark) { 73 return NULL; 74 } 75 // If the CAS was unsuccessful then curMark->is_marked() 76 // should return true as another thread has CAS'd in another 77 // forwarding pointer. 78 oldMark = curMark; 79 } 80 return forwardee(); 81 } 82 83 #endif // SHARE_VM_OOPS_OOP_PCGC_INLINE_HPP |