Loading...
Searching...
No Matches
member.h
Go to the documentation of this file.
1// Copyright 2020 the V8 project authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5#ifndef INCLUDE_CPPGC_MEMBER_H_
6#define INCLUDE_CPPGC_MEMBER_H_
7
8#include <atomic>
9#include <cstddef>
10#include <type_traits>
11
16#include "cppgc/type-traits.h"
17#include "v8config.h" // NOLINT(build/include_directory)
18
19namespace cppgc {
20
21namespace subtle {
22class HeapConsistency;
23} // namespace subtle
24
25class Visitor;
26
27namespace internal {
28
29// MemberBase always refers to the object as const object and defers to
30// BasicMember on casting to the right type as needed.
31template <typename StorageType>
33 public:
34 using RawStorage = StorageType;
35
36 protected:
38
39 V8_INLINE MemberBase() = default;
40 V8_INLINE explicit MemberBase(const void* value) : raw_(value) {}
42 : raw_(value, typename RawStorage::AtomicInitializerTag{}) {}
43
44 V8_INLINE explicit MemberBase(RawStorage raw) : raw_(raw) {}
45 V8_INLINE explicit MemberBase(std::nullptr_t) : raw_(nullptr) {}
46 V8_INLINE explicit MemberBase(SentinelPointer s) : raw_(s) {}
47
48 V8_INLINE const void** GetRawSlot() const {
49 return reinterpret_cast<const void**>(const_cast<MemberBase*>(this));
50 }
51 V8_INLINE const void* GetRaw() const { return raw_.Load(); }
52 V8_INLINE void SetRaw(void* value) { raw_.Store(value); }
53
54 V8_INLINE const void* GetRawAtomic() const { return raw_.LoadAtomic(); }
55 V8_INLINE void SetRawAtomic(const void* value) { raw_.StoreAtomic(value); }
56
57 V8_INLINE RawStorage GetRawStorage() const { return raw_; }
59 reinterpret_cast<std::atomic<RawStorage>&>(raw_).store(
60 other, std::memory_order_relaxed);
61 }
62
63 V8_INLINE bool IsCleared() const { return raw_.IsCleared(); }
64
65 V8_INLINE void ClearFromGC() const { raw_.Clear(); }
66
67 private:
68 friend class MemberDebugHelper;
69
70 mutable RawStorage raw_;
71};
72
73// The basic class from which all Member classes are 'generated'.
74template <typename T, typename WeaknessTag, typename WriteBarrierPolicy,
75 typename CheckingPolicy, typename StorageType>
76class V8_TRIVIAL_ABI BasicMember final : private MemberBase<StorageType>,
77 private CheckingPolicy {
79
80 public:
81 using PointeeType = T;
82 using RawStorage = typename Base::RawStorage;
83
84 V8_INLINE constexpr BasicMember() = default;
85 V8_INLINE constexpr BasicMember(std::nullptr_t) {} // NOLINT
87 V8_INLINE BasicMember(T* raw) : Base(raw) { // NOLINT
88 InitializingWriteBarrier(raw);
89 CheckPointer(raw);
90 }
91 V8_INLINE BasicMember(T& raw) // NOLINT
92 : BasicMember(&raw) {}
93
94 // Atomic ctor. Using the AtomicInitializerTag forces BasicMember to
95 // initialize using atomic assignments. This is required for preventing
96 // data races with concurrent marking.
99 : Base(nullptr, atomic) {}
101 : Base(s, atomic) {}
103 : Base(raw, atomic) {
104 InitializingWriteBarrier(raw);
105 CheckPointer(raw);
106 }
108 : BasicMember(&raw, atomic) {}
109
110 // Copy ctor.
112 : BasicMember(other.GetRawStorage()) {}
113
114 // Heterogeneous copy constructors. When the source pointer have a different
115 // type, perform a compress-decompress round, because the source pointer may
116 // need to be adjusted.
117 template <typename U, typename OtherBarrierPolicy, typename OtherWeaknessTag,
118 typename OtherCheckingPolicy,
119 std::enable_if_t<internal::IsDecayedSameV<T, U>>* = nullptr>
121 const BasicMember<U, OtherWeaknessTag, OtherBarrierPolicy,
122 OtherCheckingPolicy, StorageType>& other)
123 : BasicMember(other.GetRawStorage()) {}
124
125 template <typename U, typename OtherBarrierPolicy, typename OtherWeaknessTag,
126 typename OtherCheckingPolicy,
127 std::enable_if_t<internal::IsStrictlyBaseOfV<T, U>>* = nullptr>
129 const BasicMember<U, OtherWeaknessTag, OtherBarrierPolicy,
130 OtherCheckingPolicy, StorageType>& other)
131 : BasicMember(other.Get()) {}
132
133 // Move ctor.
135 : BasicMember(other.GetRawStorage()) {
136 other.Clear();
137 }
138
139 // Heterogeneous move constructors. When the source pointer have a different
140 // type, perform a compress-decompress round, because the source pointer may
141 // need to be adjusted.
142 template <typename U, typename OtherBarrierPolicy, typename OtherWeaknessTag,
143 typename OtherCheckingPolicy,
144 std::enable_if_t<internal::IsDecayedSameV<T, U>>* = nullptr>
146 BasicMember<U, OtherWeaknessTag, OtherBarrierPolicy, OtherCheckingPolicy,
147 StorageType>&& other) noexcept
148 : BasicMember(other.GetRawStorage()) {
149 other.Clear();
150 }
151
152 template <typename U, typename OtherBarrierPolicy, typename OtherWeaknessTag,
153 typename OtherCheckingPolicy,
154 std::enable_if_t<internal::IsStrictlyBaseOfV<T, U>>* = nullptr>
156 BasicMember<U, OtherWeaknessTag, OtherBarrierPolicy, OtherCheckingPolicy,
157 StorageType>&& other) noexcept
158 : BasicMember(other.Get()) {
159 other.Clear();
160 }
161
162 // Construction from Persistent.
163 template <typename U, typename PersistentWeaknessPolicy,
164 typename PersistentLocationPolicy,
165 typename PersistentCheckingPolicy,
166 typename = std::enable_if_t<std::is_base_of<T, U>::value>>
167 V8_INLINE BasicMember(const BasicPersistent<U, PersistentWeaknessPolicy,
168 PersistentLocationPolicy,
169 PersistentCheckingPolicy>& p)
170 : BasicMember(p.Get()) {}
171
172 // Copy assignment.
174 return operator=(other.GetRawStorage());
175 }
176
177 // Heterogeneous copy assignment. When the source pointer have a different
178 // type, perform a compress-decompress round, because the source pointer may
179 // need to be adjusted.
180 template <typename U, typename OtherWeaknessTag, typename OtherBarrierPolicy,
181 typename OtherCheckingPolicy>
183 const BasicMember<U, OtherWeaknessTag, OtherBarrierPolicy,
184 OtherCheckingPolicy, StorageType>& other) {
185 if constexpr (internal::IsDecayedSameV<T, U>) {
186 return operator=(other.GetRawStorage());
187 } else {
188 static_assert(internal::IsStrictlyBaseOfV<T, U>);
189 return operator=(other.Get());
190 }
191 }
192
193 // Move assignment.
195 operator=(other.GetRawStorage());
196 other.Clear();
197 return *this;
198 }
199
200 // Heterogeneous move assignment. When the source pointer have a different
201 // type, perform a compress-decompress round, because the source pointer may
202 // need to be adjusted.
203 template <typename U, typename OtherWeaknessTag, typename OtherBarrierPolicy,
204 typename OtherCheckingPolicy>
206 BasicMember<U, OtherWeaknessTag, OtherBarrierPolicy, OtherCheckingPolicy,
207 StorageType>&& other) noexcept {
208 if constexpr (internal::IsDecayedSameV<T, U>) {
209 operator=(other.GetRawStorage());
210 } else {
211 static_assert(internal::IsStrictlyBaseOfV<T, U>);
212 operator=(other.Get());
213 }
214 other.Clear();
215 return *this;
216 }
217
218 // Assignment from Persistent.
219 template <typename U, typename PersistentWeaknessPolicy,
220 typename PersistentLocationPolicy,
221 typename PersistentCheckingPolicy,
222 typename = std::enable_if_t<std::is_base_of<T, U>::value>>
224 const BasicPersistent<U, PersistentWeaknessPolicy,
225 PersistentLocationPolicy, PersistentCheckingPolicy>&
226 other) {
227 return operator=(other.Get());
228 }
229
231 Base::SetRawAtomic(other);
232 AssigningWriteBarrier(other);
233 CheckPointer(other);
234 return *this;
235 }
236
237 V8_INLINE BasicMember& operator=(std::nullptr_t) {
238 Clear();
239 return *this;
240 }
242 Base::SetRawAtomic(s);
243 return *this;
244 }
245
246 template <typename OtherWeaknessTag, typename OtherBarrierPolicy,
247 typename OtherCheckingPolicy>
248 V8_INLINE void Swap(BasicMember<T, OtherWeaknessTag, OtherBarrierPolicy,
249 OtherCheckingPolicy, StorageType>& other) {
250 auto tmp = GetRawStorage();
251 *this = other;
252 other = tmp;
253 }
254
255 V8_INLINE explicit operator bool() const { return !Base::IsCleared(); }
256 V8_INLINE operator T*() const { return Get(); }
257 V8_INLINE T* operator->() const { return Get(); }
258 V8_INLINE T& operator*() const { return *Get(); }
259
260 // CFI cast exemption to allow passing SentinelPointer through T* and support
261 // heterogeneous assignments between different Member and Persistent handles
262 // based on their actual types.
263 V8_INLINE V8_CLANG_NO_SANITIZE("cfi-unrelated-cast") T* Get() const {
264 // Executed by the mutator, hence non atomic load.
265 //
266 // The const_cast below removes the constness from MemberBase storage. The
267 // following static_cast re-adds any constness if specified through the
268 // user-visible template parameter T.
269 return static_cast<T*>(const_cast<void*>(Base::GetRaw()));
270 }
271
273 Base::SetRawStorageAtomic(RawStorage{});
274 }
275
277 T* result = Get();
278 Clear();
279 return result;
280 }
281
282 V8_INLINE const T** GetSlotForTesting() const {
283 return reinterpret_cast<const T**>(Base::GetRawSlot());
284 }
285
287 return Base::GetRawStorage();
288 }
289
290 private:
291 V8_INLINE explicit BasicMember(RawStorage raw) : Base(raw) {
292 InitializingWriteBarrier();
293 CheckPointer();
294 }
295
296 V8_INLINE BasicMember& operator=(RawStorage other) {
297 Base::SetRawStorageAtomic(other);
298 AssigningWriteBarrier();
299 CheckPointer();
300 return *this;
301 }
302
303 V8_INLINE const T* GetRawAtomic() const {
304 return static_cast<const T*>(Base::GetRawAtomic());
305 }
306
307 V8_INLINE void InitializingWriteBarrier(T* value) const {
308 WriteBarrierPolicy::InitializingBarrier(Base::GetRawSlot(), value);
309 }
310 V8_INLINE void InitializingWriteBarrier() const {
311 WriteBarrierPolicy::InitializingBarrier(Base::GetRawSlot(),
312 Base::GetRawStorage());
313 }
314 V8_INLINE void AssigningWriteBarrier(T* value) const {
315 WriteBarrierPolicy::template AssigningBarrier<
316 StorageType::kWriteBarrierSlotType>(Base::GetRawSlot(), value);
317 }
318 V8_INLINE void AssigningWriteBarrier() const {
319 WriteBarrierPolicy::template AssigningBarrier<
320 StorageType::kWriteBarrierSlotType>(Base::GetRawSlot(),
321 Base::GetRawStorage());
322 }
323 V8_INLINE void CheckPointer(T* value) {
324 CheckingPolicy::template CheckPointer<T>(value);
325 }
326 V8_INLINE void CheckPointer() {
327 CheckingPolicy::template CheckPointer<T>(Base::GetRawStorage());
328 }
329
330 V8_INLINE void ClearFromGC() const { Base::ClearFromGC(); }
331
332 V8_INLINE T* GetFromGC() const { return Get(); }
333
335 friend class cppgc::Visitor;
336 template <typename U>
337 friend struct cppgc::TraceTrait;
338 template <typename T1, typename WeaknessTag1, typename WriteBarrierPolicy1,
339 typename CheckingPolicy1, typename StorageType1>
340 friend class BasicMember;
341};
342
343// Member equality operators.
344template <typename T1, typename WeaknessTag1, typename WriteBarrierPolicy1,
345 typename CheckingPolicy1, typename T2, typename WeaknessTag2,
346 typename WriteBarrierPolicy2, typename CheckingPolicy2,
347 typename StorageType>
349 const BasicMember<T1, WeaknessTag1, WriteBarrierPolicy1, CheckingPolicy1,
350 StorageType>& member1,
351 const BasicMember<T2, WeaknessTag2, WriteBarrierPolicy2, CheckingPolicy2,
352 StorageType>& member2) {
353 if constexpr (internal::IsDecayedSameV<T1, T2>) {
354 // Check compressed pointers if types are the same.
355 return member1.GetRawStorage() == member2.GetRawStorage();
356 } else {
357 static_assert(internal::IsStrictlyBaseOfV<T1, T2> ||
358 internal::IsStrictlyBaseOfV<T2, T1>);
359 // Otherwise, check decompressed pointers.
360 return member1.Get() == member2.Get();
361 }
362}
363
364template <typename T1, typename WeaknessTag1, typename WriteBarrierPolicy1,
365 typename CheckingPolicy1, typename T2, typename WeaknessTag2,
366 typename WriteBarrierPolicy2, typename CheckingPolicy2,
367 typename StorageType>
369 const BasicMember<T1, WeaknessTag1, WriteBarrierPolicy1, CheckingPolicy1,
370 StorageType>& member1,
371 const BasicMember<T2, WeaknessTag2, WriteBarrierPolicy2, CheckingPolicy2,
372 StorageType>& member2) {
373 return !(member1 == member2);
374}
375
376// Equality with raw pointers.
377template <typename T, typename WeaknessTag, typename WriteBarrierPolicy,
378 typename CheckingPolicy, typename StorageType, typename U>
380 const BasicMember<T, WeaknessTag, WriteBarrierPolicy, CheckingPolicy,
381 StorageType>& member,
382 U* raw) {
383 // Never allow comparison with erased pointers.
384 static_assert(!internal::IsDecayedSameV<void, U>);
385
386 if constexpr (internal::IsDecayedSameV<T, U>) {
387 // Check compressed pointers if types are the same.
388 return member.GetRawStorage() == StorageType(raw);
389 } else if constexpr (internal::IsStrictlyBaseOfV<T, U>) {
390 // Cast the raw pointer to T, which may adjust the pointer.
391 return member.GetRawStorage() == StorageType(static_cast<T*>(raw));
392 } else {
393 // Otherwise, decompressed the member.
394 return member.Get() == raw;
395 }
396}
397
398template <typename T, typename WeaknessTag, typename WriteBarrierPolicy,
399 typename CheckingPolicy, typename StorageType, typename U>
401 const BasicMember<T, WeaknessTag, WriteBarrierPolicy, CheckingPolicy,
402 StorageType>& member,
403 U* raw) {
404 return !(member == raw);
405}
406
407template <typename T, typename U, typename WeaknessTag,
408 typename WriteBarrierPolicy, typename CheckingPolicy,
409 typename StorageType>
411 T* raw, const BasicMember<U, WeaknessTag, WriteBarrierPolicy,
412 CheckingPolicy, StorageType>& member) {
413 return member == raw;
414}
415
416template <typename T, typename U, typename WeaknessTag,
417 typename WriteBarrierPolicy, typename CheckingPolicy,
418 typename StorageType>
420 T* raw, const BasicMember<U, WeaknessTag, WriteBarrierPolicy,
421 CheckingPolicy, StorageType>& member) {
422 return !(raw == member);
423}
424
425// Equality with sentinel.
426template <typename T, typename WeaknessTag, typename WriteBarrierPolicy,
427 typename CheckingPolicy, typename StorageType>
429 const BasicMember<T, WeaknessTag, WriteBarrierPolicy, CheckingPolicy,
430 StorageType>& member,
432 return member.GetRawStorage().IsSentinel();
433}
434
435template <typename T, typename WeaknessTag, typename WriteBarrierPolicy,
436 typename CheckingPolicy, typename StorageType>
438 const BasicMember<T, WeaknessTag, WriteBarrierPolicy, CheckingPolicy,
439 StorageType>& member,
440 SentinelPointer s) {
441 return !(member == s);
442}
443
444template <typename T, typename WeaknessTag, typename WriteBarrierPolicy,
445 typename CheckingPolicy, typename StorageType>
447 SentinelPointer s, const BasicMember<T, WeaknessTag, WriteBarrierPolicy,
448 CheckingPolicy, StorageType>& member) {
449 return member == s;
450}
451
452template <typename T, typename WeaknessTag, typename WriteBarrierPolicy,
453 typename CheckingPolicy, typename StorageType>
455 SentinelPointer s, const BasicMember<T, WeaknessTag, WriteBarrierPolicy,
456 CheckingPolicy, StorageType>& member) {
457 return !(s == member);
458}
459
460// Equality with nullptr.
461template <typename T, typename WeaknessTag, typename WriteBarrierPolicy,
462 typename CheckingPolicy, typename StorageType>
464 const BasicMember<T, WeaknessTag, WriteBarrierPolicy, CheckingPolicy,
465 StorageType>& member,
466 std::nullptr_t) {
467 return !static_cast<bool>(member);
468}
469
470template <typename T, typename WeaknessTag, typename WriteBarrierPolicy,
471 typename CheckingPolicy, typename StorageType>
473 const BasicMember<T, WeaknessTag, WriteBarrierPolicy, CheckingPolicy,
474 StorageType>& member,
475 std::nullptr_t n) {
476 return !(member == n);
477}
478
479template <typename T, typename WeaknessTag, typename WriteBarrierPolicy,
480 typename CheckingPolicy, typename StorageType>
482 std::nullptr_t n, const BasicMember<T, WeaknessTag, WriteBarrierPolicy,
483 CheckingPolicy, StorageType>& member) {
484 return member == n;
485}
486
487template <typename T, typename WeaknessTag, typename WriteBarrierPolicy,
488 typename CheckingPolicy, typename StorageType>
490 std::nullptr_t n, const BasicMember<T, WeaknessTag, WriteBarrierPolicy,
491 CheckingPolicy, StorageType>& member) {
492 return !(n == member);
493}
494
495// Relational operators.
496template <typename T1, typename WeaknessTag1, typename WriteBarrierPolicy1,
497 typename CheckingPolicy1, typename T2, typename WeaknessTag2,
498 typename WriteBarrierPolicy2, typename CheckingPolicy2,
499 typename StorageType>
501 const BasicMember<T1, WeaknessTag1, WriteBarrierPolicy1, CheckingPolicy1,
502 StorageType>& member1,
503 const BasicMember<T2, WeaknessTag2, WriteBarrierPolicy2, CheckingPolicy2,
504 StorageType>& member2) {
505 static_assert(
506 internal::IsDecayedSameV<T1, T2>,
507 "Comparison works only for same pointer type modulo cv-qualifiers");
508 return member1.GetRawStorage() < member2.GetRawStorage();
509}
510
511template <typename T1, typename WeaknessTag1, typename WriteBarrierPolicy1,
512 typename CheckingPolicy1, typename T2, typename WeaknessTag2,
513 typename WriteBarrierPolicy2, typename CheckingPolicy2,
514 typename StorageType>
516 const BasicMember<T1, WeaknessTag1, WriteBarrierPolicy1, CheckingPolicy1,
517 StorageType>& member1,
518 const BasicMember<T2, WeaknessTag2, WriteBarrierPolicy2, CheckingPolicy2,
519 StorageType>& member2) {
520 static_assert(
521 internal::IsDecayedSameV<T1, T2>,
522 "Comparison works only for same pointer type modulo cv-qualifiers");
523 return member1.GetRawStorage() <= member2.GetRawStorage();
524}
525
526template <typename T1, typename WeaknessTag1, typename WriteBarrierPolicy1,
527 typename CheckingPolicy1, typename T2, typename WeaknessTag2,
528 typename WriteBarrierPolicy2, typename CheckingPolicy2,
529 typename StorageType>
531 const BasicMember<T1, WeaknessTag1, WriteBarrierPolicy1, CheckingPolicy1,
532 StorageType>& member1,
533 const BasicMember<T2, WeaknessTag2, WriteBarrierPolicy2, CheckingPolicy2,
534 StorageType>& member2) {
535 static_assert(
536 internal::IsDecayedSameV<T1, T2>,
537 "Comparison works only for same pointer type modulo cv-qualifiers");
538 return member1.GetRawStorage() > member2.GetRawStorage();
539}
540
541template <typename T1, typename WeaknessTag1, typename WriteBarrierPolicy1,
542 typename CheckingPolicy1, typename T2, typename WeaknessTag2,
543 typename WriteBarrierPolicy2, typename CheckingPolicy2,
544 typename StorageType>
546 const BasicMember<T1, WeaknessTag1, WriteBarrierPolicy1, CheckingPolicy1,
547 StorageType>& member1,
548 const BasicMember<T2, WeaknessTag2, WriteBarrierPolicy2, CheckingPolicy2,
549 StorageType>& member2) {
550 static_assert(
551 internal::IsDecayedSameV<T1, T2>,
552 "Comparison works only for same pointer type modulo cv-qualifiers");
553 return member1.GetRawStorage() >= member2.GetRawStorage();
554}
555
556template <typename T, typename WriteBarrierPolicy, typename CheckingPolicy,
557 typename StorageType>
558struct IsWeak<internal::BasicMember<T, WeakMemberTag, WriteBarrierPolicy,
559 CheckingPolicy, StorageType>>
560 : std::true_type {};
561
562} // namespace internal
563
569template <typename T>
571 T, internal::StrongMemberTag, internal::DijkstraWriteBarrierPolicy,
573
582template <typename T>
584 T, internal::WeakMemberTag, internal::DijkstraWriteBarrierPolicy,
586
593template <typename T>
595 T, internal::UntracedMemberTag, internal::NoWriteBarrierPolicy,
597
598namespace subtle {
599
604template <typename T>
606 T, internal::StrongMemberTag, internal::DijkstraWriteBarrierPolicy,
608
609#if defined(CPPGC_POINTER_COMPRESSION)
614template <typename T>
615using CompressedMember = internal::BasicMember<
616 T, internal::StrongMemberTag, internal::DijkstraWriteBarrierPolicy,
617 internal::DefaultMemberCheckingPolicy, internal::CompressedPointer>;
618#endif // defined(CPPGC_POINTER_COMPRESSION)
619
620} // namespace subtle
621
622namespace internal {
623
624struct Dummy;
625
626static constexpr size_t kSizeOfMember = sizeof(Member<Dummy>);
627static constexpr size_t kSizeOfUncompressedMember =
629#if defined(CPPGC_POINTER_COMPRESSION)
630static constexpr size_t kSizeofCompressedMember =
631 sizeof(subtle::CompressedMember<Dummy>);
632#endif // defined(CPPGC_POINTER_COMPRESSION)
633
634} // namespace internal
635
636} // namespace cppgc
637
638#endif // INCLUDE_CPPGC_MEMBER_H_
Definition: visitor.h:56
Definition: member.h:77
BasicMember & operator=(const BasicMember< U, OtherWeaknessTag, OtherBarrierPolicy, OtherCheckingPolicy, StorageType > &other)
Definition: member.h:182
T PointeeType
Definition: member.h:81
BasicMember & operator=(BasicMember &&other) noexcept
Definition: member.h:194
T & operator*() const
Definition: member.h:258
BasicMember(SentinelPointer s)
Definition: member.h:86
BasicMember(T *raw)
Definition: member.h:87
BasicMember & operator=(T *other)
Definition: member.h:230
void Clear()
Definition: member.h:272
T * operator->() const
Definition: member.h:257
constexpr BasicMember()=default
BasicMember & operator=(const BasicMember &other)
Definition: member.h:173
const T ** GetSlotForTesting() const
Definition: member.h:282
BasicMember(SentinelPointer s, AtomicInitializerTag atomic)
Definition: member.h:100
RawStorage GetRawStorage() const
Definition: member.h:286
BasicMember & operator=(BasicMember< U, OtherWeaknessTag, OtherBarrierPolicy, OtherCheckingPolicy, StorageType > &&other) noexcept
Definition: member.h:205
BasicMember(const BasicPersistent< U, PersistentWeaknessPolicy, PersistentLocationPolicy, PersistentCheckingPolicy > &p)
Definition: member.h:167
BasicMember(T &raw)
Definition: member.h:91
BasicMember(T *raw, AtomicInitializerTag atomic)
Definition: member.h:102
BasicMember(const BasicMember &other)
Definition: member.h:111
BasicMember & operator=(std::nullptr_t)
Definition: member.h:237
BasicMember(const BasicMember< U, OtherWeaknessTag, OtherBarrierPolicy, OtherCheckingPolicy, StorageType > &other)
Definition: member.h:120
T * Release()
Definition: member.h:276
void Swap(BasicMember< T, OtherWeaknessTag, OtherBarrierPolicy, OtherCheckingPolicy, StorageType > &other)
Definition: member.h:248
typename Base::RawStorage RawStorage
Definition: member.h:82
BasicMember(T &raw, AtomicInitializerTag atomic)
Definition: member.h:107
BasicMember(BasicMember &&other) noexcept
Definition: member.h:134
constexpr BasicMember(std::nullptr_t)
Definition: member.h:85
BasicMember(BasicMember< U, OtherWeaknessTag, OtherBarrierPolicy, OtherCheckingPolicy, StorageType > &&other) noexcept
Definition: member.h:145
BasicMember & operator=(const BasicPersistent< U, PersistentWeaknessPolicy, PersistentLocationPolicy, PersistentCheckingPolicy > &other)
Definition: member.h:223
BasicMember & operator=(SentinelPointer s)
Definition: member.h:241
typename Base::AtomicInitializerTag AtomicInitializerTag
Definition: member.h:97
BasicMember(std::nullptr_t, AtomicInitializerTag atomic)
Definition: member.h:98
Definition: persistent.h:54
Definition: member.h:32
MemberBase(RawStorage raw)
Definition: member.h:44
MemberBase(SentinelPointer s)
Definition: member.h:46
const void * GetRawAtomic() const
Definition: member.h:54
void SetRawStorageAtomic(RawStorage other)
Definition: member.h:58
MemberBase(std::nullptr_t)
Definition: member.h:45
void SetRaw(void *value)
Definition: member.h:52
MemberBase(const void *value)
Definition: member.h:40
MemberBase(const void *value, AtomicInitializerTag)
Definition: member.h:41
const void * GetRaw() const
Definition: member.h:51
bool IsCleared() const
Definition: member.h:63
void SetRawAtomic(const void *value)
Definition: member.h:55
StorageType RawStorage
Definition: member.h:34
void ClearFromGC() const
Definition: member.h:65
RawStorage GetRawStorage() const
Definition: member.h:57
const void ** GetRawSlot() const
Definition: member.h:48
Definition: member-storage.h:192
Definition: heap-consistency.h:28
bool operator<=(const BasicMember< T1, WeaknessTag1, WriteBarrierPolicy1, CheckingPolicy1, StorageType > &member1, const BasicMember< T2, WeaknessTag2, WriteBarrierPolicy2, CheckingPolicy2, StorageType > &member2)
Definition: member.h:515
bool operator!=(const BasicMember< T1, WeaknessTag1, WriteBarrierPolicy1, CheckingPolicy1, StorageType > &member1, const BasicMember< T2, WeaknessTag2, WriteBarrierPolicy2, CheckingPolicy2, StorageType > &member2)
Definition: member.h:368
bool operator>(const BasicMember< T1, WeaknessTag1, WriteBarrierPolicy1, CheckingPolicy1, StorageType > &member1, const BasicMember< T2, WeaknessTag2, WriteBarrierPolicy2, CheckingPolicy2, StorageType > &member2)
Definition: member.h:530
bool operator==(const BasicMember< T1, WeaknessTag1, WriteBarrierPolicy1, CheckingPolicy1, StorageType > &member1, const BasicMember< T2, WeaknessTag2, WriteBarrierPolicy2, CheckingPolicy2, StorageType > &member2)
Definition: member.h:348
bool operator>=(const BasicMember< T1, WeaknessTag1, WriteBarrierPolicy1, CheckingPolicy1, StorageType > &member1, const BasicMember< T2, WeaknessTag2, WriteBarrierPolicy2, CheckingPolicy2, StorageType > &member2)
Definition: member.h:545
bool operator<(const BasicMember< T1, WeaknessTag1, WriteBarrierPolicy1, CheckingPolicy1, StorageType > &member1, const BasicMember< T2, WeaknessTag2, WriteBarrierPolicy2, CheckingPolicy2, StorageType > &member2)
Definition: member.h:500
DisabledCheckingPolicy DefaultMemberCheckingPolicy
Definition: pointer-policies.h:196
Definition: allocation.h:38
Definition: trace-trait.h:105
Definition: pointer-policies.h:30
Definition: type-traits.h:30
Definition: pointer-policies.h:108
Definition: sentinel-pointer.h:17
#define V8_INLINE
Definition: v8config.h:499
#define V8_CLANG_NO_SANITIZE(what)
defined(V8_TRIVIAL_ABI)
Definition: v8config.h:754
#define V8_TRIVIAL_ABI
Definition: v8config.h:743