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<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<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<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<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 (IsDecayedSameV<T, U>) {
186 return operator=(other.GetRawStorage());
187 } else {
188 static_assert(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 (IsDecayedSameV<T, U>) {
209 operator=(other.GetRawStorage());
210 } else {
211 static_assert(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
272 V8_INLINE void Clear() { Base::SetRawStorageAtomic(RawStorage{}); }
273
275 T* result = Get();
276 Clear();
277 return result;
278 }
279
280 V8_INLINE const T** GetSlotForTesting() const {
281 return reinterpret_cast<const T**>(Base::GetRawSlot());
282 }
283
284 V8_INLINE RawStorage GetRawStorage() const { return Base::GetRawStorage(); }
285
286 private:
287 V8_INLINE explicit BasicMember(RawStorage raw) : Base(raw) {
288 InitializingWriteBarrier();
289 CheckPointer();
290 }
291
292 V8_INLINE BasicMember& operator=(RawStorage other) {
293 Base::SetRawStorageAtomic(other);
294 AssigningWriteBarrier();
295 CheckPointer();
296 return *this;
297 }
298
299 V8_INLINE const T* GetRawAtomic() const {
300 return static_cast<const T*>(Base::GetRawAtomic());
301 }
302
303 V8_INLINE void InitializingWriteBarrier(T* value) const {
304 WriteBarrierPolicy::InitializingBarrier(Base::GetRawSlot(), value);
305 }
306 V8_INLINE void InitializingWriteBarrier() const {
307 WriteBarrierPolicy::InitializingBarrier(Base::GetRawSlot(),
308 Base::GetRawStorage());
309 }
310 V8_INLINE void AssigningWriteBarrier(T* value) const {
311 WriteBarrierPolicy::template AssigningBarrier<
312 StorageType::kWriteBarrierSlotType>(Base::GetRawSlot(), value);
313 }
314 V8_INLINE void AssigningWriteBarrier() const {
315 WriteBarrierPolicy::template AssigningBarrier<
316 StorageType::kWriteBarrierSlotType>(Base::GetRawSlot(),
317 Base::GetRawStorage());
318 }
319 V8_INLINE void CheckPointer(T* value) {
320 CheckingPolicy::template CheckPointer<T>(value);
321 }
322 V8_INLINE void CheckPointer() {
323 CheckingPolicy::template CheckPointer<T>(Base::GetRawStorage());
324 }
325
326 V8_INLINE void ClearFromGC() const { Base::ClearFromGC(); }
327
328 V8_INLINE T* GetFromGC() const { return Get(); }
329
331 friend class cppgc::Visitor;
332 template <typename U>
333 friend struct cppgc::TraceTrait;
334 template <typename T1, typename WeaknessTag1, typename WriteBarrierPolicy1,
335 typename CheckingPolicy1, typename StorageType1>
336 friend class BasicMember;
337};
338
339// Member equality operators.
340template <typename T1, typename WeaknessTag1, typename WriteBarrierPolicy1,
341 typename CheckingPolicy1, typename T2, typename WeaknessTag2,
342 typename WriteBarrierPolicy2, typename CheckingPolicy2,
343 typename StorageType>
345 const BasicMember<T1, WeaknessTag1, WriteBarrierPolicy1, CheckingPolicy1,
346 StorageType>& member1,
347 const BasicMember<T2, WeaknessTag2, WriteBarrierPolicy2, CheckingPolicy2,
348 StorageType>& member2) {
349 if constexpr (IsDecayedSameV<T1, T2>) {
350 // Check compressed pointers if types are the same.
351 return member1.GetRawStorage() == member2.GetRawStorage();
352 } else {
353 static_assert(IsStrictlyBaseOfV<T1, T2> || IsStrictlyBaseOfV<T2, T1>);
354 // Otherwise, check decompressed pointers.
355 return member1.Get() == member2.Get();
356 }
357}
358
359template <typename T1, typename WeaknessTag1, typename WriteBarrierPolicy1,
360 typename CheckingPolicy1, typename T2, typename WeaknessTag2,
361 typename WriteBarrierPolicy2, typename CheckingPolicy2,
362 typename StorageType>
364 const BasicMember<T1, WeaknessTag1, WriteBarrierPolicy1, CheckingPolicy1,
365 StorageType>& member1,
366 const BasicMember<T2, WeaknessTag2, WriteBarrierPolicy2, CheckingPolicy2,
367 StorageType>& member2) {
368 return !(member1 == member2);
369}
370
371// Equality with raw pointers.
372template <typename T, typename WeaknessTag, typename WriteBarrierPolicy,
373 typename CheckingPolicy, typename StorageType, typename U>
375 const BasicMember<T, WeaknessTag, WriteBarrierPolicy, CheckingPolicy,
376 StorageType>& member,
377 U* raw) {
378 // Never allow comparison with erased pointers.
379 static_assert(!IsDecayedSameV<void, U>);
380
381 if constexpr (IsDecayedSameV<T, U>) {
382 // Check compressed pointers if types are the same.
383 return member.GetRawStorage() == StorageType(raw);
384 } else if constexpr (IsStrictlyBaseOfV<T, U>) {
385 // Cast the raw pointer to T, which may adjust the pointer.
386 return member.GetRawStorage() == StorageType(static_cast<T*>(raw));
387 } else {
388 // Otherwise, decompressed the member.
389 return member.Get() == raw;
390 }
391}
392
393template <typename T, typename WeaknessTag, typename WriteBarrierPolicy,
394 typename CheckingPolicy, typename StorageType, typename U>
396 const BasicMember<T, WeaknessTag, WriteBarrierPolicy, CheckingPolicy,
397 StorageType>& member,
398 U* raw) {
399 return !(member == raw);
400}
401
402template <typename T, typename U, typename WeaknessTag,
403 typename WriteBarrierPolicy, typename CheckingPolicy,
404 typename StorageType>
406 T* raw, const BasicMember<U, WeaknessTag, WriteBarrierPolicy,
407 CheckingPolicy, StorageType>& member) {
408 return member == raw;
409}
410
411template <typename T, typename U, typename WeaknessTag,
412 typename WriteBarrierPolicy, typename CheckingPolicy,
413 typename StorageType>
415 T* raw, const BasicMember<U, WeaknessTag, WriteBarrierPolicy,
416 CheckingPolicy, StorageType>& member) {
417 return !(raw == member);
418}
419
420// Equality with sentinel.
421template <typename T, typename WeaknessTag, typename WriteBarrierPolicy,
422 typename CheckingPolicy, typename StorageType>
424 const BasicMember<T, WeaknessTag, WriteBarrierPolicy, CheckingPolicy,
425 StorageType>& member,
427 return member.GetRawStorage().IsSentinel();
428}
429
430template <typename T, typename WeaknessTag, typename WriteBarrierPolicy,
431 typename CheckingPolicy, typename StorageType>
433 const BasicMember<T, WeaknessTag, WriteBarrierPolicy, CheckingPolicy,
434 StorageType>& member,
435 SentinelPointer s) {
436 return !(member == s);
437}
438
439template <typename T, typename WeaknessTag, typename WriteBarrierPolicy,
440 typename CheckingPolicy, typename StorageType>
442 SentinelPointer s, const BasicMember<T, WeaknessTag, WriteBarrierPolicy,
443 CheckingPolicy, StorageType>& member) {
444 return member == s;
445}
446
447template <typename T, typename WeaknessTag, typename WriteBarrierPolicy,
448 typename CheckingPolicy, typename StorageType>
450 SentinelPointer s, const BasicMember<T, WeaknessTag, WriteBarrierPolicy,
451 CheckingPolicy, StorageType>& member) {
452 return !(s == member);
453}
454
455// Equality with nullptr.
456template <typename T, typename WeaknessTag, typename WriteBarrierPolicy,
457 typename CheckingPolicy, typename StorageType>
459 const BasicMember<T, WeaknessTag, WriteBarrierPolicy, CheckingPolicy,
460 StorageType>& member,
461 std::nullptr_t) {
462 return !static_cast<bool>(member);
463}
464
465template <typename T, typename WeaknessTag, typename WriteBarrierPolicy,
466 typename CheckingPolicy, typename StorageType>
468 const BasicMember<T, WeaknessTag, WriteBarrierPolicy, CheckingPolicy,
469 StorageType>& member,
470 std::nullptr_t n) {
471 return !(member == n);
472}
473
474template <typename T, typename WeaknessTag, typename WriteBarrierPolicy,
475 typename CheckingPolicy, typename StorageType>
477 std::nullptr_t n, const BasicMember<T, WeaknessTag, WriteBarrierPolicy,
478 CheckingPolicy, StorageType>& member) {
479 return member == n;
480}
481
482template <typename T, typename WeaknessTag, typename WriteBarrierPolicy,
483 typename CheckingPolicy, typename StorageType>
485 std::nullptr_t n, const BasicMember<T, WeaknessTag, WriteBarrierPolicy,
486 CheckingPolicy, StorageType>& member) {
487 return !(n == member);
488}
489
490// Relational operators.
491template <typename T1, typename WeaknessTag1, typename WriteBarrierPolicy1,
492 typename CheckingPolicy1, typename T2, typename WeaknessTag2,
493 typename WriteBarrierPolicy2, typename CheckingPolicy2,
494 typename StorageType>
496 const BasicMember<T1, WeaknessTag1, WriteBarrierPolicy1, CheckingPolicy1,
497 StorageType>& member1,
498 const BasicMember<T2, WeaknessTag2, WriteBarrierPolicy2, CheckingPolicy2,
499 StorageType>& member2) {
500 static_assert(
501 IsDecayedSameV<T1, T2>,
502 "Comparison works only for same pointer type modulo cv-qualifiers");
503 return member1.GetRawStorage() < member2.GetRawStorage();
504}
505
506template <typename T1, typename WeaknessTag1, typename WriteBarrierPolicy1,
507 typename CheckingPolicy1, typename T2, typename WeaknessTag2,
508 typename WriteBarrierPolicy2, typename CheckingPolicy2,
509 typename StorageType>
511 const BasicMember<T1, WeaknessTag1, WriteBarrierPolicy1, CheckingPolicy1,
512 StorageType>& member1,
513 const BasicMember<T2, WeaknessTag2, WriteBarrierPolicy2, CheckingPolicy2,
514 StorageType>& member2) {
515 static_assert(
516 IsDecayedSameV<T1, T2>,
517 "Comparison works only for same pointer type modulo cv-qualifiers");
518 return member1.GetRawStorage() <= member2.GetRawStorage();
519}
520
521template <typename T1, typename WeaknessTag1, typename WriteBarrierPolicy1,
522 typename CheckingPolicy1, typename T2, typename WeaknessTag2,
523 typename WriteBarrierPolicy2, typename CheckingPolicy2,
524 typename StorageType>
526 const BasicMember<T1, WeaknessTag1, WriteBarrierPolicy1, CheckingPolicy1,
527 StorageType>& member1,
528 const BasicMember<T2, WeaknessTag2, WriteBarrierPolicy2, CheckingPolicy2,
529 StorageType>& member2) {
530 static_assert(
531 IsDecayedSameV<T1, T2>,
532 "Comparison works only for same pointer type modulo cv-qualifiers");
533 return member1.GetRawStorage() > member2.GetRawStorage();
534}
535
536template <typename T1, typename WeaknessTag1, typename WriteBarrierPolicy1,
537 typename CheckingPolicy1, typename T2, typename WeaknessTag2,
538 typename WriteBarrierPolicy2, typename CheckingPolicy2,
539 typename StorageType>
541 const BasicMember<T1, WeaknessTag1, WriteBarrierPolicy1, CheckingPolicy1,
542 StorageType>& member1,
543 const BasicMember<T2, WeaknessTag2, WriteBarrierPolicy2, CheckingPolicy2,
544 StorageType>& member2) {
545 static_assert(
546 IsDecayedSameV<T1, T2>,
547 "Comparison works only for same pointer type modulo cv-qualifiers");
548 return member1.GetRawStorage() >= member2.GetRawStorage();
549}
550
551template <typename T, typename WriteBarrierPolicy, typename CheckingPolicy,
552 typename StorageType>
553struct IsWeak<BasicMember<T, WeakMemberTag, WriteBarrierPolicy, CheckingPolicy,
554 StorageType>> : std::true_type {};
555
556} // namespace internal
557
563template <typename T>
565 T, internal::StrongMemberTag, internal::DijkstraWriteBarrierPolicy,
567
576template <typename T>
578 T, internal::WeakMemberTag, internal::DijkstraWriteBarrierPolicy,
580
587template <typename T>
589 T, internal::UntracedMemberTag, internal::NoWriteBarrierPolicy,
591
592namespace subtle {
593
598template <typename T>
600 T, internal::StrongMemberTag, internal::DijkstraWriteBarrierPolicy,
602
603#if defined(CPPGC_POINTER_COMPRESSION)
608template <typename T>
609using CompressedMember = internal::BasicMember<
610 T, internal::StrongMemberTag, internal::DijkstraWriteBarrierPolicy,
611 internal::DefaultMemberCheckingPolicy, internal::CompressedPointer>;
612#endif // defined(CPPGC_POINTER_COMPRESSION)
613
614} // namespace subtle
615
616namespace internal {
617
618struct Dummy;
619
620static constexpr size_t kSizeOfMember = sizeof(Member<Dummy>);
621static constexpr size_t kSizeOfUncompressedMember =
623#if defined(CPPGC_POINTER_COMPRESSION)
624static constexpr size_t kSizeofCompressedMember =
625 sizeof(subtle::CompressedMember<Dummy>);
626#endif // defined(CPPGC_POINTER_COMPRESSION)
627
628} // namespace internal
629
630} // namespace cppgc
631
632// Mark `BasicMember<T>` and `T*` as having a common reference type of `T*` (the
633// type to which both can be converted or bound). This makes them satisfy
634// `std::equality_comparable`, which allows usage like the following:
635// ```
636// HeapVector<Member<T>> v;
637// T* e;
638// auto it = std::ranges::find(v, e);
639// ```
640// Without this, the `find()` call above would fail to compile with an error
641// about being unable to invoke `std::ranges::equal_to()`.
642template <typename T, typename WeaknessTag, typename WriteBarrierPolicy,
643 typename CheckingPolicy, typename StorageType,
644 template <typename> typename TQ, template <typename> typename UQ>
645struct std::basic_common_reference<
646 cppgc::internal::BasicMember<T, WeaknessTag, WriteBarrierPolicy,
647 CheckingPolicy, StorageType>,
648 T*, TQ, UQ> {
649 using type = T*;
650};
651
652template <typename T, typename WeaknessTag, typename WriteBarrierPolicy,
653 typename CheckingPolicy, typename StorageType,
654 template <typename> typename TQ, template <typename> typename UQ>
655struct std::basic_common_reference<
656 T*,
657 cppgc::internal::BasicMember<T, WeaknessTag, WriteBarrierPolicy,
658 CheckingPolicy, StorageType>,
659 TQ, UQ> {
660 using type = T*;
661};
662
663#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:280
BasicMember(SentinelPointer s, AtomicInitializerTag atomic)
Definition: member.h:100
RawStorage GetRawStorage() const
Definition: member.h:284
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:274
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:510
bool operator!=(const BasicMember< T1, WeaknessTag1, WriteBarrierPolicy1, CheckingPolicy1, StorageType > &member1, const BasicMember< T2, WeaknessTag2, WriteBarrierPolicy2, CheckingPolicy2, StorageType > &member2)
Definition: member.h:363
bool operator>(const BasicMember< T1, WeaknessTag1, WriteBarrierPolicy1, CheckingPolicy1, StorageType > &member1, const BasicMember< T2, WeaknessTag2, WriteBarrierPolicy2, CheckingPolicy2, StorageType > &member2)
Definition: member.h:525
bool operator==(const BasicMember< T1, WeaknessTag1, WriteBarrierPolicy1, CheckingPolicy1, StorageType > &member1, const BasicMember< T2, WeaknessTag2, WriteBarrierPolicy2, CheckingPolicy2, StorageType > &member2)
Definition: member.h:344
bool operator>=(const BasicMember< T1, WeaknessTag1, WriteBarrierPolicy1, CheckingPolicy1, StorageType > &member1, const BasicMember< T2, WeaknessTag2, WriteBarrierPolicy2, CheckingPolicy2, StorageType > &member2)
Definition: member.h:540
bool operator<(const BasicMember< T1, WeaknessTag1, WriteBarrierPolicy1, CheckingPolicy1, StorageType > &member1, const BasicMember< T2, WeaknessTag2, WriteBarrierPolicy2, CheckingPolicy2, StorageType > &member2)
Definition: member.h:495
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