5 #ifndef V8_OBJECTS_SLOTS_ATOMIC_INL_H_ 6 #define V8_OBJECTS_SLOTS_ATOMIC_INL_H_ 8 #include "src/base/atomic-utils.h" 9 #include "src/objects/slots.h" 38 AsAtomicTagged::Relaxed_Store(
39 address_, AsAtomicTagged::Relaxed_Load(other.address_));
43 AsAtomicTagged::Relaxed_Store(address_, value);
49 operator Tagged_t()
const {
return AsAtomicTagged::Relaxed_Load(address_); }
53 AsAtomicTagged::Relaxed_Store(address_, other.value());
54 AsAtomicTagged::Relaxed_Store(other.address_, tmp);
57 bool operator<(
const Reference& other)
const {
58 return value() < other.value();
61 bool operator==(
const Reference& other)
const {
62 return value() == other.value();
66 Address value()
const {
return AsAtomicTagged::Relaxed_Load(address_); }
76 typedef void* pointer;
77 typedef std::random_access_iterator_tag iterator_category;
81 explicit AtomicSlot(ObjectSlot slot) : SlotBase(slot.address()) {}
83 Reference operator*()
const {
84 return Reference(reinterpret_cast<Tagged_t*>(address()));
86 Reference operator[](difference_type
i)
const {
87 return Reference(reinterpret_cast<Tagged_t*>(address() +
i * kTaggedSize));
90 friend void swap(Reference lhs, Reference rhs) { lhs.swap(rhs); }
92 friend difference_type operator-(AtomicSlot a, AtomicSlot b) {
93 return static_cast<int>(a.address() - b.address()) / kTaggedSize;
100 #endif // V8_OBJECTS_SLOTS_ATOMIC_INL_H_