/src/node/deps/v8/include/v8-local-handle.h
Line | Count | Source (jump to first uncovered line) |
1 | | // Copyright 2021 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_V8_LOCAL_HANDLE_H_ |
6 | | #define INCLUDE_V8_LOCAL_HANDLE_H_ |
7 | | |
8 | | #include <stddef.h> |
9 | | |
10 | | #include <type_traits> |
11 | | #include <vector> |
12 | | |
13 | | #include "v8-handle-base.h" // NOLINT(build/include_directory) |
14 | | #include "v8-internal.h" // NOLINT(build/include_directory) |
15 | | |
16 | | namespace v8 { |
17 | | |
18 | | template <class T> |
19 | | class LocalBase; |
20 | | template <class T> |
21 | | class Local; |
22 | | template <class T> |
23 | | class LocalVector; |
24 | | template <class F> |
25 | | class MaybeLocal; |
26 | | |
27 | | template <class T> |
28 | | class Eternal; |
29 | | template <class T> |
30 | | class Global; |
31 | | |
32 | | template <class T> |
33 | | class NonCopyablePersistentTraits; |
34 | | template <class T> |
35 | | class PersistentBase; |
36 | | template <class T, class M = NonCopyablePersistentTraits<T>> |
37 | | class Persistent; |
38 | | |
39 | | class TracedReferenceBase; |
40 | | template <class T> |
41 | | class BasicTracedReference; |
42 | | template <class F> |
43 | | class TracedReference; |
44 | | |
45 | | class Boolean; |
46 | | class Context; |
47 | | class EscapableHandleScope; |
48 | | template <class F> |
49 | | class FunctionCallbackInfo; |
50 | | class Isolate; |
51 | | class Object; |
52 | | template <class F1, class F2, class F3> |
53 | | class PersistentValueMapBase; |
54 | | template <class F1, class F2> |
55 | | class PersistentValueVector; |
56 | | class Primitive; |
57 | | class Private; |
58 | | template <class F> |
59 | | class PropertyCallbackInfo; |
60 | | template <class F> |
61 | | class ReturnValue; |
62 | | class String; |
63 | | template <class F> |
64 | | class Traced; |
65 | | class Utils; |
66 | | |
67 | | namespace debug { |
68 | | class ConsoleCallArguments; |
69 | | } |
70 | | |
71 | | namespace internal { |
72 | | template <typename T> |
73 | | class CustomArguments; |
74 | | template <typename T> |
75 | | class LocalUnchecked; |
76 | | class SamplingHeapProfiler; |
77 | | } // namespace internal |
78 | | |
79 | | namespace api_internal { |
80 | | // Called when ToLocalChecked is called on an empty Local. |
81 | | V8_EXPORT void ToLocalEmpty(); |
82 | | } // namespace api_internal |
83 | | |
84 | | /** |
85 | | * A stack-allocated class that governs a number of local handles. |
86 | | * After a handle scope has been created, all local handles will be |
87 | | * allocated within that handle scope until either the handle scope is |
88 | | * deleted or another handle scope is created. If there is already a |
89 | | * handle scope and a new one is created, all allocations will take |
90 | | * place in the new handle scope until it is deleted. After that, |
91 | | * new handles will again be allocated in the original handle scope. |
92 | | * |
93 | | * After the handle scope of a local handle has been deleted the |
94 | | * garbage collector will no longer track the object stored in the |
95 | | * handle and may deallocate it. The behavior of accessing a handle |
96 | | * for which the handle scope has been deleted is undefined. |
97 | | */ |
98 | | class V8_EXPORT V8_NODISCARD HandleScope { |
99 | | public: |
100 | | explicit HandleScope(Isolate* isolate); |
101 | | |
102 | | ~HandleScope(); |
103 | | |
104 | | /** |
105 | | * Counts the number of allocated handles. |
106 | | */ |
107 | | static int NumberOfHandles(Isolate* isolate); |
108 | | |
109 | 122k | V8_INLINE Isolate* GetIsolate() const { |
110 | 122k | return reinterpret_cast<Isolate*>(i_isolate_); |
111 | 122k | } |
112 | | |
113 | | HandleScope(const HandleScope&) = delete; |
114 | | void operator=(const HandleScope&) = delete; |
115 | | |
116 | | static internal::Address* CreateHandleForCurrentIsolate( |
117 | | internal::Address value); |
118 | | |
119 | | protected: |
120 | | V8_INLINE HandleScope() = default; |
121 | | |
122 | | void Initialize(Isolate* isolate); |
123 | | |
124 | | static internal::Address* CreateHandle(internal::Isolate* i_isolate, |
125 | | internal::Address value); |
126 | | |
127 | | private: |
128 | | // Declaring operator new and delete as deleted is not spec compliant. |
129 | | // Therefore declare them private instead to disable dynamic alloc |
130 | | void* operator new(size_t size); |
131 | | void* operator new[](size_t size); |
132 | | void operator delete(void*, size_t); |
133 | | void operator delete[](void*, size_t); |
134 | | |
135 | | internal::Isolate* i_isolate_; |
136 | | internal::Address* prev_next_; |
137 | | internal::Address* prev_limit_; |
138 | | #ifdef V8_ENABLE_CHECKS |
139 | | int scope_level_ = 0; |
140 | | #endif |
141 | | |
142 | | // LocalBase<T>::New uses CreateHandle with an Isolate* parameter. |
143 | | template <typename T> |
144 | | friend class LocalBase; |
145 | | |
146 | | // Object::GetInternalField and Context::GetEmbedderData use CreateHandle with |
147 | | // a HeapObject in their shortcuts. |
148 | | friend class Object; |
149 | | friend class Context; |
150 | | }; |
151 | | |
152 | | /** |
153 | | * A base class for local handles. |
154 | | * Its implementation depends on whether direct local support is enabled. |
155 | | * When it is, a local handle contains a direct pointer to the referenced |
156 | | * object, otherwise it contains an indirect pointer. |
157 | | */ |
158 | | #ifdef V8_ENABLE_DIRECT_LOCAL |
159 | | |
160 | | template <typename T> |
161 | | class LocalBase : public api_internal::DirectHandleBase { |
162 | | protected: |
163 | | template <class F> |
164 | | friend class Local; |
165 | | |
166 | | V8_INLINE LocalBase() = default; |
167 | | |
168 | | V8_INLINE explicit LocalBase(internal::Address ptr) : DirectHandleBase(ptr) {} |
169 | | |
170 | | template <typename S> |
171 | | V8_INLINE LocalBase(const LocalBase<S>& other) : DirectHandleBase(other) {} |
172 | | |
173 | | V8_INLINE static LocalBase<T> New(Isolate* isolate, internal::Address value) { |
174 | | return LocalBase<T>(value); |
175 | | } |
176 | | |
177 | | V8_INLINE static LocalBase<T> New(Isolate* isolate, T* that) { |
178 | | return LocalBase<T>::New(isolate, |
179 | | internal::ValueHelper::ValueAsAddress(that)); |
180 | | } |
181 | | |
182 | | V8_INLINE static LocalBase<T> FromSlot(internal::Address* slot) { |
183 | | return LocalBase<T>(*slot); |
184 | | } |
185 | | }; |
186 | | |
187 | | #else // !V8_ENABLE_DIRECT_LOCAL |
188 | | |
189 | | template <typename T> |
190 | | class LocalBase : public api_internal::IndirectHandleBase { |
191 | | protected: |
192 | | template <class F> |
193 | | friend class Local; |
194 | | |
195 | 974M | V8_INLINE LocalBase() = default; v8::LocalBase<v8::ObjectTemplate>::LocalBase() Line | Count | Source | 195 | 4.38M | V8_INLINE LocalBase() = default; |
v8::LocalBase<v8::Value>::LocalBase() Line | Count | Source | 195 | 747M | V8_INLINE LocalBase() = default; |
v8::LocalBase<v8::Function>::LocalBase() Line | Count | Source | 195 | 24.4M | V8_INLINE LocalBase() = default; |
v8::LocalBase<v8::Context>::LocalBase() Line | Count | Source | 195 | 9.53k | V8_INLINE LocalBase() = default; |
v8::LocalBase<v8::Object>::LocalBase() Line | Count | Source | 195 | 5.66M | V8_INLINE LocalBase() = default; |
v8::LocalBase<v8::String>::LocalBase() Line | Count | Source | 195 | 138M | V8_INLINE LocalBase() = default; |
v8::LocalBase<v8::Signature>::LocalBase() Line | Count | Source | 195 | 38.6M | V8_INLINE LocalBase() = default; |
Unexecuted instantiation: v8::LocalBase<v8::Uint32Array>::LocalBase() Unexecuted instantiation: v8::LocalBase<v8::Float64Array>::LocalBase() v8::LocalBase<v8::Array>::LocalBase() Line | Count | Source | 195 | 1.14k | V8_INLINE LocalBase() = default; |
Unexecuted instantiation: v8::LocalBase<v8::Private>::LocalBase() v8::LocalBase<v8::Symbol>::LocalBase() Line | Count | Source | 195 | 1.90k | V8_INLINE LocalBase() = default; |
v8::LocalBase<v8::FunctionTemplate>::LocalBase() Line | Count | Source | 195 | 3.37M | V8_INLINE LocalBase() = default; |
Unexecuted instantiation: v8::LocalBase<v8::Script>::LocalBase() Unexecuted instantiation: v8::LocalBase<v8::Int32Array>::LocalBase() v8::LocalBase<v8::Uint8Array>::LocalBase() Line | Count | Source | 195 | 10 | V8_INLINE LocalBase() = default; |
Unexecuted instantiation: v8::LocalBase<v8::Module>::LocalBase() Unexecuted instantiation: v8::LocalBase<v8::Promise>::LocalBase() Unexecuted instantiation: v8::LocalBase<v8::Promise::Resolver>::LocalBase() v8::LocalBase<v8::ArrayBuffer>::LocalBase() Line | Count | Source | 195 | 244k | V8_INLINE LocalBase() = default; |
v8::LocalBase<v8::Data>::LocalBase() Line | Count | Source | 195 | 11.3M | V8_INLINE LocalBase() = default; |
v8::LocalBase<v8::Boolean>::LocalBase() Line | Count | Source | 195 | 1.90k | V8_INLINE LocalBase() = default; |
v8::LocalBase<v8::ArrayBufferView>::LocalBase() Line | Count | Source | 195 | 953 | V8_INLINE LocalBase() = default; |
v8::LocalBase<v8::UnboundScript>::LocalBase() Line | Count | Source | 195 | 953 | V8_INLINE LocalBase() = default; |
Unexecuted instantiation: v8::LocalBase<v8::BigInt64Array>::LocalBase() Unexecuted instantiation: v8::LocalBase<v8::StackTrace>::LocalBase() Unexecuted instantiation: v8::LocalBase<v8::WasmMemoryObject>::LocalBase() v8::LocalBase<v8::Name>::LocalBase() Line | Count | Source | 195 | 45.0k | V8_INLINE LocalBase() = default; |
Unexecuted instantiation: v8::LocalBase<v8::Number>::LocalBase() Unexecuted instantiation: v8::LocalBase<v8::TypedArray>::LocalBase() Unexecuted instantiation: v8::LocalBase<v8::Int32>::LocalBase() Unexecuted instantiation: v8::LocalBase<v8::Uint32>::LocalBase() |
196 | | |
197 | | V8_INLINE explicit LocalBase(internal::Address* location) |
198 | 236M | : IndirectHandleBase(location) {} v8::LocalBase<v8::Value>::LocalBase(unsigned long*) Line | Count | Source | 198 | 38.2M | : IndirectHandleBase(location) {} |
v8::LocalBase<v8::Primitive>::LocalBase(unsigned long*) Line | Count | Source | 198 | 11.2M | : IndirectHandleBase(location) {} |
v8::LocalBase<v8::Boolean>::LocalBase(unsigned long*) Line | Count | Source | 198 | 35.7M | : IndirectHandleBase(location) {} |
v8::LocalBase<v8::Object>::LocalBase(unsigned long*) Line | Count | Source | 198 | 6.76M | : IndirectHandleBase(location) {} |
v8::LocalBase<v8::String>::LocalBase(unsigned long*) Line | Count | Source | 198 | 110M | : IndirectHandleBase(location) {} |
v8::LocalBase<v8::Symbol>::LocalBase(unsigned long*) Line | Count | Source | 198 | 4.80M | : IndirectHandleBase(location) {} |
v8::LocalBase<v8::FunctionTemplate>::LocalBase(unsigned long*) Line | Count | Source | 198 | 2.63M | : IndirectHandleBase(location) {} |
v8::LocalBase<v8::Uint32Array>::LocalBase(unsigned long*) Line | Count | Source | 198 | 854k | : IndirectHandleBase(location) {} |
v8::LocalBase<v8::Float64Array>::LocalBase(unsigned long*) Line | Count | Source | 198 | 610k | : IndirectHandleBase(location) {} |
v8::LocalBase<v8::Array>::LocalBase(unsigned long*) Line | Count | Source | 198 | 4.88M | : IndirectHandleBase(location) {} |
v8::LocalBase<v8::ObjectTemplate>::LocalBase(unsigned long*) Line | Count | Source | 198 | 4.50M | : IndirectHandleBase(location) {} |
v8::LocalBase<v8::Int32Array>::LocalBase(unsigned long*) Line | Count | Source | 198 | 327k | : IndirectHandleBase(location) {} |
v8::LocalBase<v8::Uint8Array>::LocalBase(unsigned long*) Line | Count | Source | 198 | 488k | : IndirectHandleBase(location) {} |
v8::LocalBase<v8::Private>::LocalBase(unsigned long*) Line | Count | Source | 198 | 3.04M | : IndirectHandleBase(location) {} |
v8::LocalBase<v8::Context>::LocalBase(unsigned long*) Line | Count | Source | 198 | 138k | : IndirectHandleBase(location) {} |
v8::LocalBase<v8::Function>::LocalBase(unsigned long*) Line | Count | Source | 198 | 11.3M | : IndirectHandleBase(location) {} |
v8::LocalBase<v8::Data>::LocalBase(unsigned long*) Line | Count | Source | 198 | 5.52k | : IndirectHandleBase(location) {} |
Unexecuted instantiation: v8::LocalBase<v8::Promise>::LocalBase(unsigned long*) Unexecuted instantiation: v8::LocalBase<v8::Module>::LocalBase(unsigned long*) Unexecuted instantiation: v8::LocalBase<v8::ArrayBuffer>::LocalBase(unsigned long*) v8::LocalBase<v8::UnboundScript>::LocalBase(unsigned long*) Line | Count | Source | 198 | 953 | : IndirectHandleBase(location) {} |
v8::LocalBase<v8::BigInt64Array>::LocalBase(unsigned long*) Line | Count | Source | 198 | 244k | : IndirectHandleBase(location) {} |
Unexecuted instantiation: v8::LocalBase<v8::StackTrace>::LocalBase(unsigned long*) v8::LocalBase<v8::Integer>::LocalBase(unsigned long*) Line | Count | Source | 198 | 152 | : IndirectHandleBase(location) {} |
v8::LocalBase<v8::Map>::LocalBase(unsigned long*) Line | Count | Source | 198 | 122k | : IndirectHandleBase(location) {} |
Unexecuted instantiation: v8::LocalBase<v8::WasmMemoryObject>::LocalBase(unsigned long*) Unexecuted instantiation: v8::LocalBase<v8::ArrayBufferView>::LocalBase(unsigned long*) |
199 | | |
200 | | template <typename S> |
201 | 750M | V8_INLINE LocalBase(const LocalBase<S>& other) : IndirectHandleBase(other) {} v8::LocalBase<v8::Name>::LocalBase<v8::String>(v8::LocalBase<v8::String> const&) Line | Count | Source | 201 | 113M | V8_INLINE LocalBase(const LocalBase<S>& other) : IndirectHandleBase(other) {} |
v8::LocalBase<v8::Value>::LocalBase<v8::String>(v8::LocalBase<v8::String> const&) Line | Count | Source | 201 | 319M | V8_INLINE LocalBase(const LocalBase<S>& other) : IndirectHandleBase(other) {} |
v8::LocalBase<v8::Value>::LocalBase<v8::Object>(v8::LocalBase<v8::Object> const&) Line | Count | Source | 201 | 29.2M | V8_INLINE LocalBase(const LocalBase<S>& other) : IndirectHandleBase(other) {} |
v8::LocalBase<v8::Object>::LocalBase<v8::Value>(v8::LocalBase<v8::Value> const&) Line | Count | Source | 201 | 3.69M | V8_INLINE LocalBase(const LocalBase<S>& other) : IndirectHandleBase(other) {} |
v8::LocalBase<v8::Value>::LocalBase<v8::Array>(v8::LocalBase<v8::Array> const&) Line | Count | Source | 201 | 5.30M | V8_INLINE LocalBase(const LocalBase<S>& other) : IndirectHandleBase(other) {} |
v8::LocalBase<v8::Value>::LocalBase<v8::Primitive>(v8::LocalBase<v8::Primitive> const&) Line | Count | Source | 201 | 10.8M | V8_INLINE LocalBase(const LocalBase<S>& other) : IndirectHandleBase(other) {} |
v8::LocalBase<v8::Value>::LocalBase<v8::Boolean>(v8::LocalBase<v8::Boolean> const&) Line | Count | Source | 201 | 35.4M | V8_INLINE LocalBase(const LocalBase<S>& other) : IndirectHandleBase(other) {} |
v8::LocalBase<v8::Value>::LocalBase<v8::Function>(v8::LocalBase<v8::Function> const&) Line | Count | Source | 201 | 17.9M | V8_INLINE LocalBase(const LocalBase<S>& other) : IndirectHandleBase(other) {} |
v8::LocalBase<v8::Value>::LocalBase<v8::Integer>(v8::LocalBase<v8::Integer> const&) Line | Count | Source | 201 | 62.3M | V8_INLINE LocalBase(const LocalBase<S>& other) : IndirectHandleBase(other) {} |
v8::LocalBase<v8::Value>::LocalBase<v8::FunctionTemplate>(v8::LocalBase<v8::FunctionTemplate> const&) Line | Count | Source | 201 | 1.12M | V8_INLINE LocalBase(const LocalBase<S>& other) : IndirectHandleBase(other) {} |
v8::LocalBase<v8::Number>::LocalBase<v8::Value>(v8::LocalBase<v8::Value> const&) Line | Count | Source | 201 | 9 | V8_INLINE LocalBase(const LocalBase<S>& other) : IndirectHandleBase(other) {} |
v8::LocalBase<v8::Function>::LocalBase<v8::Value>(v8::LocalBase<v8::Value> const&) Line | Count | Source | 201 | 3.50M | V8_INLINE LocalBase(const LocalBase<S>& other) : IndirectHandleBase(other) {} |
v8::LocalBase<v8::Value>::LocalBase<v8::Number>(v8::LocalBase<v8::Number> const&) Line | Count | Source | 201 | 55.3M | V8_INLINE LocalBase(const LocalBase<S>& other) : IndirectHandleBase(other) {} |
v8::LocalBase<v8::Value>::LocalBase<v8::Symbol>(v8::LocalBase<v8::Symbol> const&) Line | Count | Source | 201 | 4.49M | V8_INLINE LocalBase(const LocalBase<S>& other) : IndirectHandleBase(other) {} |
v8::LocalBase<v8::Template>::LocalBase<v8::ObjectTemplate>(v8::LocalBase<v8::ObjectTemplate> const&) Line | Count | Source | 201 | 20.6M | V8_INLINE LocalBase(const LocalBase<S>& other) : IndirectHandleBase(other) {} |
v8::LocalBase<v8::Value>::LocalBase<v8::Uint32Array>(v8::LocalBase<v8::Uint32Array> const&) Line | Count | Source | 201 | 854k | V8_INLINE LocalBase(const LocalBase<S>& other) : IndirectHandleBase(other) {} |
v8::LocalBase<v8::Value>::LocalBase<v8::Float64Array>(v8::LocalBase<v8::Float64Array> const&) Line | Count | Source | 201 | 610k | V8_INLINE LocalBase(const LocalBase<S>& other) : IndirectHandleBase(other) {} |
v8::LocalBase<v8::Value>::LocalBase<v8::Name>(v8::LocalBase<v8::Name> const&) Line | Count | Source | 201 | 45.8k | V8_INLINE LocalBase(const LocalBase<S>& other) : IndirectHandleBase(other) {} |
v8::LocalBase<v8::Array>::LocalBase<v8::Value>(v8::LocalBase<v8::Value> const&) Line | Count | Source | 201 | 130k | V8_INLINE LocalBase(const LocalBase<S>& other) : IndirectHandleBase(other) {} |
v8::LocalBase<v8::Int32>::LocalBase<v8::Value>(v8::LocalBase<v8::Value> const&) Line | Count | Source | 201 | 115k | V8_INLINE LocalBase(const LocalBase<S>& other) : IndirectHandleBase(other) {} |
v8::LocalBase<v8::String>::LocalBase<v8::Value>(v8::LocalBase<v8::Value> const&) Line | Count | Source | 201 | 15.0M | V8_INLINE LocalBase(const LocalBase<S>& other) : IndirectHandleBase(other) {} |
v8::LocalBase<v8::Value>::LocalBase<v8::ObjectTemplate>(v8::LocalBase<v8::ObjectTemplate> const&) Line | Count | Source | 201 | 3.70M | V8_INLINE LocalBase(const LocalBase<S>& other) : IndirectHandleBase(other) {} |
v8::LocalBase<v8::Value>::LocalBase<v8::Int32Array>(v8::LocalBase<v8::Int32Array> const&) Line | Count | Source | 201 | 327k | V8_INLINE LocalBase(const LocalBase<S>& other) : IndirectHandleBase(other) {} |
v8::LocalBase<v8::Value>::LocalBase<v8::Uint8Array>(v8::LocalBase<v8::Uint8Array> const&) Line | Count | Source | 201 | 244k | V8_INLINE LocalBase(const LocalBase<S>& other) : IndirectHandleBase(other) {} |
v8::LocalBase<v8::Value>::LocalBase<v8::Private>(v8::LocalBase<v8::Private> const&) Line | Count | Source | 201 | 9.15M | V8_INLINE LocalBase(const LocalBase<S>& other) : IndirectHandleBase(other) {} |
Unexecuted instantiation: v8::LocalBase<v8::Promise>::LocalBase<v8::Value>(v8::LocalBase<v8::Value> const&) v8::LocalBase<v8::Uint32>::LocalBase<v8::Value>(v8::LocalBase<v8::Value> const&) Line | Count | Source | 201 | 1.30k | V8_INLINE LocalBase(const LocalBase<S>& other) : IndirectHandleBase(other) {} |
v8::LocalBase<v8::Name>::LocalBase<v8::Value>(v8::LocalBase<v8::Value> const&) Line | Count | Source | 201 | 7.51k | V8_INLINE LocalBase(const LocalBase<S>& other) : IndirectHandleBase(other) {} |
Unexecuted instantiation: v8::LocalBase<v8::Uint8Array>::LocalBase<v8::Value>(v8::LocalBase<v8::Value> const&) Unexecuted instantiation: v8::LocalBase<v8::String>::LocalBase<v8::Data>(v8::LocalBase<v8::Data> const&) Unexecuted instantiation: v8::LocalBase<v8::FixedArray>::LocalBase<v8::Data>(v8::LocalBase<v8::Data> const&) Unexecuted instantiation: v8::LocalBase<v8::Symbol>::LocalBase<v8::Data>(v8::LocalBase<v8::Data> const&) Unexecuted instantiation: v8::LocalBase<v8::Data>::LocalBase<v8::Module>(v8::LocalBase<v8::Module> const&) v8::LocalBase<v8::Data>::LocalBase<v8::String>(v8::LocalBase<v8::String> const&) Line | Count | Source | 201 | 122k | V8_INLINE LocalBase(const LocalBase<S>& other) : IndirectHandleBase(other) {} |
v8::LocalBase<v8::Data>::LocalBase<v8::Value>(v8::LocalBase<v8::Value> const&) Line | Count | Source | 201 | 83.0k | V8_INLINE LocalBase(const LocalBase<S>& other) : IndirectHandleBase(other) {} |
Unexecuted instantiation: v8::LocalBase<v8::Data>::LocalBase<v8::Object>(v8::LocalBase<v8::Object> const&) v8::LocalBase<v8::Value>::LocalBase<v8::Data>(v8::LocalBase<v8::Data> const&) Line | Count | Source | 201 | 5.52k | V8_INLINE LocalBase(const LocalBase<S>& other) : IndirectHandleBase(other) {} |
v8::LocalBase<v8::Symbol>::LocalBase<v8::Value>(v8::LocalBase<v8::Value> const&) Line | Count | Source | 201 | 1.90k | V8_INLINE LocalBase(const LocalBase<S>& other) : IndirectHandleBase(other) {} |
v8::LocalBase<v8::Primitive>::LocalBase<v8::Symbol>(v8::LocalBase<v8::Symbol> const&) Line | Count | Source | 201 | 264k | V8_INLINE LocalBase(const LocalBase<S>& other) : IndirectHandleBase(other) {} |
v8::LocalBase<v8::ArrayBufferView>::LocalBase<v8::Value>(v8::LocalBase<v8::Value> const&) Line | Count | Source | 201 | 33.9k | V8_INLINE LocalBase(const LocalBase<S>& other) : IndirectHandleBase(other) {} |
v8::LocalBase<v8::Data>::LocalBase<v8::PrimitiveArray>(v8::LocalBase<v8::PrimitiveArray> const&) Line | Count | Source | 201 | 335k | V8_INLINE LocalBase(const LocalBase<S>& other) : IndirectHandleBase(other) {} |
Unexecuted instantiation: v8::LocalBase<v8::ModuleRequest>::LocalBase<v8::Data>(v8::LocalBase<v8::Data> const&) v8::LocalBase<v8::Boolean>::LocalBase<v8::Value>(v8::LocalBase<v8::Value> const&) Line | Count | Source | 201 | 124k | V8_INLINE LocalBase(const LocalBase<S>& other) : IndirectHandleBase(other) {} |
Unexecuted instantiation: v8::LocalBase<v8::Value>::LocalBase<v8::Promise>(v8::LocalBase<v8::Promise> const&) v8::LocalBase<v8::Data>::LocalBase<v8::Primitive>(v8::LocalBase<v8::Primitive> const&) Line | Count | Source | 201 | 414k | V8_INLINE LocalBase(const LocalBase<S>& other) : IndirectHandleBase(other) {} |
v8::LocalBase<v8::ArrayBuffer>::LocalBase<v8::Value>(v8::LocalBase<v8::Value> const&) Line | Count | Source | 201 | 8 | V8_INLINE LocalBase(const LocalBase<S>& other) : IndirectHandleBase(other) {} |
v8::LocalBase<v8::Value>::LocalBase<v8::ArrayBuffer>(v8::LocalBase<v8::ArrayBuffer> const&) Line | Count | Source | 201 | 18 | V8_INLINE LocalBase(const LocalBase<S>& other) : IndirectHandleBase(other) {} |
Unexecuted instantiation: v8::LocalBase<v8::SharedArrayBuffer>::LocalBase<v8::Value>(v8::LocalBase<v8::Value> const&) v8::LocalBase<v8::Integer>::LocalBase<v8::Value>(v8::LocalBase<v8::Value> const&) Line | Count | Source | 201 | 1.00k | V8_INLINE LocalBase(const LocalBase<S>& other) : IndirectHandleBase(other) {} |
v8::LocalBase<v8::ArrayBufferView>::LocalBase<v8::Object>(v8::LocalBase<v8::Object> const&) Line | Count | Source | 201 | 148k | V8_INLINE LocalBase(const LocalBase<S>& other) : IndirectHandleBase(other) {} |
v8::LocalBase<v8::Object>::LocalBase<v8::Uint8Array>(v8::LocalBase<v8::Uint8Array> const&) Line | Count | Source | 201 | 3.71k | V8_INLINE LocalBase(const LocalBase<S>& other) : IndirectHandleBase(other) {} |
Unexecuted instantiation: v8::LocalBase<v8::Value>::LocalBase<v8::Set>(v8::LocalBase<v8::Set> const&) v8::LocalBase<v8::Data>::LocalBase<v8::FunctionTemplate>(v8::LocalBase<v8::FunctionTemplate> const&) Line | Count | Source | 201 | 31.7M | V8_INLINE LocalBase(const LocalBase<S>& other) : IndirectHandleBase(other) {} |
v8::LocalBase<v8::Name>::LocalBase<v8::Symbol>(v8::LocalBase<v8::Symbol> const&) Line | Count | Source | 201 | 82.9k | V8_INLINE LocalBase(const LocalBase<S>& other) : IndirectHandleBase(other) {} |
v8::LocalBase<v8::Data>::LocalBase<v8::UnboundScript>(v8::LocalBase<v8::UnboundScript> const&) Line | Count | Source | 201 | 953 | V8_INLINE LocalBase(const LocalBase<S>& other) : IndirectHandleBase(other) {} |
Unexecuted instantiation: v8::LocalBase<v8::Value>::LocalBase<v8::Promise::Resolver>(v8::LocalBase<v8::Promise::Resolver> const&) v8::LocalBase<v8::Value>::LocalBase<v8::BigInt64Array>(v8::LocalBase<v8::BigInt64Array> const&) Line | Count | Source | 201 | 244k | V8_INLINE LocalBase(const LocalBase<S>& other) : IndirectHandleBase(other) {} |
Unexecuted instantiation: v8::LocalBase<v8::Promise::Resolver>::LocalBase<v8::Value>(v8::LocalBase<v8::Value> const&) v8::LocalBase<v8::String>::LocalBase<v8::Name>(v8::LocalBase<v8::Name> const&) Line | Count | Source | 201 | 573k | V8_INLINE LocalBase(const LocalBase<S>& other) : IndirectHandleBase(other) {} |
Unexecuted instantiation: v8::LocalBase<v8::BigInt>::LocalBase<v8::Value>(v8::LocalBase<v8::Value> const&) v8::LocalBase<v8::Data>::LocalBase<v8::Integer>(v8::LocalBase<v8::Integer> const&) Line | Count | Source | 201 | 200k | V8_INLINE LocalBase(const LocalBase<S>& other) : IndirectHandleBase(other) {} |
v8::LocalBase<v8::Data>::LocalBase<v8::Symbol>(v8::LocalBase<v8::Symbol> const&) Line | Count | Source | 201 | 122k | V8_INLINE LocalBase(const LocalBase<S>& other) : IndirectHandleBase(other) {} |
Unexecuted instantiation: v8::LocalBase<v8::Promise::Resolver>::LocalBase<v8::Promise>(v8::LocalBase<v8::Promise> const&) Unexecuted instantiation: v8::LocalBase<v8::Promise>::LocalBase<v8::Promise::Resolver>(v8::LocalBase<v8::Promise::Resolver> const&) Unexecuted instantiation: v8::LocalBase<v8::Data>::LocalBase<v8::Promise>(v8::LocalBase<v8::Promise> const&) Unexecuted instantiation: v8::LocalBase<v8::ArrayBuffer>::LocalBase<v8::Object>(v8::LocalBase<v8::Object> const&) Unexecuted instantiation: v8::LocalBase<v8::Primitive>::LocalBase<v8::String>(v8::LocalBase<v8::String> const&) v8::LocalBase<v8::Value>::LocalBase<v8::Map>(v8::LocalBase<v8::Map> const&) Line | Count | Source | 201 | 244k | V8_INLINE LocalBase(const LocalBase<S>& other) : IndirectHandleBase(other) {} |
Unexecuted instantiation: v8::LocalBase<v8::Float64Array>::LocalBase<v8::Value>(v8::LocalBase<v8::Value> const&) Unexecuted instantiation: v8::LocalBase<v8::Value>::LocalBase<v8::SharedArrayBuffer>(v8::LocalBase<v8::SharedArrayBuffer> const&) Unexecuted instantiation: v8::LocalBase<v8::Object>::LocalBase<v8::Promise>(v8::LocalBase<v8::Promise> const&) Unexecuted instantiation: v8::LocalBase<v8::Proxy>::LocalBase<v8::Value>(v8::LocalBase<v8::Value> const&) Unexecuted instantiation: v8::LocalBase<v8::External>::LocalBase<v8::Value>(v8::LocalBase<v8::Value> const&) v8::LocalBase<v8::Data>::LocalBase<v8::Private>(v8::LocalBase<v8::Private> const&) Line | Count | Source | 201 | 1.70M | V8_INLINE LocalBase(const LocalBase<S>& other) : IndirectHandleBase(other) {} |
Unexecuted instantiation: v8::LocalBase<v8::Value>::LocalBase<v8::WasmMemoryObject>(v8::LocalBase<v8::WasmMemoryObject> const&) Unexecuted instantiation: v8::LocalBase<v8::WasmMemoryObject>::LocalBase<v8::Value>(v8::LocalBase<v8::Value> const&) v8::LocalBase<v8::Uint32Array>::LocalBase<v8::Value>(v8::LocalBase<v8::Value> const&) Line | Count | Source | 201 | 5.53k | V8_INLINE LocalBase(const LocalBase<S>& other) : IndirectHandleBase(other) {} |
v8::LocalBase<v8::Data>::LocalBase<v8::Function>(v8::LocalBase<v8::Function> const&) Line | Count | Source | 201 | 5.53k | V8_INLINE LocalBase(const LocalBase<S>& other) : IndirectHandleBase(other) {} |
Unexecuted instantiation: v8::LocalBase<v8::Array>::LocalBase<v8::Object>(v8::LocalBase<v8::Object> const&) v8::LocalBase<v8::Data>::LocalBase<v8::Boolean>(v8::LocalBase<v8::Boolean> const&) Line | Count | Source | 201 | 289k | V8_INLINE LocalBase(const LocalBase<S>& other) : IndirectHandleBase(other) {} |
Unexecuted instantiation: v8::LocalBase<v8::Value>::LocalBase<v8::ArrayBufferView>(v8::LocalBase<v8::ArrayBufferView> const&) Unexecuted instantiation: v8::LocalBase<v8::Map>::LocalBase<v8::Value>(v8::LocalBase<v8::Value> const&) Unexecuted instantiation: v8::LocalBase<v8::Value>::LocalBase<v8::BigInt>(v8::LocalBase<v8::BigInt> const&) Unexecuted instantiation: v8::LocalBase<v8::Value>::LocalBase<v8::External>(v8::LocalBase<v8::External> const&) Unexecuted instantiation: v8::LocalBase<v8::TypedArray>::LocalBase<v8::Int8Array>(v8::LocalBase<v8::Int8Array> const&) Unexecuted instantiation: v8::LocalBase<v8::TypedArray>::LocalBase<v8::Uint8Array>(v8::LocalBase<v8::Uint8Array> const&) Unexecuted instantiation: v8::LocalBase<v8::TypedArray>::LocalBase<v8::Uint8ClampedArray>(v8::LocalBase<v8::Uint8ClampedArray> const&) Unexecuted instantiation: v8::LocalBase<v8::TypedArray>::LocalBase<v8::Int16Array>(v8::LocalBase<v8::Int16Array> const&) Unexecuted instantiation: v8::LocalBase<v8::TypedArray>::LocalBase<v8::Uint16Array>(v8::LocalBase<v8::Uint16Array> const&) Unexecuted instantiation: v8::LocalBase<v8::TypedArray>::LocalBase<v8::Int32Array>(v8::LocalBase<v8::Int32Array> const&) Unexecuted instantiation: v8::LocalBase<v8::TypedArray>::LocalBase<v8::Uint32Array>(v8::LocalBase<v8::Uint32Array> const&) Unexecuted instantiation: v8::LocalBase<v8::TypedArray>::LocalBase<v8::Float32Array>(v8::LocalBase<v8::Float32Array> const&) Unexecuted instantiation: v8::LocalBase<v8::TypedArray>::LocalBase<v8::Float64Array>(v8::LocalBase<v8::Float64Array> const&) Unexecuted instantiation: v8::LocalBase<v8::TypedArray>::LocalBase<v8::BigInt64Array>(v8::LocalBase<v8::BigInt64Array> const&) Unexecuted instantiation: v8::LocalBase<v8::TypedArray>::LocalBase<v8::BigUint64Array>(v8::LocalBase<v8::BigUint64Array> const&) Unexecuted instantiation: v8::LocalBase<v8::Value>::LocalBase<v8::TypedArray>(v8::LocalBase<v8::TypedArray> const&) Unexecuted instantiation: v8::LocalBase<v8::TypedArray>::LocalBase<v8::Value>(v8::LocalBase<v8::Value> const&) Unexecuted instantiation: v8::LocalBase<v8::Value>::LocalBase<v8::DataView>(v8::LocalBase<v8::DataView> const&) Unexecuted instantiation: v8::LocalBase<v8::DataView>::LocalBase<v8::Value>(v8::LocalBase<v8::Value> const&) Unexecuted instantiation: v8::LocalBase<v8::Date>::LocalBase<v8::Value>(v8::LocalBase<v8::Value> const&) |
202 | | |
203 | 3.67M | V8_INLINE static LocalBase<T> New(Isolate* isolate, internal::Address value) { |
204 | 3.67M | return LocalBase(HandleScope::CreateHandle( |
205 | 3.67M | reinterpret_cast<internal::Isolate*>(isolate), value)); |
206 | 3.67M | } v8::LocalBase<v8::Value>::New(v8::Isolate*, unsigned long) Line | Count | Source | 203 | 3.81k | V8_INLINE static LocalBase<T> New(Isolate* isolate, internal::Address value) { | 204 | 3.81k | return LocalBase(HandleScope::CreateHandle( | 205 | 3.81k | reinterpret_cast<internal::Isolate*>(isolate), value)); | 206 | 3.81k | } |
v8::LocalBase<v8::Data>::New(v8::Isolate*, unsigned long) Line | Count | Source | 203 | 5.52k | V8_INLINE static LocalBase<T> New(Isolate* isolate, internal::Address value) { | 204 | 5.52k | return LocalBase(HandleScope::CreateHandle( | 205 | 5.52k | reinterpret_cast<internal::Isolate*>(isolate), value)); | 206 | 5.52k | } |
Unexecuted instantiation: v8::LocalBase<v8::Int8Array>::New(v8::Isolate*, unsigned long) v8::LocalBase<v8::Uint8Array>::New(v8::Isolate*, unsigned long) Line | Count | Source | 203 | 488k | V8_INLINE static LocalBase<T> New(Isolate* isolate, internal::Address value) { | 204 | 488k | return LocalBase(HandleScope::CreateHandle( | 205 | 488k | reinterpret_cast<internal::Isolate*>(isolate), value)); | 206 | 488k | } |
Unexecuted instantiation: v8::LocalBase<v8::Int16Array>::New(v8::Isolate*, unsigned long) Unexecuted instantiation: v8::LocalBase<v8::Uint16Array>::New(v8::Isolate*, unsigned long) v8::LocalBase<v8::Int32Array>::New(v8::Isolate*, unsigned long) Line | Count | Source | 203 | 327k | V8_INLINE static LocalBase<T> New(Isolate* isolate, internal::Address value) { | 204 | 327k | return LocalBase(HandleScope::CreateHandle( | 205 | 327k | reinterpret_cast<internal::Isolate*>(isolate), value)); | 206 | 327k | } |
v8::LocalBase<v8::Uint32Array>::New(v8::Isolate*, unsigned long) Line | Count | Source | 203 | 854k | V8_INLINE static LocalBase<T> New(Isolate* isolate, internal::Address value) { | 204 | 854k | return LocalBase(HandleScope::CreateHandle( | 205 | 854k | reinterpret_cast<internal::Isolate*>(isolate), value)); | 206 | 854k | } |
Unexecuted instantiation: v8::LocalBase<v8::Float32Array>::New(v8::Isolate*, unsigned long) v8::LocalBase<v8::Float64Array>::New(v8::Isolate*, unsigned long) Line | Count | Source | 203 | 610k | V8_INLINE static LocalBase<T> New(Isolate* isolate, internal::Address value) { | 204 | 610k | return LocalBase(HandleScope::CreateHandle( | 205 | 610k | reinterpret_cast<internal::Isolate*>(isolate), value)); | 206 | 610k | } |
v8::LocalBase<v8::BigInt64Array>::New(v8::Isolate*, unsigned long) Line | Count | Source | 203 | 244k | V8_INLINE static LocalBase<T> New(Isolate* isolate, internal::Address value) { | 204 | 244k | return LocalBase(HandleScope::CreateHandle( | 205 | 244k | reinterpret_cast<internal::Isolate*>(isolate), value)); | 206 | 244k | } |
v8::LocalBase<v8::Object>::New(v8::Isolate*, unsigned long) Line | Count | Source | 203 | 1.00M | V8_INLINE static LocalBase<T> New(Isolate* isolate, internal::Address value) { | 204 | 1.00M | return LocalBase(HandleScope::CreateHandle( | 205 | 1.00M | reinterpret_cast<internal::Isolate*>(isolate), value)); | 206 | 1.00M | } |
v8::LocalBase<v8::Context>::New(v8::Isolate*, unsigned long) Line | Count | Source | 203 | 137k | V8_INLINE static LocalBase<T> New(Isolate* isolate, internal::Address value) { | 204 | 137k | return LocalBase(HandleScope::CreateHandle( | 205 | 137k | reinterpret_cast<internal::Isolate*>(isolate), value)); | 206 | 137k | } |
Unexecuted instantiation: v8::LocalBase<v8::Array>::New(v8::Isolate*, unsigned long) v8::LocalBase<v8::Function>::New(v8::Isolate*, unsigned long) Line | Count | Source | 203 | 2 | V8_INLINE static LocalBase<T> New(Isolate* isolate, internal::Address value) { | 204 | 2 | return LocalBase(HandleScope::CreateHandle( | 205 | 2 | reinterpret_cast<internal::Isolate*>(isolate), value)); | 206 | 2 | } |
Unexecuted instantiation: v8::LocalBase<v8::Promise>::New(v8::Isolate*, unsigned long) Unexecuted instantiation: v8::LocalBase<v8::Module>::New(v8::Isolate*, unsigned long) Unexecuted instantiation: v8::LocalBase<v8::ArrayBuffer>::New(v8::Isolate*, unsigned long) v8::LocalBase<v8::UnboundScript>::New(v8::Isolate*, unsigned long) Line | Count | Source | 203 | 953 | V8_INLINE static LocalBase<T> New(Isolate* isolate, internal::Address value) { | 204 | 953 | return LocalBase(HandleScope::CreateHandle( | 205 | 953 | reinterpret_cast<internal::Isolate*>(isolate), value)); | 206 | 953 | } |
Unexecuted instantiation: v8::LocalBase<v8::WasmMemoryObject>::New(v8::Isolate*, unsigned long) Unexecuted instantiation: v8::LocalBase<v8::ArrayBufferView>::New(v8::Isolate*, unsigned long) Unexecuted instantiation: v8::LocalBase<v8::FunctionTemplate>::New(v8::Isolate*, unsigned long) |
207 | | |
208 | 3.66M | V8_INLINE static LocalBase<T> New(Isolate* isolate, T* that) { |
209 | 3.66M | if (internal::ValueHelper::IsEmpty(that)) return LocalBase<T>(); |
210 | 3.66M | return LocalBase<T>::New(isolate, |
211 | 3.66M | internal::ValueHelper::ValueAsAddress(that)); |
212 | 3.66M | } v8::LocalBase<v8::Value>::New(v8::Isolate*, v8::Value*) Line | Count | Source | 208 | 2 | V8_INLINE static LocalBase<T> New(Isolate* isolate, T* that) { | 209 | 2 | if (internal::ValueHelper::IsEmpty(that)) return LocalBase<T>(); | 210 | 2 | return LocalBase<T>::New(isolate, | 211 | 2 | internal::ValueHelper::ValueAsAddress(that)); | 212 | 2 | } |
Unexecuted instantiation: v8::LocalBase<v8::Int8Array>::New(v8::Isolate*, v8::Int8Array*) v8::LocalBase<v8::Uint8Array>::New(v8::Isolate*, v8::Uint8Array*) Line | Count | Source | 208 | 488k | V8_INLINE static LocalBase<T> New(Isolate* isolate, T* that) { | 209 | 488k | if (internal::ValueHelper::IsEmpty(that)) return LocalBase<T>(); | 210 | 488k | return LocalBase<T>::New(isolate, | 211 | 488k | internal::ValueHelper::ValueAsAddress(that)); | 212 | 488k | } |
Unexecuted instantiation: v8::LocalBase<v8::Int16Array>::New(v8::Isolate*, v8::Int16Array*) Unexecuted instantiation: v8::LocalBase<v8::Uint16Array>::New(v8::Isolate*, v8::Uint16Array*) v8::LocalBase<v8::Int32Array>::New(v8::Isolate*, v8::Int32Array*) Line | Count | Source | 208 | 327k | V8_INLINE static LocalBase<T> New(Isolate* isolate, T* that) { | 209 | 327k | if (internal::ValueHelper::IsEmpty(that)) return LocalBase<T>(); | 210 | 327k | return LocalBase<T>::New(isolate, | 211 | 327k | internal::ValueHelper::ValueAsAddress(that)); | 212 | 327k | } |
v8::LocalBase<v8::Uint32Array>::New(v8::Isolate*, v8::Uint32Array*) Line | Count | Source | 208 | 854k | V8_INLINE static LocalBase<T> New(Isolate* isolate, T* that) { | 209 | 854k | if (internal::ValueHelper::IsEmpty(that)) return LocalBase<T>(); | 210 | 854k | return LocalBase<T>::New(isolate, | 211 | 854k | internal::ValueHelper::ValueAsAddress(that)); | 212 | 854k | } |
Unexecuted instantiation: v8::LocalBase<v8::Float32Array>::New(v8::Isolate*, v8::Float32Array*) v8::LocalBase<v8::Float64Array>::New(v8::Isolate*, v8::Float64Array*) Line | Count | Source | 208 | 610k | V8_INLINE static LocalBase<T> New(Isolate* isolate, T* that) { | 209 | 610k | if (internal::ValueHelper::IsEmpty(that)) return LocalBase<T>(); | 210 | 610k | return LocalBase<T>::New(isolate, | 211 | 610k | internal::ValueHelper::ValueAsAddress(that)); | 212 | 610k | } |
v8::LocalBase<v8::BigInt64Array>::New(v8::Isolate*, v8::BigInt64Array*) Line | Count | Source | 208 | 244k | V8_INLINE static LocalBase<T> New(Isolate* isolate, T* that) { | 209 | 244k | if (internal::ValueHelper::IsEmpty(that)) return LocalBase<T>(); | 210 | 244k | return LocalBase<T>::New(isolate, | 211 | 244k | internal::ValueHelper::ValueAsAddress(that)); | 212 | 244k | } |
v8::LocalBase<v8::Object>::New(v8::Isolate*, v8::Object*) Line | Count | Source | 208 | 1.00M | V8_INLINE static LocalBase<T> New(Isolate* isolate, T* that) { | 209 | 1.00M | if (internal::ValueHelper::IsEmpty(that)) return LocalBase<T>(); | 210 | 1.00M | return LocalBase<T>::New(isolate, | 211 | 1.00M | internal::ValueHelper::ValueAsAddress(that)); | 212 | 1.00M | } |
v8::LocalBase<v8::Context>::New(v8::Isolate*, v8::Context*) Line | Count | Source | 208 | 137k | V8_INLINE static LocalBase<T> New(Isolate* isolate, T* that) { | 209 | 137k | if (internal::ValueHelper::IsEmpty(that)) return LocalBase<T>(); | 210 | 137k | return LocalBase<T>::New(isolate, | 211 | 137k | internal::ValueHelper::ValueAsAddress(that)); | 212 | 137k | } |
Unexecuted instantiation: v8::LocalBase<v8::Array>::New(v8::Isolate*, v8::Array*) v8::LocalBase<v8::Function>::New(v8::Isolate*, v8::Function*) Line | Count | Source | 208 | 2 | V8_INLINE static LocalBase<T> New(Isolate* isolate, T* that) { | 209 | 2 | if (internal::ValueHelper::IsEmpty(that)) return LocalBase<T>(); | 210 | 2 | return LocalBase<T>::New(isolate, | 211 | 2 | internal::ValueHelper::ValueAsAddress(that)); | 212 | 2 | } |
Unexecuted instantiation: v8::LocalBase<v8::Promise>::New(v8::Isolate*, v8::Promise*) Unexecuted instantiation: v8::LocalBase<v8::Module>::New(v8::Isolate*, v8::Module*) Unexecuted instantiation: v8::LocalBase<v8::ArrayBuffer>::New(v8::Isolate*, v8::ArrayBuffer*) v8::LocalBase<v8::UnboundScript>::New(v8::Isolate*, v8::UnboundScript*) Line | Count | Source | 208 | 953 | V8_INLINE static LocalBase<T> New(Isolate* isolate, T* that) { | 209 | 953 | if (internal::ValueHelper::IsEmpty(that)) return LocalBase<T>(); | 210 | 953 | return LocalBase<T>::New(isolate, | 211 | 953 | internal::ValueHelper::ValueAsAddress(that)); | 212 | 953 | } |
Unexecuted instantiation: v8::LocalBase<v8::WasmMemoryObject>::New(v8::Isolate*, v8::WasmMemoryObject*) Unexecuted instantiation: v8::LocalBase<v8::ArrayBufferView>::New(v8::Isolate*, v8::ArrayBufferView*) Unexecuted instantiation: v8::LocalBase<v8::FunctionTemplate>::New(v8::Isolate*, v8::FunctionTemplate*) |
213 | | |
214 | 233M | V8_INLINE static LocalBase<T> FromSlot(internal::Address* slot) { |
215 | 233M | return LocalBase<T>(slot); |
216 | 233M | } v8::LocalBase<v8::String>::FromSlot(unsigned long*) Line | Count | Source | 214 | 110M | V8_INLINE static LocalBase<T> FromSlot(internal::Address* slot) { | 215 | 110M | return LocalBase<T>(slot); | 216 | 110M | } |
v8::LocalBase<v8::Primitive>::FromSlot(unsigned long*) Line | Count | Source | 214 | 11.2M | V8_INLINE static LocalBase<T> FromSlot(internal::Address* slot) { | 215 | 11.2M | return LocalBase<T>(slot); | 216 | 11.2M | } |
v8::LocalBase<v8::Boolean>::FromSlot(unsigned long*) Line | Count | Source | 214 | 35.7M | V8_INLINE static LocalBase<T> FromSlot(internal::Address* slot) { | 215 | 35.7M | return LocalBase<T>(slot); | 216 | 35.7M | } |
v8::LocalBase<v8::Value>::FromSlot(unsigned long*) Line | Count | Source | 214 | 38.2M | V8_INLINE static LocalBase<T> FromSlot(internal::Address* slot) { | 215 | 38.2M | return LocalBase<T>(slot); | 216 | 38.2M | } |
v8::LocalBase<v8::Private>::FromSlot(unsigned long*) Line | Count | Source | 214 | 3.04M | V8_INLINE static LocalBase<T> FromSlot(internal::Address* slot) { | 215 | 3.04M | return LocalBase<T>(slot); | 216 | 3.04M | } |
v8::LocalBase<v8::Symbol>::FromSlot(unsigned long*) Line | Count | Source | 214 | 4.80M | V8_INLINE static LocalBase<T> FromSlot(internal::Address* slot) { | 215 | 4.80M | return LocalBase<T>(slot); | 216 | 4.80M | } |
v8::LocalBase<v8::FunctionTemplate>::FromSlot(unsigned long*) Line | Count | Source | 214 | 2.63M | V8_INLINE static LocalBase<T> FromSlot(internal::Address* slot) { | 215 | 2.63M | return LocalBase<T>(slot); | 216 | 2.63M | } |
v8::LocalBase<v8::ObjectTemplate>::FromSlot(unsigned long*) Line | Count | Source | 214 | 4.50M | V8_INLINE static LocalBase<T> FromSlot(internal::Address* slot) { | 215 | 4.50M | return LocalBase<T>(slot); | 216 | 4.50M | } |
v8::LocalBase<v8::Object>::FromSlot(unsigned long*) Line | Count | Source | 214 | 5.76M | V8_INLINE static LocalBase<T> FromSlot(internal::Address* slot) { | 215 | 5.76M | return LocalBase<T>(slot); | 216 | 5.76M | } |
v8::LocalBase<v8::Array>::FromSlot(unsigned long*) Line | Count | Source | 214 | 4.88M | V8_INLINE static LocalBase<T> FromSlot(internal::Address* slot) { | 215 | 4.88M | return LocalBase<T>(slot); | 216 | 4.88M | } |
Unexecuted instantiation: v8::LocalBase<v8::Uint32Array>::FromSlot(unsigned long*) Unexecuted instantiation: v8::LocalBase<v8::Uint8Array>::FromSlot(unsigned long*) Unexecuted instantiation: v8::LocalBase<v8::Float64Array>::FromSlot(unsigned long*) Unexecuted instantiation: v8::LocalBase<v8::Int32Array>::FromSlot(unsigned long*) Unexecuted instantiation: v8::LocalBase<v8::Promise>::FromSlot(unsigned long*) v8::LocalBase<v8::Function>::FromSlot(unsigned long*) Line | Count | Source | 214 | 11.3M | V8_INLINE static LocalBase<T> FromSlot(internal::Address* slot) { | 215 | 11.3M | return LocalBase<T>(slot); | 216 | 11.3M | } |
v8::LocalBase<v8::Context>::FromSlot(unsigned long*) Line | Count | Source | 214 | 953 | V8_INLINE static LocalBase<T> FromSlot(internal::Address* slot) { | 215 | 953 | return LocalBase<T>(slot); | 216 | 953 | } |
Unexecuted instantiation: v8::LocalBase<v8::StackTrace>::FromSlot(unsigned long*) Unexecuted instantiation: v8::LocalBase<v8::BigInt64Array>::FromSlot(unsigned long*) v8::LocalBase<v8::Integer>::FromSlot(unsigned long*) Line | Count | Source | 214 | 152 | V8_INLINE static LocalBase<T> FromSlot(internal::Address* slot) { | 215 | 152 | return LocalBase<T>(slot); | 216 | 152 | } |
v8::LocalBase<v8::Map>::FromSlot(unsigned long*) Line | Count | Source | 214 | 122k | V8_INLINE static LocalBase<T> FromSlot(internal::Address* slot) { | 215 | 122k | return LocalBase<T>(slot); | 216 | 122k | } |
|
217 | | }; |
218 | | |
219 | | #endif // V8_ENABLE_DIRECT_LOCAL |
220 | | |
221 | | /** |
222 | | * An object reference managed by the v8 garbage collector. |
223 | | * |
224 | | * All objects returned from v8 have to be tracked by the garbage collector so |
225 | | * that it knows that the objects are still alive. Also, because the garbage |
226 | | * collector may move objects, it is unsafe to point directly to an object. |
227 | | * Instead, all objects are stored in handles which are known by the garbage |
228 | | * collector and updated whenever an object moves. Handles should always be |
229 | | * passed by value (except in cases like out-parameters) and they should never |
230 | | * be allocated on the heap. |
231 | | * |
232 | | * There are two types of handles: local and persistent handles. |
233 | | * |
234 | | * Local handles are light-weight and transient and typically used in local |
235 | | * operations. They are managed by HandleScopes. That means that a HandleScope |
236 | | * must exist on the stack when they are created and that they are only valid |
237 | | * inside of the HandleScope active during their creation. For passing a local |
238 | | * handle to an outer HandleScope, an EscapableHandleScope and its Escape() |
239 | | * method must be used. |
240 | | * |
241 | | * Persistent handles can be used when storing objects across several |
242 | | * independent operations and have to be explicitly deallocated when they're no |
243 | | * longer used. |
244 | | * |
245 | | * It is safe to extract the object stored in the handle by dereferencing the |
246 | | * handle (for instance, to extract the Object* from a Local<Object>); the value |
247 | | * will still be governed by a handle behind the scenes and the same rules apply |
248 | | * to these values as to their handles. |
249 | | */ |
250 | | template <class T> |
251 | | class V8_TRIVIAL_ABI Local : public LocalBase<T>, |
252 | | #ifdef V8_ENABLE_LOCAL_OFF_STACK_CHECK |
253 | | public api_internal::StackAllocated<true> |
254 | | #else |
255 | | public api_internal::StackAllocated<false> |
256 | | #endif |
257 | | { |
258 | | public: |
259 | 974M | V8_INLINE Local() = default; v8::Local<v8::ObjectTemplate>::Local() Line | Count | Source | 259 | 4.38M | V8_INLINE Local() = default; |
v8::Local<v8::Value>::Local() Line | Count | Source | 259 | 747M | V8_INLINE Local() = default; |
v8::Local<v8::Function>::Local() Line | Count | Source | 259 | 24.4M | V8_INLINE Local() = default; |
v8::Local<v8::Context>::Local() Line | Count | Source | 259 | 9.53k | V8_INLINE Local() = default; |
v8::Local<v8::Object>::Local() Line | Count | Source | 259 | 5.66M | V8_INLINE Local() = default; |
v8::Local<v8::String>::Local() Line | Count | Source | 259 | 138M | V8_INLINE Local() = default; |
v8::Local<v8::Signature>::Local() Line | Count | Source | 259 | 38.6M | V8_INLINE Local() = default; |
v8::Local<v8::Array>::Local() Line | Count | Source | 259 | 1.14k | V8_INLINE Local() = default; |
Unexecuted instantiation: v8::Local<v8::Private>::Local() v8::Local<v8::Symbol>::Local() Line | Count | Source | 259 | 1.90k | V8_INLINE Local() = default; |
v8::Local<v8::FunctionTemplate>::Local() Line | Count | Source | 259 | 3.37M | V8_INLINE Local() = default; |
Unexecuted instantiation: v8::Local<v8::Script>::Local() Unexecuted instantiation: v8::Local<v8::Module>::Local() Unexecuted instantiation: v8::Local<v8::Promise>::Local() Unexecuted instantiation: v8::Local<v8::Promise::Resolver>::Local() v8::Local<v8::ArrayBuffer>::Local() Line | Count | Source | 259 | 244k | V8_INLINE Local() = default; |
v8::Local<v8::Uint8Array>::Local() Line | Count | Source | 259 | 10 | V8_INLINE Local() = default; |
v8::Local<v8::Data>::Local() Line | Count | Source | 259 | 11.3M | V8_INLINE Local() = default; |
v8::Local<v8::Boolean>::Local() Line | Count | Source | 259 | 1.90k | V8_INLINE Local() = default; |
v8::Local<v8::ArrayBufferView>::Local() Line | Count | Source | 259 | 953 | V8_INLINE Local() = default; |
v8::Local<v8::UnboundScript>::Local() Line | Count | Source | 259 | 953 | V8_INLINE Local() = default; |
Unexecuted instantiation: v8::Local<v8::StackTrace>::Local() v8::Local<v8::Name>::Local() Line | Count | Source | 259 | 45.0k | V8_INLINE Local() = default; |
Unexecuted instantiation: v8::Local<v8::Number>::Local() Unexecuted instantiation: v8::Local<v8::TypedArray>::Local() Unexecuted instantiation: v8::Local<v8::Int32>::Local() Unexecuted instantiation: v8::Local<v8::Uint32>::Local() |
260 | | |
261 | | template <class S> |
262 | 667M | V8_INLINE Local(Local<S> that) : LocalBase<T>(that) { |
263 | | /** |
264 | | * This check fails when trying to convert between incompatible |
265 | | * handles. For example, converting from a Local<String> to a |
266 | | * Local<Number>. |
267 | | */ |
268 | 667M | static_assert(std::is_base_of<T, S>::value, "type check"); |
269 | 667M | } v8::Local<v8::Name>::Local<v8::String>(v8::Local<v8::String>) Line | Count | Source | 262 | 113M | V8_INLINE Local(Local<S> that) : LocalBase<T>(that) { | 263 | | /** | 264 | | * This check fails when trying to convert between incompatible | 265 | | * handles. For example, converting from a Local<String> to a | 266 | | * Local<Number>. | 267 | | */ | 268 | 113M | static_assert(std::is_base_of<T, S>::value, "type check"); | 269 | 113M | } |
v8::Local<v8::Value>::Local<v8::String>(v8::Local<v8::String>) Line | Count | Source | 262 | 276M | V8_INLINE Local(Local<S> that) : LocalBase<T>(that) { | 263 | | /** | 264 | | * This check fails when trying to convert between incompatible | 265 | | * handles. For example, converting from a Local<String> to a | 266 | | * Local<Number>. | 267 | | */ | 268 | 276M | static_assert(std::is_base_of<T, S>::value, "type check"); | 269 | 276M | } |
v8::Local<v8::Value>::Local<v8::Object>(v8::Local<v8::Object>) Line | Count | Source | 262 | 29.2M | V8_INLINE Local(Local<S> that) : LocalBase<T>(that) { | 263 | | /** | 264 | | * This check fails when trying to convert between incompatible | 265 | | * handles. For example, converting from a Local<String> to a | 266 | | * Local<Number>. | 267 | | */ | 268 | 29.2M | static_assert(std::is_base_of<T, S>::value, "type check"); | 269 | 29.2M | } |
v8::Local<v8::Value>::Local<v8::Array>(v8::Local<v8::Array>) Line | Count | Source | 262 | 5.30M | V8_INLINE Local(Local<S> that) : LocalBase<T>(that) { | 263 | | /** | 264 | | * This check fails when trying to convert between incompatible | 265 | | * handles. For example, converting from a Local<String> to a | 266 | | * Local<Number>. | 267 | | */ | 268 | 5.30M | static_assert(std::is_base_of<T, S>::value, "type check"); | 269 | 5.30M | } |
v8::Local<v8::Value>::Local<v8::Primitive>(v8::Local<v8::Primitive>) Line | Count | Source | 262 | 10.8M | V8_INLINE Local(Local<S> that) : LocalBase<T>(that) { | 263 | | /** | 264 | | * This check fails when trying to convert between incompatible | 265 | | * handles. For example, converting from a Local<String> to a | 266 | | * Local<Number>. | 267 | | */ | 268 | 10.8M | static_assert(std::is_base_of<T, S>::value, "type check"); | 269 | 10.8M | } |
v8::Local<v8::Value>::Local<v8::Boolean>(v8::Local<v8::Boolean>) Line | Count | Source | 262 | 35.4M | V8_INLINE Local(Local<S> that) : LocalBase<T>(that) { | 263 | | /** | 264 | | * This check fails when trying to convert between incompatible | 265 | | * handles. For example, converting from a Local<String> to a | 266 | | * Local<Number>. | 267 | | */ | 268 | 35.4M | static_assert(std::is_base_of<T, S>::value, "type check"); | 269 | 35.4M | } |
v8::Local<v8::Value>::Local<v8::Function>(v8::Local<v8::Function>) Line | Count | Source | 262 | 17.9M | V8_INLINE Local(Local<S> that) : LocalBase<T>(that) { | 263 | | /** | 264 | | * This check fails when trying to convert between incompatible | 265 | | * handles. For example, converting from a Local<String> to a | 266 | | * Local<Number>. | 267 | | */ | 268 | 17.9M | static_assert(std::is_base_of<T, S>::value, "type check"); | 269 | 17.9M | } |
v8::Local<v8::Value>::Local<v8::Integer>(v8::Local<v8::Integer>) Line | Count | Source | 262 | 62.3M | V8_INLINE Local(Local<S> that) : LocalBase<T>(that) { | 263 | | /** | 264 | | * This check fails when trying to convert between incompatible | 265 | | * handles. For example, converting from a Local<String> to a | 266 | | * Local<Number>. | 267 | | */ | 268 | 62.3M | static_assert(std::is_base_of<T, S>::value, "type check"); | 269 | 62.3M | } |
v8::Local<v8::Value>::Local<v8::Number>(v8::Local<v8::Number>) Line | Count | Source | 262 | 55.3M | V8_INLINE Local(Local<S> that) : LocalBase<T>(that) { | 263 | | /** | 264 | | * This check fails when trying to convert between incompatible | 265 | | * handles. For example, converting from a Local<String> to a | 266 | | * Local<Number>. | 267 | | */ | 268 | 55.3M | static_assert(std::is_base_of<T, S>::value, "type check"); | 269 | 55.3M | } |
v8::Local<v8::Value>::Local<v8::Symbol>(v8::Local<v8::Symbol>) Line | Count | Source | 262 | 2.29M | V8_INLINE Local(Local<S> that) : LocalBase<T>(that) { | 263 | | /** | 264 | | * This check fails when trying to convert between incompatible | 265 | | * handles. For example, converting from a Local<String> to a | 266 | | * Local<Number>. | 267 | | */ | 268 | 2.29M | static_assert(std::is_base_of<T, S>::value, "type check"); | 269 | 2.29M | } |
v8::Local<v8::Template>::Local<v8::ObjectTemplate>(v8::Local<v8::ObjectTemplate>) Line | Count | Source | 262 | 20.6M | V8_INLINE Local(Local<S> that) : LocalBase<T>(that) { | 263 | | /** | 264 | | * This check fails when trying to convert between incompatible | 265 | | * handles. For example, converting from a Local<String> to a | 266 | | * Local<Number>. | 267 | | */ | 268 | 20.6M | static_assert(std::is_base_of<T, S>::value, "type check"); | 269 | 20.6M | } |
v8::Local<v8::Value>::Local<v8::Uint32Array>(v8::Local<v8::Uint32Array>) Line | Count | Source | 262 | 854k | V8_INLINE Local(Local<S> that) : LocalBase<T>(that) { | 263 | | /** | 264 | | * This check fails when trying to convert between incompatible | 265 | | * handles. For example, converting from a Local<String> to a | 266 | | * Local<Number>. | 267 | | */ | 268 | 854k | static_assert(std::is_base_of<T, S>::value, "type check"); | 269 | 854k | } |
v8::Local<v8::Value>::Local<v8::Float64Array>(v8::Local<v8::Float64Array>) Line | Count | Source | 262 | 610k | V8_INLINE Local(Local<S> that) : LocalBase<T>(that) { | 263 | | /** | 264 | | * This check fails when trying to convert between incompatible | 265 | | * handles. For example, converting from a Local<String> to a | 266 | | * Local<Number>. | 267 | | */ | 268 | 610k | static_assert(std::is_base_of<T, S>::value, "type check"); | 269 | 610k | } |
v8::Local<v8::Value>::Local<v8::Name>(v8::Local<v8::Name>) Line | Count | Source | 262 | 45.8k | V8_INLINE Local(Local<S> that) : LocalBase<T>(that) { | 263 | | /** | 264 | | * This check fails when trying to convert between incompatible | 265 | | * handles. For example, converting from a Local<String> to a | 266 | | * Local<Number>. | 267 | | */ | 268 | 45.8k | static_assert(std::is_base_of<T, S>::value, "type check"); | 269 | 45.8k | } |
v8::Local<v8::Value>::Local<v8::Int32Array>(v8::Local<v8::Int32Array>) Line | Count | Source | 262 | 327k | V8_INLINE Local(Local<S> that) : LocalBase<T>(that) { | 263 | | /** | 264 | | * This check fails when trying to convert between incompatible | 265 | | * handles. For example, converting from a Local<String> to a | 266 | | * Local<Number>. | 267 | | */ | 268 | 327k | static_assert(std::is_base_of<T, S>::value, "type check"); | 269 | 327k | } |
v8::Local<v8::Value>::Local<v8::Uint8Array>(v8::Local<v8::Uint8Array>) Line | Count | Source | 262 | 244k | V8_INLINE Local(Local<S> that) : LocalBase<T>(that) { | 263 | | /** | 264 | | * This check fails when trying to convert between incompatible | 265 | | * handles. For example, converting from a Local<String> to a | 266 | | * Local<Number>. | 267 | | */ | 268 | 244k | static_assert(std::is_base_of<T, S>::value, "type check"); | 269 | 244k | } |
Unexecuted instantiation: v8::Local<v8::Data>::Local<v8::Module>(v8::Local<v8::Module>) v8::Local<v8::Data>::Local<v8::String>(v8::Local<v8::String>) Line | Count | Source | 262 | 122k | V8_INLINE Local(Local<S> that) : LocalBase<T>(that) { | 263 | | /** | 264 | | * This check fails when trying to convert between incompatible | 265 | | * handles. For example, converting from a Local<String> to a | 266 | | * Local<Number>. | 267 | | */ | 268 | 122k | static_assert(std::is_base_of<T, S>::value, "type check"); | 269 | 122k | } |
v8::Local<v8::Data>::Local<v8::Value>(v8::Local<v8::Value>) Line | Count | Source | 262 | 83.0k | V8_INLINE Local(Local<S> that) : LocalBase<T>(that) { | 263 | | /** | 264 | | * This check fails when trying to convert between incompatible | 265 | | * handles. For example, converting from a Local<String> to a | 266 | | * Local<Number>. | 267 | | */ | 268 | 83.0k | static_assert(std::is_base_of<T, S>::value, "type check"); | 269 | 83.0k | } |
Unexecuted instantiation: v8::Local<v8::Data>::Local<v8::Object>(v8::Local<v8::Object>) v8::Local<v8::Primitive>::Local<v8::Symbol>(v8::Local<v8::Symbol>) Line | Count | Source | 262 | 264k | V8_INLINE Local(Local<S> that) : LocalBase<T>(that) { | 263 | | /** | 264 | | * This check fails when trying to convert between incompatible | 265 | | * handles. For example, converting from a Local<String> to a | 266 | | * Local<Number>. | 267 | | */ | 268 | 264k | static_assert(std::is_base_of<T, S>::value, "type check"); | 269 | 264k | } |
v8::Local<v8::Data>::Local<v8::PrimitiveArray>(v8::Local<v8::PrimitiveArray>) Line | Count | Source | 262 | 335k | V8_INLINE Local(Local<S> that) : LocalBase<T>(that) { | 263 | | /** | 264 | | * This check fails when trying to convert between incompatible | 265 | | * handles. For example, converting from a Local<String> to a | 266 | | * Local<Number>. | 267 | | */ | 268 | 335k | static_assert(std::is_base_of<T, S>::value, "type check"); | 269 | 335k | } |
Unexecuted instantiation: v8::Local<v8::Value>::Local<v8::Promise>(v8::Local<v8::Promise>) v8::Local<v8::Data>::Local<v8::Primitive>(v8::Local<v8::Primitive>) Line | Count | Source | 262 | 414k | V8_INLINE Local(Local<S> that) : LocalBase<T>(that) { | 263 | | /** | 264 | | * This check fails when trying to convert between incompatible | 265 | | * handles. For example, converting from a Local<String> to a | 266 | | * Local<Number>. | 267 | | */ | 268 | 414k | static_assert(std::is_base_of<T, S>::value, "type check"); | 269 | 414k | } |
v8::Local<v8::Value>::Local<v8::ArrayBuffer>(v8::Local<v8::ArrayBuffer>) Line | Count | Source | 262 | 18 | V8_INLINE Local(Local<S> that) : LocalBase<T>(that) { | 263 | | /** | 264 | | * This check fails when trying to convert between incompatible | 265 | | * handles. For example, converting from a Local<String> to a | 266 | | * Local<Number>. | 267 | | */ | 268 | 18 | static_assert(std::is_base_of<T, S>::value, "type check"); | 269 | 18 | } |
v8::Local<v8::Object>::Local<v8::Uint8Array>(v8::Local<v8::Uint8Array>) Line | Count | Source | 262 | 3.71k | V8_INLINE Local(Local<S> that) : LocalBase<T>(that) { | 263 | | /** | 264 | | * This check fails when trying to convert between incompatible | 265 | | * handles. For example, converting from a Local<String> to a | 266 | | * Local<Number>. | 267 | | */ | 268 | 3.71k | static_assert(std::is_base_of<T, S>::value, "type check"); | 269 | 3.71k | } |
Unexecuted instantiation: v8::Local<v8::Value>::Local<v8::Set>(v8::Local<v8::Set>) v8::Local<v8::Data>::Local<v8::FunctionTemplate>(v8::Local<v8::FunctionTemplate>) Line | Count | Source | 262 | 31.7M | V8_INLINE Local(Local<S> that) : LocalBase<T>(that) { | 263 | | /** | 264 | | * This check fails when trying to convert between incompatible | 265 | | * handles. For example, converting from a Local<String> to a | 266 | | * Local<Number>. | 267 | | */ | 268 | 31.7M | static_assert(std::is_base_of<T, S>::value, "type check"); | 269 | 31.7M | } |
v8::Local<v8::Name>::Local<v8::Symbol>(v8::Local<v8::Symbol>) Line | Count | Source | 262 | 82.9k | V8_INLINE Local(Local<S> that) : LocalBase<T>(that) { | 263 | | /** | 264 | | * This check fails when trying to convert between incompatible | 265 | | * handles. For example, converting from a Local<String> to a | 266 | | * Local<Number>. | 267 | | */ | 268 | 82.9k | static_assert(std::is_base_of<T, S>::value, "type check"); | 269 | 82.9k | } |
v8::Local<v8::Data>::Local<v8::UnboundScript>(v8::Local<v8::UnboundScript>) Line | Count | Source | 262 | 953 | V8_INLINE Local(Local<S> that) : LocalBase<T>(that) { | 263 | | /** | 264 | | * This check fails when trying to convert between incompatible | 265 | | * handles. For example, converting from a Local<String> to a | 266 | | * Local<Number>. | 267 | | */ | 268 | 953 | static_assert(std::is_base_of<T, S>::value, "type check"); | 269 | 953 | } |
Unexecuted instantiation: v8::Local<v8::Value>::Local<v8::Promise::Resolver>(v8::Local<v8::Promise::Resolver>) v8::Local<v8::Value>::Local<v8::BigInt64Array>(v8::Local<v8::BigInt64Array>) Line | Count | Source | 262 | 244k | V8_INLINE Local(Local<S> that) : LocalBase<T>(that) { | 263 | | /** | 264 | | * This check fails when trying to convert between incompatible | 265 | | * handles. For example, converting from a Local<String> to a | 266 | | * Local<Number>. | 267 | | */ | 268 | 244k | static_assert(std::is_base_of<T, S>::value, "type check"); | 269 | 244k | } |
v8::Local<v8::Data>::Local<v8::Integer>(v8::Local<v8::Integer>) Line | Count | Source | 262 | 200k | V8_INLINE Local(Local<S> that) : LocalBase<T>(that) { | 263 | | /** | 264 | | * This check fails when trying to convert between incompatible | 265 | | * handles. For example, converting from a Local<String> to a | 266 | | * Local<Number>. | 267 | | */ | 268 | 200k | static_assert(std::is_base_of<T, S>::value, "type check"); | 269 | 200k | } |
v8::Local<v8::Data>::Local<v8::Symbol>(v8::Local<v8::Symbol>) Line | Count | Source | 262 | 122k | V8_INLINE Local(Local<S> that) : LocalBase<T>(that) { | 263 | | /** | 264 | | * This check fails when trying to convert between incompatible | 265 | | * handles. For example, converting from a Local<String> to a | 266 | | * Local<Number>. | 267 | | */ | 268 | 122k | static_assert(std::is_base_of<T, S>::value, "type check"); | 269 | 122k | } |
Unexecuted instantiation: v8::Local<v8::Data>::Local<v8::Promise>(v8::Local<v8::Promise>) Unexecuted instantiation: v8::Local<v8::Primitive>::Local<v8::String>(v8::Local<v8::String>) v8::Local<v8::Value>::Local<v8::Map>(v8::Local<v8::Map>) Line | Count | Source | 262 | 244k | V8_INLINE Local(Local<S> that) : LocalBase<T>(that) { | 263 | | /** | 264 | | * This check fails when trying to convert between incompatible | 265 | | * handles. For example, converting from a Local<String> to a | 266 | | * Local<Number>. | 267 | | */ | 268 | 244k | static_assert(std::is_base_of<T, S>::value, "type check"); | 269 | 244k | } |
Unexecuted instantiation: v8::Local<v8::Value>::Local<v8::SharedArrayBuffer>(v8::Local<v8::SharedArrayBuffer>) Unexecuted instantiation: v8::Local<v8::Object>::Local<v8::Promise>(v8::Local<v8::Promise>) v8::Local<v8::Data>::Local<v8::Private>(v8::Local<v8::Private>) Line | Count | Source | 262 | 1.70M | V8_INLINE Local(Local<S> that) : LocalBase<T>(that) { | 263 | | /** | 264 | | * This check fails when trying to convert between incompatible | 265 | | * handles. For example, converting from a Local<String> to a | 266 | | * Local<Number>. | 267 | | */ | 268 | 1.70M | static_assert(std::is_base_of<T, S>::value, "type check"); | 269 | 1.70M | } |
Unexecuted instantiation: v8::Local<v8::Value>::Local<v8::WasmMemoryObject>(v8::Local<v8::WasmMemoryObject>) v8::Local<v8::Data>::Local<v8::Function>(v8::Local<v8::Function>) Line | Count | Source | 262 | 5.53k | V8_INLINE Local(Local<S> that) : LocalBase<T>(that) { | 263 | | /** | 264 | | * This check fails when trying to convert between incompatible | 265 | | * handles. For example, converting from a Local<String> to a | 266 | | * Local<Number>. | 267 | | */ | 268 | 5.53k | static_assert(std::is_base_of<T, S>::value, "type check"); | 269 | 5.53k | } |
v8::Local<v8::Data>::Local<v8::Boolean>(v8::Local<v8::Boolean>) Line | Count | Source | 262 | 289k | V8_INLINE Local(Local<S> that) : LocalBase<T>(that) { | 263 | | /** | 264 | | * This check fails when trying to convert between incompatible | 265 | | * handles. For example, converting from a Local<String> to a | 266 | | * Local<Number>. | 267 | | */ | 268 | 289k | static_assert(std::is_base_of<T, S>::value, "type check"); | 269 | 289k | } |
Unexecuted instantiation: v8::Local<v8::Value>::Local<v8::ArrayBufferView>(v8::Local<v8::ArrayBufferView>) Unexecuted instantiation: v8::Local<v8::Value>::Local<v8::BigInt>(v8::Local<v8::BigInt>) Unexecuted instantiation: v8::Local<v8::Value>::Local<v8::External>(v8::Local<v8::External>) Unexecuted instantiation: v8::Local<v8::TypedArray>::Local<v8::Int8Array>(v8::Local<v8::Int8Array>) Unexecuted instantiation: v8::Local<v8::TypedArray>::Local<v8::Uint8Array>(v8::Local<v8::Uint8Array>) Unexecuted instantiation: v8::Local<v8::TypedArray>::Local<v8::Uint8ClampedArray>(v8::Local<v8::Uint8ClampedArray>) Unexecuted instantiation: v8::Local<v8::TypedArray>::Local<v8::Int16Array>(v8::Local<v8::Int16Array>) Unexecuted instantiation: v8::Local<v8::TypedArray>::Local<v8::Uint16Array>(v8::Local<v8::Uint16Array>) Unexecuted instantiation: v8::Local<v8::TypedArray>::Local<v8::Int32Array>(v8::Local<v8::Int32Array>) Unexecuted instantiation: v8::Local<v8::TypedArray>::Local<v8::Uint32Array>(v8::Local<v8::Uint32Array>) Unexecuted instantiation: v8::Local<v8::TypedArray>::Local<v8::Float32Array>(v8::Local<v8::Float32Array>) Unexecuted instantiation: v8::Local<v8::TypedArray>::Local<v8::Float64Array>(v8::Local<v8::Float64Array>) Unexecuted instantiation: v8::Local<v8::TypedArray>::Local<v8::BigInt64Array>(v8::Local<v8::BigInt64Array>) Unexecuted instantiation: v8::Local<v8::TypedArray>::Local<v8::BigUint64Array>(v8::Local<v8::BigUint64Array>) Unexecuted instantiation: v8::Local<v8::Value>::Local<v8::TypedArray>(v8::Local<v8::TypedArray>) Unexecuted instantiation: v8::Local<v8::Value>::Local<v8::DataView>(v8::Local<v8::DataView>) |
270 | | |
271 | 757M | V8_INLINE T* operator->() const { return this->template value<T>(); } v8::Local<v8::Value>::operator->() const Line | Count | Source | 271 | 129M | V8_INLINE T* operator->() const { return this->template value<T>(); } |
Unexecuted instantiation: v8::Local<v8::Data>::operator->() const v8::Local<v8::Context>::operator->() const Line | Count | Source | 271 | 167M | V8_INLINE T* operator->() const { return this->template value<T>(); } |
Unexecuted instantiation: v8::Local<v8::Date>::operator->() const v8::Local<v8::FunctionTemplate>::operator->() const Line | Count | Source | 271 | 50.3M | V8_INLINE T* operator->() const { return this->template value<T>(); } |
v8::Local<v8::Template>::operator->() const Line | Count | Source | 271 | 20.6M | V8_INLINE T* operator->() const { return this->template value<T>(); } |
v8::Local<v8::Function>::operator->() const Line | Count | Source | 271 | 19.9M | V8_INLINE T* operator->() const { return this->template value<T>(); } |
v8::Local<v8::Object>::operator->() const Line | Count | Source | 271 | 278M | V8_INLINE T* operator->() const { return this->template value<T>(); } |
v8::Local<v8::ObjectTemplate>::operator->() const Line | Count | Source | 271 | 25.8M | V8_INLINE T* operator->() const { return this->template value<T>(); } |
v8::Local<v8::Array>::operator->() const Line | Count | Source | 271 | 1.71M | V8_INLINE T* operator->() const { return this->template value<T>(); } |
v8::Local<v8::Number>::operator->() const Line | Count | Source | 271 | 9 | V8_INLINE T* operator->() const { return this->template value<T>(); } |
v8::Local<v8::Int32>::operator->() const Line | Count | Source | 271 | 115k | V8_INLINE T* operator->() const { return this->template value<T>(); } |
Unexecuted instantiation: v8::Local<v8::Private>::operator->() const v8::Local<v8::Symbol>::operator->() const Line | Count | Source | 271 | 2.19M | V8_INLINE T* operator->() const { return this->template value<T>(); } |
v8::Local<v8::String>::operator->() const Line | Count | Source | 271 | 31.0M | V8_INLINE T* operator->() const { return this->template value<T>(); } |
v8::Local<v8::ArrayBuffer>::operator->() const Line | Count | Source | 271 | 2.85M | V8_INLINE T* operator->() const { return this->template value<T>(); } |
v8::Local<v8::Script>::operator->() const Line | Count | Source | 271 | 3.98k | V8_INLINE T* operator->() const { return this->template value<T>(); } |
Unexecuted instantiation: v8::Local<v8::Promise>::operator->() const v8::Local<v8::Uint32Array>::operator->() const Line | Count | Source | 271 | 5.53k | V8_INLINE T* operator->() const { return this->template value<T>(); } |
v8::Local<v8::Uint8Array>::operator->() const Line | Count | Source | 271 | 248k | V8_INLINE T* operator->() const { return this->template value<T>(); } |
Unexecuted instantiation: v8::Local<v8::Float64Array>::operator->() const Unexecuted instantiation: v8::Local<v8::Int32Array>::operator->() const v8::Local<v8::Uint32>::operator->() const Line | Count | Source | 271 | 1.30k | V8_INLINE T* operator->() const { return this->template value<T>(); } |
v8::Local<v8::Name>::operator->() const Line | Count | Source | 271 | 1.14M | V8_INLINE T* operator->() const { return this->template value<T>(); } |
Unexecuted instantiation: v8::Local<v8::Module>::operator->() const v8::Local<v8::PrimitiveArray>::operator->() const Line | Count | Source | 271 | 264k | V8_INLINE T* operator->() const { return this->template value<T>(); } |
v8::Local<v8::ArrayBufferView>::operator->() const Line | Count | Source | 271 | 508k | V8_INLINE T* operator->() const { return this->template value<T>(); } |
Unexecuted instantiation: v8::Local<v8::UnboundModuleScript>::operator->() const Unexecuted instantiation: v8::Local<v8::FixedArray>::operator->() const Unexecuted instantiation: v8::Local<v8::ModuleRequest>::operator->() const v8::Local<v8::Boolean>::operator->() const Line | Count | Source | 271 | 122k | V8_INLINE T* operator->() const { return this->template value<T>(); } |
Unexecuted instantiation: v8::Local<v8::Promise::Resolver>::operator->() const Unexecuted instantiation: v8::Local<v8::SharedArrayBuffer>::operator->() const v8::Local<v8::Integer>::operator->() const Line | Count | Source | 271 | 1.00k | V8_INLINE T* operator->() const { return this->template value<T>(); } |
Unexecuted instantiation: v8::Local<v8::Set>::operator->() const v8::Local<v8::UnboundScript>::operator->() const Line | Count | Source | 271 | 2.85k | V8_INLINE T* operator->() const { return this->template value<T>(); } |
v8::Local<v8::Message>::operator->() const Line | Count | Source | 271 | 1.44M | V8_INLINE T* operator->() const { return this->template value<T>(); } |
Unexecuted instantiation: v8::Local<v8::StackFrame>::operator->() const Unexecuted instantiation: v8::Local<v8::StackTrace>::operator->() const Unexecuted instantiation: v8::Local<v8::BigInt>::operator->() const Unexecuted instantiation: v8::Local<v8::BigInt64Array>::operator->() const Unexecuted instantiation: v8::Local<v8::WasmModuleObject>::operator->() const v8::Local<v8::Map>::operator->() const Line | Count | Source | 271 | 24.0M | V8_INLINE T* operator->() const { return this->template value<T>(); } |
Unexecuted instantiation: v8::Local<v8::Proxy>::operator->() const Unexecuted instantiation: v8::Local<v8::External>::operator->() const Unexecuted instantiation: v8::Local<v8::WasmMemoryObject>::operator->() const Unexecuted instantiation: v8::Local<v8::TypedArray>::operator->() const Unexecuted instantiation: v8::Local<v8::DataView>::operator->() const |
272 | | |
273 | 63.4M | V8_INLINE T* operator*() const { return this->operator->(); } v8::Local<v8::Value>::operator*() const Line | Count | Source | 273 | 59.1M | V8_INLINE T* operator*() const { return this->operator->(); } |
Unexecuted instantiation: v8::Local<v8::Data>::operator*() const v8::Local<v8::Array>::operator*() const Line | Count | Source | 273 | 122k | V8_INLINE T* operator*() const { return this->operator->(); } |
v8::Local<v8::Object>::operator*() const Line | Count | Source | 273 | 977k | V8_INLINE T* operator*() const { return this->operator->(); } |
v8::Local<v8::Function>::operator*() const Line | Count | Source | 273 | 3.03M | V8_INLINE T* operator*() const { return this->operator->(); } |
v8::Local<v8::Context>::operator*() const Line | Count | Source | 273 | 246k | V8_INLINE T* operator*() const { return this->operator->(); } |
Unexecuted instantiation: v8::Local<v8::Private>::operator*() const Unexecuted instantiation: v8::Local<v8::Symbol>::operator*() const Unexecuted instantiation: v8::Local<v8::String>::operator*() const Unexecuted instantiation: v8::Local<v8::FunctionTemplate>::operator*() const Unexecuted instantiation: v8::Local<v8::ObjectTemplate>::operator*() const Unexecuted instantiation: v8::Local<v8::Uint32Array>::operator*() const Unexecuted instantiation: v8::Local<v8::Uint8Array>::operator*() const Unexecuted instantiation: v8::Local<v8::Float64Array>::operator*() const Unexecuted instantiation: v8::Local<v8::Int32Array>::operator*() const Unexecuted instantiation: v8::Local<v8::Promise>::operator*() const Unexecuted instantiation: v8::Local<v8::ArrayBuffer>::operator*() const v8::Local<v8::UnboundScript>::operator*() const Line | Count | Source | 273 | 953 | V8_INLINE T* operator*() const { return this->operator->(); } |
Unexecuted instantiation: v8::Local<v8::BigInt64Array>::operator*() const Unexecuted instantiation: v8::Local<v8::WasmMemoryObject>::operator*() const Unexecuted instantiation: v8::Local<v8::ArrayBufferView>::operator*() const Unexecuted instantiation: v8::Local<v8::External>::operator*() const Unexecuted instantiation: v8::Local<v8::Promise::Resolver>::operator*() const |
274 | | |
275 | | /** |
276 | | * Checks whether two handles are equal or different. |
277 | | * They are equal iff they are both empty or they are both non-empty and the |
278 | | * objects to which they refer are physically equal. |
279 | | * |
280 | | * If both handles refer to JS objects, this is the same as strict |
281 | | * non-equality. For primitives, such as numbers or strings, a `true` return |
282 | | * value does not indicate that the values aren't equal in the JavaScript |
283 | | * sense. Use `Value::StrictEquals()` to check primitives for equality. |
284 | | */ |
285 | | |
286 | | template <class S> |
287 | 347k | V8_INLINE bool operator==(const Local<S>& that) const { |
288 | 347k | return internal::HandleHelper::EqualHandles(*this, that); |
289 | 347k | } bool v8::Local<v8::Object>::operator==<v8::Object>(v8::Local<v8::Object> const&) const Line | Count | Source | 287 | 97.3k | V8_INLINE bool operator==(const Local<S>& that) const { | 288 | 97.3k | return internal::HandleHelper::EqualHandles(*this, that); | 289 | 97.3k | } |
bool v8::Local<v8::Context>::operator==<v8::Context>(v8::Local<v8::Context> const&) const Line | Count | Source | 287 | 246k | V8_INLINE bool operator==(const Local<S>& that) const { | 288 | 246k | return internal::HandleHelper::EqualHandles(*this, that); | 289 | 246k | } |
bool v8::Local<v8::Value>::operator==<v8::Object>(v8::Local<v8::Object> const&) const Line | Count | Source | 287 | 3.81k | V8_INLINE bool operator==(const Local<S>& that) const { | 288 | 3.81k | return internal::HandleHelper::EqualHandles(*this, that); | 289 | 3.81k | } |
Unexecuted instantiation: bool v8::Local<v8::SharedArrayBuffer>::operator==<v8::SharedArrayBuffer>(v8::Local<v8::SharedArrayBuffer> const&) const Unexecuted instantiation: bool v8::Local<v8::ArrayBuffer>::operator==<v8::ArrayBuffer>(v8::Local<v8::ArrayBuffer> const&) const Unexecuted instantiation: bool v8::Local<v8::Value>::operator==<v8::Symbol>(v8::Local<v8::Symbol> const&) const Unexecuted instantiation: bool v8::Local<v8::Object>::operator==<v8::Value>(v8::Local<v8::Value> const&) const |
290 | | |
291 | | template <class S> |
292 | | V8_INLINE bool operator==(const PersistentBase<S>& that) const { |
293 | | return internal::HandleHelper::EqualHandles(*this, that); |
294 | | } |
295 | | |
296 | | template <class S> |
297 | 219k | V8_INLINE bool operator!=(const Local<S>& that) const { |
298 | 219k | return !operator==(that); |
299 | 219k | } bool v8::Local<v8::Object>::operator!=<v8::Object>(v8::Local<v8::Object> const&) const Line | Count | Source | 297 | 97.3k | V8_INLINE bool operator!=(const Local<S>& that) const { | 298 | 97.3k | return !operator==(that); | 299 | 97.3k | } |
bool v8::Local<v8::Context>::operator!=<v8::Context>(v8::Local<v8::Context> const&) const Line | Count | Source | 297 | 122k | V8_INLINE bool operator!=(const Local<S>& that) const { | 298 | 122k | return !operator==(that); | 299 | 122k | } |
|
300 | | |
301 | | template <class S> |
302 | | V8_INLINE bool operator!=(const Persistent<S>& that) const { |
303 | | return !operator==(that); |
304 | | } |
305 | | |
306 | | /** |
307 | | * Cast a handle to a subclass, e.g. Local<Value> to Local<Object>. |
308 | | * This is only valid if the handle actually refers to a value of the |
309 | | * target type. |
310 | | */ |
311 | | template <class S> |
312 | 23.4M | V8_INLINE static Local<T> Cast(Local<S> that) { |
313 | | #ifdef V8_ENABLE_CHECKS |
314 | | // If we're going to perform the type check then we have to check |
315 | | // that the handle isn't empty before doing the checked cast. |
316 | | if (that.IsEmpty()) return Local<T>(); |
317 | | T::Cast(that.template value<S>()); |
318 | | #endif |
319 | 23.4M | return Local<T>(LocalBase<T>(that)); |
320 | 23.4M | } v8::Local<v8::Number> v8::Local<v8::Number>::Cast<v8::Value>(v8::Local<v8::Value>) Line | Count | Source | 312 | 9 | V8_INLINE static Local<T> Cast(Local<S> that) { | 313 | | #ifdef V8_ENABLE_CHECKS | 314 | | // If we're going to perform the type check then we have to check | 315 | | // that the handle isn't empty before doing the checked cast. | 316 | | if (that.IsEmpty()) return Local<T>(); | 317 | | T::Cast(that.template value<S>()); | 318 | | #endif | 319 | 9 | return Local<T>(LocalBase<T>(that)); | 320 | 9 | } |
v8::Local<v8::Object> v8::Local<v8::Object>::Cast<v8::Value>(v8::Local<v8::Value>) Line | Count | Source | 312 | 3.69M | V8_INLINE static Local<T> Cast(Local<S> that) { | 313 | | #ifdef V8_ENABLE_CHECKS | 314 | | // If we're going to perform the type check then we have to check | 315 | | // that the handle isn't empty before doing the checked cast. | 316 | | if (that.IsEmpty()) return Local<T>(); | 317 | | T::Cast(that.template value<S>()); | 318 | | #endif | 319 | 3.69M | return Local<T>(LocalBase<T>(that)); | 320 | 3.69M | } |
v8::Local<v8::Function> v8::Local<v8::Function>::Cast<v8::Value>(v8::Local<v8::Value>) Line | Count | Source | 312 | 3.50M | V8_INLINE static Local<T> Cast(Local<S> that) { | 313 | | #ifdef V8_ENABLE_CHECKS | 314 | | // If we're going to perform the type check then we have to check | 315 | | // that the handle isn't empty before doing the checked cast. | 316 | | if (that.IsEmpty()) return Local<T>(); | 317 | | T::Cast(that.template value<S>()); | 318 | | #endif | 319 | 3.50M | return Local<T>(LocalBase<T>(that)); | 320 | 3.50M | } |
v8::Local<v8::Name> v8::Local<v8::Name>::Cast<v8::String>(v8::Local<v8::String>) Line | Count | Source | 312 | 776 | V8_INLINE static Local<T> Cast(Local<S> that) { | 313 | | #ifdef V8_ENABLE_CHECKS | 314 | | // If we're going to perform the type check then we have to check | 315 | | // that the handle isn't empty before doing the checked cast. | 316 | | if (that.IsEmpty()) return Local<T>(); | 317 | | T::Cast(that.template value<S>()); | 318 | | #endif | 319 | 776 | return Local<T>(LocalBase<T>(that)); | 320 | 776 | } |
v8::Local<v8::Name> v8::Local<v8::Name>::Cast<v8::Symbol>(v8::Local<v8::Symbol>) Line | Count | Source | 312 | 4 | V8_INLINE static Local<T> Cast(Local<S> that) { | 313 | | #ifdef V8_ENABLE_CHECKS | 314 | | // If we're going to perform the type check then we have to check | 315 | | // that the handle isn't empty before doing the checked cast. | 316 | | if (that.IsEmpty()) return Local<T>(); | 317 | | T::Cast(that.template value<S>()); | 318 | | #endif | 319 | 4 | return Local<T>(LocalBase<T>(that)); | 320 | 4 | } |
v8::Local<v8::Array> v8::Local<v8::Array>::Cast<v8::Value>(v8::Local<v8::Value>) Line | Count | Source | 312 | 130k | V8_INLINE static Local<T> Cast(Local<S> that) { | 313 | | #ifdef V8_ENABLE_CHECKS | 314 | | // If we're going to perform the type check then we have to check | 315 | | // that the handle isn't empty before doing the checked cast. | 316 | | if (that.IsEmpty()) return Local<T>(); | 317 | | T::Cast(that.template value<S>()); | 318 | | #endif | 319 | 130k | return Local<T>(LocalBase<T>(that)); | 320 | 130k | } |
v8::Local<v8::Int32> v8::Local<v8::Int32>::Cast<v8::Value>(v8::Local<v8::Value>) Line | Count | Source | 312 | 115k | V8_INLINE static Local<T> Cast(Local<S> that) { | 313 | | #ifdef V8_ENABLE_CHECKS | 314 | | // If we're going to perform the type check then we have to check | 315 | | // that the handle isn't empty before doing the checked cast. | 316 | | if (that.IsEmpty()) return Local<T>(); | 317 | | T::Cast(that.template value<S>()); | 318 | | #endif | 319 | 115k | return Local<T>(LocalBase<T>(that)); | 320 | 115k | } |
v8::Local<v8::String> v8::Local<v8::String>::Cast<v8::Value>(v8::Local<v8::Value>) Line | Count | Source | 312 | 15.0M | V8_INLINE static Local<T> Cast(Local<S> that) { | 313 | | #ifdef V8_ENABLE_CHECKS | 314 | | // If we're going to perform the type check then we have to check | 315 | | // that the handle isn't empty before doing the checked cast. | 316 | | if (that.IsEmpty()) return Local<T>(); | 317 | | T::Cast(that.template value<S>()); | 318 | | #endif | 319 | 15.0M | return Local<T>(LocalBase<T>(that)); | 320 | 15.0M | } |
Unexecuted instantiation: v8::Local<v8::Promise> v8::Local<v8::Promise>::Cast<v8::Value>(v8::Local<v8::Value>) v8::Local<v8::Uint32> v8::Local<v8::Uint32>::Cast<v8::Value>(v8::Local<v8::Value>) Line | Count | Source | 312 | 1.30k | V8_INLINE static Local<T> Cast(Local<S> that) { | 313 | | #ifdef V8_ENABLE_CHECKS | 314 | | // If we're going to perform the type check then we have to check | 315 | | // that the handle isn't empty before doing the checked cast. | 316 | | if (that.IsEmpty()) return Local<T>(); | 317 | | T::Cast(that.template value<S>()); | 318 | | #endif | 319 | 1.30k | return Local<T>(LocalBase<T>(that)); | 320 | 1.30k | } |
v8::Local<v8::Name> v8::Local<v8::Name>::Cast<v8::Value>(v8::Local<v8::Value>) Line | Count | Source | 312 | 7.51k | V8_INLINE static Local<T> Cast(Local<S> that) { | 313 | | #ifdef V8_ENABLE_CHECKS | 314 | | // If we're going to perform the type check then we have to check | 315 | | // that the handle isn't empty before doing the checked cast. | 316 | | if (that.IsEmpty()) return Local<T>(); | 317 | | T::Cast(that.template value<S>()); | 318 | | #endif | 319 | 7.51k | return Local<T>(LocalBase<T>(that)); | 320 | 7.51k | } |
Unexecuted instantiation: v8::Local<v8::Uint8Array> v8::Local<v8::Uint8Array>::Cast<v8::Value>(v8::Local<v8::Value>) Unexecuted instantiation: v8::Local<v8::String> v8::Local<v8::String>::Cast<v8::Data>(v8::Local<v8::Data>) Unexecuted instantiation: v8::Local<v8::FixedArray> v8::Local<v8::FixedArray>::Cast<v8::Data>(v8::Local<v8::Data>) Unexecuted instantiation: v8::Local<v8::Symbol> v8::Local<v8::Symbol>::Cast<v8::Data>(v8::Local<v8::Data>) v8::Local<v8::Value> v8::Local<v8::Value>::Cast<v8::Data>(v8::Local<v8::Data>) Line | Count | Source | 312 | 5.52k | V8_INLINE static Local<T> Cast(Local<S> that) { | 313 | | #ifdef V8_ENABLE_CHECKS | 314 | | // If we're going to perform the type check then we have to check | 315 | | // that the handle isn't empty before doing the checked cast. | 316 | | if (that.IsEmpty()) return Local<T>(); | 317 | | T::Cast(that.template value<S>()); | 318 | | #endif | 319 | 5.52k | return Local<T>(LocalBase<T>(that)); | 320 | 5.52k | } |
v8::Local<v8::Symbol> v8::Local<v8::Symbol>::Cast<v8::Value>(v8::Local<v8::Value>) Line | Count | Source | 312 | 1.90k | V8_INLINE static Local<T> Cast(Local<S> that) { | 313 | | #ifdef V8_ENABLE_CHECKS | 314 | | // If we're going to perform the type check then we have to check | 315 | | // that the handle isn't empty before doing the checked cast. | 316 | | if (that.IsEmpty()) return Local<T>(); | 317 | | T::Cast(that.template value<S>()); | 318 | | #endif | 319 | 1.90k | return Local<T>(LocalBase<T>(that)); | 320 | 1.90k | } |
v8::Local<v8::ArrayBufferView> v8::Local<v8::ArrayBufferView>::Cast<v8::Value>(v8::Local<v8::Value>) Line | Count | Source | 312 | 33.9k | V8_INLINE static Local<T> Cast(Local<S> that) { | 313 | | #ifdef V8_ENABLE_CHECKS | 314 | | // If we're going to perform the type check then we have to check | 315 | | // that the handle isn't empty before doing the checked cast. | 316 | | if (that.IsEmpty()) return Local<T>(); | 317 | | T::Cast(that.template value<S>()); | 318 | | #endif | 319 | 33.9k | return Local<T>(LocalBase<T>(that)); | 320 | 33.9k | } |
Unexecuted instantiation: v8::Local<v8::Value> v8::Local<v8::Value>::Cast<v8::Primitive>(v8::Local<v8::Primitive>) Unexecuted instantiation: v8::Local<v8::ModuleRequest> v8::Local<v8::ModuleRequest>::Cast<v8::Data>(v8::Local<v8::Data>) v8::Local<v8::Boolean> v8::Local<v8::Boolean>::Cast<v8::Value>(v8::Local<v8::Value>) Line | Count | Source | 312 | 124k | V8_INLINE static Local<T> Cast(Local<S> that) { | 313 | | #ifdef V8_ENABLE_CHECKS | 314 | | // If we're going to perform the type check then we have to check | 315 | | // that the handle isn't empty before doing the checked cast. | 316 | | if (that.IsEmpty()) return Local<T>(); | 317 | | T::Cast(that.template value<S>()); | 318 | | #endif | 319 | 124k | return Local<T>(LocalBase<T>(that)); | 320 | 124k | } |
v8::Local<v8::ArrayBuffer> v8::Local<v8::ArrayBuffer>::Cast<v8::Value>(v8::Local<v8::Value>) Line | Count | Source | 312 | 8 | V8_INLINE static Local<T> Cast(Local<S> that) { | 313 | | #ifdef V8_ENABLE_CHECKS | 314 | | // If we're going to perform the type check then we have to check | 315 | | // that the handle isn't empty before doing the checked cast. | 316 | | if (that.IsEmpty()) return Local<T>(); | 317 | | T::Cast(that.template value<S>()); | 318 | | #endif | 319 | 8 | return Local<T>(LocalBase<T>(that)); | 320 | 8 | } |
Unexecuted instantiation: v8::Local<v8::SharedArrayBuffer> v8::Local<v8::SharedArrayBuffer>::Cast<v8::Value>(v8::Local<v8::Value>) v8::Local<v8::Integer> v8::Local<v8::Integer>::Cast<v8::Value>(v8::Local<v8::Value>) Line | Count | Source | 312 | 1.00k | V8_INLINE static Local<T> Cast(Local<S> that) { | 313 | | #ifdef V8_ENABLE_CHECKS | 314 | | // If we're going to perform the type check then we have to check | 315 | | // that the handle isn't empty before doing the checked cast. | 316 | | if (that.IsEmpty()) return Local<T>(); | 317 | | T::Cast(that.template value<S>()); | 318 | | #endif | 319 | 1.00k | return Local<T>(LocalBase<T>(that)); | 320 | 1.00k | } |
v8::Local<v8::Value> v8::Local<v8::Value>::Cast<v8::Object>(v8::Local<v8::Object>) Line | Count | Source | 312 | 11.0k | V8_INLINE static Local<T> Cast(Local<S> that) { | 313 | | #ifdef V8_ENABLE_CHECKS | 314 | | // If we're going to perform the type check then we have to check | 315 | | // that the handle isn't empty before doing the checked cast. | 316 | | if (that.IsEmpty()) return Local<T>(); | 317 | | T::Cast(that.template value<S>()); | 318 | | #endif | 319 | 11.0k | return Local<T>(LocalBase<T>(that)); | 320 | 11.0k | } |
v8::Local<v8::ArrayBufferView> v8::Local<v8::ArrayBufferView>::Cast<v8::Object>(v8::Local<v8::Object>) Line | Count | Source | 312 | 148k | V8_INLINE static Local<T> Cast(Local<S> that) { | 313 | | #ifdef V8_ENABLE_CHECKS | 314 | | // If we're going to perform the type check then we have to check | 315 | | // that the handle isn't empty before doing the checked cast. | 316 | | if (that.IsEmpty()) return Local<T>(); | 317 | | T::Cast(that.template value<S>()); | 318 | | #endif | 319 | 148k | return Local<T>(LocalBase<T>(that)); | 320 | 148k | } |
Unexecuted instantiation: v8::Local<v8::Promise::Resolver> v8::Local<v8::Promise::Resolver>::Cast<v8::Value>(v8::Local<v8::Value>) v8::Local<v8::String> v8::Local<v8::String>::Cast<v8::Name>(v8::Local<v8::Name>) Line | Count | Source | 312 | 573k | V8_INLINE static Local<T> Cast(Local<S> that) { | 313 | | #ifdef V8_ENABLE_CHECKS | 314 | | // If we're going to perform the type check then we have to check | 315 | | // that the handle isn't empty before doing the checked cast. | 316 | | if (that.IsEmpty()) return Local<T>(); | 317 | | T::Cast(that.template value<S>()); | 318 | | #endif | 319 | 573k | return Local<T>(LocalBase<T>(that)); | 320 | 573k | } |
Unexecuted instantiation: v8::Local<v8::BigInt> v8::Local<v8::BigInt>::Cast<v8::Value>(v8::Local<v8::Value>) Unexecuted instantiation: v8::Local<v8::Promise::Resolver> v8::Local<v8::Promise::Resolver>::Cast<v8::Promise>(v8::Local<v8::Promise>) Unexecuted instantiation: v8::Local<v8::Promise> v8::Local<v8::Promise>::Cast<v8::Promise::Resolver>(v8::Local<v8::Promise::Resolver>) Unexecuted instantiation: v8::Local<v8::ArrayBuffer> v8::Local<v8::ArrayBuffer>::Cast<v8::Object>(v8::Local<v8::Object>) Unexecuted instantiation: v8::Local<v8::Float64Array> v8::Local<v8::Float64Array>::Cast<v8::Value>(v8::Local<v8::Value>) Unexecuted instantiation: v8::Local<v8::Function> v8::Local<v8::Function>::Cast<v8::Function>(v8::Local<v8::Function>) Unexecuted instantiation: v8::Local<v8::Proxy> v8::Local<v8::Proxy>::Cast<v8::Value>(v8::Local<v8::Value>) Unexecuted instantiation: v8::Local<v8::External> v8::Local<v8::External>::Cast<v8::Value>(v8::Local<v8::Value>) Unexecuted instantiation: v8::Local<v8::WasmMemoryObject> v8::Local<v8::WasmMemoryObject>::Cast<v8::Value>(v8::Local<v8::Value>) Unexecuted instantiation: v8::Local<v8::Value> v8::Local<v8::Value>::Cast<v8::String>(v8::Local<v8::String>) v8::Local<v8::Uint32Array> v8::Local<v8::Uint32Array>::Cast<v8::Value>(v8::Local<v8::Value>) Line | Count | Source | 312 | 5.53k | V8_INLINE static Local<T> Cast(Local<S> that) { | 313 | | #ifdef V8_ENABLE_CHECKS | 314 | | // If we're going to perform the type check then we have to check | 315 | | // that the handle isn't empty before doing the checked cast. | 316 | | if (that.IsEmpty()) return Local<T>(); | 317 | | T::Cast(that.template value<S>()); | 318 | | #endif | 319 | 5.53k | return Local<T>(LocalBase<T>(that)); | 320 | 5.53k | } |
Unexecuted instantiation: v8::Local<v8::Array> v8::Local<v8::Array>::Cast<v8::Object>(v8::Local<v8::Object>) Unexecuted instantiation: v8::Local<v8::Value> v8::Local<v8::Value>::Cast<v8::ArrayBuffer>(v8::Local<v8::ArrayBuffer>) v8::Local<v8::Object> v8::Local<v8::Object>::Cast<v8::Object>(v8::Local<v8::Object>) Line | Count | Source | 312 | 1.05k | V8_INLINE static Local<T> Cast(Local<S> that) { | 313 | | #ifdef V8_ENABLE_CHECKS | 314 | | // If we're going to perform the type check then we have to check | 315 | | // that the handle isn't empty before doing the checked cast. | 316 | | if (that.IsEmpty()) return Local<T>(); | 317 | | T::Cast(that.template value<S>()); | 318 | | #endif | 319 | 1.05k | return Local<T>(LocalBase<T>(that)); | 320 | 1.05k | } |
Unexecuted instantiation: v8::Local<v8::Map> v8::Local<v8::Map>::Cast<v8::Value>(v8::Local<v8::Value>) Unexecuted instantiation: v8::Local<v8::TypedArray> v8::Local<v8::TypedArray>::Cast<v8::Value>(v8::Local<v8::Value>) Unexecuted instantiation: v8::Local<v8::DataView> v8::Local<v8::DataView>::Cast<v8::Value>(v8::Local<v8::Value>) Unexecuted instantiation: v8::Local<v8::Date> v8::Local<v8::Date>::Cast<v8::Value>(v8::Local<v8::Value>) Unexecuted instantiation: v8::Local<v8::Value> v8::Local<v8::Value>::Cast<v8::Array>(v8::Local<v8::Array>) |
321 | | |
322 | | /** |
323 | | * Calling this is equivalent to Local<S>::Cast(). |
324 | | * In particular, this is only valid if the handle actually refers to a value |
325 | | * of the target type. |
326 | | */ |
327 | | template <class S> |
328 | 23.4M | V8_INLINE Local<S> As() const { |
329 | 23.4M | return Local<S>::Cast(*this); |
330 | 23.4M | } v8::Local<v8::Number> v8::Local<v8::Value>::As<v8::Number>() const Line | Count | Source | 328 | 9 | V8_INLINE Local<S> As() const { | 329 | 9 | return Local<S>::Cast(*this); | 330 | 9 | } |
v8::Local<v8::Object> v8::Local<v8::Value>::As<v8::Object>() const Line | Count | Source | 328 | 3.69M | V8_INLINE Local<S> As() const { | 329 | 3.69M | return Local<S>::Cast(*this); | 330 | 3.69M | } |
v8::Local<v8::Function> v8::Local<v8::Value>::As<v8::Function>() const Line | Count | Source | 328 | 3.50M | V8_INLINE Local<S> As() const { | 329 | 3.50M | return Local<S>::Cast(*this); | 330 | 3.50M | } |
v8::Local<v8::Name> v8::Local<v8::String>::As<v8::Name>() const Line | Count | Source | 328 | 776 | V8_INLINE Local<S> As() const { | 329 | 776 | return Local<S>::Cast(*this); | 330 | 776 | } |
v8::Local<v8::Name> v8::Local<v8::Symbol>::As<v8::Name>() const Line | Count | Source | 328 | 4 | V8_INLINE Local<S> As() const { | 329 | 4 | return Local<S>::Cast(*this); | 330 | 4 | } |
v8::Local<v8::Array> v8::Local<v8::Value>::As<v8::Array>() const Line | Count | Source | 328 | 130k | V8_INLINE Local<S> As() const { | 329 | 130k | return Local<S>::Cast(*this); | 330 | 130k | } |
v8::Local<v8::Int32> v8::Local<v8::Value>::As<v8::Int32>() const Line | Count | Source | 328 | 115k | V8_INLINE Local<S> As() const { | 329 | 115k | return Local<S>::Cast(*this); | 330 | 115k | } |
v8::Local<v8::String> v8::Local<v8::Value>::As<v8::String>() const Line | Count | Source | 328 | 15.0M | V8_INLINE Local<S> As() const { | 329 | 15.0M | return Local<S>::Cast(*this); | 330 | 15.0M | } |
Unexecuted instantiation: v8::Local<v8::Promise> v8::Local<v8::Value>::As<v8::Promise>() const v8::Local<v8::Uint32> v8::Local<v8::Value>::As<v8::Uint32>() const Line | Count | Source | 328 | 1.30k | V8_INLINE Local<S> As() const { | 329 | 1.30k | return Local<S>::Cast(*this); | 330 | 1.30k | } |
v8::Local<v8::Name> v8::Local<v8::Value>::As<v8::Name>() const Line | Count | Source | 328 | 7.51k | V8_INLINE Local<S> As() const { | 329 | 7.51k | return Local<S>::Cast(*this); | 330 | 7.51k | } |
Unexecuted instantiation: v8::Local<v8::Uint8Array> v8::Local<v8::Value>::As<v8::Uint8Array>() const Unexecuted instantiation: v8::Local<v8::String> v8::Local<v8::Data>::As<v8::String>() const Unexecuted instantiation: v8::Local<v8::FixedArray> v8::Local<v8::Data>::As<v8::FixedArray>() const Unexecuted instantiation: v8::Local<v8::Symbol> v8::Local<v8::Data>::As<v8::Symbol>() const v8::Local<v8::Value> v8::Local<v8::Data>::As<v8::Value>() const Line | Count | Source | 328 | 5.52k | V8_INLINE Local<S> As() const { | 329 | 5.52k | return Local<S>::Cast(*this); | 330 | 5.52k | } |
v8::Local<v8::Symbol> v8::Local<v8::Value>::As<v8::Symbol>() const Line | Count | Source | 328 | 1.90k | V8_INLINE Local<S> As() const { | 329 | 1.90k | return Local<S>::Cast(*this); | 330 | 1.90k | } |
v8::Local<v8::ArrayBufferView> v8::Local<v8::Value>::As<v8::ArrayBufferView>() const Line | Count | Source | 328 | 33.9k | V8_INLINE Local<S> As() const { | 329 | 33.9k | return Local<S>::Cast(*this); | 330 | 33.9k | } |
Unexecuted instantiation: v8::Local<v8::Value> v8::Local<v8::Primitive>::As<v8::Value>() const Unexecuted instantiation: v8::Local<v8::ModuleRequest> v8::Local<v8::Data>::As<v8::ModuleRequest>() const v8::Local<v8::Boolean> v8::Local<v8::Value>::As<v8::Boolean>() const Line | Count | Source | 328 | 124k | V8_INLINE Local<S> As() const { | 329 | 124k | return Local<S>::Cast(*this); | 330 | 124k | } |
v8::Local<v8::ArrayBuffer> v8::Local<v8::Value>::As<v8::ArrayBuffer>() const Line | Count | Source | 328 | 8 | V8_INLINE Local<S> As() const { | 329 | 8 | return Local<S>::Cast(*this); | 330 | 8 | } |
Unexecuted instantiation: v8::Local<v8::SharedArrayBuffer> v8::Local<v8::Value>::As<v8::SharedArrayBuffer>() const v8::Local<v8::Integer> v8::Local<v8::Value>::As<v8::Integer>() const Line | Count | Source | 328 | 1.00k | V8_INLINE Local<S> As() const { | 329 | 1.00k | return Local<S>::Cast(*this); | 330 | 1.00k | } |
v8::Local<v8::Value> v8::Local<v8::Object>::As<v8::Value>() const Line | Count | Source | 328 | 11.0k | V8_INLINE Local<S> As() const { | 329 | 11.0k | return Local<S>::Cast(*this); | 330 | 11.0k | } |
v8::Local<v8::ArrayBufferView> v8::Local<v8::Object>::As<v8::ArrayBufferView>() const Line | Count | Source | 328 | 148k | V8_INLINE Local<S> As() const { | 329 | 148k | return Local<S>::Cast(*this); | 330 | 148k | } |
Unexecuted instantiation: v8::Local<v8::Promise::Resolver> v8::Local<v8::Value>::As<v8::Promise::Resolver>() const v8::Local<v8::String> v8::Local<v8::Name>::As<v8::String>() const Line | Count | Source | 328 | 573k | V8_INLINE Local<S> As() const { | 329 | 573k | return Local<S>::Cast(*this); | 330 | 573k | } |
Unexecuted instantiation: v8::Local<v8::BigInt> v8::Local<v8::Value>::As<v8::BigInt>() const Unexecuted instantiation: v8::Local<v8::Promise::Resolver> v8::Local<v8::Promise>::As<v8::Promise::Resolver>() const Unexecuted instantiation: v8::Local<v8::Promise> v8::Local<v8::Promise::Resolver>::As<v8::Promise>() const Unexecuted instantiation: v8::Local<v8::ArrayBuffer> v8::Local<v8::Object>::As<v8::ArrayBuffer>() const Unexecuted instantiation: v8::Local<v8::Float64Array> v8::Local<v8::Value>::As<v8::Float64Array>() const Unexecuted instantiation: v8::Local<v8::Function> v8::Local<v8::Function>::As<v8::Function>() const Unexecuted instantiation: v8::Local<v8::Proxy> v8::Local<v8::Value>::As<v8::Proxy>() const Unexecuted instantiation: v8::Local<v8::External> v8::Local<v8::Value>::As<v8::External>() const Unexecuted instantiation: v8::Local<v8::WasmMemoryObject> v8::Local<v8::Value>::As<v8::WasmMemoryObject>() const Unexecuted instantiation: v8::Local<v8::Value> v8::Local<v8::String>::As<v8::Value>() const v8::Local<v8::Uint32Array> v8::Local<v8::Value>::As<v8::Uint32Array>() const Line | Count | Source | 328 | 5.53k | V8_INLINE Local<S> As() const { | 329 | 5.53k | return Local<S>::Cast(*this); | 330 | 5.53k | } |
Unexecuted instantiation: v8::Local<v8::Array> v8::Local<v8::Object>::As<v8::Array>() const Unexecuted instantiation: v8::Local<v8::Value> v8::Local<v8::ArrayBuffer>::As<v8::Value>() const v8::Local<v8::Object> v8::Local<v8::Object>::As<v8::Object>() const Line | Count | Source | 328 | 1.05k | V8_INLINE Local<S> As() const { | 329 | 1.05k | return Local<S>::Cast(*this); | 330 | 1.05k | } |
Unexecuted instantiation: v8::Local<v8::Map> v8::Local<v8::Value>::As<v8::Map>() const Unexecuted instantiation: v8::Local<v8::TypedArray> v8::Local<v8::Value>::As<v8::TypedArray>() const Unexecuted instantiation: v8::Local<v8::DataView> v8::Local<v8::Value>::As<v8::DataView>() const Unexecuted instantiation: v8::Local<v8::Date> v8::Local<v8::Value>::As<v8::Date>() const Unexecuted instantiation: v8::Local<v8::Value> v8::Local<v8::Array>::As<v8::Value>() const |
331 | | |
332 | | /** |
333 | | * Create a local handle for the content of another handle. |
334 | | * The referee is kept alive by the local handle even when |
335 | | * the original handle is destroyed/disposed. |
336 | | */ |
337 | | V8_INLINE static Local<T> New(Isolate* isolate, Local<T> that) { |
338 | | return New(isolate, that.template value<T, true>()); |
339 | | } |
340 | | |
341 | | V8_INLINE static Local<T> New(Isolate* isolate, |
342 | 3.66M | const PersistentBase<T>& that) { |
343 | 3.66M | return New(isolate, that.template value<T, true>()); |
344 | 3.66M | } Unexecuted instantiation: v8::Local<v8::Int8Array>::New(v8::Isolate*, v8::PersistentBase<v8::Int8Array> const&) v8::Local<v8::Uint8Array>::New(v8::Isolate*, v8::PersistentBase<v8::Uint8Array> const&) Line | Count | Source | 342 | 488k | const PersistentBase<T>& that) { | 343 | 488k | return New(isolate, that.template value<T, true>()); | 344 | 488k | } |
Unexecuted instantiation: v8::Local<v8::Int16Array>::New(v8::Isolate*, v8::PersistentBase<v8::Int16Array> const&) Unexecuted instantiation: v8::Local<v8::Uint16Array>::New(v8::Isolate*, v8::PersistentBase<v8::Uint16Array> const&) v8::Local<v8::Int32Array>::New(v8::Isolate*, v8::PersistentBase<v8::Int32Array> const&) Line | Count | Source | 342 | 327k | const PersistentBase<T>& that) { | 343 | 327k | return New(isolate, that.template value<T, true>()); | 344 | 327k | } |
v8::Local<v8::Uint32Array>::New(v8::Isolate*, v8::PersistentBase<v8::Uint32Array> const&) Line | Count | Source | 342 | 854k | const PersistentBase<T>& that) { | 343 | 854k | return New(isolate, that.template value<T, true>()); | 344 | 854k | } |
Unexecuted instantiation: v8::Local<v8::Float32Array>::New(v8::Isolate*, v8::PersistentBase<v8::Float32Array> const&) v8::Local<v8::Float64Array>::New(v8::Isolate*, v8::PersistentBase<v8::Float64Array> const&) Line | Count | Source | 342 | 610k | const PersistentBase<T>& that) { | 343 | 610k | return New(isolate, that.template value<T, true>()); | 344 | 610k | } |
v8::Local<v8::BigInt64Array>::New(v8::Isolate*, v8::PersistentBase<v8::BigInt64Array> const&) Line | Count | Source | 342 | 244k | const PersistentBase<T>& that) { | 343 | 244k | return New(isolate, that.template value<T, true>()); | 344 | 244k | } |
v8::Local<v8::Object>::New(v8::Isolate*, v8::PersistentBase<v8::Object> const&) Line | Count | Source | 342 | 1.00M | const PersistentBase<T>& that) { | 343 | 1.00M | return New(isolate, that.template value<T, true>()); | 344 | 1.00M | } |
v8::Local<v8::Context>::New(v8::Isolate*, v8::PersistentBase<v8::Context> const&) Line | Count | Source | 342 | 137k | const PersistentBase<T>& that) { | 343 | 137k | return New(isolate, that.template value<T, true>()); | 344 | 137k | } |
Unexecuted instantiation: v8::Local<v8::Array>::New(v8::Isolate*, v8::PersistentBase<v8::Array> const&) v8::Local<v8::Function>::New(v8::Isolate*, v8::PersistentBase<v8::Function> const&) Line | Count | Source | 342 | 2 | const PersistentBase<T>& that) { | 343 | 2 | return New(isolate, that.template value<T, true>()); | 344 | 2 | } |
Unexecuted instantiation: v8::Local<v8::Promise>::New(v8::Isolate*, v8::PersistentBase<v8::Promise> const&) Unexecuted instantiation: v8::Local<v8::Module>::New(v8::Isolate*, v8::PersistentBase<v8::Module> const&) v8::Local<v8::Value>::New(v8::Isolate*, v8::PersistentBase<v8::Value> const&) Line | Count | Source | 342 | 2 | const PersistentBase<T>& that) { | 343 | 2 | return New(isolate, that.template value<T, true>()); | 344 | 2 | } |
Unexecuted instantiation: v8::Local<v8::ArrayBuffer>::New(v8::Isolate*, v8::PersistentBase<v8::ArrayBuffer> const&) v8::Local<v8::UnboundScript>::New(v8::Isolate*, v8::PersistentBase<v8::UnboundScript> const&) Line | Count | Source | 342 | 953 | const PersistentBase<T>& that) { | 343 | 953 | return New(isolate, that.template value<T, true>()); | 344 | 953 | } |
Unexecuted instantiation: v8::Local<v8::WasmMemoryObject>::New(v8::Isolate*, v8::PersistentBase<v8::WasmMemoryObject> const&) Unexecuted instantiation: v8::Local<v8::ArrayBufferView>::New(v8::Isolate*, v8::PersistentBase<v8::ArrayBufferView> const&) Unexecuted instantiation: v8::Local<v8::FunctionTemplate>::New(v8::Isolate*, v8::PersistentBase<v8::FunctionTemplate> const&) |
345 | | |
346 | | V8_INLINE static Local<T> New(Isolate* isolate, |
347 | | const BasicTracedReference<T>& that) { |
348 | | return New(isolate, that.template value<T, true>()); |
349 | | } |
350 | | |
351 | | private: |
352 | | friend class TracedReferenceBase; |
353 | | friend class Utils; |
354 | | template <class F> |
355 | | friend class Eternal; |
356 | | template <class F> |
357 | | friend class Global; |
358 | | template <class F> |
359 | | friend class Local; |
360 | | template <class F> |
361 | | friend class MaybeLocal; |
362 | | template <class F, class M> |
363 | | friend class Persistent; |
364 | | template <class F> |
365 | | friend class FunctionCallbackInfo; |
366 | | template <class F> |
367 | | friend class PropertyCallbackInfo; |
368 | | friend class String; |
369 | | friend class Object; |
370 | | friend class Context; |
371 | | friend class Isolate; |
372 | | friend class Private; |
373 | | template <class F> |
374 | | friend class internal::CustomArguments; |
375 | | friend Local<Primitive> Undefined(Isolate* isolate); |
376 | | friend Local<Primitive> Null(Isolate* isolate); |
377 | | friend Local<Boolean> True(Isolate* isolate); |
378 | | friend Local<Boolean> False(Isolate* isolate); |
379 | | friend class HandleScope; |
380 | | friend class EscapableHandleScope; |
381 | | friend class InternalEscapableScope; |
382 | | template <class F1, class F2, class F3> |
383 | | friend class PersistentValueMapBase; |
384 | | template <class F1, class F2> |
385 | | friend class PersistentValueVector; |
386 | | template <class F> |
387 | | friend class ReturnValue; |
388 | | template <class F> |
389 | | friend class Traced; |
390 | | friend class internal::SamplingHeapProfiler; |
391 | | friend class internal::HandleHelper; |
392 | | friend class debug::ConsoleCallArguments; |
393 | | friend class internal::LocalUnchecked<T>; |
394 | | |
395 | | explicit Local(no_checking_tag do_not_check) |
396 | | : LocalBase<T>(), StackAllocated(do_not_check) {} |
397 | | explicit Local(const Local<T>& other, no_checking_tag do_not_check) |
398 | | : LocalBase<T>(other), StackAllocated(do_not_check) {} |
399 | | |
400 | | V8_INLINE explicit Local<T>(const LocalBase<T>& other) |
401 | 319M | : LocalBase<T>(other) {} v8::Local<v8::Value>::Local(v8::LocalBase<v8::Value> const&) Line | Count | Source | 401 | 97.2M | : LocalBase<T>(other) {} |
v8::Local<v8::Primitive>::Local(v8::LocalBase<v8::Primitive> const&) Line | Count | Source | 401 | 11.2M | : LocalBase<T>(other) {} |
v8::Local<v8::Boolean>::Local(v8::LocalBase<v8::Boolean> const&) Line | Count | Source | 401 | 35.8M | : LocalBase<T>(other) {} |
v8::Local<v8::Object>::Local(v8::LocalBase<v8::Object> const&) Line | Count | Source | 401 | 10.4M | : LocalBase<T>(other) {} |
v8::Local<v8::String>::Local(v8::LocalBase<v8::String> const&) Line | Count | Source | 401 | 126M | : LocalBase<T>(other) {} |
v8::Local<v8::Symbol>::Local(v8::LocalBase<v8::Symbol> const&) Line | Count | Source | 401 | 4.81M | : LocalBase<T>(other) {} |
v8::Local<v8::FunctionTemplate>::Local(v8::LocalBase<v8::FunctionTemplate> const&) Line | Count | Source | 401 | 2.63M | : LocalBase<T>(other) {} |
v8::Local<v8::Number>::Local(v8::LocalBase<v8::Number> const&) Line | Count | Source | 401 | 9 | : LocalBase<T>(other) {} |
v8::Local<v8::Function>::Local(v8::LocalBase<v8::Function> const&) Line | Count | Source | 401 | 14.8M | : LocalBase<T>(other) {} |
v8::Local<v8::Uint32Array>::Local(v8::LocalBase<v8::Uint32Array> const&) Line | Count | Source | 401 | 860k | : LocalBase<T>(other) {} |
v8::Local<v8::Float64Array>::Local(v8::LocalBase<v8::Float64Array> const&) Line | Count | Source | 401 | 610k | : LocalBase<T>(other) {} |
v8::Local<v8::Array>::Local(v8::LocalBase<v8::Array> const&) Line | Count | Source | 401 | 5.01M | : LocalBase<T>(other) {} |
v8::Local<v8::Name>::Local(v8::LocalBase<v8::Name> const&) Line | Count | Source | 401 | 8.29k | : LocalBase<T>(other) {} |
v8::Local<v8::Int32>::Local(v8::LocalBase<v8::Int32> const&) Line | Count | Source | 401 | 115k | : LocalBase<T>(other) {} |
v8::Local<v8::ObjectTemplate>::Local(v8::LocalBase<v8::ObjectTemplate> const&) Line | Count | Source | 401 | 4.50M | : LocalBase<T>(other) {} |
v8::Local<v8::Int32Array>::Local(v8::LocalBase<v8::Int32Array> const&) Line | Count | Source | 401 | 327k | : LocalBase<T>(other) {} |
v8::Local<v8::Uint8Array>::Local(v8::LocalBase<v8::Uint8Array> const&) Line | Count | Source | 401 | 488k | : LocalBase<T>(other) {} |
v8::Local<v8::Private>::Local(v8::LocalBase<v8::Private> const&) Line | Count | Source | 401 | 3.04M | : LocalBase<T>(other) {} |
v8::Local<v8::Context>::Local(v8::LocalBase<v8::Context> const&) Line | Count | Source | 401 | 138k | : LocalBase<T>(other) {} |
Unexecuted instantiation: v8::Local<v8::Promise>::Local(v8::LocalBase<v8::Promise> const&) v8::Local<v8::Uint32>::Local(v8::LocalBase<v8::Uint32> const&) Line | Count | Source | 401 | 1.30k | : LocalBase<T>(other) {} |
v8::Local<v8::Data>::Local(v8::LocalBase<v8::Data> const&) Line | Count | Source | 401 | 5.52k | : LocalBase<T>(other) {} |
Unexecuted instantiation: v8::Local<v8::FixedArray>::Local(v8::LocalBase<v8::FixedArray> const&) Unexecuted instantiation: v8::Local<v8::Module>::Local(v8::LocalBase<v8::Module> const&) v8::Local<v8::ArrayBufferView>::Local(v8::LocalBase<v8::ArrayBufferView> const&) Line | Count | Source | 401 | 182k | : LocalBase<T>(other) {} |
Unexecuted instantiation: v8::Local<v8::ModuleRequest>::Local(v8::LocalBase<v8::ModuleRequest> const&) v8::Local<v8::ArrayBuffer>::Local(v8::LocalBase<v8::ArrayBuffer> const&) Line | Count | Source | 401 | 8 | : LocalBase<T>(other) {} |
Unexecuted instantiation: v8::Local<v8::SharedArrayBuffer>::Local(v8::LocalBase<v8::SharedArrayBuffer> const&) v8::Local<v8::Integer>::Local(v8::LocalBase<v8::Integer> const&) Line | Count | Source | 401 | 1.16k | : LocalBase<T>(other) {} |
v8::Local<v8::UnboundScript>::Local(v8::LocalBase<v8::UnboundScript> const&) Line | Count | Source | 401 | 953 | : LocalBase<T>(other) {} |
v8::Local<v8::BigInt64Array>::Local(v8::LocalBase<v8::BigInt64Array> const&) Line | Count | Source | 401 | 244k | : LocalBase<T>(other) {} |
Unexecuted instantiation: v8::Local<v8::Promise::Resolver>::Local(v8::LocalBase<v8::Promise::Resolver> const&) Unexecuted instantiation: v8::Local<v8::StackTrace>::Local(v8::LocalBase<v8::StackTrace> const&) Unexecuted instantiation: v8::Local<v8::BigInt>::Local(v8::LocalBase<v8::BigInt> const&) v8::Local<v8::Map>::Local(v8::LocalBase<v8::Map> const&) Line | Count | Source | 401 | 122k | : LocalBase<T>(other) {} |
Unexecuted instantiation: v8::Local<v8::Proxy>::Local(v8::LocalBase<v8::Proxy> const&) Unexecuted instantiation: v8::Local<v8::External>::Local(v8::LocalBase<v8::External> const&) Unexecuted instantiation: v8::Local<v8::WasmMemoryObject>::Local(v8::LocalBase<v8::WasmMemoryObject> const&) Unexecuted instantiation: v8::Local<v8::TypedArray>::Local(v8::LocalBase<v8::TypedArray> const&) Unexecuted instantiation: v8::Local<v8::DataView>::Local(v8::LocalBase<v8::DataView> const&) Unexecuted instantiation: v8::Local<v8::Date>::Local(v8::LocalBase<v8::Date> const&) |
402 | | |
403 | 233M | V8_INLINE static Local<T> FromSlot(internal::Address* slot) { |
404 | 233M | return Local<T>(LocalBase<T>::FromSlot(slot)); |
405 | 233M | } v8::Local<v8::String>::FromSlot(unsigned long*) Line | Count | Source | 403 | 110M | V8_INLINE static Local<T> FromSlot(internal::Address* slot) { | 404 | 110M | return Local<T>(LocalBase<T>::FromSlot(slot)); | 405 | 110M | } |
v8::Local<v8::Primitive>::FromSlot(unsigned long*) Line | Count | Source | 403 | 11.2M | V8_INLINE static Local<T> FromSlot(internal::Address* slot) { | 404 | 11.2M | return Local<T>(LocalBase<T>::FromSlot(slot)); | 405 | 11.2M | } |
v8::Local<v8::Boolean>::FromSlot(unsigned long*) Line | Count | Source | 403 | 35.7M | V8_INLINE static Local<T> FromSlot(internal::Address* slot) { | 404 | 35.7M | return Local<T>(LocalBase<T>::FromSlot(slot)); | 405 | 35.7M | } |
v8::Local<v8::Value>::FromSlot(unsigned long*) Line | Count | Source | 403 | 38.2M | V8_INLINE static Local<T> FromSlot(internal::Address* slot) { | 404 | 38.2M | return Local<T>(LocalBase<T>::FromSlot(slot)); | 405 | 38.2M | } |
v8::Local<v8::Private>::FromSlot(unsigned long*) Line | Count | Source | 403 | 3.04M | V8_INLINE static Local<T> FromSlot(internal::Address* slot) { | 404 | 3.04M | return Local<T>(LocalBase<T>::FromSlot(slot)); | 405 | 3.04M | } |
v8::Local<v8::Symbol>::FromSlot(unsigned long*) Line | Count | Source | 403 | 4.80M | V8_INLINE static Local<T> FromSlot(internal::Address* slot) { | 404 | 4.80M | return Local<T>(LocalBase<T>::FromSlot(slot)); | 405 | 4.80M | } |
v8::Local<v8::FunctionTemplate>::FromSlot(unsigned long*) Line | Count | Source | 403 | 2.63M | V8_INLINE static Local<T> FromSlot(internal::Address* slot) { | 404 | 2.63M | return Local<T>(LocalBase<T>::FromSlot(slot)); | 405 | 2.63M | } |
v8::Local<v8::ObjectTemplate>::FromSlot(unsigned long*) Line | Count | Source | 403 | 4.50M | V8_INLINE static Local<T> FromSlot(internal::Address* slot) { | 404 | 4.50M | return Local<T>(LocalBase<T>::FromSlot(slot)); | 405 | 4.50M | } |
v8::Local<v8::Object>::FromSlot(unsigned long*) Line | Count | Source | 403 | 5.76M | V8_INLINE static Local<T> FromSlot(internal::Address* slot) { | 404 | 5.76M | return Local<T>(LocalBase<T>::FromSlot(slot)); | 405 | 5.76M | } |
v8::Local<v8::Array>::FromSlot(unsigned long*) Line | Count | Source | 403 | 4.88M | V8_INLINE static Local<T> FromSlot(internal::Address* slot) { | 404 | 4.88M | return Local<T>(LocalBase<T>::FromSlot(slot)); | 405 | 4.88M | } |
Unexecuted instantiation: v8::Local<v8::Uint32Array>::FromSlot(unsigned long*) Unexecuted instantiation: v8::Local<v8::Uint8Array>::FromSlot(unsigned long*) Unexecuted instantiation: v8::Local<v8::Float64Array>::FromSlot(unsigned long*) Unexecuted instantiation: v8::Local<v8::Int32Array>::FromSlot(unsigned long*) Unexecuted instantiation: v8::Local<v8::Promise>::FromSlot(unsigned long*) v8::Local<v8::Function>::FromSlot(unsigned long*) Line | Count | Source | 403 | 11.3M | V8_INLINE static Local<T> FromSlot(internal::Address* slot) { | 404 | 11.3M | return Local<T>(LocalBase<T>::FromSlot(slot)); | 405 | 11.3M | } |
v8::Local<v8::Context>::FromSlot(unsigned long*) Line | Count | Source | 403 | 953 | V8_INLINE static Local<T> FromSlot(internal::Address* slot) { | 404 | 953 | return Local<T>(LocalBase<T>::FromSlot(slot)); | 405 | 953 | } |
Unexecuted instantiation: v8::Local<v8::StackTrace>::FromSlot(unsigned long*) Unexecuted instantiation: v8::Local<v8::BigInt64Array>::FromSlot(unsigned long*) v8::Local<v8::Integer>::FromSlot(unsigned long*) Line | Count | Source | 403 | 152 | V8_INLINE static Local<T> FromSlot(internal::Address* slot) { | 404 | 152 | return Local<T>(LocalBase<T>::FromSlot(slot)); | 405 | 152 | } |
v8::Local<v8::Map>::FromSlot(unsigned long*) Line | Count | Source | 403 | 122k | V8_INLINE static Local<T> FromSlot(internal::Address* slot) { | 404 | 122k | return Local<T>(LocalBase<T>::FromSlot(slot)); | 405 | 122k | } |
|
406 | | |
407 | | #ifdef V8_ENABLE_DIRECT_LOCAL |
408 | | V8_INLINE static Local<T> FromAddress(internal::Address ptr) { |
409 | | return Local<T>(LocalBase<T>(ptr)); |
410 | | } |
411 | | #endif // V8_ENABLE_DIRECT_LOCAL |
412 | | |
413 | 9.34k | V8_INLINE static Local<T> New(Isolate* isolate, internal::Address value) { |
414 | 9.34k | return Local<T>(LocalBase<T>::New(isolate, value)); |
415 | 9.34k | } v8::Local<v8::Data>::New(v8::Isolate*, unsigned long) Line | Count | Source | 413 | 5.52k | V8_INLINE static Local<T> New(Isolate* isolate, internal::Address value) { | 414 | 5.52k | return Local<T>(LocalBase<T>::New(isolate, value)); | 415 | 5.52k | } |
v8::Local<v8::Value>::New(v8::Isolate*, unsigned long) Line | Count | Source | 413 | 3.81k | V8_INLINE static Local<T> New(Isolate* isolate, internal::Address value) { | 414 | 3.81k | return Local<T>(LocalBase<T>::New(isolate, value)); | 415 | 3.81k | } |
|
416 | | |
417 | 3.66M | V8_INLINE static Local<T> New(Isolate* isolate, T* that) { |
418 | 3.66M | return Local<T>(LocalBase<T>::New(isolate, that)); |
419 | 3.66M | } v8::Local<v8::Value>::New(v8::Isolate*, v8::Value*) Line | Count | Source | 417 | 2 | V8_INLINE static Local<T> New(Isolate* isolate, T* that) { | 418 | 2 | return Local<T>(LocalBase<T>::New(isolate, that)); | 419 | 2 | } |
Unexecuted instantiation: v8::Local<v8::Int8Array>::New(v8::Isolate*, v8::Int8Array*) v8::Local<v8::Uint8Array>::New(v8::Isolate*, v8::Uint8Array*) Line | Count | Source | 417 | 488k | V8_INLINE static Local<T> New(Isolate* isolate, T* that) { | 418 | 488k | return Local<T>(LocalBase<T>::New(isolate, that)); | 419 | 488k | } |
Unexecuted instantiation: v8::Local<v8::Int16Array>::New(v8::Isolate*, v8::Int16Array*) Unexecuted instantiation: v8::Local<v8::Uint16Array>::New(v8::Isolate*, v8::Uint16Array*) v8::Local<v8::Int32Array>::New(v8::Isolate*, v8::Int32Array*) Line | Count | Source | 417 | 327k | V8_INLINE static Local<T> New(Isolate* isolate, T* that) { | 418 | 327k | return Local<T>(LocalBase<T>::New(isolate, that)); | 419 | 327k | } |
v8::Local<v8::Uint32Array>::New(v8::Isolate*, v8::Uint32Array*) Line | Count | Source | 417 | 854k | V8_INLINE static Local<T> New(Isolate* isolate, T* that) { | 418 | 854k | return Local<T>(LocalBase<T>::New(isolate, that)); | 419 | 854k | } |
Unexecuted instantiation: v8::Local<v8::Float32Array>::New(v8::Isolate*, v8::Float32Array*) v8::Local<v8::Float64Array>::New(v8::Isolate*, v8::Float64Array*) Line | Count | Source | 417 | 610k | V8_INLINE static Local<T> New(Isolate* isolate, T* that) { | 418 | 610k | return Local<T>(LocalBase<T>::New(isolate, that)); | 419 | 610k | } |
v8::Local<v8::BigInt64Array>::New(v8::Isolate*, v8::BigInt64Array*) Line | Count | Source | 417 | 244k | V8_INLINE static Local<T> New(Isolate* isolate, T* that) { | 418 | 244k | return Local<T>(LocalBase<T>::New(isolate, that)); | 419 | 244k | } |
v8::Local<v8::Object>::New(v8::Isolate*, v8::Object*) Line | Count | Source | 417 | 1.00M | V8_INLINE static Local<T> New(Isolate* isolate, T* that) { | 418 | 1.00M | return Local<T>(LocalBase<T>::New(isolate, that)); | 419 | 1.00M | } |
v8::Local<v8::Context>::New(v8::Isolate*, v8::Context*) Line | Count | Source | 417 | 137k | V8_INLINE static Local<T> New(Isolate* isolate, T* that) { | 418 | 137k | return Local<T>(LocalBase<T>::New(isolate, that)); | 419 | 137k | } |
Unexecuted instantiation: v8::Local<v8::Array>::New(v8::Isolate*, v8::Array*) v8::Local<v8::Function>::New(v8::Isolate*, v8::Function*) Line | Count | Source | 417 | 2 | V8_INLINE static Local<T> New(Isolate* isolate, T* that) { | 418 | 2 | return Local<T>(LocalBase<T>::New(isolate, that)); | 419 | 2 | } |
Unexecuted instantiation: v8::Local<v8::Promise>::New(v8::Isolate*, v8::Promise*) Unexecuted instantiation: v8::Local<v8::Module>::New(v8::Isolate*, v8::Module*) Unexecuted instantiation: v8::Local<v8::ArrayBuffer>::New(v8::Isolate*, v8::ArrayBuffer*) v8::Local<v8::UnboundScript>::New(v8::Isolate*, v8::UnboundScript*) Line | Count | Source | 417 | 953 | V8_INLINE static Local<T> New(Isolate* isolate, T* that) { | 418 | 953 | return Local<T>(LocalBase<T>::New(isolate, that)); | 419 | 953 | } |
Unexecuted instantiation: v8::Local<v8::WasmMemoryObject>::New(v8::Isolate*, v8::WasmMemoryObject*) Unexecuted instantiation: v8::Local<v8::ArrayBufferView>::New(v8::Isolate*, v8::ArrayBufferView*) Unexecuted instantiation: v8::Local<v8::FunctionTemplate>::New(v8::Isolate*, v8::FunctionTemplate*) |
420 | | |
421 | | // Unsafe cast, should be avoided. |
422 | | template <class S> |
423 | 58.9M | V8_INLINE Local<S> UnsafeAs() const { |
424 | 58.9M | return Local<S>(LocalBase<S>(*this)); |
425 | 58.9M | } v8::Local<v8::Value> v8::Local<v8::FunctionTemplate>::UnsafeAs<v8::Value>() const Line | Count | Source | 423 | 1.12M | V8_INLINE Local<S> UnsafeAs() const { | 424 | 1.12M | return Local<S>(LocalBase<S>(*this)); | 425 | 1.12M | } |
v8::Local<v8::Value> v8::Local<v8::ObjectTemplate>::UnsafeAs<v8::Value>() const Line | Count | Source | 423 | 3.70M | V8_INLINE Local<S> UnsafeAs() const { | 424 | 3.70M | return Local<S>(LocalBase<S>(*this)); | 425 | 3.70M | } |
v8::Local<v8::Value> v8::Local<v8::Private>::UnsafeAs<v8::Value>() const Line | Count | Source | 423 | 9.15M | V8_INLINE Local<S> UnsafeAs() const { | 424 | 9.15M | return Local<S>(LocalBase<S>(*this)); | 425 | 9.15M | } |
v8::Local<v8::Value> v8::Local<v8::Symbol>::UnsafeAs<v8::Value>() const Line | Count | Source | 423 | 2.19M | V8_INLINE Local<S> UnsafeAs() const { | 424 | 2.19M | return Local<S>(LocalBase<S>(*this)); | 425 | 2.19M | } |
v8::Local<v8::Value> v8::Local<v8::String>::UnsafeAs<v8::Value>() const Line | Count | Source | 423 | 42.7M | V8_INLINE Local<S> UnsafeAs() const { | 424 | 42.7M | return Local<S>(LocalBase<S>(*this)); | 425 | 42.7M | } |
|
426 | | }; |
427 | | |
428 | | namespace internal { |
429 | | // A local variant that is suitable for off-stack allocation. |
430 | | // Used internally by LocalVector<T>. Not to be used directly! |
431 | | template <typename T> |
432 | | class V8_TRIVIAL_ABI LocalUnchecked : public Local<T> { |
433 | | public: |
434 | | LocalUnchecked() : Local<T>(Local<T>::do_not_check) {} |
435 | | |
436 | | #if defined(V8_ENABLE_LOCAL_OFF_STACK_CHECK) && V8_HAS_ATTRIBUTE_TRIVIAL_ABI |
437 | | // In this case, the check is also enforced in the copy constructor and we |
438 | | // need to suppress it. |
439 | | LocalUnchecked(const LocalUnchecked& other) |
440 | | : Local<T>(other, Local<T>::do_not_check) {} |
441 | | LocalUnchecked& operator=(const LocalUnchecked&) = default; |
442 | | #endif |
443 | | |
444 | | // Implicit conversion from Local. |
445 | | LocalUnchecked(const Local<T>& other) // NOLINT(runtime/explicit) |
446 | | : Local<T>(other, Local<T>::do_not_check) {} |
447 | | }; |
448 | | |
449 | | #ifdef V8_ENABLE_DIRECT_LOCAL |
450 | | // Off-stack allocated direct locals must be registered as strong roots. |
451 | | // For off-stack indirect locals, this is not necessary. |
452 | | |
453 | | template <typename T> |
454 | | class StrongRootAllocator<LocalUnchecked<T>> : public StrongRootAllocatorBase { |
455 | | public: |
456 | | using value_type = LocalUnchecked<T>; |
457 | | static_assert(std::is_standard_layout_v<value_type>); |
458 | | static_assert(sizeof(value_type) == sizeof(Address)); |
459 | | |
460 | | explicit StrongRootAllocator(Heap* heap) : StrongRootAllocatorBase(heap) {} |
461 | | explicit StrongRootAllocator(v8::Isolate* isolate) |
462 | | : StrongRootAllocatorBase(isolate) {} |
463 | | template <typename U> |
464 | | StrongRootAllocator(const StrongRootAllocator<U>& other) noexcept |
465 | | : StrongRootAllocatorBase(other) {} |
466 | | |
467 | | value_type* allocate(size_t n) { |
468 | | return reinterpret_cast<value_type*>(allocate_impl(n)); |
469 | | } |
470 | | void deallocate(value_type* p, size_t n) noexcept { |
471 | | return deallocate_impl(reinterpret_cast<Address*>(p), n); |
472 | | } |
473 | | }; |
474 | | #endif // V8_ENABLE_DIRECT_LOCAL |
475 | | } // namespace internal |
476 | | |
477 | | template <typename T> |
478 | | class LocalVector { |
479 | | private: |
480 | | using element_type = internal::LocalUnchecked<T>; |
481 | | |
482 | | #ifdef V8_ENABLE_DIRECT_LOCAL |
483 | | using allocator_type = internal::StrongRootAllocator<element_type>; |
484 | | |
485 | | static allocator_type make_allocator(Isolate* isolate) noexcept { |
486 | | return allocator_type(isolate); |
487 | | } |
488 | | #else |
489 | | using allocator_type = std::allocator<element_type>; |
490 | | |
491 | | static allocator_type make_allocator(Isolate* isolate) noexcept { |
492 | | return allocator_type(); |
493 | | } |
494 | | #endif // V8_ENABLE_DIRECT_LOCAL |
495 | | |
496 | | using vector_type = std::vector<element_type, allocator_type>; |
497 | | |
498 | | public: |
499 | | using value_type = Local<T>; |
500 | | using reference = value_type&; |
501 | | using const_reference = const value_type&; |
502 | | using size_type = size_t; |
503 | | using difference_type = ptrdiff_t; |
504 | | using iterator = |
505 | | internal::WrappedIterator<typename vector_type::iterator, Local<T>>; |
506 | | using const_iterator = |
507 | | internal::WrappedIterator<typename vector_type::const_iterator, |
508 | | const Local<T>>; |
509 | | |
510 | | explicit LocalVector(Isolate* isolate) : backing_(make_allocator(isolate)) {} |
511 | | LocalVector(Isolate* isolate, size_t n) |
512 | | : backing_(n, make_allocator(isolate)) {} |
513 | | explicit LocalVector(Isolate* isolate, std::initializer_list<Local<T>> init) |
514 | | : backing_(make_allocator(isolate)) { |
515 | | if (init.size() == 0) return; |
516 | | backing_.reserve(init.size()); |
517 | | backing_.insert(backing_.end(), init.begin(), init.end()); |
518 | | } |
519 | | |
520 | 0 | iterator begin() noexcept { return iterator(backing_.begin()); } |
521 | | const_iterator begin() const noexcept { |
522 | | return const_iterator(backing_.begin()); |
523 | | } |
524 | 0 | iterator end() noexcept { return iterator(backing_.end()); } Unexecuted instantiation: v8::LocalVector<v8::Object>::end() Unexecuted instantiation: v8::LocalVector<v8::Message>::end() |
525 | | const_iterator end() const noexcept { return const_iterator(backing_.end()); } |
526 | | |
527 | 0 | size_t size() const noexcept { return backing_.size(); } |
528 | | bool empty() const noexcept { return backing_.empty(); } |
529 | | void reserve(size_t n) { backing_.reserve(n); } |
530 | | void shrink_to_fit() { backing_.shrink_to_fit(); } |
531 | | |
532 | | Local<T>& operator[](size_t n) { return backing_[n]; } |
533 | | const Local<T>& operator[](size_t n) const { return backing_[n]; } |
534 | | |
535 | | Local<T>& at(size_t n) { return backing_.at(n); } |
536 | | const Local<T>& at(size_t n) const { return backing_.at(n); } |
537 | | |
538 | | Local<T>& front() { return backing_.front(); } |
539 | | const Local<T>& front() const { return backing_.front(); } |
540 | | Local<T>& back() { return backing_.back(); } |
541 | | const Local<T>& back() const { return backing_.back(); } |
542 | | |
543 | | Local<T>* data() noexcept { return backing_.data(); } |
544 | | const Local<T>* data() const noexcept { return backing_.data(); } |
545 | | |
546 | | iterator insert(const_iterator pos, const Local<T>& value) { |
547 | | return iterator(backing_.insert(pos.base(), value)); |
548 | | } |
549 | | |
550 | | template <typename InputIt> |
551 | 0 | iterator insert(const_iterator pos, InputIt first, InputIt last) { |
552 | 0 | return iterator(backing_.insert(pos.base(), first, last)); |
553 | 0 | } |
554 | | |
555 | | iterator insert(const_iterator pos, std::initializer_list<Local<T>> init) { |
556 | | return iterator(backing_.insert(pos.base(), init.begin(), init.end())); |
557 | | } |
558 | | |
559 | | LocalVector<T>& operator=(std::initializer_list<Local<T>> init) { |
560 | | backing_.clear(); |
561 | | backing_.insert(backing_.end(), init.begin(), init.end()); |
562 | | return *this; |
563 | | } |
564 | | |
565 | | void push_back(const Local<T>& x) { backing_.push_back(x); } |
566 | | void pop_back() { backing_.pop_back(); } |
567 | | void emplace_back(const Local<T>& x) { backing_.emplace_back(x); } |
568 | | |
569 | | void clear() noexcept { backing_.clear(); } |
570 | | void resize(size_t n) { backing_.resize(n); } |
571 | | void swap(LocalVector<T>& other) { backing_.swap(other.backing_); } |
572 | | |
573 | | friend bool operator==(const LocalVector<T>& x, const LocalVector<T>& y) { |
574 | | return x.backing_ == y.backing_; |
575 | | } |
576 | | friend bool operator!=(const LocalVector<T>& x, const LocalVector<T>& y) { |
577 | | return x.backing_ != y.backing_; |
578 | | } |
579 | | friend bool operator<(const LocalVector<T>& x, const LocalVector<T>& y) { |
580 | | return x.backing_ < y.backing_; |
581 | | } |
582 | | friend bool operator>(const LocalVector<T>& x, const LocalVector<T>& y) { |
583 | | return x.backing_ > y.backing_; |
584 | | } |
585 | | friend bool operator<=(const LocalVector<T>& x, const LocalVector<T>& y) { |
586 | | return x.backing_ <= y.backing_; |
587 | | } |
588 | | friend bool operator>=(const LocalVector<T>& x, const LocalVector<T>& y) { |
589 | | return x.backing_ >= y.backing_; |
590 | | } |
591 | | |
592 | | private: |
593 | | vector_type backing_; |
594 | | }; |
595 | | |
596 | | #if !defined(V8_IMMINENT_DEPRECATION_WARNINGS) |
597 | | // Handle is an alias for Local for historical reasons. |
598 | | template <class T> |
599 | | using Handle = Local<T>; |
600 | | #endif |
601 | | |
602 | | /** |
603 | | * A MaybeLocal<> is a wrapper around Local<> that enforces a check whether |
604 | | * the Local<> is empty before it can be used. |
605 | | * |
606 | | * If an API method returns a MaybeLocal<>, the API method can potentially fail |
607 | | * either because an exception is thrown, or because an exception is pending, |
608 | | * e.g. because a previous API call threw an exception that hasn't been caught |
609 | | * yet, or because a TerminateExecution exception was thrown. In that case, an |
610 | | * empty MaybeLocal is returned. |
611 | | */ |
612 | | template <class T> |
613 | | class MaybeLocal { |
614 | | public: |
615 | 908k | V8_INLINE MaybeLocal() : local_() {} v8::MaybeLocal<v8::Value>::MaybeLocal() Line | Count | Source | 615 | 334k | V8_INLINE MaybeLocal() : local_() {} |
v8::MaybeLocal<v8::Object>::MaybeLocal() Line | Count | Source | 615 | 12 | V8_INLINE MaybeLocal() : local_() {} |
Unexecuted instantiation: v8::MaybeLocal<v8::Array>::MaybeLocal() Unexecuted instantiation: v8::MaybeLocal<v8::Promise>::MaybeLocal() Unexecuted instantiation: v8::MaybeLocal<v8::Module>::MaybeLocal() Unexecuted instantiation: v8::MaybeLocal<v8::Uint8Array>::MaybeLocal() Unexecuted instantiation: v8::MaybeLocal<v8::Function>::MaybeLocal() Unexecuted instantiation: v8::MaybeLocal<v8::Context>::MaybeLocal() v8::MaybeLocal<v8::String>::MaybeLocal() Line | Count | Source | 615 | 574k | V8_INLINE MaybeLocal() : local_() {} |
Unexecuted instantiation: v8::MaybeLocal<v8::StackTrace>::MaybeLocal() Unexecuted instantiation: v8::MaybeLocal<v8::ObjectTemplate>::MaybeLocal() Unexecuted instantiation: v8::MaybeLocal<v8::ArrayBufferView>::MaybeLocal() |
616 | | template <class S> |
617 | 125M | V8_INLINE MaybeLocal(Local<S> that) : local_(that) {} v8::MaybeLocal<v8::Value>::MaybeLocal<v8::Value>(v8::Local<v8::Value>) Line | Count | Source | 617 | 1.46M | V8_INLINE MaybeLocal(Local<S> that) : local_(that) {} |
v8::MaybeLocal<v8::Value>::MaybeLocal<v8::String>(v8::Local<v8::String>) Line | Count | Source | 617 | 95.3M | V8_INLINE MaybeLocal(Local<S> that) : local_(that) {} |
v8::MaybeLocal<v8::Object>::MaybeLocal<v8::Object>(v8::Local<v8::Object>) Line | Count | Source | 617 | 614k | V8_INLINE MaybeLocal(Local<S> that) : local_(that) {} |
v8::MaybeLocal<v8::ObjectTemplate>::MaybeLocal<v8::ObjectTemplate>(v8::Local<v8::ObjectTemplate>) Line | Count | Source | 617 | 123k | V8_INLINE MaybeLocal(Local<S> that) : local_(that) {} |
Unexecuted instantiation: v8::MaybeLocal<v8::Value>::MaybeLocal<v8::Primitive>(v8::Local<v8::Primitive>) Unexecuted instantiation: v8::MaybeLocal<v8::Private>::MaybeLocal<v8::Private>(v8::Local<v8::Private>) Unexecuted instantiation: v8::MaybeLocal<v8::Symbol>::MaybeLocal<v8::Symbol>(v8::Local<v8::Symbol>) v8::MaybeLocal<v8::String>::MaybeLocal<v8::String>(v8::Local<v8::String>) Line | Count | Source | 617 | 11.3M | V8_INLINE MaybeLocal(Local<S> that) : local_(that) {} |
Unexecuted instantiation: v8::MaybeLocal<v8::FunctionTemplate>::MaybeLocal<v8::FunctionTemplate>(v8::Local<v8::FunctionTemplate>) Unexecuted instantiation: v8::MaybeLocal<v8::Uint32Array>::MaybeLocal<v8::Uint32Array>(v8::Local<v8::Uint32Array>) v8::MaybeLocal<v8::Uint8Array>::MaybeLocal<v8::Uint8Array>(v8::Local<v8::Uint8Array>) Line | Count | Source | 617 | 3.74k | V8_INLINE MaybeLocal(Local<S> that) : local_(that) {} |
Unexecuted instantiation: v8::MaybeLocal<v8::Float64Array>::MaybeLocal<v8::Float64Array>(v8::Local<v8::Float64Array>) Unexecuted instantiation: v8::MaybeLocal<v8::Array>::MaybeLocal<v8::Array>(v8::Local<v8::Array>) Unexecuted instantiation: v8::MaybeLocal<v8::Int32Array>::MaybeLocal<v8::Int32Array>(v8::Local<v8::Int32Array>) Unexecuted instantiation: v8::MaybeLocal<v8::Promise>::MaybeLocal<v8::Promise>(v8::Local<v8::Promise>) Unexecuted instantiation: v8::MaybeLocal<v8::Module>::MaybeLocal<v8::Module>(v8::Local<v8::Module>) Unexecuted instantiation: v8::MaybeLocal<v8::Value>::MaybeLocal<v8::Promise>(v8::Local<v8::Promise>) v8::MaybeLocal<v8::Object>::MaybeLocal<v8::Uint8Array>(v8::Local<v8::Uint8Array>) Line | Count | Source | 617 | 10 | V8_INLINE MaybeLocal(Local<S> that) : local_(that) {} |
v8::MaybeLocal<v8::Function>::MaybeLocal<v8::Function>(v8::Local<v8::Function>) Line | Count | Source | 617 | 11.4M | V8_INLINE MaybeLocal(Local<S> that) : local_(that) {} |
Unexecuted instantiation: v8::MaybeLocal<v8::Value>::MaybeLocal<v8::Set>(v8::Local<v8::Set>) v8::MaybeLocal<v8::Value>::MaybeLocal<v8::Array>(v8::Local<v8::Array>) Line | Count | Source | 617 | 4.88M | V8_INLINE MaybeLocal(Local<S> that) : local_(that) {} |
v8::MaybeLocal<v8::Context>::MaybeLocal<v8::Context>(v8::Local<v8::Context>) Line | Count | Source | 617 | 953 | V8_INLINE MaybeLocal(Local<S> that) : local_(that) {} |
Unexecuted instantiation: v8::MaybeLocal<v8::Value>::MaybeLocal<v8::Integer>(v8::Local<v8::Integer>) Unexecuted instantiation: v8::MaybeLocal<v8::StackTrace>::MaybeLocal<v8::StackTrace>(v8::Local<v8::StackTrace>) Unexecuted instantiation: v8::MaybeLocal<v8::BigInt64Array>::MaybeLocal<v8::BigInt64Array>(v8::Local<v8::BigInt64Array>) Unexecuted instantiation: v8::MaybeLocal<v8::SharedArrayBuffer>::MaybeLocal<v8::SharedArrayBuffer>(v8::Local<v8::SharedArrayBuffer>) Unexecuted instantiation: v8::MaybeLocal<v8::Value>::MaybeLocal<v8::Symbol>(v8::Local<v8::Symbol>) v8::MaybeLocal<v8::Value>::MaybeLocal<v8::Map>(v8::Local<v8::Map>) Line | Count | Source | 617 | 122k | V8_INLINE MaybeLocal(Local<S> that) : local_(that) {} |
v8::MaybeLocal<v8::Value>::MaybeLocal<v8::Boolean>(v8::Local<v8::Boolean>) Line | Count | Source | 617 | 122k | V8_INLINE MaybeLocal(Local<S> that) : local_(that) {} |
v8::MaybeLocal<v8::Value>::MaybeLocal<v8::Object>(v8::Local<v8::Object>) Line | Count | Source | 617 | 3 | V8_INLINE MaybeLocal(Local<S> that) : local_(that) {} |
Unexecuted instantiation: v8::MaybeLocal<v8::ArrayBufferView>::MaybeLocal<v8::ArrayBufferView>(v8::Local<v8::ArrayBufferView>) Unexecuted instantiation: v8::MaybeLocal<v8::Integer>::MaybeLocal<v8::Integer>(v8::Local<v8::Integer>) Unexecuted instantiation: v8::MaybeLocal<v8::Boolean>::MaybeLocal<v8::Boolean>(v8::Local<v8::Boolean>) |
618 | | |
619 | 602M | V8_INLINE bool IsEmpty() const { return local_.IsEmpty(); } v8::MaybeLocal<v8::String>::IsEmpty() const Line | Count | Source | 619 | 424M | V8_INLINE bool IsEmpty() const { return local_.IsEmpty(); } |
v8::MaybeLocal<v8::Value>::IsEmpty() const Line | Count | Source | 619 | 108M | V8_INLINE bool IsEmpty() const { return local_.IsEmpty(); } |
v8::MaybeLocal<v8::Function>::IsEmpty() const Line | Count | Source | 619 | 39.5M | V8_INLINE bool IsEmpty() const { return local_.IsEmpty(); } |
v8::MaybeLocal<v8::Object>::IsEmpty() const Line | Count | Source | 619 | 5.37M | V8_INLINE bool IsEmpty() const { return local_.IsEmpty(); } |
v8::MaybeLocal<v8::Context>::IsEmpty() const Line | Count | Source | 619 | 7.62k | V8_INLINE bool IsEmpty() const { return local_.IsEmpty(); } |
Unexecuted instantiation: v8::MaybeLocal<v8::Private>::IsEmpty() const Unexecuted instantiation: v8::MaybeLocal<v8::Symbol>::IsEmpty() const Unexecuted instantiation: v8::MaybeLocal<v8::FunctionTemplate>::IsEmpty() const Unexecuted instantiation: v8::MaybeLocal<v8::ObjectTemplate>::IsEmpty() const v8::MaybeLocal<v8::Script>::IsEmpty() const Line | Count | Source | 619 | 10.5k | V8_INLINE bool IsEmpty() const { return local_.IsEmpty(); } |
Unexecuted instantiation: v8::MaybeLocal<v8::Uint32Array>::IsEmpty() const v8::MaybeLocal<v8::Uint8Array>::IsEmpty() const Line | Count | Source | 619 | 3.74k | V8_INLINE bool IsEmpty() const { return local_.IsEmpty(); } |
Unexecuted instantiation: v8::MaybeLocal<v8::Float64Array>::IsEmpty() const v8::MaybeLocal<v8::Array>::IsEmpty() const Line | Count | Source | 619 | 16.1k | V8_INLINE bool IsEmpty() const { return local_.IsEmpty(); } |
Unexecuted instantiation: v8::MaybeLocal<v8::Int32Array>::IsEmpty() const Unexecuted instantiation: v8::MaybeLocal<v8::Module>::IsEmpty() const Unexecuted instantiation: v8::MaybeLocal<v8::Promise::Resolver>::IsEmpty() const Unexecuted instantiation: v8::MaybeLocal<v8::Set>::IsEmpty() const v8::MaybeLocal<v8::UnboundScript>::IsEmpty() const Line | Count | Source | 619 | 953 | V8_INLINE bool IsEmpty() const { return local_.IsEmpty(); } |
Unexecuted instantiation: v8::MaybeLocal<v8::StackTrace>::IsEmpty() const Unexecuted instantiation: v8::MaybeLocal<v8::Promise>::IsEmpty() const Unexecuted instantiation: v8::MaybeLocal<v8::BigInt64Array>::IsEmpty() const v8::MaybeLocal<v8::Map>::IsEmpty() const Line | Count | Source | 619 | 23.9M | V8_INLINE bool IsEmpty() const { return local_.IsEmpty(); } |
Unexecuted instantiation: v8::MaybeLocal<v8::ArrayBufferView>::IsEmpty() const Unexecuted instantiation: v8::MaybeLocal<v8::BigInt>::IsEmpty() const Unexecuted instantiation: v8::MaybeLocal<v8::Number>::IsEmpty() const Unexecuted instantiation: v8::MaybeLocal<v8::Integer>::IsEmpty() const Unexecuted instantiation: v8::MaybeLocal<v8::Boolean>::IsEmpty() const Unexecuted instantiation: v8::MaybeLocal<v8::Int32>::IsEmpty() const Unexecuted instantiation: v8::MaybeLocal<v8::Uint32>::IsEmpty() const |
620 | | |
621 | | /** |
622 | | * Converts this MaybeLocal<> to a Local<>. If this MaybeLocal<> is empty, |
623 | | * |false| is returned and |out| is assigned with nullptr. |
624 | | */ |
625 | | template <class S> |
626 | 146M | V8_WARN_UNUSED_RESULT V8_INLINE bool ToLocal(Local<S>* out) const { |
627 | 146M | *out = local_; |
628 | 146M | return !IsEmpty(); |
629 | 146M | } bool v8::MaybeLocal<v8::Value>::ToLocal<v8::Value>(v8::Local<v8::Value>*) const Line | Count | Source | 626 | 80.0M | V8_WARN_UNUSED_RESULT V8_INLINE bool ToLocal(Local<S>* out) const { | 627 | 80.0M | *out = local_; | 628 | 80.0M | return !IsEmpty(); | 629 | 80.0M | } |
bool v8::MaybeLocal<v8::Function>::ToLocal<v8::Value>(v8::Local<v8::Value>*) const Line | Count | Source | 626 | 252k | V8_WARN_UNUSED_RESULT V8_INLINE bool ToLocal(Local<S>* out) const { | 627 | 252k | *out = local_; | 628 | 252k | return !IsEmpty(); | 629 | 252k | } |
bool v8::MaybeLocal<v8::Object>::ToLocal<v8::Object>(v8::Local<v8::Object>*) const Line | Count | Source | 626 | 625k | V8_WARN_UNUSED_RESULT V8_INLINE bool ToLocal(Local<S>* out) const { | 627 | 625k | *out = local_; | 628 | 625k | return !IsEmpty(); | 629 | 625k | } |
Unexecuted instantiation: bool v8::MaybeLocal<v8::Private>::ToLocal<v8::Private>(v8::Local<v8::Private>*) const Unexecuted instantiation: bool v8::MaybeLocal<v8::Symbol>::ToLocal<v8::Symbol>(v8::Local<v8::Symbol>*) const bool v8::MaybeLocal<v8::String>::ToLocal<v8::String>(v8::Local<v8::String>*) const Line | Count | Source | 626 | 42.0M | V8_WARN_UNUSED_RESULT V8_INLINE bool ToLocal(Local<S>* out) const { | 627 | 42.0M | *out = local_; | 628 | 42.0M | return !IsEmpty(); | 629 | 42.0M | } |
Unexecuted instantiation: bool v8::MaybeLocal<v8::FunctionTemplate>::ToLocal<v8::FunctionTemplate>(v8::Local<v8::FunctionTemplate>*) const Unexecuted instantiation: bool v8::MaybeLocal<v8::ObjectTemplate>::ToLocal<v8::ObjectTemplate>(v8::Local<v8::ObjectTemplate>*) const Unexecuted instantiation: bool v8::MaybeLocal<v8::Script>::ToLocal<v8::Script>(v8::Local<v8::Script>*) const Unexecuted instantiation: bool v8::MaybeLocal<v8::String>::ToLocal<v8::Value>(v8::Local<v8::Value>*) const bool v8::MaybeLocal<v8::Array>::ToLocal<v8::Array>(v8::Local<v8::Array>*) const Line | Count | Source | 626 | 1.13k | V8_WARN_UNUSED_RESULT V8_INLINE bool ToLocal(Local<S>* out) const { | 627 | 1.13k | *out = local_; | 628 | 1.13k | return !IsEmpty(); | 629 | 1.13k | } |
Unexecuted instantiation: bool v8::MaybeLocal<v8::Module>::ToLocal<v8::Module>(v8::Local<v8::Module>*) const Unexecuted instantiation: bool v8::MaybeLocal<v8::Promise::Resolver>::ToLocal<v8::Promise::Resolver>(v8::Local<v8::Promise::Resolver>*) const bool v8::MaybeLocal<v8::Function>::ToLocal<v8::Function>(v8::Local<v8::Function>*) const Line | Count | Source | 626 | 23.0M | V8_WARN_UNUSED_RESULT V8_INLINE bool ToLocal(Local<S>* out) const { | 627 | 23.0M | *out = local_; | 628 | 23.0M | return !IsEmpty(); | 629 | 23.0M | } |
bool v8::MaybeLocal<v8::Uint8Array>::ToLocal<v8::Object>(v8::Local<v8::Object>*) const Line | Count | Source | 626 | 3.70k | V8_WARN_UNUSED_RESULT V8_INLINE bool ToLocal(Local<S>* out) const { | 627 | 3.70k | *out = local_; | 628 | 3.70k | return !IsEmpty(); | 629 | 3.70k | } |
Unexecuted instantiation: bool v8::MaybeLocal<v8::Uint8Array>::ToLocal<v8::Uint8Array>(v8::Local<v8::Uint8Array>*) const bool v8::MaybeLocal<v8::Context>::ToLocal<v8::Context>(v8::Local<v8::Context>*) const Line | Count | Source | 626 | 7.62k | V8_WARN_UNUSED_RESULT V8_INLINE bool ToLocal(Local<S>* out) const { | 627 | 7.62k | *out = local_; | 628 | 7.62k | return !IsEmpty(); | 629 | 7.62k | } |
bool v8::MaybeLocal<v8::UnboundScript>::ToLocal<v8::UnboundScript>(v8::Local<v8::UnboundScript>*) const Line | Count | Source | 626 | 953 | V8_WARN_UNUSED_RESULT V8_INLINE bool ToLocal(Local<S>* out) const { | 627 | 953 | *out = local_; | 628 | 953 | return !IsEmpty(); | 629 | 953 | } |
Unexecuted instantiation: bool v8::MaybeLocal<v8::StackTrace>::ToLocal<v8::StackTrace>(v8::Local<v8::StackTrace>*) const Unexecuted instantiation: bool v8::MaybeLocal<v8::Promise>::ToLocal<v8::Promise>(v8::Local<v8::Promise>*) const bool v8::MaybeLocal<v8::Object>::ToLocal<v8::Value>(v8::Local<v8::Value>*) const Line | Count | Source | 626 | 9 | V8_WARN_UNUSED_RESULT V8_INLINE bool ToLocal(Local<S>* out) const { | 627 | 9 | *out = local_; | 628 | 9 | return !IsEmpty(); | 629 | 9 | } |
bool v8::MaybeLocal<v8::Uint8Array>::ToLocal<v8::Value>(v8::Local<v8::Value>*) const Line | Count | Source | 626 | 10 | V8_WARN_UNUSED_RESULT V8_INLINE bool ToLocal(Local<S>* out) const { | 627 | 10 | *out = local_; | 628 | 10 | return !IsEmpty(); | 629 | 10 | } |
Unexecuted instantiation: bool v8::MaybeLocal<v8::Integer>::ToLocal<v8::Value>(v8::Local<v8::Value>*) const Unexecuted instantiation: bool v8::MaybeLocal<v8::Boolean>::ToLocal<v8::Value>(v8::Local<v8::Value>*) const Unexecuted instantiation: bool v8::MaybeLocal<v8::Int32>::ToLocal<v8::Int32>(v8::Local<v8::Int32>*) const Unexecuted instantiation: bool v8::MaybeLocal<v8::Uint32>::ToLocal<v8::Uint32>(v8::Local<v8::Uint32>*) const |
630 | | |
631 | | /** |
632 | | * Converts this MaybeLocal<> to a Local<>. If this MaybeLocal<> is empty, |
633 | | * V8 will crash the process. |
634 | | */ |
635 | 332M | V8_INLINE Local<T> ToLocalChecked() { |
636 | 332M | if (V8_UNLIKELY(IsEmpty())) api_internal::ToLocalEmpty(); |
637 | 332M | return local_; |
638 | 332M | } v8::MaybeLocal<v8::String>::ToLocalChecked() Line | Count | Source | 635 | 286M | V8_INLINE Local<T> ToLocalChecked() { | 636 | 286M | if (V8_UNLIKELY(IsEmpty())) api_internal::ToLocalEmpty(); | 637 | 286M | return local_; | 638 | 286M | } |
v8::MaybeLocal<v8::Value>::ToLocalChecked() Line | Count | Source | 635 | 25.1M | V8_INLINE Local<T> ToLocalChecked() { | 636 | 25.1M | if (V8_UNLIKELY(IsEmpty())) api_internal::ToLocalEmpty(); | 637 | 25.1M | return local_; | 638 | 25.1M | } |
v8::MaybeLocal<v8::Function>::ToLocalChecked() Line | Count | Source | 635 | 16.2M | V8_INLINE Local<T> ToLocalChecked() { | 636 | 16.2M | if (V8_UNLIKELY(IsEmpty())) api_internal::ToLocalEmpty(); | 637 | 16.2M | return local_; | 638 | 16.2M | } |
v8::MaybeLocal<v8::Object>::ToLocalChecked() Line | Count | Source | 635 | 4.56M | V8_INLINE Local<T> ToLocalChecked() { | 636 | 4.56M | if (V8_UNLIKELY(IsEmpty())) api_internal::ToLocalEmpty(); | 637 | 4.56M | return local_; | 638 | 4.56M | } |
Unexecuted instantiation: v8::MaybeLocal<v8::Context>::ToLocalChecked() Unexecuted instantiation: v8::MaybeLocal<v8::Uint32Array>::ToLocalChecked() Unexecuted instantiation: v8::MaybeLocal<v8::Uint8Array>::ToLocalChecked() Unexecuted instantiation: v8::MaybeLocal<v8::Float64Array>::ToLocalChecked() v8::MaybeLocal<v8::Array>::ToLocalChecked() Line | Count | Source | 635 | 7.51k | V8_INLINE Local<T> ToLocalChecked() { | 636 | 7.51k | if (V8_UNLIKELY(IsEmpty())) api_internal::ToLocalEmpty(); | 637 | 7.51k | return local_; | 638 | 7.51k | } |
Unexecuted instantiation: v8::MaybeLocal<v8::Int32Array>::ToLocalChecked() Unexecuted instantiation: v8::MaybeLocal<v8::Promise::Resolver>::ToLocalChecked() Unexecuted instantiation: v8::MaybeLocal<v8::BigInt64Array>::ToLocalChecked() Unexecuted instantiation: v8::MaybeLocal<v8::BigInt>::ToLocalChecked() Unexecuted instantiation: v8::MaybeLocal<v8::Number>::ToLocalChecked() v8::MaybeLocal<v8::Script>::ToLocalChecked() Line | Count | Source | 635 | 3.03k | V8_INLINE Local<T> ToLocalChecked() { | 636 | 3.03k | if (V8_UNLIKELY(IsEmpty())) api_internal::ToLocalEmpty(); | 637 | 3.03k | return local_; | 638 | 3.03k | } |
|
639 | | |
640 | | /** |
641 | | * Converts this MaybeLocal<> to a Local<>, using a default value if this |
642 | | * MaybeLocal<> is empty. |
643 | | */ |
644 | | template <class S> |
645 | 96.5M | V8_INLINE Local<S> FromMaybe(Local<S> default_value) const { |
646 | 96.5M | return IsEmpty() ? default_value : Local<S>(local_); |
647 | 96.5M | } v8::Local<v8::String> v8::MaybeLocal<v8::String>::FromMaybe<v8::String>(v8::Local<v8::String>) const Line | Count | Source | 645 | 95.3M | V8_INLINE Local<S> FromMaybe(Local<S> default_value) const { | 646 | 95.3M | return IsEmpty() ? default_value : Local<S>(local_); | 647 | 95.3M | } |
v8::Local<v8::Value> v8::MaybeLocal<v8::String>::FromMaybe<v8::Value>(v8::Local<v8::Value>) const Line | Count | Source | 645 | 4 | V8_INLINE Local<S> FromMaybe(Local<S> default_value) const { | 646 | 4 | return IsEmpty() ? default_value : Local<S>(local_); | 647 | 4 | } |
v8::Local<v8::Value> v8::MaybeLocal<v8::Value>::FromMaybe<v8::Value>(v8::Local<v8::Value>) const Line | Count | Source | 645 | 1.09M | V8_INLINE Local<S> FromMaybe(Local<S> default_value) const { | 646 | 1.09M | return IsEmpty() ? default_value : Local<S>(local_); | 647 | 1.09M | } |
v8::Local<v8::Object> v8::MaybeLocal<v8::Object>::FromMaybe<v8::Object>(v8::Local<v8::Object>) const Line | Count | Source | 645 | 122k | V8_INLINE Local<S> FromMaybe(Local<S> default_value) const { | 646 | 122k | return IsEmpty() ? default_value : Local<S>(local_); | 647 | 122k | } |
v8::Local<v8::Uint8Array> v8::MaybeLocal<v8::Uint8Array>::FromMaybe<v8::Uint8Array>(v8::Local<v8::Uint8Array>) const Line | Count | Source | 645 | 10 | V8_INLINE Local<S> FromMaybe(Local<S> default_value) const { | 646 | 10 | return IsEmpty() ? default_value : Local<S>(local_); | 647 | 10 | } |
v8::Local<v8::Value> v8::MaybeLocal<v8::Uint8Array>::FromMaybe<v8::Value>(v8::Local<v8::Value>) const Line | Count | Source | 645 | 16 | V8_INLINE Local<S> FromMaybe(Local<S> default_value) const { | 646 | 16 | return IsEmpty() ? default_value : Local<S>(local_); | 647 | 16 | } |
v8::Local<v8::Value> v8::MaybeLocal<v8::Object>::FromMaybe<v8::Value>(v8::Local<v8::Value>) const Line | Count | Source | 645 | 3 | V8_INLINE Local<S> FromMaybe(Local<S> default_value) const { | 646 | 3 | return IsEmpty() ? default_value : Local<S>(local_); | 647 | 3 | } |
Unexecuted instantiation: v8::Local<v8::ArrayBufferView> v8::MaybeLocal<v8::ArrayBufferView>::FromMaybe<v8::ArrayBufferView>(v8::Local<v8::ArrayBufferView>) const v8::Local<v8::Object> v8::MaybeLocal<v8::Uint8Array>::FromMaybe<v8::Object>(v8::Local<v8::Object>) const Line | Count | Source | 645 | 9 | V8_INLINE Local<S> FromMaybe(Local<S> default_value) const { | 646 | 9 | return IsEmpty() ? default_value : Local<S>(local_); | 647 | 9 | } |
|
648 | | |
649 | | /** |
650 | | * Cast a handle to a subclass, e.g. MaybeLocal<Value> to MaybeLocal<Object>. |
651 | | * This is only valid if the handle actually refers to a value of the target |
652 | | * type. |
653 | | */ |
654 | | template <class S> |
655 | | V8_INLINE static MaybeLocal<T> Cast(MaybeLocal<S> that) { |
656 | | #ifdef V8_ENABLE_CHECKS |
657 | | // If we're going to perform the type check then we have to check |
658 | | // that the handle isn't empty before doing the checked cast. |
659 | | if (that.IsEmpty()) return MaybeLocal<T>(); |
660 | | T::Cast(that.local_.template value<S>()); |
661 | | #endif |
662 | | return MaybeLocal<T>(that.local_); |
663 | | } |
664 | | |
665 | | /** |
666 | | * Calling this is equivalent to MaybeLocal<S>::Cast(). |
667 | | * In particular, this is only valid if the handle actually refers to a value |
668 | | * of the target type. |
669 | | */ |
670 | | template <class S> |
671 | | V8_INLINE MaybeLocal<S> As() const { |
672 | | return MaybeLocal<S>::Cast(*this); |
673 | | } |
674 | | |
675 | | private: |
676 | | Local<T> local_; |
677 | | |
678 | | template <typename S> |
679 | | friend class MaybeLocal; |
680 | | }; |
681 | | |
682 | | /** |
683 | | * A HandleScope which first allocates a handle in the current scope |
684 | | * which will be later filled with the escape value. |
685 | | */ |
686 | | class V8_EXPORT V8_NODISCARD EscapableHandleScopeBase : public HandleScope { |
687 | | public: |
688 | | explicit EscapableHandleScopeBase(Isolate* isolate); |
689 | | V8_INLINE ~EscapableHandleScopeBase() = default; |
690 | | |
691 | | EscapableHandleScopeBase(const EscapableHandleScopeBase&) = delete; |
692 | | void operator=(const EscapableHandleScopeBase&) = delete; |
693 | | void* operator new(size_t size) = delete; |
694 | | void* operator new[](size_t size) = delete; |
695 | | void operator delete(void*, size_t) = delete; |
696 | | void operator delete[](void*, size_t) = delete; |
697 | | |
698 | | protected: |
699 | | /** |
700 | | * Pushes the value into the previous scope and returns a handle to it. |
701 | | * Cannot be called twice. |
702 | | */ |
703 | | internal::Address* EscapeSlot(internal::Address* escape_value); |
704 | | |
705 | | private: |
706 | | internal::Address* escape_slot_; |
707 | | }; |
708 | | |
709 | | class V8_EXPORT V8_NODISCARD EscapableHandleScope |
710 | | : public EscapableHandleScopeBase { |
711 | | public: |
712 | | explicit EscapableHandleScope(Isolate* isolate) |
713 | 22.4M | : EscapableHandleScopeBase(isolate) {} |
714 | | V8_INLINE ~EscapableHandleScope() = default; |
715 | | template <class T> |
716 | 22.4M | V8_INLINE Local<T> Escape(Local<T> value) { |
717 | | #ifdef V8_ENABLE_DIRECT_LOCAL |
718 | | return value; |
719 | | #else |
720 | 22.4M | if (value.IsEmpty()) return value; |
721 | 22.4M | return Local<T>::FromSlot(EscapeSlot(value.slot())); |
722 | 22.4M | #endif |
723 | 22.4M | } v8::Local<v8::Object> v8::EscapableHandleScope::Escape<v8::Object>(v8::Local<v8::Object>) Line | Count | Source | 716 | 4.87M | V8_INLINE Local<T> Escape(Local<T> value) { | 717 | | #ifdef V8_ENABLE_DIRECT_LOCAL | 718 | | return value; | 719 | | #else | 720 | 4.87M | if (value.IsEmpty()) return value; | 721 | 4.87M | return Local<T>::FromSlot(EscapeSlot(value.slot())); | 722 | 4.87M | #endif | 723 | 4.87M | } |
v8::Local<v8::Array> v8::EscapableHandleScope::Escape<v8::Array>(v8::Local<v8::Array>) Line | Count | Source | 716 | 4.88M | V8_INLINE Local<T> Escape(Local<T> value) { | 717 | | #ifdef V8_ENABLE_DIRECT_LOCAL | 718 | | return value; | 719 | | #else | 720 | 4.88M | if (value.IsEmpty()) return value; | 721 | 4.88M | return Local<T>::FromSlot(EscapeSlot(value.slot())); | 722 | 4.88M | #endif | 723 | 4.88M | } |
v8::Local<v8::Value> v8::EscapableHandleScope::Escape<v8::Value>(v8::Local<v8::Value>) Line | Count | Source | 716 | 1.22M | V8_INLINE Local<T> Escape(Local<T> value) { | 717 | | #ifdef V8_ENABLE_DIRECT_LOCAL | 718 | | return value; | 719 | | #else | 720 | 1.22M | if (value.IsEmpty()) return value; | 721 | 1.14M | return Local<T>::FromSlot(EscapeSlot(value.slot())); | 722 | 1.22M | #endif | 723 | 1.22M | } |
Unexecuted instantiation: v8::Local<v8::Primitive> v8::EscapableHandleScope::Escape<v8::Primitive>(v8::Local<v8::Primitive>) Unexecuted instantiation: v8::Local<v8::Promise> v8::EscapableHandleScope::Escape<v8::Promise>(v8::Local<v8::Promise>) Unexecuted instantiation: v8::Local<v8::Uint8Array> v8::EscapableHandleScope::Escape<v8::Uint8Array>(v8::Local<v8::Uint8Array>) v8::Local<v8::Function> v8::EscapableHandleScope::Escape<v8::Function>(v8::Local<v8::Function>) Line | Count | Source | 716 | 11.3M | V8_INLINE Local<T> Escape(Local<T> value) { | 717 | | #ifdef V8_ENABLE_DIRECT_LOCAL | 718 | | return value; | 719 | | #else | 720 | 11.3M | if (value.IsEmpty()) return value; | 721 | 11.3M | return Local<T>::FromSlot(EscapeSlot(value.slot())); | 722 | 11.3M | #endif | 723 | 11.3M | } |
v8::Local<v8::Context> v8::EscapableHandleScope::Escape<v8::Context>(v8::Local<v8::Context>) Line | Count | Source | 716 | 953 | V8_INLINE Local<T> Escape(Local<T> value) { | 717 | | #ifdef V8_ENABLE_DIRECT_LOCAL | 718 | | return value; | 719 | | #else | 720 | 953 | if (value.IsEmpty()) return value; | 721 | 953 | return Local<T>::FromSlot(EscapeSlot(value.slot())); | 722 | 953 | #endif | 723 | 953 | } |
Unexecuted instantiation: v8::Local<v8::StackTrace> v8::EscapableHandleScope::Escape<v8::StackTrace>(v8::Local<v8::StackTrace>) v8::Local<v8::Integer> v8::EscapableHandleScope::Escape<v8::Integer>(v8::Local<v8::Integer>) Line | Count | Source | 716 | 152 | V8_INLINE Local<T> Escape(Local<T> value) { | 717 | | #ifdef V8_ENABLE_DIRECT_LOCAL | 718 | | return value; | 719 | | #else | 720 | 152 | if (value.IsEmpty()) return value; | 721 | 152 | return Local<T>::FromSlot(EscapeSlot(value.slot())); | 722 | 152 | #endif | 723 | 152 | } |
v8::Local<v8::Map> v8::EscapableHandleScope::Escape<v8::Map>(v8::Local<v8::Map>) Line | Count | Source | 716 | 122k | V8_INLINE Local<T> Escape(Local<T> value) { | 717 | | #ifdef V8_ENABLE_DIRECT_LOCAL | 718 | | return value; | 719 | | #else | 720 | 122k | if (value.IsEmpty()) return value; | 721 | 122k | return Local<T>::FromSlot(EscapeSlot(value.slot())); | 722 | 122k | #endif | 723 | 122k | } |
|
724 | | |
725 | | template <class T> |
726 | 1.09M | V8_INLINE MaybeLocal<T> EscapeMaybe(MaybeLocal<T> value) { |
727 | 1.09M | return Escape(value.FromMaybe(Local<T>())); |
728 | 1.09M | } v8::MaybeLocal<v8::Value> v8::EscapableHandleScope::EscapeMaybe<v8::Value>(v8::MaybeLocal<v8::Value>) Line | Count | Source | 726 | 1.09M | V8_INLINE MaybeLocal<T> EscapeMaybe(MaybeLocal<T> value) { | 727 | 1.09M | return Escape(value.FromMaybe(Local<T>())); | 728 | 1.09M | } |
v8::MaybeLocal<v8::Object> v8::EscapableHandleScope::EscapeMaybe<v8::Object>(v8::MaybeLocal<v8::Object>) Line | Count | Source | 726 | 10 | V8_INLINE MaybeLocal<T> EscapeMaybe(MaybeLocal<T> value) { | 727 | 10 | return Escape(value.FromMaybe(Local<T>())); | 728 | 10 | } |
|
729 | | }; |
730 | | |
731 | | /** |
732 | | * A SealHandleScope acts like a handle scope in which no handle allocations |
733 | | * are allowed. It can be useful for debugging handle leaks. |
734 | | * Handles can be allocated within inner normal HandleScopes. |
735 | | */ |
736 | | class V8_EXPORT V8_NODISCARD SealHandleScope { |
737 | | public: |
738 | | explicit SealHandleScope(Isolate* isolate); |
739 | | ~SealHandleScope(); |
740 | | |
741 | | SealHandleScope(const SealHandleScope&) = delete; |
742 | | void operator=(const SealHandleScope&) = delete; |
743 | | void* operator new(size_t size) = delete; |
744 | | void* operator new[](size_t size) = delete; |
745 | | void operator delete(void*, size_t) = delete; |
746 | | void operator delete[](void*, size_t) = delete; |
747 | | |
748 | | private: |
749 | | internal::Isolate* const i_isolate_; |
750 | | internal::Address* prev_limit_; |
751 | | int prev_sealed_level_; |
752 | | }; |
753 | | |
754 | | } // namespace v8 |
755 | | |
756 | | #endif // INCLUDE_V8_LOCAL_HANDLE_H_ |