< prev index next >

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

Print this page

48 }
49 
50 inline void OopHandle::release(OopStorage* storage) {
51   if (_obj != nullptr) {
52     // Clear the OopHandle first
53     NativeAccess<>::oop_store(_obj, nullptr);
54     storage->release(_obj);
55     _obj = nullptr;
56   }
57 }
58 
59 inline void OopHandle::replace(oop obj) {
60   assert(!is_empty(), "should not use replace");
61   NativeAccess<>::oop_store(_obj, obj);
62 }
63 
64 inline oop OopHandle::xchg(oop new_value) {
65   return NativeAccess<MO_SEQ_CST>::oop_atomic_xchg(_obj, new_value);
66 }
67 




68 #endif // SHARE_OOPS_OOPHANDLE_INLINE_HPP

48 }
49 
50 inline void OopHandle::release(OopStorage* storage) {
51   if (_obj != nullptr) {
52     // Clear the OopHandle first
53     NativeAccess<>::oop_store(_obj, nullptr);
54     storage->release(_obj);
55     _obj = nullptr;
56   }
57 }
58 
59 inline void OopHandle::replace(oop obj) {
60   assert(!is_empty(), "should not use replace");
61   NativeAccess<>::oop_store(_obj, obj);
62 }
63 
64 inline oop OopHandle::xchg(oop new_value) {
65   return NativeAccess<MO_SEQ_CST>::oop_atomic_xchg(_obj, new_value);
66 }
67 
68 inline oop OopHandle::cmpxchg(oop old_value, oop new_value) {
69   return NativeAccess<MO_SEQ_CST>::oop_atomic_cmpxchg(_obj, old_value, new_value);
70 }
71 
72 #endif // SHARE_OOPS_OOPHANDLE_INLINE_HPP
< prev index next >