@babylonjs/v8-android-jit-nointl-nosnapshot 11.110.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (126) hide show
  1. package/dist/include/APIDesign.md +72 -0
  2. package/dist/include/DEPS +10 -0
  3. package/dist/include/DIR_METADATA +11 -0
  4. package/dist/include/OWNERS +23 -0
  5. package/dist/include/cppgc/DEPS +8 -0
  6. package/dist/include/cppgc/OWNERS +2 -0
  7. package/dist/include/cppgc/README.md +135 -0
  8. package/dist/include/cppgc/allocation.h +310 -0
  9. package/dist/include/cppgc/common.h +28 -0
  10. package/dist/include/cppgc/cross-thread-persistent.h +464 -0
  11. package/dist/include/cppgc/custom-space.h +97 -0
  12. package/dist/include/cppgc/default-platform.h +67 -0
  13. package/dist/include/cppgc/ephemeron-pair.h +30 -0
  14. package/dist/include/cppgc/explicit-management.h +100 -0
  15. package/dist/include/cppgc/garbage-collected.h +106 -0
  16. package/dist/include/cppgc/heap-consistency.h +309 -0
  17. package/dist/include/cppgc/heap-handle.h +48 -0
  18. package/dist/include/cppgc/heap-state.h +82 -0
  19. package/dist/include/cppgc/heap-statistics.h +120 -0
  20. package/dist/include/cppgc/heap.h +202 -0
  21. package/dist/include/cppgc/internal/api-constants.h +65 -0
  22. package/dist/include/cppgc/internal/atomic-entry-flag.h +48 -0
  23. package/dist/include/cppgc/internal/base-page-handle.h +45 -0
  24. package/dist/include/cppgc/internal/caged-heap-local-data.h +111 -0
  25. package/dist/include/cppgc/internal/caged-heap.h +61 -0
  26. package/dist/include/cppgc/internal/compiler-specific.h +38 -0
  27. package/dist/include/cppgc/internal/finalizer-trait.h +93 -0
  28. package/dist/include/cppgc/internal/gc-info.h +155 -0
  29. package/dist/include/cppgc/internal/logging.h +50 -0
  30. package/dist/include/cppgc/internal/member-storage.h +236 -0
  31. package/dist/include/cppgc/internal/name-trait.h +137 -0
  32. package/dist/include/cppgc/internal/persistent-node.h +214 -0
  33. package/dist/include/cppgc/internal/pointer-policies.h +207 -0
  34. package/dist/include/cppgc/internal/write-barrier.h +477 -0
  35. package/dist/include/cppgc/liveness-broker.h +78 -0
  36. package/dist/include/cppgc/macros.h +26 -0
  37. package/dist/include/cppgc/member.h +566 -0
  38. package/dist/include/cppgc/name-provider.h +65 -0
  39. package/dist/include/cppgc/object-size-trait.h +58 -0
  40. package/dist/include/cppgc/persistent.h +366 -0
  41. package/dist/include/cppgc/platform.h +158 -0
  42. package/dist/include/cppgc/prefinalizer.h +75 -0
  43. package/dist/include/cppgc/process-heap-statistics.h +36 -0
  44. package/dist/include/cppgc/sentinel-pointer.h +32 -0
  45. package/dist/include/cppgc/source-location.h +92 -0
  46. package/dist/include/cppgc/testing.h +106 -0
  47. package/dist/include/cppgc/trace-trait.h +120 -0
  48. package/dist/include/cppgc/type-traits.h +249 -0
  49. package/dist/include/cppgc/visitor.h +411 -0
  50. package/dist/include/js_protocol-1.2.json +997 -0
  51. package/dist/include/js_protocol-1.3.json +1159 -0
  52. package/dist/include/js_protocol.pdl +1766 -0
  53. package/dist/include/libplatform/DEPS +9 -0
  54. package/dist/include/libplatform/libplatform-export.h +29 -0
  55. package/dist/include/libplatform/libplatform.h +106 -0
  56. package/dist/include/libplatform/v8-tracing.h +333 -0
  57. package/dist/include/v8-array-buffer.h +512 -0
  58. package/dist/include/v8-callbacks.h +412 -0
  59. package/dist/include/v8-container.h +129 -0
  60. package/dist/include/v8-context.h +415 -0
  61. package/dist/include/v8-cppgc.h +231 -0
  62. package/dist/include/v8-data.h +80 -0
  63. package/dist/include/v8-date.h +48 -0
  64. package/dist/include/v8-debug.h +168 -0
  65. package/dist/include/v8-embedder-heap.h +223 -0
  66. package/dist/include/v8-embedder-state-scope.h +51 -0
  67. package/dist/include/v8-exception.h +217 -0
  68. package/dist/include/v8-extension.h +62 -0
  69. package/dist/include/v8-external.h +37 -0
  70. package/dist/include/v8-fast-api-calls.h +957 -0
  71. package/dist/include/v8-forward.h +81 -0
  72. package/dist/include/v8-function-callback.h +475 -0
  73. package/dist/include/v8-function.h +133 -0
  74. package/dist/include/v8-initialization.h +289 -0
  75. package/dist/include/v8-inspector-protocol.h +13 -0
  76. package/dist/include/v8-inspector.h +397 -0
  77. package/dist/include/v8-internal.h +851 -0
  78. package/dist/include/v8-isolate.h +1695 -0
  79. package/dist/include/v8-json.h +47 -0
  80. package/dist/include/v8-local-handle.h +455 -0
  81. package/dist/include/v8-locker.h +138 -0
  82. package/dist/include/v8-maybe.h +160 -0
  83. package/dist/include/v8-memory-span.h +43 -0
  84. package/dist/include/v8-message.h +214 -0
  85. package/dist/include/v8-metrics.h +311 -0
  86. package/dist/include/v8-microtask-queue.h +157 -0
  87. package/dist/include/v8-microtask.h +28 -0
  88. package/dist/include/v8-object.h +768 -0
  89. package/dist/include/v8-persistent-handle.h +588 -0
  90. package/dist/include/v8-platform.h +1130 -0
  91. package/dist/include/v8-primitive-object.h +118 -0
  92. package/dist/include/v8-primitive.h +866 -0
  93. package/dist/include/v8-profiler.h +1277 -0
  94. package/dist/include/v8-promise.h +174 -0
  95. package/dist/include/v8-proxy.h +50 -0
  96. package/dist/include/v8-regexp.h +106 -0
  97. package/dist/include/v8-script.h +803 -0
  98. package/dist/include/v8-snapshot.h +196 -0
  99. package/dist/include/v8-statistics.h +217 -0
  100. package/dist/include/v8-template.h +1018 -0
  101. package/dist/include/v8-traced-handle.h +420 -0
  102. package/dist/include/v8-typed-array.h +282 -0
  103. package/dist/include/v8-unwinder-state.h +31 -0
  104. package/dist/include/v8-unwinder.h +132 -0
  105. package/dist/include/v8-util.h +656 -0
  106. package/dist/include/v8-value-serializer-version.h +24 -0
  107. package/dist/include/v8-value-serializer.h +302 -0
  108. package/dist/include/v8-value.h +531 -0
  109. package/dist/include/v8-version-string.h +38 -0
  110. package/dist/include/v8-version.h +20 -0
  111. package/dist/include/v8-wasm-trap-handler-posix.h +31 -0
  112. package/dist/include/v8-wasm-trap-handler-win.h +28 -0
  113. package/dist/include/v8-wasm.h +200 -0
  114. package/dist/include/v8-weak-callback-info.h +80 -0
  115. package/dist/include/v8.h +88 -0
  116. package/dist/include/v8config.h +904 -0
  117. package/dist/org/chromium/v8-android/11.110.1/v8-android-11.110.1.aar +0 -0
  118. package/dist/org/chromium/v8-android/11.110.1/v8-android-11.110.1.aar.md5 +1 -0
  119. package/dist/org/chromium/v8-android/11.110.1/v8-android-11.110.1.aar.sha1 +1 -0
  120. package/dist/org/chromium/v8-android/11.110.1/v8-android-11.110.1.pom +10 -0
  121. package/dist/org/chromium/v8-android/11.110.1/v8-android-11.110.1.pom.md5 +1 -0
  122. package/dist/org/chromium/v8-android/11.110.1/v8-android-11.110.1.pom.sha1 +1 -0
  123. package/dist/org/chromium/v8-android/maven-metadata.xml +12 -0
  124. package/dist/org/chromium/v8-android/maven-metadata.xml.md5 +1 -0
  125. package/dist/org/chromium/v8-android/maven-metadata.xml.sha1 +1 -0
  126. package/package.json +24 -0
@@ -0,0 +1,214 @@
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_INTERNAL_PERSISTENT_NODE_H_
6
+ #define INCLUDE_CPPGC_INTERNAL_PERSISTENT_NODE_H_
7
+
8
+ #include <array>
9
+ #include <memory>
10
+ #include <vector>
11
+
12
+ #include "cppgc/internal/logging.h"
13
+ #include "cppgc/trace-trait.h"
14
+ #include "v8config.h" // NOLINT(build/include_directory)
15
+
16
+ namespace cppgc {
17
+ namespace internal {
18
+
19
+ class CrossThreadPersistentRegion;
20
+ class FatalOutOfMemoryHandler;
21
+ class RootVisitor;
22
+
23
+ // PersistentNode represents a variant of two states:
24
+ // 1) traceable node with a back pointer to the Persistent object;
25
+ // 2) freelist entry.
26
+ class PersistentNode final {
27
+ public:
28
+ PersistentNode() = default;
29
+
30
+ PersistentNode(const PersistentNode&) = delete;
31
+ PersistentNode& operator=(const PersistentNode&) = delete;
32
+
33
+ void InitializeAsUsedNode(void* owner, TraceRootCallback trace) {
34
+ CPPGC_DCHECK(trace);
35
+ owner_ = owner;
36
+ trace_ = trace;
37
+ }
38
+
39
+ void InitializeAsFreeNode(PersistentNode* next) {
40
+ next_ = next;
41
+ trace_ = nullptr;
42
+ }
43
+
44
+ void UpdateOwner(void* owner) {
45
+ CPPGC_DCHECK(IsUsed());
46
+ owner_ = owner;
47
+ }
48
+
49
+ PersistentNode* FreeListNext() const {
50
+ CPPGC_DCHECK(!IsUsed());
51
+ return next_;
52
+ }
53
+
54
+ void Trace(RootVisitor& root_visitor) const {
55
+ CPPGC_DCHECK(IsUsed());
56
+ trace_(root_visitor, owner_);
57
+ }
58
+
59
+ bool IsUsed() const { return trace_; }
60
+
61
+ void* owner() const {
62
+ CPPGC_DCHECK(IsUsed());
63
+ return owner_;
64
+ }
65
+
66
+ private:
67
+ // PersistentNode acts as a designated union:
68
+ // If trace_ != nullptr, owner_ points to the corresponding Persistent handle.
69
+ // Otherwise, next_ points to the next freed PersistentNode.
70
+ union {
71
+ void* owner_ = nullptr;
72
+ PersistentNode* next_;
73
+ };
74
+ TraceRootCallback trace_ = nullptr;
75
+ };
76
+
77
+ class V8_EXPORT PersistentRegionBase {
78
+ using PersistentNodeSlots = std::array<PersistentNode, 256u>;
79
+
80
+ public:
81
+ // Clears Persistent fields to avoid stale pointers after heap teardown.
82
+ ~PersistentRegionBase();
83
+
84
+ PersistentRegionBase(const PersistentRegionBase&) = delete;
85
+ PersistentRegionBase& operator=(const PersistentRegionBase&) = delete;
86
+
87
+ void Iterate(RootVisitor&);
88
+
89
+ size_t NodesInUse() const;
90
+
91
+ void ClearAllUsedNodes();
92
+
93
+ protected:
94
+ explicit PersistentRegionBase(const FatalOutOfMemoryHandler& oom_handler);
95
+
96
+ PersistentNode* TryAllocateNodeFromFreeList(void* owner,
97
+ TraceRootCallback trace) {
98
+ PersistentNode* node = nullptr;
99
+ if (V8_LIKELY(free_list_head_)) {
100
+ node = free_list_head_;
101
+ free_list_head_ = free_list_head_->FreeListNext();
102
+ CPPGC_DCHECK(!node->IsUsed());
103
+ node->InitializeAsUsedNode(owner, trace);
104
+ nodes_in_use_++;
105
+ }
106
+ return node;
107
+ }
108
+
109
+ void FreeNode(PersistentNode* node) {
110
+ CPPGC_DCHECK(node);
111
+ CPPGC_DCHECK(node->IsUsed());
112
+ node->InitializeAsFreeNode(free_list_head_);
113
+ free_list_head_ = node;
114
+ CPPGC_DCHECK(nodes_in_use_ > 0);
115
+ nodes_in_use_--;
116
+ }
117
+
118
+ PersistentNode* RefillFreeListAndAllocateNode(void* owner,
119
+ TraceRootCallback trace);
120
+
121
+ private:
122
+ template <typename PersistentBaseClass>
123
+ void ClearAllUsedNodes();
124
+
125
+ void RefillFreeList();
126
+
127
+ std::vector<std::unique_ptr<PersistentNodeSlots>> nodes_;
128
+ PersistentNode* free_list_head_ = nullptr;
129
+ size_t nodes_in_use_ = 0;
130
+ const FatalOutOfMemoryHandler& oom_handler_;
131
+
132
+ friend class CrossThreadPersistentRegion;
133
+ };
134
+
135
+ // Variant of PersistentRegionBase that checks whether the allocation and
136
+ // freeing happens only on the thread that created the region.
137
+ class V8_EXPORT PersistentRegion final : public PersistentRegionBase {
138
+ public:
139
+ explicit PersistentRegion(const FatalOutOfMemoryHandler&);
140
+ // Clears Persistent fields to avoid stale pointers after heap teardown.
141
+ ~PersistentRegion() = default;
142
+
143
+ PersistentRegion(const PersistentRegion&) = delete;
144
+ PersistentRegion& operator=(const PersistentRegion&) = delete;
145
+
146
+ V8_INLINE PersistentNode* AllocateNode(void* owner, TraceRootCallback trace) {
147
+ CPPGC_DCHECK(IsCreationThread());
148
+ auto* node = TryAllocateNodeFromFreeList(owner, trace);
149
+ if (V8_LIKELY(node)) return node;
150
+
151
+ // Slow path allocation allows for checking thread correspondence.
152
+ CPPGC_CHECK(IsCreationThread());
153
+ return RefillFreeListAndAllocateNode(owner, trace);
154
+ }
155
+
156
+ V8_INLINE void FreeNode(PersistentNode* node) {
157
+ CPPGC_DCHECK(IsCreationThread());
158
+ PersistentRegionBase::FreeNode(node);
159
+ }
160
+
161
+ private:
162
+ bool IsCreationThread();
163
+
164
+ int creation_thread_id_;
165
+ };
166
+
167
+ // CrossThreadPersistent uses PersistentRegionBase but protects it using this
168
+ // lock when needed.
169
+ class V8_EXPORT PersistentRegionLock final {
170
+ public:
171
+ PersistentRegionLock();
172
+ ~PersistentRegionLock();
173
+
174
+ static void AssertLocked();
175
+ };
176
+
177
+ // Variant of PersistentRegionBase that checks whether the PersistentRegionLock
178
+ // is locked.
179
+ class V8_EXPORT CrossThreadPersistentRegion final
180
+ : protected PersistentRegionBase {
181
+ public:
182
+ explicit CrossThreadPersistentRegion(const FatalOutOfMemoryHandler&);
183
+ // Clears Persistent fields to avoid stale pointers after heap teardown.
184
+ ~CrossThreadPersistentRegion();
185
+
186
+ CrossThreadPersistentRegion(const CrossThreadPersistentRegion&) = delete;
187
+ CrossThreadPersistentRegion& operator=(const CrossThreadPersistentRegion&) =
188
+ delete;
189
+
190
+ V8_INLINE PersistentNode* AllocateNode(void* owner, TraceRootCallback trace) {
191
+ PersistentRegionLock::AssertLocked();
192
+ auto* node = TryAllocateNodeFromFreeList(owner, trace);
193
+ if (V8_LIKELY(node)) return node;
194
+
195
+ return RefillFreeListAndAllocateNode(owner, trace);
196
+ }
197
+
198
+ V8_INLINE void FreeNode(PersistentNode* node) {
199
+ PersistentRegionLock::AssertLocked();
200
+ PersistentRegionBase::FreeNode(node);
201
+ }
202
+
203
+ void Iterate(RootVisitor&);
204
+
205
+ size_t NodesInUse() const;
206
+
207
+ void ClearAllUsedNodes();
208
+ };
209
+
210
+ } // namespace internal
211
+
212
+ } // namespace cppgc
213
+
214
+ #endif // INCLUDE_CPPGC_INTERNAL_PERSISTENT_NODE_H_
@@ -0,0 +1,207 @@
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_INTERNAL_POINTER_POLICIES_H_
6
+ #define INCLUDE_CPPGC_INTERNAL_POINTER_POLICIES_H_
7
+
8
+ #include <cstdint>
9
+ #include <type_traits>
10
+
11
+ #include "cppgc/internal/member-storage.h"
12
+ #include "cppgc/internal/write-barrier.h"
13
+ #include "cppgc/sentinel-pointer.h"
14
+ #include "cppgc/source-location.h"
15
+ #include "cppgc/type-traits.h"
16
+ #include "v8config.h" // NOLINT(build/include_directory)
17
+
18
+ namespace cppgc {
19
+ namespace internal {
20
+
21
+ class HeapBase;
22
+ class PersistentRegion;
23
+ class CrossThreadPersistentRegion;
24
+
25
+ // Tags to distinguish between strong and weak member types.
26
+ class StrongMemberTag;
27
+ class WeakMemberTag;
28
+ class UntracedMemberTag;
29
+
30
+ struct DijkstraWriteBarrierPolicy {
31
+ V8_INLINE static void InitializingBarrier(const void*, const void*) {
32
+ // Since in initializing writes the source object is always white, having no
33
+ // barrier doesn't break the tri-color invariant.
34
+ }
35
+
36
+ V8_INLINE static void AssigningBarrier(const void* slot, const void* value) {
37
+ WriteBarrier::Params params;
38
+ const WriteBarrier::Type type =
39
+ WriteBarrier::GetWriteBarrierType(slot, value, params);
40
+ WriteBarrier(type, params, slot, value);
41
+ }
42
+
43
+ V8_INLINE static void AssigningBarrier(const void* slot,
44
+ MemberStorage storage) {
45
+ WriteBarrier::Params params;
46
+ const WriteBarrier::Type type =
47
+ WriteBarrier::GetWriteBarrierType(slot, storage, params);
48
+ WriteBarrier(type, params, slot, storage.Load());
49
+ }
50
+
51
+ private:
52
+ V8_INLINE static void WriteBarrier(WriteBarrier::Type type,
53
+ const WriteBarrier::Params& params,
54
+ const void* slot, const void* value) {
55
+ switch (type) {
56
+ case WriteBarrier::Type::kGenerational:
57
+ WriteBarrier::GenerationalBarrier<
58
+ WriteBarrier::GenerationalBarrierType::kPreciseSlot>(params, slot);
59
+ break;
60
+ case WriteBarrier::Type::kMarking:
61
+ WriteBarrier::DijkstraMarkingBarrier(params, value);
62
+ break;
63
+ case WriteBarrier::Type::kNone:
64
+ break;
65
+ }
66
+ }
67
+ };
68
+
69
+ struct NoWriteBarrierPolicy {
70
+ V8_INLINE static void InitializingBarrier(const void*, const void*) {}
71
+ V8_INLINE static void AssigningBarrier(const void*, const void*) {}
72
+ V8_INLINE static void AssigningBarrier(const void*, MemberStorage) {}
73
+ };
74
+
75
+ class V8_EXPORT SameThreadEnabledCheckingPolicyBase {
76
+ protected:
77
+ void CheckPointerImpl(const void* ptr, bool points_to_payload,
78
+ bool check_off_heap_assignments);
79
+
80
+ const HeapBase* heap_ = nullptr;
81
+ };
82
+
83
+ template <bool kCheckOffHeapAssignments>
84
+ class V8_EXPORT SameThreadEnabledCheckingPolicy
85
+ : private SameThreadEnabledCheckingPolicyBase {
86
+ protected:
87
+ template <typename T>
88
+ void CheckPointer(const T* ptr) {
89
+ if (!ptr || (kSentinelPointer == ptr)) return;
90
+
91
+ CheckPointersImplTrampoline<T>::Call(this, ptr);
92
+ }
93
+
94
+ private:
95
+ template <typename T, bool = IsCompleteV<T>>
96
+ struct CheckPointersImplTrampoline {
97
+ static void Call(SameThreadEnabledCheckingPolicy* policy, const T* ptr) {
98
+ policy->CheckPointerImpl(ptr, false, kCheckOffHeapAssignments);
99
+ }
100
+ };
101
+
102
+ template <typename T>
103
+ struct CheckPointersImplTrampoline<T, true> {
104
+ static void Call(SameThreadEnabledCheckingPolicy* policy, const T* ptr) {
105
+ policy->CheckPointerImpl(ptr, IsGarbageCollectedTypeV<T>,
106
+ kCheckOffHeapAssignments);
107
+ }
108
+ };
109
+ };
110
+
111
+ class DisabledCheckingPolicy {
112
+ protected:
113
+ V8_INLINE void CheckPointer(const void*) {}
114
+ };
115
+
116
+ #ifdef DEBUG
117
+ // Off heap members are not connected to object graph and thus cannot ressurect
118
+ // dead objects.
119
+ using DefaultMemberCheckingPolicy =
120
+ SameThreadEnabledCheckingPolicy<false /* kCheckOffHeapAssignments*/>;
121
+ using DefaultPersistentCheckingPolicy =
122
+ SameThreadEnabledCheckingPolicy<true /* kCheckOffHeapAssignments*/>;
123
+ #else // !DEBUG
124
+ using DefaultMemberCheckingPolicy = DisabledCheckingPolicy;
125
+ using DefaultPersistentCheckingPolicy = DisabledCheckingPolicy;
126
+ #endif // !DEBUG
127
+ // For CT(W)P neither marking information (for value), nor objectstart bitmap
128
+ // (for slot) are guaranteed to be present because there's no synchronization
129
+ // between heaps after marking.
130
+ using DefaultCrossThreadPersistentCheckingPolicy = DisabledCheckingPolicy;
131
+
132
+ class KeepLocationPolicy {
133
+ public:
134
+ constexpr const SourceLocation& Location() const { return location_; }
135
+
136
+ protected:
137
+ constexpr KeepLocationPolicy() = default;
138
+ constexpr explicit KeepLocationPolicy(const SourceLocation& location)
139
+ : location_(location) {}
140
+
141
+ // KeepLocationPolicy must not copy underlying source locations.
142
+ KeepLocationPolicy(const KeepLocationPolicy&) = delete;
143
+ KeepLocationPolicy& operator=(const KeepLocationPolicy&) = delete;
144
+
145
+ // Location of the original moved from object should be preserved.
146
+ KeepLocationPolicy(KeepLocationPolicy&&) = default;
147
+ KeepLocationPolicy& operator=(KeepLocationPolicy&&) = default;
148
+
149
+ private:
150
+ SourceLocation location_;
151
+ };
152
+
153
+ class IgnoreLocationPolicy {
154
+ public:
155
+ constexpr SourceLocation Location() const { return {}; }
156
+
157
+ protected:
158
+ constexpr IgnoreLocationPolicy() = default;
159
+ constexpr explicit IgnoreLocationPolicy(const SourceLocation&) {}
160
+ };
161
+
162
+ #if CPPGC_SUPPORTS_OBJECT_NAMES
163
+ using DefaultLocationPolicy = KeepLocationPolicy;
164
+ #else
165
+ using DefaultLocationPolicy = IgnoreLocationPolicy;
166
+ #endif
167
+
168
+ struct StrongPersistentPolicy {
169
+ using IsStrongPersistent = std::true_type;
170
+ static V8_EXPORT PersistentRegion& GetPersistentRegion(const void* object);
171
+ };
172
+
173
+ struct WeakPersistentPolicy {
174
+ using IsStrongPersistent = std::false_type;
175
+ static V8_EXPORT PersistentRegion& GetPersistentRegion(const void* object);
176
+ };
177
+
178
+ struct StrongCrossThreadPersistentPolicy {
179
+ using IsStrongPersistent = std::true_type;
180
+ static V8_EXPORT CrossThreadPersistentRegion& GetPersistentRegion(
181
+ const void* object);
182
+ };
183
+
184
+ struct WeakCrossThreadPersistentPolicy {
185
+ using IsStrongPersistent = std::false_type;
186
+ static V8_EXPORT CrossThreadPersistentRegion& GetPersistentRegion(
187
+ const void* object);
188
+ };
189
+
190
+ // Forward declarations setting up the default policies.
191
+ template <typename T, typename WeaknessPolicy,
192
+ typename LocationPolicy = DefaultLocationPolicy,
193
+ typename CheckingPolicy = DefaultCrossThreadPersistentCheckingPolicy>
194
+ class BasicCrossThreadPersistent;
195
+ template <typename T, typename WeaknessPolicy,
196
+ typename LocationPolicy = DefaultLocationPolicy,
197
+ typename CheckingPolicy = DefaultPersistentCheckingPolicy>
198
+ class BasicPersistent;
199
+ template <typename T, typename WeaknessTag, typename WriteBarrierPolicy,
200
+ typename CheckingPolicy = DefaultMemberCheckingPolicy>
201
+ class BasicMember;
202
+
203
+ } // namespace internal
204
+
205
+ } // namespace cppgc
206
+
207
+ #endif // INCLUDE_CPPGC_INTERNAL_POINTER_POLICIES_H_