Lines Matching refs:T
19 template <typename T>
24 explicit AtomicValue(T initial) in AtomicValue()
25 : value_(cast_helper<T>::to_storage_type(initial)) {} in AtomicValue()
27 V8_INLINE T Value() const { in Value()
28 return cast_helper<T>::to_return_type(base::Acquire_Load(&value_)); in Value()
31 V8_INLINE bool TrySetValue(T old_value, T new_value) { in TrySetValue()
33 &value_, cast_helper<T>::to_storage_type(old_value), in TrySetValue()
34 cast_helper<T>::to_storage_type(new_value)) == in TrySetValue()
35 cast_helper<T>::to_storage_type(old_value); in TrySetValue()
38 V8_INLINE void SetBits(T bits, T mask) { in SetBits()
39 DCHECK_EQ(bits & ~mask, static_cast<T>(0)); in SetBits()
40 T old_value; in SetBits()
41 T new_value; in SetBits()
49 SetBits(static_cast<T>(1) << bit, static_cast<T>(1) << bit); in SetBit()
54 V8_INLINE void SetValue(T new_value) { in SetValue()
55 base::Release_Store(&value_, cast_helper<T>::to_storage_type(new_value)); in SetValue()
59 STATIC_ASSERT(sizeof(T) <= sizeof(base::AtomicWord));
86 template <typename T>
87 static T Acquire_Load(T* addr) {
88 STATIC_ASSERT(sizeof(T) <= sizeof(base::Atomic32));
89 return to_return_type<T>(base::Acquire_Load(to_storage_addr(addr)));
92 template <typename T>
93 static T Relaxed_Load(T* addr) {
94 STATIC_ASSERT(sizeof(T) <= sizeof(base::Atomic32));
95 return to_return_type<T>(base::Relaxed_Load(to_storage_addr(addr)));
98 template <typename T>
99 static void Release_Store(T* addr,
100 typename std::remove_reference<T>::type new_value) {
101 STATIC_ASSERT(sizeof(T) <= sizeof(base::Atomic32));
105 template <typename T>
106 static void Relaxed_Store(T* addr,
107 typename std::remove_reference<T>::type new_value) {
108 STATIC_ASSERT(sizeof(T) <= sizeof(base::Atomic32));
112 template <typename T>
113 static T Release_CompareAndSwap(
114 T* addr, typename std::remove_reference<T>::type old_value,
115 typename std::remove_reference<T>::type new_value) {
116 STATIC_ASSERT(sizeof(T) <= sizeof(base::Atomic32));
117 return to_return_type<T>(base::Release_CompareAndSwap(
124 template <typename T>
125 static bool SetBits(T* addr, T bits, T mask) {
126 STATIC_ASSERT(sizeof(T) <= sizeof(base::Atomic32));
127 DCHECK_EQ(bits & ~mask, static_cast<T>(0));
128 T old_value;
129 T new_value;
139 template <typename T>
140 static base::Atomic32 to_storage_type(T value) {
143 template <typename T>
144 static T to_return_type(base::Atomic32 value) {
145 return static_cast<T>(value);
147 template <typename T>
148 static base::Atomic32* to_storage_addr(T* value) {
151 template <typename T>
152 static const base::Atomic32* to_storage_addr(const T* value) {
159 template <typename T>
160 static T Acquire_Load(T* addr) {
161 STATIC_ASSERT(sizeof(T) <= sizeof(base::AtomicWord));
162 return to_return_type<T>(base::Acquire_Load(to_storage_addr(addr)));
165 template <typename T>
166 static T Relaxed_Load(T* addr) {
167 STATIC_ASSERT(sizeof(T) <= sizeof(base::AtomicWord));
168 return to_return_type<T>(base::Relaxed_Load(to_storage_addr(addr)));
171 template <typename T>
172 static void Release_Store(T* addr,
173 typename std::remove_reference<T>::type new_value) {
174 STATIC_ASSERT(sizeof(T) <= sizeof(base::AtomicWord));
178 template <typename T>
179 static void Relaxed_Store(T* addr,
180 typename std::remove_reference<T>::type new_value) {
181 STATIC_ASSERT(sizeof(T) <= sizeof(base::AtomicWord));
185 template <typename T>
186 static T Release_CompareAndSwap(
187 T* addr, typename std::remove_reference<T>::type old_value,
188 typename std::remove_reference<T>::type new_value) {
189 STATIC_ASSERT(sizeof(T) <= sizeof(base::AtomicWord));
190 return to_return_type<T>(base::Release_CompareAndSwap(
197 template <typename T>
198 static bool SetBits(T* addr, T bits, T mask) {
199 STATIC_ASSERT(sizeof(T) <= sizeof(base::AtomicWord));
200 DCHECK_EQ(bits & ~mask, static_cast<T>(0));
201 T old_value;
202 T new_value;
212 template <typename T>
213 static base::AtomicWord to_storage_type(T value) {
216 template <typename T>
217 static T to_return_type(base::AtomicWord value) {
218 return static_cast<T>(value);
220 template <typename T>
221 static base::AtomicWord* to_storage_addr(T* value) {
224 template <typename T>
225 static const base::AtomicWord* to_storage_addr(const T* value) {
232 template <typename T>
233 static T Acquire_Load(T* addr) {
234 STATIC_ASSERT(sizeof(T) <= sizeof(base::Atomic8));
235 return to_return_type<T>(base::Acquire_Load(to_storage_addr(addr)));
238 template <typename T>
239 static T Relaxed_Load(T* addr) {
240 STATIC_ASSERT(sizeof(T) <= sizeof(base::Atomic8));
241 return to_return_type<T>(base::Relaxed_Load(to_storage_addr(addr)));
244 template <typename T>
245 static void Release_Store(T* addr,
246 typename std::remove_reference<T>::type new_value) {
247 STATIC_ASSERT(sizeof(T) <= sizeof(base::Atomic8));
251 template <typename T>
252 static void Relaxed_Store(T* addr,
253 typename std::remove_reference<T>::type new_value) {
254 STATIC_ASSERT(sizeof(T) <= sizeof(base::Atomic8));
258 template <typename T>
259 static T Release_CompareAndSwap(
260 T* addr, typename std::remove_reference<T>::type old_value,
261 typename std::remove_reference<T>::type new_value) {
262 STATIC_ASSERT(sizeof(T) <= sizeof(base::Atomic8));
263 return to_return_type<T>(base::Release_CompareAndSwap(
269 template <typename T>
270 static base::Atomic8 to_storage_type(T value) {
273 template <typename T>
274 static T to_return_type(base::Atomic8 value) {
275 return static_cast<T>(value);
277 template <typename T>
278 static base::Atomic8* to_storage_addr(T* value) {
281 template <typename T>
282 static const base::Atomic8* to_storage_addr(const T* value) {
289 template <typename T>
290 static T Acquire_Load(T* addr) {
291 STATIC_ASSERT(sizeof(T) <= sizeof(base::AtomicWord));
292 return to_return_type<T>(base::Acquire_Load(to_storage_addr(addr)));
295 template <typename T>
296 static T Relaxed_Load(T* addr) {
297 STATIC_ASSERT(sizeof(T) <= sizeof(base::AtomicWord));
298 return to_return_type<T>(base::Relaxed_Load(to_storage_addr(addr)));
301 template <typename T>
302 static void Release_Store(T* addr,
303 typename std::remove_reference<T>::type new_value) {
304 STATIC_ASSERT(sizeof(T) <= sizeof(base::AtomicWord));
308 template <typename T>
309 static void Relaxed_Store(T* addr,
310 typename std::remove_reference<T>::type new_value) {
311 STATIC_ASSERT(sizeof(T) <= sizeof(base::AtomicWord));
315 template <typename T>
316 static T Release_CompareAndSwap(
317 T* addr, typename std::remove_reference<T>::type old_value,
318 typename std::remove_reference<T>::type new_value) {
319 STATIC_ASSERT(sizeof(T) <= sizeof(base::AtomicWord));
320 return to_return_type<T>(base::Release_CompareAndSwap(
326 template <typename T>
327 static base::AtomicWord to_storage_type(T value) {
330 template <typename T>
331 static T to_return_type(base::AtomicWord value) {
332 return reinterpret_cast<T>(value);
334 template <typename T>
335 static base::AtomicWord* to_storage_addr(T* value) {
338 template <typename T>
339 static const base::AtomicWord* to_storage_addr(const T* value) {
353 template <typename T>
356 AtomicElement(const AtomicElement<T>& other) {
361 void operator=(const AtomicElement<T>& other) {
366 T value() const { return AsAtomicPointer::Relaxed_Load(&value_); }
368 bool operator<(const AtomicElement<T>& other) const {
372 bool operator==(const AtomicElement<T>& other) const {
377 T value_;