24 #include <type_traits>
41 class AccessorSignature;
53 class FunctionTemplate;
55 class ImplementationUtilities;
66 class ObjectOperationDescriptor;
73 class RawOperationDescriptor;
96 template <
class T,
class M = NonCopyablePersistentTraits<T> >
107 template <
class K,
class V,
class T>
109 template <
class K,
class V,
class T>
120 class CallHandlerHelper;
125 enum class ArgumentsType;
126 template <ArgumentsType>
128 template <
typename T>
130 class DeferredHandles;
131 class FunctionCallbackArguments;
135 class ExternalString;
137 class LocalEmbedderHeapTracer;
139 class PropertyCallbackArguments;
141 class ScopedExternalStringLock;
142 struct ScriptStreamingData;
143 class ThreadLocalTop;
147 class StreamingDecoder;
153 class ConsoleCallArguments;
195 : val_(reinterpret_cast<T*>(*that)) {
201 static_assert(std::is_base_of<T, S>::value,
"type check");
232 if (a ==
nullptr)
return b ==
nullptr;
233 if (b ==
nullptr)
return false;
241 if (a ==
nullptr)
return b ==
nullptr;
242 if (b ==
nullptr)
return false;
272 #ifdef V8_ENABLE_CHECKS
306 template<
class F>
friend class Local;
323 template <
class F1,
class F2,
class F3>
343 #if !defined(V8_IMMINENT_DEPRECATION_WARNINGS)
366 : val_(reinterpret_cast<T*>(*that)) {
367 static_assert(std::is_base_of<T, S>::value,
"type check");
378 out->val_ =
IsEmpty() ? nullptr : this->val_;
405 template <
class T>
class Eternal {
410 Set(isolate, handle);
422 static const int kInternalFieldsInWeakCallback = 2;
423 static const int kEmbedderFieldsInWeakCallback = 2;
425 template <
typename T>
431 void* embedder_fields[kEmbedderFieldsInWeakCallback],
433 : isolate_(isolate), parameter_(parameter), callback_(callback) {
434 for (
int i = 0; i < kEmbedderFieldsInWeakCallback; ++i) {
435 embedder_fields_[i] = embedder_fields[i];
455 void* embedder_fields_[kEmbedderFieldsInWeakCallback];
479 template <
class T>
class PersistentBase {
511 if (a ==
nullptr)
return b ==
nullptr;
512 if (b ==
nullptr)
return false;
520 if (a ==
nullptr)
return b ==
nullptr;
521 if (b ==
nullptr)
return false;
547 template <
typename P>
595 template<
class F>
friend class Local;
601 template <
class F1,
class F2,
class F3>
620 class NonCopyablePersistentTraits {
624 template<
class S,
class M>
627 static_assert(
sizeof(S) < 0,
628 "NonCopyablePersistentTraits::Copy is not instantiable");
641 template<
class S,
class M>
657 template <
class T,
class M>
class Persistent :
public PersistentBase<T> {
671 static_assert(std::is_base_of<T, S>::value,
"type check");
678 template <
class S,
class M2>
681 static_assert(std::is_base_of<T, S>::value,
"type check");
692 template <
class S,
class M2>
700 template <
class S,
class M2>
711 if (M::kResetInDestructor) this->Reset();
717 #ifdef V8_ENABLE_CHECKS
720 if (!that.IsEmpty()) T::Cast(*that);
734 template<
class F>
friend class Local;
739 V8_INLINE T* operator*()
const {
return this->val_; }
740 template<
class S,
class M2>
741 V8_INLINE void Copy(
const Persistent<S, M2>& that);
751 class Global :
public PersistentBase<T> {
766 static_assert(std::is_base_of<T, S>::value,
"type check");
777 static_assert(std::is_base_of<T, S>::value,
"type check");
809 V8_INLINE T* operator*()
const {
return this->val_; }
820 template <
typename T>
838 template <
typename T>
845 bool IsEmpty()
const {
return val_ ==
nullptr; }
862 if (a ==
nullptr)
return b ==
nullptr;
863 if (b ==
nullptr)
return false;
871 if (a ==
nullptr)
return b ==
nullptr;
872 if (b ==
nullptr)
return false;
904 enum DestructionMode { kWithDestructor, kWithoutDestructor };
909 TracedReferenceBase() =
default;
911 V8_INLINE static T* New(Isolate* isolate, T* that,
void* slot,
912 DestructionMode destruction_mode);
917 template <
typename F>
920 template <
typename F>
922 template <
typename F>
924 template <
typename F>
932 template <
typename T>
955 this->val_ = this->New(isolate, that.val_, &this->val_,
957 static_assert(std::is_base_of<T, S>::value,
"type check");
965 *
this = std::move(other);
971 template <
typename S>
974 *
this = std::move(other);
988 template <
typename S>
1060 template <
typename T>
1061 class TracedReference :
public TracedReferenceBase<T> {
1078 this->val_ = this->New(isolate, that.val_, &this->val_,
1080 static_assert(std::is_base_of<T, S>::value,
"type check");
1089 *
this = std::move(other);
1096 template <
typename S>
1099 *
this = std::move(other);
1115 template <
typename S>
1180 static int NumberOfHandles(
Isolate* isolate);
1183 return reinterpret_cast<Isolate*
>(isolate_);
1192 void Initialize(
Isolate* isolate);
1200 void*
operator new(
size_t size);
1201 void*
operator new[](
size_t size);
1202 void operator delete(
void*, size_t);
1203 void operator delete[](
void*, size_t);
1205 internal::Isolate* isolate_;
1236 return Local<T>(
reinterpret_cast<T*
>(slot));
1250 void*
operator new(
size_t size);
1251 void*
operator new[](
size_t size);
1252 void operator delete(
void*, size_t);
1253 void operator delete[](
void*, size_t);
1275 void*
operator new(
size_t size);
1276 void*
operator new[](
size_t size);
1277 void operator delete(
void*, size_t);
1278 void operator delete[](
void*, size_t);
1280 internal::Isolate*
const isolate_;
1282 int prev_sealed_level_;
1339 bool is_opaque =
false,
bool is_wasm =
false,
1340 bool is_module =
false)
1341 : flags_((is_shared_cross_origin ? kIsSharedCrossOrigin : 0) |
1342 (is_wasm ? kIsWasm : 0) | (is_opaque ? kIsOpaque : 0) |
1343 (is_module ? kIsModule : 0)) {}
1346 (kIsSharedCrossOrigin | kIsOpaque | kIsWasm | kIsModule)) {}
1349 return (flags_ & kIsSharedCrossOrigin) != 0;
1351 bool IsOpaque()
const {
return (flags_ & kIsOpaque) != 0; }
1352 bool IsWasm()
const {
return (flags_ & kIsWasm) != 0; }
1353 bool IsModule()
const {
return (flags_ & kIsModule) != 0; }
1359 kIsSharedCrossOrigin = 1,
1428 int GetLineNumber(
int code_pos);
1430 static const int kNoScriptId = 0;
1449 : line_number_(line_number), column_number_(column_number) {}
1480 Status GetStatus()
const;
1490 int GetModuleRequestsLength()
const;
1502 Location GetModuleRequestLocation(
int i)
const;
1507 int GetIdentityHash()
const;
1521 ResolveCallback callback);
1568 SyntheticModuleEvaluationSteps evaluation_steps);
1580 "Use the preceding SetSyntheticModuleExport with an Isolate parameter, "
1581 "instead of the one that follows. The former will throw a runtime "
1582 "error if called for an export that doesn't exist (as per spec); "
1583 "the latter will crash with a failed CHECK().")
1584 void SetSyntheticModuleExport(
Local<
String> export_name,
1637 buffer_policy(BufferNotOwned) {}
1644 BufferPolicy buffer_policy = BufferNotOwned);
1729 virtual size_t GetMoreData(
const uint8_t** src) = 0;
1741 virtual bool SetBookmark();
1746 virtual void ResetToBookmark();
1760 "This class takes ownership of source_stream, so use the constructor "
1761 "taking a unique_ptr to make these semantics clearer")
1767 internal::ScriptStreamingData* impl()
const {
return impl_.get(); }
1774 std::unique_ptr<internal::ScriptStreamingData> impl_;
1791 internal::ScriptStreamingData* data_;
1795 kNoCompileOptions = 0,
1804 kNoCacheNoReason = 0,
1818 kNoCacheBecauseDeferredProduceCodeCache
1835 Isolate* isolate, Source* source,
1836 CompileOptions options = kNoCompileOptions,
1837 NoCacheReason no_cache_reason = kNoCacheNoReason);
1852 CompileOptions options = kNoCompileOptions,
1853 NoCacheReason no_cache_reason = kNoCacheNoReason);
1866 static ScriptStreamingTask* StartStreamingScript(
1867 Isolate* isolate, StreamedSource* source,
1868 CompileOptions options = kNoCompileOptions);
1899 static uint32_t CachedDataVersionTag();
1909 Isolate* isolate, Source* source,
1910 CompileOptions options = kNoCompileOptions,
1911 NoCacheReason no_cache_reason = kNoCacheNoReason);
1927 CompileOptions options = kNoCompileOptions,
1928 NoCacheReason no_cache_reason = kNoCacheNoReason,
1943 static CachedData* CreateCodeCache(
1952 static CachedData* CreateCodeCacheForFunction(
Local<Function> function);
1956 Isolate* isolate, Source* source, CompileOptions options,
1957 NoCacheReason no_cache_reason);
2004 int GetStartPosition()
const;
2010 int GetEndPosition()
const;
2016 int GetWasmFunctionIndex()
const;
2021 int ErrorLevel()
const;
2027 int GetStartColumn()
const;
2034 int GetEndColumn()
const;
2041 bool IsSharedCrossOrigin()
const;
2042 bool IsOpaque()
const;
2045 static void PrintCurrentStackTrace(
Isolate* isolate, FILE* out);
2047 static const int kNoLineNumberInfo = 0;
2048 static const int kNoColumnInfo = 0;
2049 static const int kNoScriptIdInfo = 0;
2050 static const int kNoWasmFunctionIndexInfo = -1;
2069 kColumnOffset = 1 << 1 | kLineNumber,
2070 kScriptName = 1 << 2,
2071 kFunctionName = 1 << 3,
2073 kIsConstructor = 1 << 5,
2074 kScriptNameOrSourceURL = 1 << 6,
2076 kExposeFramesAcrossSecurityOrigins = 1 << 8,
2077 kOverview = kLineNumber | kColumnOffset | kScriptName | kFunctionName,
2078 kDetailed = kOverview | kIsEval | kIsConstructor | kScriptNameOrSourceURL
2089 int GetFrameCount()
const;
2099 Isolate* isolate,
int frame_limit, StackTraceOptions options = kDetailed);
2114 int GetLineNumber()
const;
2123 int GetColumn()
const;
2131 int GetScriptId()
const;
2156 bool IsEval()
const;
2162 bool IsConstructor()
const;
2167 bool IsWasm()
const;
2172 bool IsUserJavaScript()
const;
2209 const void* start =
nullptr;
2210 size_t length_in_bytes = 0;
2274 virtual void ThrowDataCloneError(
Local<String> message) = 0;
2309 virtual void* ReallocateBufferMemory(
void* old_buffer,
size_t size,
2310 size_t* actual_size);
2317 virtual void FreeBufferMemory(
void* buffer);
2348 void TransferArrayBuffer(uint32_t transfer_id,
2359 void SetTreatArrayBufferViewsAsHostObjects(
bool mode);
2366 void WriteUint32(uint32_t value);
2367 void WriteUint64(uint64_t value);
2368 void WriteDouble(
double value);
2369 void WriteRawBytes(
const void* source,
size_t length);
2376 PrivateData* private_;
2401 Isolate* isolate, uint32_t transfer_id);
2408 Isolate* isolate, uint32_t clone_id);
2431 void TransferArrayBuffer(uint32_t transfer_id,
2439 void TransferSharedArrayBuffer(uint32_t
id,
2449 void SetSupportsLegacyWireFormat(
bool supports_legacy_wire_format);
2456 uint32_t GetWireFormatVersion()
const;
2473 PrivateData* private_;
2508 V8_INLINE bool IsNullOrUndefined()
const;
2517 bool IsTrue()
const;
2526 bool IsFalse()
const;
2534 bool IsName()
const;
2549 bool IsSymbol()
const;
2556 bool IsFunction()
const;
2562 bool IsArray()
const;
2567 bool IsObject()
const;
2574 bool IsBigInt()
const;
2581 bool IsBoolean()
const;
2588 bool IsNumber()
const;
2593 bool IsExternal()
const;
2598 bool IsInt32()
const;
2603 bool IsUint32()
const;
2608 bool IsDate()
const;
2613 bool IsArgumentsObject()
const;
2618 bool IsBigIntObject()
const;
2623 bool IsBooleanObject()
const;
2628 bool IsNumberObject()
const;
2633 bool IsStringObject()
const;
2638 bool IsSymbolObject()
const;
2643 bool IsNativeError()
const;
2648 bool IsRegExp()
const;
2653 bool IsAsyncFunction()
const;
2658 bool IsGeneratorFunction()
const;
2663 bool IsGeneratorObject()
const;
2668 bool IsPromise()
const;
2683 bool IsMapIterator()
const;
2688 bool IsSetIterator()
const;
2693 bool IsWeakMap()
const;
2698 bool IsWeakSet()
const;
2703 bool IsArrayBuffer()
const;
2708 bool IsArrayBufferView()
const;
2713 bool IsTypedArray()
const;
2718 bool IsUint8Array()
const;
2723 bool IsUint8ClampedArray()
const;
2728 bool IsInt8Array()
const;
2733 bool IsUint16Array()
const;
2738 bool IsInt16Array()
const;
2743 bool IsUint32Array()
const;
2748 bool IsInt32Array()
const;
2753 bool IsFloat32Array()
const;
2758 bool IsFloat64Array()
const;
2763 bool IsBigInt64Array()
const;
2768 bool IsBigUint64Array()
const;
2773 bool IsDataView()
const;
2778 bool IsSharedArrayBuffer()
const;
2783 bool IsProxy()
const;
2788 bool IsWasmModuleObject()
const;
2793 bool IsModuleNamespaceObject()
const;
2856 bool BooleanValue(
Isolate* isolate)
const;
2882 V8_INLINE bool QuickIsUndefined()
const;
2884 V8_INLINE bool QuickIsNullOrUndefined()
const;
2886 bool FullIsUndefined()
const;
2887 bool FullIsNull()
const;
2888 bool FullIsString()
const;
2925 int GetIdentityHash();
2930 static void CheckCast(
Value* obj);
2958 static constexpr
int kMaxLength =
2962 UNKNOWN_ENCODING = 0x1,
2963 TWO_BYTE_ENCODING = 0x0,
2964 ONE_BYTE_ENCODING = 0x8
2975 int Utf8Length(
Isolate* isolate)
const;
2983 bool IsOneByte()
const;
2990 bool ContainsOnlyOneByte()
const;
3019 HINT_MANY_WRITES_EXPECTED = 1,
3020 NO_NULL_TERMINATION = 2,
3021 PRESERVE_ONE_BYTE_NULL = 4,
3025 REPLACE_INVALID_UTF8 = 8
3029 int Write(
Isolate* isolate, uint16_t* buffer,
int start = 0,
int length = -1,
3030 int options = NO_OPTIONS)
const;
3032 int WriteOneByte(
Isolate* isolate, uint8_t* buffer,
int start = 0,
3033 int length = -1,
int options = NO_OPTIONS)
const;
3035 int WriteUtf8(
Isolate* isolate,
char* buffer,
int length = -1,
3036 int* nchars_ref =
nullptr,
int options = NO_OPTIONS)
const;
3046 bool IsExternal()
const;
3051 bool IsExternalOneByte()
const;
3098 friend class internal::ExternalString;
3100 friend class internal::ScopedExternalStringLock;
3121 virtual const uint16_t* data()
const = 0;
3126 virtual size_t length()
const = 0;
3151 virtual const char* data()
const = 0;
3153 virtual size_t length()
const = 0;
3191 Isolate* isolate,
const char (&literal)[N],
3193 static_assert(N <= kMaxLength,
"String is too long");
3194 return NewFromUtf8Literal(isolate, literal, type, N - 1);
3200 Isolate* isolate,
const char* data,
3206 Isolate* isolate,
const uint8_t* data,
3212 Isolate* isolate,
const uint16_t* data,
3231 Isolate* isolate, ExternalStringResource* resource);
3242 bool MakeExternal(ExternalStringResource* resource);
3253 Isolate* isolate, ExternalOneByteStringResource* resource);
3264 bool MakeExternal(ExternalOneByteStringResource* resource);
3269 bool CanMakeExternal();
3293 void operator=(
const Utf8Value&) =
delete;
3316 void operator=(
const Value&) =
delete;
3324 void VerifyExternalStringResourceBase(ExternalStringResourceBase* v,
3325 Encoding encoding)
const;
3326 void VerifyExternalStringResource(ExternalStringResource* val)
const;
3327 ExternalStringResource* GetExternalStringResourceSlow()
const;
3328 ExternalStringResourceBase* GetExternalStringResourceBaseSlow(
3332 const char* literal,
3399 static void CheckCast(
Value* obj);
3437 static void CheckCast(
Data* that);
3446 double Value()
const;
3462 int64_t
Value()
const;
3475 int32_t
Value()
const;
3489 uint32_t
Value()
const;
3512 int word_count,
const uint64_t* words);
3520 uint64_t Uint64Value(
bool* lossless =
nullptr)
const;
3527 int64_t Int64Value(
bool* lossless =
nullptr)
const;
3533 int WordCount()
const;
3543 void ToWordsArray(
int* sign_bit,
int* word_count, uint64_t* words)
const;
3888 int InternalFieldCount();
3893 return object.val_->InternalFieldCount();
3899 return object.val_->InternalFieldCount();
3913 V8_INLINE void* GetAlignedPointerFromInternalField(
int index);
3918 return object.val_->GetAlignedPointerFromInternalField(index);
3924 return object.val_->GetAlignedPointerFromInternalField(index);
3932 void SetAlignedPointerInInternalField(
int index,
void* value);
3933 void SetAlignedPointerInInternalFields(
int argc,
int indices[],
3978 GetRealNamedPropertyAttributesInPrototypeChain(
Local<Context> context,
3998 bool HasNamedLookupInterceptor();
4001 bool HasIndexedLookupInterceptor();
4010 int GetIdentityHash();
4027 return object.val_->CreationContext();
4040 bool IsConstructor();
4049 bool IsApiWrapper();
4056 bool IsUndetectable();
4109 static void CheckCast(
Value* obj);
4111 void* SlowGetAlignedPointerFromInternalField(
int index);
4120 uint32_t Length()
const;
4137 static void CheckCast(
Value* obj);
4146 size_t Size()
const;
4173 static void CheckCast(
Value* obj);
4182 size_t Size()
const;
4205 static void CheckCast(
Value* obj);
4209 template<
typename T>
4213 : value_(that.value_) {
4214 static_assert(std::is_base_of<T, S>::value,
"type check");
4217 template <
typename S>
4219 template <
typename S>
4221 template <
typename S>
4236 template <
typename S>
4248 template <
class F,
class G,
class H>
4263 template<
typename T>
4264 class FunctionCallbackInfo {
4272 V8_INLINE Local<Value> operator[](
int i)
const;
4287 V8_INLINE Local<Value> NewTarget()
const;
4295 V8_INLINE ReturnValue<T> GetReturnValue()
const;
4297 static const int kArgsLength = 6;
4300 friend class internal::FunctionCallbackArguments;
4302 friend class debug::ConsoleCallArguments;
4303 static const int kHolderIndex = 0;
4304 static const int kIsolateIndex = 1;
4305 static const int kReturnValueDefaultValueIndex = 2;
4306 static const int kReturnValueIndex = 3;
4307 static const int kDataIndex = 4;
4308 static const int kNewTargetIndex = 5;
4322 template<
typename T>
4411 static const int kArgsLength = 7;
4414 friend class MacroAssembler;
4415 friend class internal::PropertyCallbackArguments;
4417 static const int kShouldThrowOnErrorIndex = 0;
4418 static const int kHolderIndex = 1;
4419 static const int kIsolateIndex = 2;
4420 static const int kReturnValueDefaultValueIndex = 3;
4421 static const int kReturnValueIndex = 4;
4422 static const int kDataIndex = 5;
4423 static const int kThisIndex = 6;
4454 return NewInstance(context, 0,
nullptr);
4497 int GetScriptLineNumber()
const;
4502 int GetScriptColumnNumber()
const;
4507 int ScriptId()
const;
4521 static void CheckCast(
Value* obj);
4524 #ifndef V8_PROMISE_INTERNAL_FIELD_COUNT
4526 #define V8_PROMISE_INTERNAL_FIELD_COUNT 0
4567 static void CheckCast(
Value* obj);
4606 void MarkAsHandled();
4614 static void CheckCast(
Value* obj);
4662 bool has_value()
const;
4665 bool has_get()
const;
4667 bool has_set()
const;
4669 void set_enumerable(
bool enumerable);
4670 bool enumerable()
const;
4671 bool has_enumerable()
const;
4673 void set_configurable(
bool configurable);
4674 bool configurable()
const;
4675 bool has_configurable()
const;
4677 bool writable()
const;
4678 bool has_writable()
const;
4687 PrivateData* private_;
4712 static void CheckCast(
Value* obj);
4725 template <
typename T>
4731 constexpr
MemorySpan(T* data,
size_t size) : data_(data), size_(size) {}
4734 constexpr T*
data()
const {
return data_; }
4736 constexpr
size_t size()
const {
return size_; }
4750 : buffer(std::move(buffer)), size(size) {}
4776 const char* source_url,
size_t url_length);
4778 const std::shared_ptr<internal::wasm::NativeModule> native_module_;
4779 const std::string source_url_;
4803 static void CheckCast(
Value* obj);
4814 class WasmStreamingImpl;
4821 virtual ~
Client() =
default;
4829 explicit WasmStreaming(std::unique_ptr<WasmStreamingImpl> impl);
4837 void OnBytesReceived(
const uint8_t* bytes,
size_t size);
4860 bool SetCompiledModuleBytes(
const uint8_t* bytes,
size_t size);
4866 void SetClient(std::shared_ptr<Client> client);
4872 void SetUrl(
const char* url,
size_t length);
4879 static std::shared_ptr<WasmStreaming> Unpack(
Isolate* isolate,
4883 std::unique_ptr<WasmStreamingImpl> impl_;
4894 void OnBytesReceived(
const uint8_t*,
size_t size);
4929 std::shared_ptr<internal::wasm::StreamingDecoder> streaming_decoder_;
4932 #ifndef V8_ARRAY_BUFFER_INTERNAL_FIELD_COUNT
4934 #define V8_ARRAY_BUFFER_INTERNAL_FIELD_COUNT 2
4967 size_t ByteLength()
const;
4973 bool IsShared()
const;
4980 static std::unique_ptr<BackingStore> Reallocate(
4981 v8::Isolate* isolate, std::unique_ptr<BackingStore> backing_store,
4982 size_t byte_length);
4990 void* deleter_data);
5001 static void EmptyDeleter(
void* data,
size_t length,
void* deleter_data);
5011 #if !defined(V8_IMMINENT_DEPRECATION_WARNINGS)
5014 void* deleter_data);
5046 virtual void* Allocate(
size_t length) = 0;
5052 virtual void* AllocateUninitialized(
size_t length) = 0;
5058 virtual void Free(
void* data,
size_t length) = 0;
5072 virtual void* Reallocate(
void* data,
size_t old_length,
size_t new_length);
5087 static Allocator* NewDefaultAllocator();
5106 allocation_base_(nullptr),
5107 allocation_length_(0),
5110 deleter_data_(nullptr) {}
5115 return allocation_mode_;
5118 void*
Data()
const {
return data_; }
5124 Contents(
void* data,
size_t byte_length,
void* allocation_base,
5125 size_t allocation_length,
5127 void* deleter_data);
5130 size_t byte_length_;
5131 void* allocation_base_;
5132 size_t allocation_length_;
5134 DeleterCallback deleter_;
5135 void* deleter_data_;
5144 size_t ByteLength()
const;
5164 "Use the version that takes a BackingStore. "
5165 "See http://crbug.com/v8/9908.")
5195 size_t byte_length);
5205 void* data,
size_t byte_length,
v8::
BackingStore::DeleterCallback deleter,
5206 void* deleter_data);
5214 "the same as ordinary ArrayBuffers. See http:
5215 bool IsExternal() const;
5220 bool IsDetachable() const;
5241 "Use GetBackingStore or Detach. See http:
5252 void Externalize(const std::shared_ptr<
BackingStore>& backing_store);
5282 static
void CheckCast(
Value* obj);
5283 Contents GetContents(
bool externalize);
5287 #ifndef V8_ARRAY_BUFFER_VIEW_INTERNAL_FIELD_COUNT
5289 #define V8_ARRAY_BUFFER_VIEW_INTERNAL_FIELD_COUNT 2
5306 size_t ByteOffset();
5310 size_t ByteLength();
5321 size_t CopyContents(
void* dest,
size_t byte_length);
5327 bool HasBuffer()
const;
5331 static const int kInternalFieldCount =
5333 static const int kEmbedderFieldCount =
5338 static void CheckCast(
Value* obj);
5365 static void CheckCast(
Value* obj);
5375 size_t byte_offset,
size_t length);
5377 size_t byte_offset,
size_t length);
5382 static void CheckCast(
Value* obj);
5392 size_t byte_offset,
size_t length);
5400 static void CheckCast(
Value* obj);
5409 size_t byte_offset,
size_t length);
5411 size_t byte_offset,
size_t length);
5416 static void CheckCast(
Value* obj);
5426 size_t byte_offset,
size_t length);
5428 size_t byte_offset,
size_t length);
5433 static void CheckCast(
Value* obj);
5443 size_t byte_offset,
size_t length);
5445 size_t byte_offset,
size_t length);
5450 static void CheckCast(
Value* obj);
5460 size_t byte_offset,
size_t length);
5462 size_t byte_offset,
size_t length);
5467 static void CheckCast(
Value* obj);
5477 size_t byte_offset,
size_t length);
5479 size_t byte_offset,
size_t length);
5484 static void CheckCast(
Value* obj);
5494 size_t byte_offset,
size_t length);
5496 size_t byte_offset,
size_t length);
5501 static void CheckCast(
Value* obj);
5511 size_t byte_offset,
size_t length);
5513 size_t byte_offset,
size_t length);
5518 static void CheckCast(
Value* obj);
5527 size_t byte_offset,
size_t length);
5529 size_t byte_offset,
size_t length);
5534 static void CheckCast(
Value* obj);
5543 size_t byte_offset,
size_t length);
5545 size_t byte_offset,
size_t length);
5550 static void CheckCast(
Value* obj);
5559 size_t byte_offset,
size_t length);
5561 size_t byte_offset,
size_t length);
5566 static void CheckCast(
Value* obj);
5592 allocation_base_(nullptr),
5593 allocation_length_(0),
5596 deleter_data_(nullptr) {}
5601 return allocation_mode_;
5604 void*
Data()
const {
return data_; }
5610 Contents(
void* data,
size_t byte_length,
void* allocation_base,
5611 size_t allocation_length,
5612 Allocator::AllocationMode allocation_mode, DeleterCallback deleter,
5613 void* deleter_data);
5616 size_t byte_length_;
5617 void* allocation_base_;
5618 size_t allocation_length_;
5619 Allocator::AllocationMode allocation_mode_;
5620 DeleterCallback deleter_;
5621 void* deleter_data_;
5629 size_t ByteLength()
const;
5646 "Use the version that takes a BackingStore. "
5647 "See http://crbug.com/v8/9908.")
5677 size_t byte_length);
5687 void* data,
size_t byte_length,
v8::
BackingStore::DeleterCallback deleter,
5688 void* deleter_data);
5706 "With
v8::
BackingStore externalized SharedArrayBuffers are the same "
5707 "as ordinary SharedArrayBuffers. See http:
5708 bool IsExternal() const;
5723 "Use GetBackingStore or Detach. See http:
5734 void Externalize(const std::shared_ptr<
BackingStore>& backing_store);
5767 static
void CheckCast(
Value* obj);
5768 Contents GetContents(
bool externalize);
5784 double ValueOf()
const;
5789 static void CheckCast(
Value* obj);
5800 double ValueOf()
const;
5805 static void CheckCast(
Value* obj);
5820 static void CheckCast(
Value* obj);
5830 bool ValueOf()
const;
5835 static void CheckCast(
Value* obj);
5851 static void CheckCast(
Value* obj);
5867 static void CheckCast(
Value* obj);
5883 kIgnoreCase = 1 << 1,
5884 kMultiline = 1 << 2,
5890 static constexpr
int kFlagCount = 6;
5913 uint32_t backtrack_limit);
5938 Flags GetFlags()
const;
5943 static void CheckCast(
Value* obj);
5954 void*
Value()
const;
5959 #define V8_INTRINSICS_LIST(F) \
5960 F(ArrayProto_entries, array_entries_iterator) \
5961 F(ArrayProto_forEach, array_for_each_iterator) \
5962 F(ArrayProto_keys, array_keys_iterator) \
5963 F(ArrayProto_values, array_values_iterator) \
5964 F(ErrorPrototype, initial_error_prototype) \
5965 F(IteratorPrototype, initial_iterator_prototype) \
5966 F(ObjProto_valueOf, object_value_of_function)
5969 #define V8_DECL_INTRINSIC(name, iname) k##name,
5971 #undef V8_DECL_INTRINSIC
5994 void SetAccessorProperty(
6028 void SetNativeDataProperty(
6037 void SetNativeDataProperty(
6051 void SetLazyDataProperty(
6459 void SetCallHandler(
6465 void SetLength(
int length);
6503 void SetAcceptAnyReceiver(
bool value);
6509 void ReadOnlyPrototype();
6515 void RemovePrototype();
6528 static void CheckCast(
Data* that);
6581 enumerator(enumerator),
6583 descriptor(descriptor),
6600 enumerator(enumerator),
6602 descriptor(nullptr),
6619 enumerator(enumerator),
6621 descriptor(descriptor),
6651 enumerator(enumerator),
6653 descriptor(descriptor),
6670 enumerator(enumerator),
6672 descriptor(nullptr),
6689 enumerator(enumerator),
6691 descriptor(descriptor),
6807 deleter, enumerator, data));
6839 void MarkAsUndetectable();
6858 void SetAccessCheckCallbackAndHandler(
6868 int InternalFieldCount();
6874 void SetInternalFieldCount(
int value);
6879 bool IsImmutableProto();
6885 void SetImmutableProto();
6893 static void CheckCast(
Data* that);
6916 static void CheckCast(
Data* that);
6935 static void CheckCast(
Data* that);
6948 Extension(
const char* name,
const char* source =
nullptr,
int dep_count = 0,
6949 const char** deps =
nullptr,
int source_length = -1);
6956 const char*
name()
const {
return name_; }
6968 void operator=(
const Extension&) =
delete;
6972 size_t source_length_;
7022 void ConfigureDefaultsFromHeapSize(
size_t initial_heap_size_in_bytes,
7023 size_t maximum_heap_size_in_bytes);
7034 void ConfigureDefaults(uint64_t physical_memory,
7035 uint64_t virtual_memory_limit);
7058 return max_old_generation_size_;
7061 max_old_generation_size_ = limit;
7070 return max_young_generation_size_;
7073 max_young_generation_size_ = limit;
7077 return initial_old_generation_size_;
7080 initial_old_generation_size_ = initial_size;
7084 return initial_young_generation_size_;
7087 initial_young_generation_size_ = initial_size;
7094 size_t code_range_size()
const {
return code_range_size_ / kMB; }
7096 void set_code_range_size(
size_t limit_in_mb) {
7097 code_range_size_ = limit_in_mb * kMB;
7100 size_t max_semi_space_size_in_kb() const;
7102 void set_max_semi_space_size_in_kb(
size_t limit_in_kb);
7104 size_t max_old_space_size()
const {
return max_old_generation_size_ / kMB; }
7106 void set_max_old_space_size(
size_t limit_in_mb) {
7107 max_old_generation_size_ = limit_in_mb * kMB;
7110 size_t max_zone_pool_size()
const {
return max_zone_pool_size_; }
7112 void set_max_zone_pool_size(
size_t bytes) { max_zone_pool_size_ = bytes; }
7115 static constexpr
size_t kMB = 1048576u;
7116 size_t code_range_size_ = 0;
7117 size_t max_old_generation_size_ = 0;
7118 size_t max_young_generation_size_ = 0;
7119 size_t max_zone_pool_size_ = 0;
7120 size_t initial_old_generation_size_ = 0;
7121 size_t initial_young_generation_size_ = 0;
7122 uint32_t* stack_limit_ =
nullptr;
7134 const char* message);
7174 typedef int* (*CounterLookupCallback)(
const char* name);
7176 typedef void* (*CreateHistogramCallback)(
const char* name,
7281 : promise_(promise), event_(event), value_(value) {}
7331 static std::unique_ptr<MicrotaskQueue> New(
7339 virtual void EnqueueMicrotask(
Isolate* isolate,
7345 virtual void EnqueueMicrotask(
v8::Isolate* isolate,
7347 void* data =
nullptr) = 0;
7361 virtual void AddMicrotasksCompletedCallback(
7367 virtual void RemoveMicrotasksCompletedCallback(
7373 virtual void PerformCheckpoint(
Isolate* isolate) = 0;
7378 virtual bool IsRunningMicrotasks()
const = 0;
7384 virtual int GetMicrotasksScopeDepth()
const = 0;
7390 friend class internal::MicrotaskQueue;
7405 enum Type { kRunMicrotasks, kDoNotRunMicrotasks };
7414 static void PerformCheckpoint(
Isolate* isolate);
7419 static int GetCurrentDepth(
Isolate* isolate);
7424 static bool IsRunningMicrotasks(
Isolate* isolate);
7431 internal::Isolate*
const isolate_;
7432 internal::MicrotaskQueue*
const microtask_queue_;
7453 bool codegen_allowed =
false;
7545 size_t initial_heap_limit);
7559 return read_only_space_physical_size_;
7563 size_t read_only_space_size_;
7564 size_t read_only_space_used_size_;
7565 size_t read_only_space_physical_size_;
7568 friend class internal::ReadOnlyHeap;
7601 size_t total_heap_size_;
7602 size_t total_heap_size_executable_;
7603 size_t total_physical_size_;
7604 size_t total_available_size_;
7605 size_t used_heap_size_;
7606 size_t heap_size_limit_;
7607 size_t malloced_memory_;
7608 size_t external_memory_;
7609 size_t peak_malloced_memory_;
7610 bool does_zap_garbage_;
7611 size_t number_of_native_contexts_;
7612 size_t number_of_detached_contexts_;
7613 size_t total_global_handles_size_;
7614 size_t used_global_handles_size_;
7631 const char* space_name_;
7633 size_t space_used_size_;
7634 size_t space_available_size_;
7635 size_t physical_space_size_;
7650 const char* object_type_;
7651 const char* object_sub_type_;
7652 size_t object_count_;
7653 size_t object_size_;
7666 size_t code_and_metadata_size_;
7667 size_t bytecode_and_metadata_size_;
7668 size_t external_script_source_size_;
7685 CODE_END_LINE_INFO_RECORDING
7804 #if defined(V8_OS_WIN)
7805 typedef int (*UnhandledExceptionCallback)(
7806 _EXCEPTION_POINTERS* exception_pointers);
7826 uint16_t class_id) {}
7852 kReduceMemory = 1 << 0,
7881 size_t allocated_size = 0;
7896 void SetStackStart(
void* stack_start);
7901 void NotifyEmptyEmbedderStack();
7909 virtual void RegisterV8References(
7910 const std::vector<std::pair<void*, void*> >& embedder_fields) = 0;
7929 virtual bool AdvanceTracing(
double deadline_in_ms) = 0;
7935 virtual bool IsTracingDone() = 0;
7961 void FinalizeTracing();
7980 virtual bool IsRootForNonTracingGC(
7993 virtual void ResetHandleInNonTracingGC(
8009 void IncreaseAllocatedSize(
size_t bytes);
8010 void DecreaseAllocatedSize(
size_t bytes);
8021 friend class internal::LocalEmbedderHeapTracer;
8036 void* data_arg =
nullptr)
8037 : callback(function), data(data_arg) {}
8053 void* data_arg =
nullptr)
8054 : callback(function), data(data_arg) {}
8101 virtual void MeasurementComplete(
8103 context_sizes_in_bytes,
8104 size_t unattributed_size_in_bytes) = 0;
8116 static std::unique_ptr<MeasureMemoryDelegate> Default(
8136 : code_event_handler(nullptr),
8137 snapshot_blob(nullptr),
8138 counter_lookup_callback(nullptr),
8139 create_histogram_callback(nullptr),
8140 add_histogram_sample_callback(nullptr),
8141 array_buffer_allocator(nullptr),
8142 array_buffer_allocator_shared(),
8143 external_references(nullptr),
8144 allow_atomics_wait(true),
8145 only_terminate_in_safe_scope(false),
8146 embedder_wrapper_type_index(-1),
8147 embedder_wrapper_object_index(-1) {}
8260 OnFailure on_failure_;
8280 void* internal_throws_;
8281 void* internal_assert_;
8282 void* internal_dump_;
8302 internal::Isolate*
const isolate_;
8303 internal::MicrotaskQueue*
const microtask_queue_;
8306 friend class internal::ThreadLocalTop;
8323 internal::Isolate* isolate_;
8333 kMinorGarbageCollection
8345 kMarkDequeOverflow = 3,
8346 kStoreBufferOverflow = 4,
8347 kSlotsBufferOverflow = 5,
8353 kRegExpPrototypeStickyGetter = 11,
8354 kRegExpPrototypeToString = 12,
8355 kRegExpPrototypeUnicodeGetter = 13,
8360 kPromiseAccept = 18,
8362 kHtmlCommentInExternalScript = 20,
8364 kSloppyModeBlockScopedFunctionRedefinition = 22,
8365 kForInInitializer = 23,
8366 kArrayProtectorDirtied = 24,
8367 kArraySpeciesModified = 25,
8368 kArrayPrototypeConstructorModified = 26,
8369 kArrayInstanceProtoModified = 27,
8370 kArrayInstanceConstructorModified = 28,
8371 kLegacyFunctionDeclaration = 29,
8372 kRegExpPrototypeSourceGetter = 30,
8373 kRegExpPrototypeOldFlagGetter = 31,
8374 kDecimalWithLeadingZeroInStrictMode = 32,
8375 kLegacyDateParser = 33,
8376 kDefineGetterOrSetterWouldThrow = 34,
8377 kFunctionConstructorReturnedUndefined = 35,
8378 kAssigmentExpressionLHSIsCallInSloppy = 36,
8379 kAssigmentExpressionLHSIsCallInStrict = 37,
8380 kPromiseConstructorReturnedUndefined = 38,
8381 kConstructorNonUndefinedPrimitiveReturn = 39,
8382 kLabeledExpressionStatement = 40,
8383 kLineOrParagraphSeparatorAsLineTerminator = 41,
8384 kIndexAccessor = 42,
8385 kErrorCaptureStackTrace = 43,
8386 kErrorPrepareStackTrace = 44,
8387 kErrorStackTraceLimit = 45,
8388 kWebAssemblyInstantiation = 46,
8389 kDeoptimizerDisableSpeculation = 47,
8390 kArrayPrototypeSortJSArrayModifiedPrototype = 48,
8391 kFunctionTokenOffsetTooLongForToString = 49,
8392 kWasmSharedMemory = 50,
8393 kWasmThreadOpcodes = 51,
8394 kAtomicsNotify = 52,
8398 kDateTimeFormat = 56,
8400 kRelativeTimeFormat = 58,
8404 kStringLocaleCompare = 62,
8405 kStringToLocaleUpperCase = 63,
8406 kStringToLocaleLowerCase = 64,
8407 kNumberToLocaleString = 65,
8408 kDateToLocaleString = 66,
8409 kDateToLocaleDateString = 67,
8410 kDateToLocaleTimeString = 68,
8411 kAttemptOverrideReadOnlyOnPrototypeSloppy = 69,
8412 kAttemptOverrideReadOnlyOnPrototypeStrict = 70,
8413 kOptimizedFunctionWithOneShotBytecode = 71,
8414 kRegExpMatchIsTrueishOnNonJSRegExp = 72,
8415 kRegExpMatchIsFalseishOnJSRegExp = 73,
8416 kDateGetTimezoneOffset = 74,
8417 kStringNormalize = 75,
8418 kCallSiteAPIGetFunctionSloppyCall = 76,
8419 kCallSiteAPIGetThisSloppyCall = 77,
8420 kRegExpMatchAllWithNonGlobalRegExp = 78,
8421 kRegExpExecCalledOnSlowRegExp = 79,
8422 kRegExpReplaceCalledOnSlowRegExp = 80,
8424 kSharedArrayBufferConstructed = 82,
8425 kArrayPrototypeHasElements = 83,
8426 kObjectPrototypeHasElements = 84,
8427 kNumberFormatStyleUnit = 85,
8428 kDateTimeFormatRange = 86,
8429 kDateTimeFormatDateTimeStyle = 87,
8430 kBreakIteratorTypeWord = 88,
8431 kBreakIteratorTypeLine = 89,
8432 kInvalidatedArrayBufferDetachingProtector = 90,
8433 kInvalidatedArrayConstructorProtector = 91,
8434 kInvalidatedArrayIteratorLookupChainProtector = 92,
8435 kInvalidatedArraySpeciesLookupChainProtector = 93,
8436 kInvalidatedIsConcatSpreadableLookupChainProtector = 94,
8437 kInvalidatedMapIteratorLookupChainProtector = 95,
8438 kInvalidatedNoElementsProtector = 96,
8439 kInvalidatedPromiseHookProtector = 97,
8440 kInvalidatedPromiseResolveLookupChainProtector = 98,
8441 kInvalidatedPromiseSpeciesLookupChainProtector = 99,
8442 kInvalidatedPromiseThenLookupChainProtector = 100,
8443 kInvalidatedRegExpSpeciesLookupChainProtector = 101,
8444 kInvalidatedSetIteratorLookupChainProtector = 102,
8445 kInvalidatedStringIteratorLookupChainProtector = 103,
8446 kInvalidatedStringLengthOverflowLookupChainProtector = 104,
8447 kInvalidatedTypedArraySpeciesLookupChainProtector = 105,
8448 kWasmSimdOpcodes = 106,
8449 kVarRedeclaredCatchBinding = 107,
8454 kUseCounterFeatureCount
8458 kMessageLog = (1 << 0),
8459 kMessageDebug = (1 << 1),
8460 kMessageInfo = (1 << 2),
8461 kMessageError = (1 << 3),
8462 kMessageWarning = (1 << 4),
8463 kMessageAll = kMessageLog | kMessageDebug | kMessageInfo | kMessageError |
8467 typedef void (*UseCounterCallback)(
Isolate* isolate,
8523 void ClearKeptObjects();
8534 typedef bool (*AbortOnUncaughtExceptionCallback)(
Isolate*);
8535 void SetAbortOnUncaughtExceptionCallback(
8536 AbortOnUncaughtExceptionCallback callback);
8542 void SetHostImportModuleDynamicallyCallback(
8549 void SetHostInitializeImportMetaObjectCallback(
8597 void DumpAndResetStats();
8606 void DiscardThreadSpecificMetadata();
8612 V8_INLINE void SetData(uint32_t slot,
void* data);
8624 V8_INLINE static uint32_t GetNumberOfDataSlots();
8642 size_t NumberOfHeapSpaces();
8659 size_t NumberOfTrackedHeapObjectTypes();
8695 std::unique_ptr<MeasureMemoryDelegate> delegate,
8714 void GetStackSample(const
RegisterState& state,
void** frames,
8715 size_t frames_limit,
SampleInfo* sample_info);
8731 AdjustAmountOfExternalAllocatedMemory(int64_t change_in_bytes);
8737 size_t NumberOfPhantomHandleResetsSinceLastCall();
8748 void SetIdle(
bool is_idle);
8751 ArrayBuffer::Allocator* GetArrayBufferAllocator();
8802 void AddGCPrologueCallback(GCCallbackWithData callback,
void* data =
nullptr,
8804 void AddGCPrologueCallback(
GCCallback callback,
8811 void RemoveGCPrologueCallback(GCCallbackWithData,
void* data =
nullptr);
8812 void RemoveGCPrologueCallback(
GCCallback callback);
8835 kTerminatedExecution,
8890 size_t offset_in_bytes, int64_t value,
8891 double timeout_in_ms,
8901 void SetAtomicsWaitCallback(AtomicsWaitCallback callback,
void* data);
8912 void AddGCEpilogueCallback(GCCallbackWithData callback,
void* data =
nullptr,
8914 void AddGCEpilogueCallback(
GCCallback callback,
8921 void RemoveGCEpilogueCallback(GCCallbackWithData callback,
8922 void* data =
nullptr);
8923 void RemoveGCEpilogueCallback(
GCCallback callback);
8925 typedef size_t (*GetExternallyAllocatedMemoryInBytesCallback)();
8933 void SetGetExternallyAllocatedMemoryInBytesCallback(
8934 GetExternallyAllocatedMemoryInBytesCallback callback);
8943 void TerminateExecution();
8953 bool IsExecutionTerminating();
8969 void CancelTerminateExecution();
9041 void RunMicrotasks() { PerformMicrotaskCheckpoint(); }
9049 void PerformMicrotaskCheckpoint();
9086 void AddMicrotasksCompletedCallback(
9094 void RemoveMicrotasksCompletedCallback(
9100 void SetUseCounterCallback(UseCounterCallback callback);
9138 bool IdleNotificationDeadline(
double deadline_in_seconds);
9144 void LowMemoryNotification();
9155 int ContextDisposedNotification(
bool dependant_context = true);
9161 void IsolateInForegroundNotification();
9167 void IsolateInBackgroundNotification();
9174 void EnableMemorySavingsMode();
9179 void DisableMemorySavingsMode();
9188 void SetRAILMode(
RAILMode rail_mode);
9194 void IncreaseHeapLimitForDebugging();
9199 void RestoreOriginalHeapLimit();
9205 bool IsHeapLimitIncreasedForDebugging();
9241 void SetStackLimit(uintptr_t stack_limit);
9258 void GetCodeRange(
void** start,
size_t* length_in_bytes);
9272 static constexpr
size_t kMinCodePagesBufferSize = 32;
9287 size_t CopyCodePages(
size_t capacity,
MemoryRange* code_pages_out);
9318 void AutomaticallyRestoreInitialHeapLimit(
double threshold_percent = 0.5);
9325 "Use
Isolate::SetModifyCodeGenerationFromStringsCallback instead. "
9327 void SetAllowCodeGenerationFromStringsCallback(
9329 void SetModifyCodeGenerationFromStringsCallback(
9336 void SetAllowWasmCodeGenerationCallback(
9399 void SetCaptureStackTraceForUncaughtExceptions(
9400 bool capture,
int frame_limit = 10,
9434 void SetAllowAtomicsWait(
bool allow);
9461 void DateTimeConfigurationChangeNotification(
9462 TimeZoneDetection time_zone_detection = TimeZoneDetection::kSkip);
9473 void LocaleConfigurationChangeNotification();
9481 void*
operator new(
size_t size) =
delete;
9482 void*
operator new[](
size_t size) =
delete;
9483 void operator delete(
void*, size_t) =
delete;
9484 void operator delete[](
void*, size_t) =
delete;
9487 template <
class K,
class V,
class Traits>
9491 void ReportExternalAllocationLimitReached();
9501 bool CanBeRehashed()
const;
9528 uintptr_t return_addr_location);
9551 static void SetSnapshotDataBlob(
StartupData* startup_blob);
9560 static void SetFlagsFromString(
const char* str);
9561 static void SetFlagsFromString(
const char* str,
size_t length);
9566 static void SetFlagsFromCommandLine(
int* argc,
9571 static const char* GetVersion();
9578 const int kBuildConfiguration =
9582 return Initialize(kBuildConfiguration);
9595 static void SetReturnAddressLocationResolver(
9607 static bool Dispose();
9616 static bool InitializeICU(
const char* icu_data_file =
nullptr);
9630 static bool InitializeICUDefaultLocation(
const char* exec_path,
9631 const char* icu_data_file =
nullptr);
9648 static void InitializeExternalStartupData(
const char* directory_path);
9649 static void InitializeExternalStartupDataFromFile(
const char* snapshot_blob);
9684 static
bool TryHandleSignal(
int signal_number,
void* info,
void* context);
9685 #endif // V8_OS_POSIX
9693 static bool EnableWebAssemblyTrapHandler(
bool use_v8_signal_handler);
9695 #if defined(V8_OS_WIN)
9705 static void SetUnhandledExceptionCallback(
9706 UnhandledExceptionCallback unhandled_exception_callback);
9717 enum BuildConfigurationFeatures {
9718 kPointerCompression = 1 << 0,
9719 k31BitSmis = 1 << 1,
9720 kHeapSandbox = 1 << 2,
9727 static bool Initialize(
int build_config);
9734 bool has_destructor);
9749 static void SetFinalizationCallbackTraced(
9754 static Value* Eternalize(Isolate* isolate, Value* handle);
9756 template <
class K,
class V,
class T>
9759 static void FromJustIsNothing();
9760 static void ToLocalEmpty();
9761 static void InternalFieldOutOfBounds(
int index);
9804 const intptr_t* external_references =
nullptr,
9878 StartupData CreateBlob(FunctionCodeHandling function_code_handling);
9917 if (
V8_UNLIKELY(!IsJust())) V8::FromJustIsNothing();
9934 if (
V8_UNLIKELY(!IsJust())) V8::FromJustIsNothing();
9943 return has_value_ ? value_ : default_value;
9947 return (IsJust() == other.IsJust()) &&
9948 (!IsJust() || FromJust() == other.FromJust());
9956 Maybe() : has_value_(false) {}
9957 explicit Maybe(
const T& t) : has_value_(true), value_(t) {}
9965 friend Maybe<U>
Just(
const U& u);
9986 return IsJust() == other.IsJust();
9996 Maybe() : is_valid_(false) {}
9997 explicit Maybe(JustTag) : is_valid_(true) {}
10028 bool HasCaught()
const;
10038 bool CanContinue()
const;
10052 bool HasTerminated()
const;
10115 void SetVerbose(
bool value);
10120 bool IsVerbose()
const;
10127 void SetCaptureMessage(
bool value);
10141 if (handler ==
nullptr)
return nullptr;
10142 return handler->js_stack_comparable_address_;
10146 void operator=(
const TryCatch&) =
delete;
10151 void*
operator new(
size_t size);
10152 void*
operator new[](
size_t size);
10153 void operator delete(
void*, size_t);
10154 void operator delete[](
void*, size_t);
10156 void ResetInternal();
10158 internal::Isolate* isolate_;
10161 void* message_obj_;
10162 void* js_stack_comparable_address_;
10163 bool is_verbose_ : 1;
10164 bool can_continue_ : 1;
10165 bool capture_message_ : 1;
10167 bool has_terminated_ : 1;
10169 friend class internal::Isolate;
10183 : name_count_(name_count), names_(names) { }
10185 const char**
begin()
const {
return &names_[0]; }
10186 const char**
end()
const {
return &names_[name_count_]; }
10189 const int name_count_;
10190 const char** names_;
10217 void DetachGlobal();
10264 Isolate* isolate,
size_t context_snapshot_index,
10299 void UseDefaultSecurityToken();
10330 uint32_t GetNumberOfEmbedderDataFields();
10359 V8_INLINE void* GetAlignedPointerFromEmbedderData(
int index);
10366 void SetAlignedPointerInEmbedderData(
int index,
void* value);
10381 void AllowCodeGenerationFromStrings(
bool allow);
10387 bool IsCodeGenerationFromStringsAllowed();
10394 void SetErrorMessageForCodeGenerationFromStrings(
Local<String> message);
10409 typedef void (*AbortScriptExecutionCallback)(
Isolate* isolate,
10411 void SetAbortScriptExecution(AbortScriptExecutionCallback callback);
10417 Local<Value> GetContinuationPreservedEmbedderData()
const;
10423 void SetContinuationPreservedEmbedderData(
Local<Value> context);
10460 return js_stack_comparable_address_;
10464 friend class internal::Isolate;
10467 uintptr_t js_stack_comparable_address_ = 0;
10479 void* SlowGetAlignedPointerFromEmbedderData(
int index);
10568 void Initialize(
Isolate* isolate);
10570 internal::Isolate* isolate_;
10587 static bool IsLocked(
Isolate* isolate);
10592 static bool IsActive();
10596 void operator=(
const Locker&) =
delete;
10599 void Initialize(
Isolate* isolate);
10603 internal::Isolate* isolate_;
10643 static bool TryUnwindV8Frames(
const UnwindState& unwind_state,
10645 const void* stack_base);
10655 static bool TryUnwindV8Frames(
const JSEntryStubs& entry_stubs,
10656 size_t code_pages_length,
10659 const void* stack_base);
10671 static bool PCIsInV8(
const UnwindState& unwind_state,
void* pc);
10677 static bool PCIsInV8(
size_t code_pages_length,
const MemoryRange* code_pages,
10685 return New(isolate, that.val_);
10690 return New(isolate, that.val_);
10695 return New(isolate, that.val_);
10700 if (that ==
nullptr)
return Local<T>();
10701 T* that_ptr = that;
10704 reinterpret_cast<internal::Isolate*
>(isolate), *p)));
10711 static_assert(std::is_base_of<T, S>::value,
"type check");
10712 val_ =
reinterpret_cast<T*
>(
10713 V8::Eternalize(isolate,
reinterpret_cast<Value*
>(*handle)));
10726 if (
V8_UNLIKELY(val_ ==
nullptr)) V8::ToLocalEmpty();
10733 #ifdef V8_ENABLE_CHECKS
10734 if (index < 0 || index >= kEmbedderFieldsInWeakCallback) {
10735 V8::InternalFieldOutOfBounds(index);
10738 return embedder_fields_[index];
10744 if (that ==
nullptr)
return nullptr;
10746 return reinterpret_cast<T*
>(
10747 V8::GlobalizeReference(
reinterpret_cast<internal::Isolate*
>(isolate),
10752 template <
class T,
class M>
10753 template <
class S,
class M2>
10755 static_assert(std::is_base_of<T, S>::value,
"type check");
10757 if (that.IsEmpty())
return;
10759 this->val_ =
reinterpret_cast<T*
>(V8::CopyGlobalReference(p));
10760 M::Copy(that,
this);
10766 if (this->IsEmpty())
return false;
10768 I::kNodeStateIsWeakValue;
10774 if (this->IsEmpty())
return;
10783 static_assert(std::is_base_of<T, S>::value,
"type check");
10786 this->val_ = New(isolate, other.val_);
10794 static_assert(std::is_base_of<T, S>::value,
"type check");
10796 if (other.IsEmpty())
return;
10797 this->val_ = New(isolate, other.val_);
10802 template <
typename P>
10808 reinterpret_cast<Callback
>(callback), type);
10817 template <
typename P>
10819 return reinterpret_cast<P*
>(
10832 if (this->IsEmpty())
return;
10834 uint8_t* addr =
reinterpret_cast<uint8_t*
>(obj) + I::kNodeClassIdOffset;
10835 *
reinterpret_cast<uint16_t*
>(addr) = class_id;
10842 if (this->IsEmpty())
return 0;
10844 uint8_t* addr =
reinterpret_cast<uint8_t*
>(obj) + I::kNodeClassIdOffset;
10845 return *
reinterpret_cast<uint16_t*
>(addr);
10850 if (other.val_ !=
nullptr) {
10853 other.val_ =
nullptr;
10860 static_assert(std::is_base_of<T, S>::value,
"type check");
10861 if (
this != &rhs) {
10863 if (rhs.val_ !=
nullptr) {
10864 this->val_ = rhs.val_;
10865 V8::MoveGlobalReference(
10868 rhs.val_ =
nullptr;
10876 DestructionMode destruction_mode) {
10877 if (that ==
nullptr)
return nullptr;
10879 return reinterpret_cast<T*
>(V8::GlobalizeTracedReference(
10880 reinterpret_cast<internal::Isolate*
>(isolate), p,
10882 destruction_mode == kWithDestructor));
10887 if (IsEmpty())
return;
10895 static_assert(std::is_base_of<T, S>::value,
"type check");
10898 this->val_ = this->New(isolate, other.val_, &this->val_,
10905 static_assert(std::is_base_of<T, S>::value,
"type check");
10906 *
this = std::move(rhs.template As<T>());
10913 static_assert(std::is_base_of<T, S>::value,
"type check");
10914 *
this = rhs.template As<T>();
10920 if (
this != &rhs) {
10921 V8::MoveTracedGlobalReference(
10930 if (
this != &rhs) {
10932 if (rhs.val_ !=
nullptr) {
10933 V8::CopyTracedGlobalReference(
10944 static_assert(std::is_base_of<T, S>::value,
"type check");
10947 this->val_ = this->New(isolate, other.val_, &this->val_,
10954 static_assert(std::is_base_of<T, S>::value,
"type check");
10955 *
this = std::move(rhs.template As<T>());
10963 static_assert(std::is_base_of<T, S>::value,
"type check");
10964 *
this = rhs.template As<T>();
10970 if (
this != &rhs) {
10971 V8::MoveTracedGlobalReference(
10980 if (
this != &rhs) {
10982 if (rhs.val_ !=
nullptr) {
10983 V8::CopyTracedGlobalReference(
10994 if (IsEmpty())
return;
10996 uint8_t* addr =
reinterpret_cast<uint8_t*
>(obj) + I::kNodeClassIdOffset;
10997 *
reinterpret_cast<uint16_t*
>(addr) = class_id;
11003 if (IsEmpty())
return 0;
11005 uint8_t* addr =
reinterpret_cast<uint8_t*
>(obj) + I::kNodeClassIdOffset;
11006 return *
reinterpret_cast<uint16_t*
>(addr);
11012 V8::SetFinalizationCallbackTraced(
11016 template <
typename T>
11019 template <
typename T>
11020 template <
typename S>
11022 static_assert(std::is_base_of<T, S>::value,
"type check");
11024 *value_ = GetDefaultValue();
11030 template <
typename T>
11031 template <
typename S>
11033 static_assert(std::is_base_of<T, S>::value,
"type check");
11035 *value_ = GetDefaultValue();
11041 template <
typename T>
11042 template <
typename S>
11044 static_assert(std::is_void<T>::value || std::is_base_of<T, S>::value,
11047 *value_ = GetDefaultValue();
11053 template<
typename T>
11055 static_assert(std::is_base_of<T, Number>::value,
"type check");
11059 template<
typename T>
11061 static_assert(std::is_base_of<T, Integer>::value,
"type check");
11064 *value_ = I::IntToSmi(i);
11070 template<
typename T>
11072 static_assert(std::is_base_of<T, Integer>::value,
"type check");
11074 bool fits_into_int32_t = (i & (1U << 31)) == 0;
11076 Set(
static_cast<int32_t
>(i));
11082 template<
typename T>
11084 static_assert(std::is_base_of<T, Boolean>::value,
"type check");
11088 root_index = I::kTrueValueRootIndex;
11090 root_index = I::kFalseValueRootIndex;
11092 *value_ = *I::GetRoot(GetIsolate(), root_index);
11095 template<
typename T>
11097 static_assert(std::is_base_of<T, Primitive>::value,
"type check");
11099 *value_ = *I::GetRoot(GetIsolate(), I::kNullValueRootIndex);
11102 template<
typename T>
11104 static_assert(std::is_base_of<T, Primitive>::value,
"type check");
11106 *value_ = *I::GetRoot(GetIsolate(), I::kUndefinedValueRootIndex);
11109 template<
typename T>
11111 static_assert(std::is_base_of<T, String>::value,
"type check");
11113 *value_ = *I::GetRoot(GetIsolate(), I::kEmptyStringRootIndex);
11116 template <
typename T>
11119 return *
reinterpret_cast<Isolate**
>(&value_[-2]);
11122 template <
typename T>
11125 if (*value_ == *I::GetRoot(GetIsolate(), I::kTheHoleValueRootIndex))
11130 template <
typename T>
11131 template <
typename S>
11133 static_assert(
sizeof(S) < 0,
"incompilable to prevent inadvertent misuse");
11136 template <
typename T>
11142 template <
typename T>
11146 : implicit_args_(implicit_args), values_(values), length_(length) {}
11148 template<
typename T>
11152 #ifdef V8_REVERSE_JSARGS
11160 template<
typename T>
11163 #ifdef V8_REVERSE_JSARGS
11171 template<
typename T>
11174 &implicit_args_[kHolderIndex]));
11177 template <
typename T>
11180 reinterpret_cast<Value*
>(&implicit_args_[kNewTargetIndex]));
11183 template <
typename T>
11189 template<
typename T>
11191 return *
reinterpret_cast<Isolate**
>(&implicit_args_[kIsolateIndex]);
11195 template<
typename T>
11201 template<
typename T>
11203 return !NewTarget()->IsUndefined();
11207 template<
typename T>
11221 : resource_name_(resource_name),
11222 resource_line_offset_(resource_line_offset),
11223 resource_column_offset_(resource_column_offset),
11224 options_(!resource_is_shared_cross_origin.IsEmpty() &&
11225 resource_is_shared_cross_origin->IsTrue(),
11226 !resource_is_opaque.IsEmpty() && resource_is_opaque->IsTrue(),
11227 !is_wasm.IsEmpty() && is_wasm->IsTrue(),
11228 !is_module.IsEmpty() && is_module->IsTrue()),
11229 script_id_(script_id),
11230 source_map_url_(source_map_url),
11231 host_defined_options_(host_defined_options) {}
11236 return host_defined_options_;
11240 return resource_line_offset_;
11245 return resource_column_offset_;
11256 : source_string(string),
11257 resource_name(origin.ResourceName()),
11258 resource_line_offset(origin.ResourceLineOffset()),
11259 resource_column_offset(origin.ResourceColumnOffset()),
11260 resource_options(origin.Options()),
11261 source_map_url(origin.SourceMapUrl()),
11262 host_defined_options(origin.HostDefinedOptions()),
11263 cached_data(data) {}
11267 : source_string(string), cached_data(data) {}
11271 delete cached_data;
11277 return cached_data;
11281 return resource_options;
11285 return value ?
True(isolate) :
False(isolate);
11295 #ifdef V8_ENABLE_CHECKS
11302 #ifdef V8_ENABLE_CHECKS
11309 #ifdef V8_ENABLE_CHECKS
11312 return reinterpret_cast<Signature*
>(data);
11316 #ifdef V8_ENABLE_CHECKS
11323 #ifndef V8_ENABLE_CHECKS
11326 A obj = *
reinterpret_cast<A*
>(
this);
11329 auto instance_type = I::GetInstanceType(obj);
11330 if (instance_type == I::kJSObjectType ||
11331 instance_type == I::kJSApiObjectType ||
11332 instance_type == I::kJSSpecialApiObjectType) {
11333 int offset = I::kJSObjectHeaderSize + (I::kEmbedderDataSlotSize * index);
11334 A value = I::ReadRawField<A>(obj, offset);
11335 #ifdef V8_COMPRESS_POINTERS
11338 value = I::DecompressTaggedAnyField(obj,
static_cast<uint32_t
>(value));
11340 internal::Isolate* isolate =
11346 return SlowGetInternalField(index);
11351 #ifndef V8_ENABLE_CHECKS
11354 A obj = *
reinterpret_cast<A*
>(
this);
11357 auto instance_type = I::GetInstanceType(obj);
11358 if (
V8_LIKELY(instance_type == I::kJSObjectType ||
11359 instance_type == I::kJSApiObjectType ||
11360 instance_type == I::kJSSpecialApiObjectType)) {
11361 int offset = I::kJSObjectHeaderSize + (I::kEmbedderDataSlotSize * index);
11362 internal::Isolate* isolate = I::GetIsolateForHeapSandbox(obj);
11363 A value = I::ReadExternalPointerField(isolate, obj, offset);
11364 return reinterpret_cast<void*
>(value);
11367 return SlowGetAlignedPointerFromInternalField(index);
11371 #ifdef V8_ENABLE_CHECKS
11374 return static_cast<String*
>(value);
11381 I::CheckInitialized(isolate);
11382 S* slot = I::GetRoot(isolate, I::kEmptyStringRootIndex);
11390 A obj = *
reinterpret_cast<const A*
>(
this);
11393 if (I::IsExternalTwoByteString(I::GetInstanceType(obj))) {
11394 internal::Isolate* isolate = I::GetIsolateForHeapSandbox(obj);
11396 I::ReadExternalPointerField(isolate, obj, I::kStringResourceOffset);
11399 result = GetExternalStringResourceSlow();
11401 #ifdef V8_ENABLE_CHECKS
11402 VerifyExternalStringResource(result);
11412 A obj = *
reinterpret_cast<const A*
>(
this);
11413 int type = I::GetInstanceType(obj) & I::kFullStringRepresentationMask;
11414 *encoding_out =
static_cast<Encoding>(type & I::kStringEncodingMask);
11416 if (type == I::kExternalOneByteRepresentationTag ||
11417 type == I::kExternalTwoByteRepresentationTag) {
11418 internal::Isolate* isolate = I::GetIsolateForHeapSandbox(obj);
11420 I::ReadExternalPointerField(isolate, obj, I::kStringResourceOffset);
11423 resource = GetExternalStringResourceBaseSlow(encoding_out);
11425 #ifdef V8_ENABLE_CHECKS
11426 VerifyExternalStringResourceBase(resource, *encoding_out);
11433 #ifdef V8_ENABLE_CHECKS
11434 return FullIsUndefined();
11436 return QuickIsUndefined();
11440 bool Value::QuickIsUndefined()
const {
11443 A obj = *
reinterpret_cast<const A*
>(
this);
11444 if (!I::HasHeapObjectTag(obj))
return false;
11445 if (I::GetInstanceType(obj) != I::kOddballType)
return false;
11446 return (I::GetOddballKind(obj) == I::kUndefinedOddballKind);
11451 #ifdef V8_ENABLE_CHECKS
11452 return FullIsNull();
11454 return QuickIsNull();
11458 bool Value::QuickIsNull()
const {
11461 A obj = *
reinterpret_cast<const A*
>(
this);
11462 if (!I::HasHeapObjectTag(obj))
return false;
11463 if (I::GetInstanceType(obj) != I::kOddballType)
return false;
11464 return (I::GetOddballKind(obj) == I::kNullOddballKind);
11468 #ifdef V8_ENABLE_CHECKS
11469 return FullIsNull() || FullIsUndefined();
11471 return QuickIsNullOrUndefined();
11475 bool Value::QuickIsNullOrUndefined()
const {
11478 A obj = *
reinterpret_cast<const A*
>(
this);
11479 if (!I::HasHeapObjectTag(obj))
return false;
11480 if (I::GetInstanceType(obj) != I::kOddballType)
return false;
11481 int kind = I::GetOddballKind(obj);
11482 return kind == I::kNullOddballKind || kind == I::kUndefinedOddballKind;
11486 #ifdef V8_ENABLE_CHECKS
11487 return FullIsString();
11489 return QuickIsString();
11493 bool Value::QuickIsString()
const {
11496 A obj = *
reinterpret_cast<const A*
>(
this);
11497 if (!I::HasHeapObjectTag(obj))
return false;
11498 return (I::GetInstanceType(obj) < I::kFirstNonstringType);
11503 return static_cast<Value*
>(value);
11508 #ifdef V8_ENABLE_CHECKS
11511 return static_cast<Boolean*
>(value);
11516 #ifdef V8_ENABLE_CHECKS
11519 return static_cast<Name*
>(value);
11524 #ifdef V8_ENABLE_CHECKS
11527 return static_cast<Symbol*
>(value);
11532 #ifdef V8_ENABLE_CHECKS
11535 return reinterpret_cast<Private*
>(data);
11540 #ifdef V8_ENABLE_CHECKS
11543 return static_cast<Number*
>(value);
11548 #ifdef V8_ENABLE_CHECKS
11551 return static_cast<Integer*
>(value);
11556 #ifdef V8_ENABLE_CHECKS
11559 return static_cast<Int32*
>(value);
11564 #ifdef V8_ENABLE_CHECKS
11567 return static_cast<Uint32*
>(value);
11571 #ifdef V8_ENABLE_CHECKS
11574 return static_cast<BigInt*
>(value);
11578 #ifdef V8_ENABLE_CHECKS
11581 return static_cast<Date*
>(value);
11586 #ifdef V8_ENABLE_CHECKS
11594 #ifdef V8_ENABLE_CHECKS
11602 #ifdef V8_ENABLE_CHECKS
11609 #ifdef V8_ENABLE_CHECKS
11616 #ifdef V8_ENABLE_CHECKS
11624 #ifdef V8_ENABLE_CHECKS
11627 return static_cast<RegExp*
>(value);
11632 #ifdef V8_ENABLE_CHECKS
11635 return static_cast<Object*
>(value);
11640 #ifdef V8_ENABLE_CHECKS
11643 return static_cast<Array*
>(value);
11648 #ifdef V8_ENABLE_CHECKS
11651 return static_cast<Map*
>(value);
11656 #ifdef V8_ENABLE_CHECKS
11659 return static_cast<Set*
>(value);
11664 #ifdef V8_ENABLE_CHECKS
11667 return static_cast<Promise*
>(value);
11672 #ifdef V8_ENABLE_CHECKS
11675 return static_cast<Proxy*
>(value);
11679 #ifdef V8_ENABLE_CHECKS
11686 #ifdef V8_ENABLE_CHECKS
11694 #ifdef V8_ENABLE_CHECKS
11702 #ifdef V8_ENABLE_CHECKS
11710 #ifdef V8_ENABLE_CHECKS
11718 #ifdef V8_ENABLE_CHECKS
11726 #ifdef V8_ENABLE_CHECKS
11734 #ifdef V8_ENABLE_CHECKS
11742 #ifdef V8_ENABLE_CHECKS
11750 #ifdef V8_ENABLE_CHECKS
11758 #ifdef V8_ENABLE_CHECKS
11766 #ifdef V8_ENABLE_CHECKS
11774 #ifdef V8_ENABLE_CHECKS
11781 #ifdef V8_ENABLE_CHECKS
11788 #ifdef V8_ENABLE_CHECKS
11795 #ifdef V8_ENABLE_CHECKS
11803 #ifdef V8_ENABLE_CHECKS
11806 return static_cast<DataView*
>(value);
11811 #ifdef V8_ENABLE_CHECKS
11819 #ifdef V8_ENABLE_CHECKS
11822 return static_cast<Function*
>(value);
11827 #ifdef V8_ENABLE_CHECKS
11830 return static_cast<External*
>(value);
11834 template<
typename T>
11836 return *
reinterpret_cast<Isolate**
>(&args_[kIsolateIndex]);
11840 template<
typename T>
11846 template<
typename T>
11852 template<
typename T>
11858 template<
typename T>
11863 template <
typename T>
11866 if (args_[kShouldThrowOnErrorIndex] !=
11867 I::IntToSmi(I::kInferShouldThrowMode)) {
11868 return args_[kShouldThrowOnErrorIndex] != I::IntToSmi(I::kDontThrow);
11871 reinterpret_cast<v8::internal::Isolate*
>(GetIsolate()));
11877 I::CheckInitialized(isolate);
11878 S* slot = I::GetRoot(isolate, I::kUndefinedValueRootIndex);
11886 I::CheckInitialized(isolate);
11887 S* slot = I::GetRoot(isolate, I::kNullValueRootIndex);
11895 I::CheckInitialized(isolate);
11896 S* slot = I::GetRoot(isolate, I::kTrueValueRootIndex);
11904 I::CheckInitialized(isolate);
11905 S* slot = I::GetRoot(isolate, I::kFalseValueRootIndex);
11912 I::SetEmbedderData(
this, slot, data);
11918 return I::GetEmbedderData(
this, slot);
11924 return I::kNumIsolateDataSlots;
11929 T* data =
reinterpret_cast<T*
>(GetDataFromSnapshotOnce(index));
11935 int64_t change_in_bytes) {
11937 int64_t* external_memory =
reinterpret_cast<int64_t*
>(
11938 reinterpret_cast<uint8_t*
>(
this) + I::kExternalMemoryOffset);
11939 int64_t* external_memory_limit =
reinterpret_cast<int64_t*
>(
11940 reinterpret_cast<uint8_t*
>(
this) + I::kExternalMemoryLimitOffset);
11941 int64_t* external_memory_low_since_mc =
11942 reinterpret_cast<int64_t*
>(
reinterpret_cast<uint8_t*
>(
this) +
11943 I::kExternalMemoryLowSinceMarkCompactOffset);
11947 const int64_t amount =
11948 static_cast<int64_t
>(
static_cast<uint64_t
>(change_in_bytes) +
11949 static_cast<uint64_t
>(*external_memory));
11950 *external_memory = amount;
11952 if (amount < *external_memory_low_since_mc) {
11953 *external_memory_low_since_mc = amount;
11954 *external_memory_limit = amount + I::kExternalAllocationSoftLimit;
11957 if (change_in_bytes <= 0)
return *external_memory;
11959 if (amount > *external_memory_limit) {
11960 ReportExternalAllocationLimitReached();
11962 return *external_memory;
11966 #ifndef V8_ENABLE_CHECKS
11969 A ctx = *
reinterpret_cast<const A*
>(
this);
11971 I::ReadTaggedPointerField(ctx, I::kNativeContextEmbedderDataOffset);
11973 I::kEmbedderDataArrayHeaderSize + (I::kEmbedderDataSlotSize * index);
11974 A value = I::ReadRawField<A>(embedder_data, value_offset);
11975 #ifdef V8_COMPRESS_POINTERS
11979 I::DecompressTaggedAnyField(embedder_data,
static_cast<uint32_t
>(value));
11982 *
reinterpret_cast<A*
>(
this));
11986 return SlowGetEmbedderData(index);
11992 #ifndef V8_ENABLE_CHECKS
11995 A ctx = *
reinterpret_cast<const A*
>(
this);
11997 I::ReadTaggedPointerField(ctx, I::kNativeContextEmbedderDataOffset);
11999 I::kEmbedderDataArrayHeaderSize + (I::kEmbedderDataSlotSize * index);
12000 internal::Isolate* isolate = I::GetIsolateForHeapSandbox(ctx);
12001 return reinterpret_cast<void*
>(
12002 I::ReadExternalPointerField(isolate, embedder_data, value_offset));
12004 return SlowGetAlignedPointerFromEmbedderData(index);
12010 T* data =
reinterpret_cast<T*
>(GetDataFromSnapshotOnce(index));
12017 T* object_ptr = *object;
12019 return AddData(context, *p);
12024 T* object_ptr = *object;
12026 return AddData(*p);
12043 #endif // INCLUDE_V8_H_