5 #ifndef V8_OBJECTS_SLOTS_INL_H_ 6 #define V8_OBJECTS_SLOTS_INL_H_ 8 #include "src/objects/slots.h" 10 #include "src/base/atomic-utils.h" 11 #include "src/objects.h" 12 #include "src/objects/heap-object.h" 13 #include "src/objects/maybe-object.h" 18 ObjectSlot::ObjectSlot(ObjectPtr*
object)
19 : SlotBase(reinterpret_cast<Address>(&object->ptr_)) {}
21 void ObjectSlot::store(Object* value)
const { *location() = value->ptr(); }
23 ObjectPtr ObjectSlot::Acquire_Load()
const {
24 return ObjectPtr(AsAtomicTagged::Acquire_Load(location()));
27 Object* ObjectSlot::Acquire_Load1()
const {
28 return reinterpret_cast<Object*
>(AsAtomicTagged::Acquire_Load(location()));
31 ObjectPtr ObjectSlot::Relaxed_Load()
const {
32 return ObjectPtr(AsAtomicTagged::Relaxed_Load(location()));
35 void ObjectSlot::Relaxed_Store(ObjectPtr value)
const {
36 AsAtomicTagged::Relaxed_Store(location(), value->ptr());
39 void ObjectSlot::Relaxed_Store1(Object* value)
const {
40 AsAtomicTagged::Relaxed_Store(location(), value->ptr());
43 void ObjectSlot::Release_Store1(Object* value)
const {
44 AsAtomicTagged::Release_Store(location(), value->ptr());
47 void ObjectSlot::Release_Store(ObjectPtr value)
const {
48 AsAtomicTagged::Release_Store(location(), value->ptr());
51 ObjectPtr ObjectSlot::Release_CompareAndSwap(ObjectPtr old,
52 ObjectPtr target)
const {
53 Address result = AsAtomicTagged::Release_CompareAndSwap(
54 location(), old->ptr(), target->ptr());
55 return ObjectPtr(result);
58 MaybeObject MaybeObjectSlot::operator*()
const {
59 return MaybeObject(*location());
62 void MaybeObjectSlot::store(MaybeObject value)
const {
63 *location() = value.ptr();
66 MaybeObject MaybeObjectSlot::Relaxed_Load()
const {
67 return MaybeObject(AsAtomicTagged::Relaxed_Load(location()));
70 void MaybeObjectSlot::Relaxed_Store(MaybeObject value)
const {
71 AsAtomicTagged::Relaxed_Store(location(), value->ptr());
74 void MaybeObjectSlot::Release_CompareAndSwap(MaybeObject old,
75 MaybeObject target)
const {
76 AsAtomicTagged::Release_CompareAndSwap(location(), old.ptr(), target.ptr());
79 HeapObjectReference HeapObjectSlot::operator*()
const {
80 return HeapObjectReference(*location());
83 void HeapObjectSlot::store(HeapObjectReference value)
const {
84 *location() = value.ptr();
90 #endif // V8_OBJECTS_SLOTS_INL_H_