25 #include "v8-internal.h" 26 #include "v8-version.h" 37 class AccessorSignature;
49 class FunctionTemplate;
51 class ImplementationUtilities;
62 class ObjectOperationDescriptor;
69 class RawOperationDescriptor;
92 template <
class T,
class M = NonCopyablePersistentTraits<T> >
99 template <
class K,
class V,
class T>
101 template <
class K,
class V,
class T>
112 class CallHandlerHelper;
118 class DeferredHandles;
122 class LocalEmbedderHeapTracer;
124 class NeverReadOnlySpaceObject;
125 struct ScriptStreamingData;
127 class PropertyCallbackArguments;
128 class FunctionCallbackArguments;
130 class ScopedExternalStringLock;
134 class StreamingDecoder;
140 class ConsoleCallArguments;
145 #define TYPE_CHECK(T, S) \ 147 *(static_cast<T* volatile*>(0)) = static_cast<S*>(0); \ 184 V8_INLINE Local() : val_(nullptr) {}
187 : val_(reinterpret_cast<T*>(*that)) {
199 V8_INLINE
bool IsEmpty()
const {
return val_ ==
nullptr; }
204 V8_INLINE
void Clear() { val_ =
nullptr; }
206 V8_INLINE T* operator->()
const {
return val_; }
208 V8_INLINE T* operator*()
const {
return val_; }
218 internal::Address* a = reinterpret_cast<internal::Address*>(this->val_);
219 internal::Address* b = reinterpret_cast<internal::Address*>(that.val_);
220 if (a ==
nullptr)
return b ==
nullptr;
221 if (b ==
nullptr)
return false;
227 internal::Address* a = reinterpret_cast<internal::Address*>(this->val_);
228 internal::Address* b = reinterpret_cast<internal::Address*>(that.val_);
229 if (a ==
nullptr)
return b ==
nullptr;
230 if (b ==
nullptr)
return false;
256 #ifdef V8_ENABLE_CHECKS 259 if (that.IsEmpty())
return Local<T>();
286 template<
class F>
friend class Eternal;
288 template<
class F,
class M>
friend class Persistent;
289 template<
class F>
friend class Local;
306 template <
class F1,
class F2,
class F3>
314 explicit V8_INLINE
Local(T* that) : val_(that) {}
315 V8_INLINE
static Local<T>
New(Isolate* isolate, T* that);
320 #if !defined(V8_IMMINENT_DEPRECATION_WARNINGS) 323 using Handle = Local<T>;
340 V8_INLINE MaybeLocal() : val_(nullptr) {}
342 V8_INLINE MaybeLocal(Local<S> that)
343 : val_(reinterpret_cast<T*>(*that)) {
347 V8_INLINE
bool IsEmpty()
const {
return val_ ==
nullptr; }
355 out->val_ = IsEmpty() ? nullptr : this->val_;
371 return IsEmpty() ? default_value :
Local<S>(val_);
382 template <
class T>
class Eternal {
384 V8_INLINE Eternal() : val_(nullptr) {}
386 V8_INLINE Eternal(Isolate* isolate, Local<S> handle) : val_(nullptr) {
387 Set(isolate, handle);
390 V8_INLINE Local<T> Get(Isolate* isolate)
const;
391 V8_INLINE
bool IsEmpty()
const {
return val_ ==
nullptr; }
392 template<
class S> V8_INLINE
void Set(Isolate* isolate, Local<S> handle);
399 static const int kInternalFieldsInWeakCallback = 2;
400 static const int kEmbedderFieldsInWeakCallback = 2;
402 template <
typename T>
408 void* embedder_fields[kEmbedderFieldsInWeakCallback],
410 : isolate_(isolate), parameter_(parameter), callback_(callback) {
411 for (
int i = 0; i < kEmbedderFieldsInWeakCallback; ++i) {
412 embedder_fields_[i] = embedder_fields[i];
416 V8_INLINE
Isolate* GetIsolate()
const {
return isolate_; }
417 V8_INLINE T* GetParameter()
const {
return parameter_; }
418 V8_INLINE
void* GetInternalField(
int index)
const;
426 void SetSecondPassCallback(Callback callback)
const { *callback_ = callback; }
432 void* embedder_fields_[kEmbedderFieldsInWeakCallback];
441 enum class WeakCallbackType { kParameter, kInternalFields, kFinalizer };
456 template <
class T>
class PersistentBase {
462 V8_INLINE
void Reset();
468 V8_INLINE
void Reset(Isolate* isolate,
const Local<S>& other);
475 V8_INLINE
void Reset(Isolate* isolate,
const PersistentBase<S>& other);
477 V8_INLINE
bool IsEmpty()
const {
return val_ ==
nullptr; }
478 V8_INLINE
void Empty() { val_ = 0; }
480 V8_INLINE Local<T> Get(Isolate* isolate)
const {
485 V8_INLINE
bool operator==(
const PersistentBase<S>& that)
const {
486 internal::Address* a = reinterpret_cast<internal::Address*>(this->val_);
487 internal::Address* b = reinterpret_cast<internal::Address*>(that.val_);
488 if (a ==
nullptr)
return b ==
nullptr;
489 if (b ==
nullptr)
return false;
494 V8_INLINE
bool operator==(
const Local<S>& that)
const {
495 internal::Address* a = reinterpret_cast<internal::Address*>(this->val_);
496 internal::Address* b = reinterpret_cast<internal::Address*>(that.val_);
497 if (a ==
nullptr)
return b ==
nullptr;
498 if (b ==
nullptr)
return false;
503 V8_INLINE
bool operator!=(
const PersistentBase<S>& that)
const {
504 return !operator==(that);
508 V8_INLINE
bool operator!=(
const Local<S>& that)
const {
509 return !operator==(that);
519 template <
typename P>
520 V8_INLINE
void SetWeak(P* parameter,
521 typename WeakCallbackInfo<P>::Callback callback,
522 WeakCallbackType type);
534 V8_INLINE P* ClearWeak();
537 V8_INLINE
void ClearWeak() { ClearWeak<void>(); }
553 "Used TracedGlobal and EmbedderHeapTracer::RegisterEmbedderReference",
554 V8_INLINE
void RegisterExternalReference(Isolate* isolate)
const);
563 "Weak objects are always considered independent. " 564 "Use TracedGlobal when trying to use EmbedderHeapTracer. " 565 "Use a strong handle when trying to keep an object alive.",
566 V8_INLINE
void MarkIndependent());
577 V8_DEPRECATED(
"See MarkIndependent.", V8_INLINE
bool IsIndependent()
const);
580 V8_DEPRECATED(
"Garbage collection internal state should not be relied on.",
581 V8_INLINE
bool IsNearDeath()
const);
584 V8_INLINE
bool IsWeak()
const;
597 PersistentBase(
const PersistentBase& other) =
delete;
598 void operator=(
const PersistentBase&) =
delete;
601 friend class Isolate;
603 template<
class F>
friend class Local;
604 template<
class F1,
class F2>
friend class Persistent;
607 template<
class F>
friend class PersistentBase;
608 template<
class F>
friend class ReturnValue;
609 template <
class F1,
class F2,
class F3>
610 friend class PersistentValueMapBase;
611 template<
class F1,
class F2>
friend class PersistentValueVector;
614 explicit V8_INLINE PersistentBase(T* val) : val_(val) {}
615 V8_INLINE
static T* New(Isolate* isolate, T* that);
628 class NonCopyablePersistentTraits {
630 typedef Persistent<T, NonCopyablePersistentTraits<T> > NonCopyablePersistent;
631 static const bool kResetInDestructor =
false;
632 template<
class S,
class M>
633 V8_INLINE
static void Copy(
const Persistent<S, M>& source,
634 NonCopyablePersistent* dest) {
635 Uncompilable<Object>();
638 template<
class O> V8_INLINE
static void Uncompilable() {
639 TYPE_CHECK(O, Primitive);
651 static const bool kResetInDestructor =
true;
652 template<
class S,
class M>
689 template <
class S,
class M2>
703 template <
class S,
class M2>
711 template <
class S,
class M2>
712 V8_INLINE
Persistent& operator=(
const Persistent<S, M2>& that) {
722 if (M::kResetInDestructor) this->
Reset();
728 #ifdef V8_ENABLE_CHECKS 731 if (!that.IsEmpty()) T::Cast(*that);
738 V8_INLINE Persistent<S>& As()
const {
739 return Persistent<S>::Cast(*
this);
743 friend class Isolate;
745 template<
class F>
friend class Local;
746 template<
class F1,
class F2>
friend class Persistent;
747 template<
class F>
friend class ReturnValue;
749 explicit V8_INLINE
Persistent(T* that) : PersistentBase<T>(that) {}
750 V8_INLINE T* operator*()
const {
return this->val_; }
751 template<
class S,
class M2>
752 V8_INLINE
void Copy(
const Persistent<S, M2>& that);
762 class Global :
public PersistentBase<T> {
812 typedef void MoveOnlyTypeForCPP03;
820 V8_INLINE T* operator*()
const {
return this->val_; }
826 using UniquePersistent = Global<T>;
839 template <
typename T>
840 class V8_EXPORT TracedGlobal {
845 TracedGlobal() =
default;
846 ~TracedGlobal() { Reset(); }
856 : val_(New(isolate, *that, &val_)) {
881 bool IsEmpty()
const {
return val_ ==
nullptr; }
887 V8_INLINE
void Reset();
908 V8_INLINE
bool operator==(
const TracedGlobal<S>& that)
const {
909 internal::Address* a = reinterpret_cast<internal::Address*>(this->val_);
910 internal::Address* b = reinterpret_cast<internal::Address*>(that.val_);
911 if (a ==
nullptr)
return b ==
nullptr;
912 if (b ==
nullptr)
return false;
917 V8_INLINE
bool operator==(
const Local<S>& that)
const {
918 internal::Address* a = reinterpret_cast<internal::Address*>(this->val_);
919 internal::Address* b = reinterpret_cast<internal::Address*>(that.val_);
920 if (a ==
nullptr)
return b ==
nullptr;
921 if (b ==
nullptr)
return false;
926 V8_INLINE
bool operator!=(
const TracedGlobal<S>& that)
const {
927 return !operator==(that);
931 V8_INLINE
bool operator!=(
const Local<S>& that)
const {
932 return !operator==(that);
938 V8_INLINE
void SetWrapperClassId(uint16_t class_id);
944 V8_INLINE uint16_t WrapperClassId()
const;
956 V8_INLINE
void SetFinalizationCallback(
957 void* parameter, WeakCallbackInfo<void>::Callback callback);
960 V8_INLINE
static T* New(Isolate* isolate, T* that, T** slot);
962 T* operator*()
const {
return this->val_; }
966 friend class EmbedderHeapTracer;
967 template <
typename F>
970 template <
typename F>
971 friend class ReturnValue;
997 static int NumberOfHandles(
Isolate* isolate);
999 V8_INLINE
Isolate* GetIsolate()
const {
1000 return reinterpret_cast<Isolate*>(isolate_);
1009 void Initialize(
Isolate* isolate);
1011 static internal::Address* CreateHandle(internal::Isolate* isolate,
1012 internal::Address value);
1017 void*
operator new(
size_t size);
1018 void*
operator new[](
size_t size);
1019 void operator delete(
void*, size_t);
1020 void operator delete[](
void*, size_t);
1022 internal::Isolate* isolate_;
1023 internal::Address* prev_next_;
1024 internal::Address* prev_limit_;
1027 template<
class F>
friend class Local;
1051 internal::Address* slot =
1052 Escape(reinterpret_cast<internal::Address*>(*value));
1053 return Local<T>(reinterpret_cast<T*>(slot));
1058 return Escape(value.FromMaybe(
Local<T>()));
1061 EscapableHandleScope(
const EscapableHandleScope&) =
delete;
1062 void operator=(
const EscapableHandleScope&) =
delete;
1067 void*
operator new(
size_t size);
1068 void*
operator new[](
size_t size);
1069 void operator delete(
void*, size_t);
1070 void operator delete[](
void*, size_t);
1072 internal::Address* Escape(internal::Address* escape_value);
1073 internal::Address* escape_slot_;
1092 void*
operator new(
size_t size);
1093 void*
operator new[](
size_t size);
1094 void operator delete(
void*, size_t);
1095 void operator delete[](
void*, size_t);
1097 internal::Isolate*
const isolate_;
1098 internal::Address* prev_limit_;
1099 int prev_sealed_level_;
1157 bool is_opaque =
false,
bool is_wasm =
false,
1158 bool is_module =
false)
1159 : flags_((is_shared_cross_origin ? kIsSharedCrossOrigin : 0) |
1160 (is_wasm ? kIsWasm : 0) | (is_opaque ? kIsOpaque : 0) |
1161 (is_module ? kIsModule : 0)) {}
1164 (kIsSharedCrossOrigin | kIsOpaque | kIsWasm | kIsModule)) {}
1166 bool IsSharedCrossOrigin()
const {
1167 return (flags_ & kIsSharedCrossOrigin) != 0;
1169 bool IsOpaque()
const {
return (flags_ & kIsOpaque) != 0; }
1170 bool IsWasm()
const {
return (flags_ & kIsWasm) != 0; }
1171 bool IsModule()
const {
return (flags_ & kIsModule) != 0; }
1173 int Flags()
const {
return flags_; }
1177 kIsSharedCrossOrigin = 1,
1246 int GetLineNumber(
int code_pos);
1248 static const int kNoScriptId = 0;
1263 int GetLineNumber() {
return line_number_; }
1264 int GetColumnNumber() {
return column_number_; }
1266 Location(
int line_number,
int column_number)
1267 : line_number_(line_number), column_number_(column_number) {}
1298 Status GetStatus()
const;
1308 int GetModuleRequestsLength()
const;
1320 Location GetModuleRequestLocation(
int i)
const;
1325 int GetIdentityHash()
const;
1339 ResolveCallback callback);
1416 buffer_policy(BufferNotOwned) {}
1423 BufferPolicy buffer_policy = BufferNotOwned);
1427 const uint8_t* data;
1430 BufferPolicy buffer_policy;
1452 V8_INLINE
const CachedData* GetCachedData()
const;
1508 virtual size_t GetMoreData(
const uint8_t** src) = 0;
1520 virtual bool SetBookmark();
1525 virtual void ResetToBookmark();
1536 enum Encoding { ONE_BYTE, TWO_BYTE, UTF8 };
1541 internal::ScriptStreamingData* impl()
const {
return impl_.get(); }
1548 std::unique_ptr<internal::ScriptStreamingData> impl_;
1565 internal::ScriptStreamingData* data_;
1568 enum CompileOptions {
1569 kNoCompileOptions = 0,
1578 kNoCacheNoReason = 0,
1579 kNoCacheBecauseCachingDisabled,
1580 kNoCacheBecauseNoResource,
1581 kNoCacheBecauseInlineScript,
1582 kNoCacheBecauseModule,
1583 kNoCacheBecauseStreamingSource,
1584 kNoCacheBecauseInspector,
1585 kNoCacheBecauseScriptTooSmall,
1586 kNoCacheBecauseCacheTooCold,
1587 kNoCacheBecauseV8Extension,
1588 kNoCacheBecauseExtensionModule,
1589 kNoCacheBecausePacScript,
1590 kNoCacheBecauseInDocumentWrite,
1591 kNoCacheBecauseResourceWithNoCacheHandler,
1592 kNoCacheBecauseDeferredProduceCodeCache
1609 Isolate* isolate, Source* source,
1610 CompileOptions options = kNoCompileOptions,
1611 NoCacheReason no_cache_reason = kNoCacheNoReason);
1626 CompileOptions options = kNoCompileOptions,
1627 NoCacheReason no_cache_reason = kNoCacheNoReason);
1640 static ScriptStreamingTask* StartStreamingScript(
1641 Isolate* isolate, StreamedSource* source,
1642 CompileOptions options = kNoCompileOptions);
1673 static uint32_t CachedDataVersionTag();
1683 Isolate* isolate, Source* source,
1684 CompileOptions options = kNoCompileOptions,
1685 NoCacheReason no_cache_reason = kNoCacheNoReason);
1701 CompileOptions options = kNoCompileOptions,
1702 NoCacheReason no_cache_reason = kNoCacheNoReason);
1716 static CachedData* CreateCodeCache(
1725 static CachedData* CreateCodeCacheForFunction(
Local<Function> function);
1729 Isolate* isolate, Source* source, CompileOptions options,
1730 NoCacheReason no_cache_reason);
1777 int GetStartPosition()
const;
1783 int GetEndPosition()
const;
1788 int ErrorLevel()
const;
1794 int GetStartColumn()
const;
1801 int GetEndColumn()
const;
1808 bool IsSharedCrossOrigin()
const;
1809 bool IsOpaque()
const;
1812 static void PrintCurrentStackTrace(
Isolate* isolate, FILE* out);
1814 static const int kNoLineNumberInfo = 0;
1815 static const int kNoColumnInfo = 0;
1816 static const int kNoScriptIdInfo = 0;
1835 kColumnOffset = 1 << 1 | kLineNumber,
1836 kScriptName = 1 << 2,
1837 kFunctionName = 1 << 3,
1839 kIsConstructor = 1 << 5,
1840 kScriptNameOrSourceURL = 1 << 6,
1842 kExposeFramesAcrossSecurityOrigins = 1 << 8,
1843 kOverview = kLineNumber | kColumnOffset | kScriptName | kFunctionName,
1844 kDetailed = kOverview | kIsEval | kIsConstructor | kScriptNameOrSourceURL
1855 int GetFrameCount()
const;
1865 Isolate* isolate,
int frame_limit, StackTraceOptions options = kDetailed);
1880 int GetLineNumber()
const;
1889 int GetColumn()
const;
1897 int GetScriptId()
const;
1922 bool IsEval()
const;
1928 bool IsConstructor()
const;
1933 bool IsWasm()
const;
1960 size_t frames_count;
1962 void* external_callback_entry;
1967 const void* start =
nullptr;
1968 size_t length_in_bytes = 0;
2024 virtual void ThrowDataCloneError(
Local<String> message) = 0;
2059 virtual void* ReallocateBufferMemory(
void* old_buffer,
size_t size,
2060 size_t* actual_size);
2067 virtual void FreeBufferMemory(
void* buffer);
2091 V8_WARN_UNUSED_RESULT std::pair<uint8_t*, size_t> Release();
2098 void TransferArrayBuffer(uint32_t transfer_id,
2109 void SetTreatArrayBufferViewsAsHostObjects(
bool mode);
2116 void WriteUint32(uint32_t value);
2117 void WriteUint64(uint64_t value);
2118 void WriteDouble(
double value);
2119 void WriteRawBytes(
const void* source,
size_t length);
2126 PrivateData* private_;
2151 Isolate* isolate, uint32_t transfer_id);
2158 Isolate* isolate, uint32_t clone_id);
2181 void TransferArrayBuffer(uint32_t transfer_id,
2189 void TransferSharedArrayBuffer(uint32_t
id,
2199 void SetSupportsLegacyWireFormat(
bool supports_legacy_wire_format);
2204 void SetExpectInlineWasm(
bool allow_inline_wasm);
2211 uint32_t GetWireFormatVersion()
const;
2218 V8_WARN_UNUSED_RESULT
bool ReadUint32(uint32_t* value);
2219 V8_WARN_UNUSED_RESULT
bool ReadUint64(uint64_t* value);
2220 V8_WARN_UNUSED_RESULT
bool ReadDouble(
double* value);
2221 V8_WARN_UNUSED_RESULT
bool ReadRawBytes(
size_t length,
const void** data);
2228 PrivateData* private_;
2244 V8_INLINE
bool IsUndefined()
const;
2250 V8_INLINE
bool IsNull()
const;
2257 V8_INLINE
bool IsNullOrUndefined()
const;
2262 bool IsTrue()
const;
2267 bool IsFalse()
const;
2272 bool IsName()
const;
2278 V8_INLINE
bool IsString()
const;
2283 bool IsSymbol()
const;
2288 bool IsFunction()
const;
2294 bool IsArray()
const;
2299 bool IsObject()
const;
2304 bool IsBigInt()
const;
2309 bool IsBoolean()
const;
2314 bool IsNumber()
const;
2319 bool IsExternal()
const;
2324 bool IsInt32()
const;
2329 bool IsUint32()
const;
2334 bool IsDate()
const;
2339 bool IsArgumentsObject()
const;
2344 bool IsBigIntObject()
const;
2349 bool IsBooleanObject()
const;
2354 bool IsNumberObject()
const;
2359 bool IsStringObject()
const;
2364 bool IsSymbolObject()
const;
2369 bool IsNativeError()
const;
2374 bool IsRegExp()
const;
2379 bool IsAsyncFunction()
const;
2384 bool IsGeneratorFunction()
const;
2389 bool IsGeneratorObject()
const;
2394 bool IsPromise()
const;
2409 bool IsMapIterator()
const;
2414 bool IsSetIterator()
const;
2419 bool IsWeakMap()
const;
2424 bool IsWeakSet()
const;
2429 bool IsArrayBuffer()
const;
2434 bool IsArrayBufferView()
const;
2439 bool IsTypedArray()
const;
2444 bool IsUint8Array()
const;
2449 bool IsUint8ClampedArray()
const;
2454 bool IsInt8Array()
const;
2459 bool IsUint16Array()
const;
2464 bool IsInt16Array()
const;
2469 bool IsUint32Array()
const;
2474 bool IsInt32Array()
const;
2479 bool IsFloat32Array()
const;
2484 bool IsFloat64Array()
const;
2489 bool IsBigInt64Array()
const;
2494 bool IsBigUint64Array()
const;
2499 bool IsDataView()
const;
2505 bool IsSharedArrayBuffer()
const;
2510 bool IsProxy()
const;
2512 bool IsWebAssemblyCompiledModule()
const;
2517 bool IsModuleNamespaceObject()
const;
2521 V8_DEPRECATE_SOON(
"ToBoolean can never throw. Use Local version.",
2539 V8_DEPRECATE_SOON(
"Use maybe version",
2541 V8_DEPRECATE_SOON(
"Use maybe version",
2543 V8_DEPRECATE_SOON(
"Use maybe version",
2545 V8_DEPRECATE_SOON(
"Use maybe version",
2547 V8_DEPRECATE_SOON(
"Use maybe version",
2557 bool BooleanValue(
Isolate* isolate)
const;
2559 V8_DEPRECATED(
"BooleanValue can never throw. Use Isolate version.",
2575 template <
class T> V8_INLINE
static Value* Cast(T* value);
2582 V8_INLINE
bool QuickIsUndefined()
const;
2583 V8_INLINE
bool QuickIsNull()
const;
2584 V8_INLINE
bool QuickIsNullOrUndefined()
const;
2585 V8_INLINE
bool QuickIsString()
const;
2586 bool FullIsUndefined()
const;
2587 bool FullIsNull()
const;
2588 bool FullIsString()
const;
2625 int GetIdentityHash();
2627 V8_INLINE
static Name* Cast(
Value* obj);
2630 static void CheckCast(
Value* obj);
2658 static constexpr
int kMaxLength = internal::kApiTaggedSize == 4
2660 : internal::kSmiMaxValue / 2 - 24;
2663 UNKNOWN_ENCODING = 0x1,
2664 TWO_BYTE_ENCODING = 0x0,
2665 ONE_BYTE_ENCODING = 0x8
2676 int Utf8Length(
Isolate* isolate)
const;
2684 bool IsOneByte()
const;
2691 bool ContainsOnlyOneByte()
const;
2720 HINT_MANY_WRITES_EXPECTED = 1,
2721 NO_NULL_TERMINATION = 2,
2722 PRESERVE_ONE_BYTE_NULL = 4,
2726 REPLACE_INVALID_UTF8 = 8
2730 int Write(
Isolate* isolate, uint16_t* buffer,
int start = 0,
int length = -1,
2731 int options = NO_OPTIONS)
const;
2733 int WriteOneByte(
Isolate* isolate, uint8_t* buffer,
int start = 0,
2734 int length = -1,
int options = NO_OPTIONS)
const;
2736 int WriteUtf8(
Isolate* isolate,
char* buffer,
int length = -1,
2737 int* nchars_ref =
nullptr,
int options = NO_OPTIONS)
const;
2747 bool IsExternal()
const;
2752 bool IsExternalOneByte()
const;
2799 friend class internal::Heap;
2801 friend class internal::ScopedExternalStringLock;
2822 virtual const uint16_t* data()
const = 0;
2827 virtual size_t length()
const = 0;
2852 virtual const char* data()
const = 0;
2854 virtual size_t length()
const = 0;
2865 Encoding* encoding_out)
const;
2882 enum NewStringType {
2888 static V8_DEPRECATED(
2889 "Use maybe version",
2907 static V8_DEPRECATE_SOON(
2908 "Use maybe version",
2935 Isolate* isolate, ExternalStringResource* resource);
2946 bool MakeExternal(ExternalStringResource* resource);
2956 static V8_DEPRECATE_SOON(
2957 "Use maybe version",
2959 ExternalOneByteStringResource* resource));
2961 Isolate* isolate, ExternalOneByteStringResource* resource);
2972 bool MakeExternal(ExternalOneByteStringResource* resource);
2977 bool CanMakeExternal();
2995 char* operator*() {
return str_; }
2996 const char* operator*()
const {
return str_; }
2997 int length()
const {
return length_; }
3001 void operator=(
const Utf8Value&) =
delete;
3018 uint16_t* operator*() {
return str_; }
3019 const uint16_t* operator*()
const {
return str_; }
3020 int length()
const {
return length_; }
3024 void operator=(
const Value&) =
delete;
3033 Encoding encoding)
const;
3037 String::Encoding* encoding_out)
const;
3091 static void CheckCast(
Value* obj);
3129 static void CheckCast(
Data* that);
3138 double Value()
const;
3154 int64_t
Value()
const;
3167 int32_t
Value()
const;
3181 uint32_t
Value()
const;
3204 int word_count,
const uint64_t* words);
3212 uint64_t Uint64Value(
bool* lossless =
nullptr)
const;
3219 int64_t Int64Value(
bool* lossless =
nullptr)
const;
3225 int WordCount()
const;
3235 void ToWordsArray(
int* sign_bit,
int* word_count, uint64_t* words)
const;
3266 typedef void (*AccessorNameGetterCallback)(
3271 typedef void (*AccessorSetterCallback)(
3275 typedef void (*AccessorNameSetterCallback)(
3293 ALL_CAN_WRITE = 1 << 1,
3294 PROHIBITS_OVERWRITING = 1 << 2
3303 ONLY_ENUMERABLE = 2,
3304 ONLY_CONFIGURABLE = 4,
3322 kHasSideEffectToReceiver
3356 V8_DEPRECATE_SOON(
"Use maybe version",
3365 V8_DEPRECATE_SOON(
"Use maybe version",
3390 V8_WARN_UNUSED_RESULT
Maybe<bool> DefineOwnProperty(
3414 V8_DEPRECATE_SOON(
"Use maybe version",
Local<Value> Get(uint32_t index));
3463 AccessorNameGetterCallback getter,
3464 AccessorNameSetterCallback setter =
nullptr,
3467 SideEffectType getter_side_effect_type = SideEffectType::kHasSideEffect,
3468 SideEffectType setter_side_effect_type = SideEffectType::kHasSideEffect);
3479 V8_WARN_UNUSED_RESULT
Maybe<bool> SetNativeDataProperty(
3481 AccessorNameGetterCallback getter,
3482 AccessorNameSetterCallback setter =
nullptr,
3484 SideEffectType getter_side_effect_type = SideEffectType::kHasSideEffect,
3485 SideEffectType setter_side_effect_type = SideEffectType::kHasSideEffect);
3495 V8_WARN_UNUSED_RESULT
Maybe<bool> SetLazyDataProperty(
3499 SideEffectType getter_side_effect_type = SideEffectType::kHasSideEffect,
3500 SideEffectType setter_side_effect_type = SideEffectType::kHasSideEffect);
3585 int InternalFieldCount();
3590 return object.val_->InternalFieldCount();
3595 return object.val_->InternalFieldCount();
3609 V8_INLINE
void* GetAlignedPointerFromInternalField(
int index);
3614 return object.val_->GetAlignedPointerFromInternalField(index);
3620 return object.val_->GetAlignedPointerFromInternalField(index);
3628 void SetAlignedPointerInInternalField(
int index,
void* value);
3629 void SetAlignedPointerInInternalFields(
int argc,
int indices[],
3656 V8_WARN_UNUSED_RESULT
Maybe<bool> HasRealIndexedProperty(
3658 V8_WARN_UNUSED_RESULT
Maybe<bool> HasRealNamedCallbackProperty(
3674 GetRealNamedPropertyAttributesInPrototypeChain(
Local<Context> context,
3694 bool HasNamedLookupInterceptor();
3697 bool HasIndexedLookupInterceptor();
3706 int GetIdentityHash();
3723 return object.val_->CreationContext();
3736 bool IsConstructor();
3789 static void CheckCast(
Value* obj);
3791 void* SlowGetAlignedPointerFromInternalField(
int index);
3800 uint32_t Length()
const;
3817 static void CheckCast(
Value* obj);
3826 size_t Size()
const;
3849 V8_INLINE
static Map* Cast(
Value* obj);
3853 static void CheckCast(
Value* obj);
3862 size_t Size()
const;
3881 V8_INLINE
static Set* Cast(
Value* obj);
3885 static void CheckCast(
Value* obj);
3889 template<
typename T>
3893 : value_(that.value_) {
3897 template <
typename S>
3898 V8_INLINE V8_DEPRECATED(
"Use Global<> instead",
3899 void Set(
const Persistent<S>& handle));
3900 template <
typename S>
3901 V8_INLINE
void Set(
const Global<S>& handle);
3902 template <
typename S>
3903 V8_INLINE
void Set(
const TracedGlobal<S>& handle);
3904 template <
typename S>
3905 V8_INLINE
void Set(
const Local<S> handle);
3907 V8_INLINE
void Set(
bool value);
3908 V8_INLINE
void Set(
double i);
3909 V8_INLINE
void Set(int32_t i);
3910 V8_INLINE
void Set(uint32_t i);
3912 V8_INLINE
void SetNull();
3913 V8_INLINE
void SetUndefined();
3914 V8_INLINE
void SetEmptyString();
3916 V8_INLINE Isolate* GetIsolate()
const;
3919 template <
typename S>
3920 V8_INLINE
void Set(S* whatever);
3925 V8_INLINE Local<Value> Get()
const;
3928 template<
class F>
friend class ReturnValue;
3929 template<
class F>
friend class FunctionCallbackInfo;
3930 template<
class F>
friend class PropertyCallbackInfo;
3931 template <
class F,
class G,
class H>
3932 friend class PersistentValueMapBase;
3933 V8_INLINE
void SetInternal(internal::Address value) { *value_ = value; }
3934 V8_INLINE internal::Address GetDefaultValue();
3935 V8_INLINE
explicit ReturnValue(internal::Address* slot);
3936 internal::Address* value_;
3946 template<
typename T>
3947 class FunctionCallbackInfo {
3950 V8_INLINE
int Length()
const;
3952 V8_INLINE Local<Value>
operator[](
int i)
const;
3954 V8_INLINE Local<Object>
This()
const;
3965 V8_INLINE Local<Object>
Holder()
const;
3967 V8_INLINE Local<Value>
NewTarget()
const;
3971 V8_INLINE Local<Value>
Data()
const;
3977 static const int kArgsLength = 6;
3980 friend class internal::FunctionCallbackArguments;
3981 friend class internal::CustomArguments<FunctionCallbackInfo>;
3982 friend class debug::ConsoleCallArguments;
3983 static const int kHolderIndex = 0;
3984 static const int kIsolateIndex = 1;
3985 static const int kReturnValueDefaultValueIndex = 2;
3986 static const int kReturnValueIndex = 3;
3987 static const int kDataIndex = 4;
3988 static const int kNewTargetIndex = 5;
3990 V8_INLINE FunctionCallbackInfo(internal::Address* implicit_args,
3991 internal::Address* values,
int length);
3992 internal::Address* implicit_args_;
3993 internal::Address* values_;
4002 template<
typename T>
4003 class PropertyCallbackInfo {
4015 V8_INLINE Local<Value>
Data()
const;
4058 V8_INLINE Local<Object>
This()
const;
4069 V8_INLINE Local<Object>
Holder()
const;
4091 static const int kArgsLength = 7;
4094 friend class MacroAssembler;
4095 friend class internal::PropertyCallbackArguments;
4096 friend class internal::CustomArguments<PropertyCallbackInfo>;
4097 static const int kShouldThrowOnErrorIndex = 0;
4098 static const int kHolderIndex = 1;
4099 static const int kIsolateIndex = 2;
4100 static const int kReturnValueDefaultValueIndex = 3;
4101 static const int kReturnValueIndex = 4;
4102 static const int kDataIndex = 5;
4103 static const int kThisIndex = 6;
4105 V8_INLINE PropertyCallbackInfo(internal::Address* args) : args_(args) {}
4106 internal::Address* args_;
4110 typedef void (*FunctionCallback)(
const FunctionCallbackInfo<Value>& info);
4112 enum class ConstructorBehavior { kThrow, kAllow };
4126 ConstructorBehavior behavior = ConstructorBehavior::kAllow,
4127 SideEffectType side_effect_type = SideEffectType::kHasSideEffect);
4134 return NewInstance(context, 0,
nullptr);
4144 SideEffectType side_effect_type = SideEffectType::kHasSideEffect)
const;
4177 int GetScriptLineNumber()
const;
4182 int GetScriptColumnNumber()
const;
4187 int ScriptId()
const;
4197 static const int kLineOffsetNotFound;
4201 static void CheckCast(
Value* obj);
4204 #ifndef V8_PROMISE_INTERNAL_FIELD_COUNT 4206 #define V8_PROMISE_INTERNAL_FIELD_COUNT 0 4247 static void CheckCast(
Value* obj);
4286 void MarkAsHandled();
4290 static const int kEmbedderFieldCount = V8_PROMISE_INTERNAL_FIELD_COUNT;
4294 static void CheckCast(
Value* obj);
4342 bool has_value()
const;
4345 bool has_get()
const;
4347 bool has_set()
const;
4349 void set_enumerable(
bool enumerable);
4350 bool enumerable()
const;
4351 bool has_enumerable()
const;
4353 void set_configurable(
bool configurable);
4354 bool configurable()
const;
4355 bool has_configurable()
const;
4357 bool writable()
const;
4358 bool has_writable()
const;
4361 PrivateData* get_private()
const {
return private_; }
4367 PrivateData* private_;
4392 static void CheckCast(
Value* obj);
4405 template <
typename T>
4411 constexpr
MemorySpan(T* data,
size_t size) : data_(data), size_(size) {}
4414 constexpr T*
data()
const {
return data_; }
4416 constexpr
size_t size()
const {
return size_; }
4427 std::unique_ptr<const uint8_t[]> buffer;
4429 OwnedBuffer(std::unique_ptr<
const uint8_t[]> buffer,
size_t size)
4430 : buffer(std::move(buffer)), size(size) {}
4453 const std::shared_ptr<internal::wasm::NativeModule> native_module_;
4474 typedef std::shared_ptr<internal::wasm::NativeModule> SharedModule;
4477 : shared_module_(std::move(shared_module)) {}
4479 : serialized_(std::move(serialized)), wire_bytes_(std::move(bytes)) {}
4481 SharedModule shared_module_;
4520 const uint8_t* start,
4523 return {buff.buffer.get(), buff.size};
4527 static void CheckCast(Value* obj);
4530 V8_DEPRECATED(
"Use WasmModuleObject",
4531 typedef WasmModuleObject WasmCompiledModule);
4541 class WasmStreamingImpl;
4548 virtual ~
Client() =
default;
4556 explicit WasmStreaming(std::unique_ptr<WasmStreamingImpl> impl);
4564 void OnBytesReceived(
const uint8_t* bytes,
size_t size);
4587 bool SetCompiledModuleBytes(
const uint8_t* bytes,
size_t size);
4593 void SetClient(std::shared_ptr<Client> client);
4600 static std::shared_ptr<WasmStreaming> Unpack(
Isolate* isolate,
4604 std::unique_ptr<WasmStreamingImpl> impl_;
4615 void OnBytesReceived(
const uint8_t*,
size_t size);
4650 std::shared_ptr<internal::wasm::StreamingDecoder> streaming_decoder_;
4653 #ifndef V8_ARRAY_BUFFER_INTERNAL_FIELD_COUNT 4655 #define V8_ARRAY_BUFFER_INTERNAL_FIELD_COUNT 2 4659 enum class ArrayBufferCreationMode {
kInternalized, kExternalized };
4690 virtual void* Allocate(
size_t length) = 0;
4696 virtual void* AllocateUninitialized(
size_t length) = 0;
4702 virtual void Free(
void* data,
size_t length) = 0;
4717 static Allocator* NewDefaultAllocator();
4731 using DeleterCallback = void (*)(
void* buffer,
size_t length,
void* info);
4736 allocation_base_(
nullptr),
4737 allocation_length_(0),
4738 allocation_mode_(Allocator::AllocationMode::kNormal),
4740 deleter_data_(
nullptr) {}
4742 void* AllocationBase()
const {
return allocation_base_; }
4743 size_t AllocationLength()
const {
return allocation_length_; }
4745 return allocation_mode_;
4748 void*
Data()
const {
return data_; }
4749 size_t ByteLength()
const {
return byte_length_; }
4750 DeleterCallback Deleter()
const {
return deleter_; }
4751 void* DeleterData()
const {
return deleter_data_; }
4754 Contents(
void* data,
size_t byte_length,
void* allocation_base,
4755 size_t allocation_length,
4757 void* deleter_data);
4760 size_t byte_length_;
4761 void* allocation_base_;
4762 size_t allocation_length_;
4764 DeleterCallback deleter_;
4765 void* deleter_data_;
4774 size_t ByteLength()
const;
4794 Isolate* isolate,
void* data,
size_t byte_length,
4795 ArrayBufferCreationMode mode = ArrayBufferCreationMode::kExternalized);
4801 bool IsExternal()
const;
4806 bool IsDetachable()
const;
4809 V8_DEPRECATE_SOON(
"Use IsDetachable() instead.",
4810 inline bool IsNeuterable()
const) {
4811 return IsDetachable();
4823 V8_DEPRECATE_SOON(
"Use Detach() instead.",
inline void Neuter()) { Detach(); }
4835 Contents Externalize();
4845 Contents GetContents();
4847 V8_INLINE
static ArrayBuffer* Cast(Value* obj);
4849 static const int kInternalFieldCount = V8_ARRAY_BUFFER_INTERNAL_FIELD_COUNT;
4850 static const int kEmbedderFieldCount = V8_ARRAY_BUFFER_INTERNAL_FIELD_COUNT;
4854 static void CheckCast(Value* obj);
4858 #ifndef V8_ARRAY_BUFFER_VIEW_INTERNAL_FIELD_COUNT 4860 #define V8_ARRAY_BUFFER_VIEW_INTERNAL_FIELD_COUNT 2 4877 size_t ByteOffset();
4881 size_t ByteLength();
4892 size_t CopyContents(
void* dest,
size_t byte_length);
4898 bool HasBuffer()
const;
4902 static const int kInternalFieldCount =
4903 V8_ARRAY_BUFFER_VIEW_INTERNAL_FIELD_COUNT;
4904 static const int kEmbedderFieldCount =
4905 V8_ARRAY_BUFFER_VIEW_INTERNAL_FIELD_COUNT;
4909 static void CheckCast(
Value* obj);
4922 static constexpr
size_t kMaxLength = internal::kSmiMaxValue;
4934 static void CheckCast(
Value* obj);
4944 size_t byte_offset,
size_t length);
4946 size_t byte_offset,
size_t length);
4951 static void CheckCast(
Value* obj);
4961 size_t byte_offset,
size_t length);
4969 static void CheckCast(
Value* obj);
4978 size_t byte_offset,
size_t length);
4980 size_t byte_offset,
size_t length);
4985 static void CheckCast(
Value* obj);
4995 size_t byte_offset,
size_t length);
4997 size_t byte_offset,
size_t length);
5002 static void CheckCast(
Value* obj);
5012 size_t byte_offset,
size_t length);
5014 size_t byte_offset,
size_t length);
5019 static void CheckCast(
Value* obj);
5029 size_t byte_offset,
size_t length);
5031 size_t byte_offset,
size_t length);
5036 static void CheckCast(
Value* obj);
5046 size_t byte_offset,
size_t length);
5048 size_t byte_offset,
size_t length);
5053 static void CheckCast(
Value* obj);
5063 size_t byte_offset,
size_t length);
5065 size_t byte_offset,
size_t length);
5070 static void CheckCast(
Value* obj);
5080 size_t byte_offset,
size_t length);
5082 size_t byte_offset,
size_t length);
5087 static void CheckCast(
Value* obj);
5096 size_t byte_offset,
size_t length);
5098 size_t byte_offset,
size_t length);
5103 static void CheckCast(
Value* obj);
5112 size_t byte_offset,
size_t length);
5114 size_t byte_offset,
size_t length);
5119 static void CheckCast(
Value* obj);
5128 size_t byte_offset,
size_t length);
5130 size_t byte_offset,
size_t length);
5135 static void CheckCast(
Value* obj);
5159 using DeleterCallback = void (*)(
void* buffer,
size_t length,
void* info);
5164 allocation_base_(
nullptr),
5165 allocation_length_(0),
5166 allocation_mode_(Allocator::AllocationMode::kNormal),
5168 deleter_data_(
nullptr),
5169 is_growable_(
false) {}
5171 void* AllocationBase()
const {
return allocation_base_; }
5172 size_t AllocationLength()
const {
return allocation_length_; }
5174 return allocation_mode_;
5177 void*
Data()
const {
return data_; }
5178 size_t ByteLength()
const {
return byte_length_; }
5179 DeleterCallback Deleter()
const {
return deleter_; }
5180 void* DeleterData()
const {
return deleter_data_; }
5181 bool IsGrowable()
const {
return is_growable_; }
5184 Contents(
void* data,
size_t byte_length,
void* allocation_base,
5185 size_t allocation_length,
5187 void* deleter_data,
bool is_growable);
5190 size_t byte_length_;
5191 void* allocation_base_;
5192 size_t allocation_length_;
5194 DeleterCallback deleter_;
5195 void* deleter_data_;
5204 size_t ByteLength()
const;
5221 Isolate* isolate,
void* data,
size_t byte_length,
5222 ArrayBufferCreationMode mode = ArrayBufferCreationMode::kExternalized);
5230 ArrayBufferCreationMode mode = ArrayBufferCreationMode::kExternalized);
5236 bool IsExternal()
const;
5268 static const int kInternalFieldCount = V8_ARRAY_BUFFER_INTERNAL_FIELD_COUNT;
5272 static void CheckCast(
Value* obj);
5288 double ValueOf()
const;
5290 V8_INLINE
static Date* Cast(
Value* obj);
5320 "Use Isolate::DateTimeConfigurationChangeNotification",
5321 static void DateTimeConfigurationChangeNotification(
5323 TimeZoneDetection time_zone_detection = TimeZoneDetection::kSkip));
5326 static void CheckCast(
Value* obj);
5337 double ValueOf()
const;
5342 static void CheckCast(
Value* obj);
5357 static void CheckCast(
Value* obj);
5367 bool ValueOf()
const;
5372 static void CheckCast(
Value* obj);
5388 static void CheckCast(
Value* obj);
5404 static void CheckCast(
Value* obj);
5420 kIgnoreCase = 1 << 1,
5421 kMultiline = 1 << 2,
5450 Flags GetFlags()
const;
5455 static void CheckCast(
Value* obj);
5467 void*
Value()
const;
5472 #define V8_INTRINSICS_LIST(F) \ 5473 F(ArrayProto_entries, array_entries_iterator) \ 5474 F(ArrayProto_forEach, array_for_each_iterator) \ 5475 F(ArrayProto_keys, array_keys_iterator) \ 5476 F(ArrayProto_values, array_values_iterator) \ 5477 F(ErrorPrototype, initial_error_prototype) \ 5478 F(IteratorPrototype, initial_iterator_prototype) 5481 #define V8_DECL_INTRINSIC(name, iname) k##name, 5482 V8_INTRINSICS_LIST(V8_DECL_INTRINSIC)
5483 #undef V8_DECL_INTRINSIC 5506 void SetAccessorProperty(
5540 void SetNativeDataProperty(
5542 AccessorSetterCallback setter =
nullptr,
5547 SideEffectType getter_side_effect_type = SideEffectType::kHasSideEffect,
5548 SideEffectType setter_side_effect_type = SideEffectType::kHasSideEffect);
5549 void SetNativeDataProperty(
5550 Local<Name> name, AccessorNameGetterCallback getter,
5551 AccessorNameSetterCallback setter =
nullptr,
5556 SideEffectType getter_side_effect_type = SideEffectType::kHasSideEffect,
5557 SideEffectType setter_side_effect_type = SideEffectType::kHasSideEffect);
5563 void SetLazyDataProperty(
5564 Local<Name> name, AccessorNameGetterCallback getter,
5566 SideEffectType getter_side_effect_type = SideEffectType::kHasSideEffect,
5567 SideEffectType setter_side_effect_type = SideEffectType::kHasSideEffect);
5573 void SetIntrinsicDataProperty(
Local<Name> name, Intrinsic intrinsic,
5928 Isolate* isolate, FunctionCallback callback =
nullptr,
5931 ConstructorBehavior behavior = ConstructorBehavior::kAllow,
5932 SideEffectType side_effect_type = SideEffectType::kHasSideEffect);
5942 Isolate* isolate, FunctionCallback callback,
5945 SideEffectType side_effect_type = SideEffectType::kHasSideEffect);
5965 void SetCallHandler(
5967 SideEffectType side_effect_type = SideEffectType::kHasSideEffect);
5970 void SetLength(
int length);
6008 void SetAcceptAnyReceiver(
bool value);
6022 V8_DEPRECATED(
"This feature is incompatible with ES6+.",
6023 void SetHiddenPrototype(
bool value));
6029 void ReadOnlyPrototype();
6035 void RemovePrototype();
6048 static void CheckCast(
Data* that);
6083 kHasNoSideEffect = 1 << 3,
6101 enumerator(enumerator),
6103 descriptor(descriptor),
6120 enumerator(enumerator),
6122 descriptor(nullptr),
6139 enumerator(enumerator),
6141 descriptor(descriptor),
6171 enumerator(enumerator),
6173 descriptor(descriptor),
6190 enumerator(enumerator),
6192 descriptor(nullptr),
6209 enumerator(enumerator),
6211 descriptor(descriptor),
6278 AccessorSetterCallback setter =
nullptr,
6282 SideEffectType getter_side_effect_type = SideEffectType::kHasSideEffect,
6283 SideEffectType setter_side_effect_type = SideEffectType::kHasSideEffect);
6285 Local<Name> name, AccessorNameGetterCallback getter,
6286 AccessorNameSetterCallback setter =
nullptr,
6290 SideEffectType getter_side_effect_type = SideEffectType::kHasSideEffect,
6291 SideEffectType setter_side_effect_type = SideEffectType::kHasSideEffect);
6331 deleter, enumerator, data));
6352 void SetCallAsFunctionHandler(FunctionCallback callback,
6363 void MarkAsUndetectable();
6382 void SetAccessCheckCallbackAndHandler(
6392 int InternalFieldCount();
6398 void SetInternalFieldCount(
int value);
6403 bool IsImmutableProto();
6409 void SetImmutableProto();
6417 static void CheckCast(
Data* that);
6440 static void CheckCast(
Data* that);
6459 static void CheckCast(
Data* that);
6472 Extension(
const char* name,
const char* source =
nullptr,
int dep_count = 0,
6473 const char** deps =
nullptr,
int source_length = -1);
6474 virtual ~
Extension() {
delete source_; }
6480 const char* name()
const {
return name_; }
6481 size_t source_length()
const {
return source_length_; }
6485 int dependency_count()
const {
return dep_count_; }
6486 const char** dependencies()
const {
return deps_; }
6487 void set_auto_enable(
bool value) { auto_enable_ = value; }
6488 bool auto_enable() {
return auto_enable_; }
6492 void operator=(
const Extension&) =
delete;
6496 size_t source_length_;
6504 "Use unique_ptr version or stop using extension (http://crbug.com/334679).",
6505 void V8_EXPORT RegisterExtension(
Extension* extension));
6507 void V8_EXPORT RegisterExtension(std::unique_ptr<Extension>);
6543 void ConfigureDefaults(uint64_t physical_memory,
6544 uint64_t virtual_memory_limit);
6547 size_t max_semi_space_size_in_kb()
const {
6548 return max_semi_space_size_in_kb_;
6552 void set_max_semi_space_size_in_kb(
size_t limit_in_kb) {
6553 max_semi_space_size_in_kb_ = limit_in_kb;
6556 size_t max_old_space_size()
const {
return max_old_space_size_; }
6557 void set_max_old_space_size(
size_t limit_in_mb) {
6558 max_old_space_size_ = limit_in_mb;
6560 uint32_t* stack_limit()
const {
return stack_limit_; }
6562 void set_stack_limit(uint32_t* value) { stack_limit_ = value; }
6563 size_t code_range_size()
const {
return code_range_size_; }
6564 void set_code_range_size(
size_t limit_in_mb) {
6565 code_range_size_ = limit_in_mb;
6567 V8_DEPRECATE_SOON(
"Zone does not pool memory any more.",
6568 size_t max_zone_pool_size()
const) {
6569 return max_zone_pool_size_;
6571 V8_DEPRECATE_SOON(
"Zone does not pool memory any more.",
6572 void set_max_zone_pool_size(
size_t bytes)) {
6573 max_zone_pool_size_ = bytes;
6578 size_t max_semi_space_size_in_kb_;
6581 size_t max_old_space_size_;
6582 uint32_t* stack_limit_;
6583 size_t code_range_size_;
6584 size_t max_zone_pool_size_;
6591 typedef void (*FatalErrorCallback)(
const char* location,
const char* message);
6593 typedef void (*OOMErrorCallback)(
const char* location,
bool is_heap_oom);
6595 typedef void (*DcheckErrorCallback)(
const char* file,
int line,
6596 const char* message);
6602 typedef void (*LogEventCallback)(
const char* name,
int event);
6633 typedef int* (*CounterLookupCallback)(
const char* name);
6635 typedef void* (*CreateHistogramCallback)(
const char* name,
6640 typedef void (*AddHistogramSampleCallback)(
void* histogram,
int sample);
6643 typedef void (*BeforeCallEnteredCallback)(
Isolate*);
6644 typedef void (*CallCompletedCallback)(
Isolate*);
6713 typedef void (*PromiseHook)(
PromiseHookType type, Local<Promise> promise,
6714 Local<Value> parent);
6717 enum PromiseRejectEvent {
6718 kPromiseRejectWithNoHandler = 0,
6719 kPromiseHandlerAddedAfterReject = 1,
6720 kPromiseRejectAfterResolved = 2,
6721 kPromiseResolveAfterResolved = 3,
6728 : promise_(promise),
6731 stack_trace_(stack_trace) {}
6734 V8_INLINE PromiseRejectEvent GetEvent()
const {
return event_; }
6735 V8_INLINE
Local<Value> GetValue()
const {
return value_; }
6739 PromiseRejectEvent event_;
6747 typedef void (*MicrotasksCompletedCallback)(
Isolate*);
6748 typedef void (*MicrotasksCompletedCallbackWithData)(
Isolate*,
void*);
6749 typedef void (*MicrotaskCallback)(
void* data);
6781 static std::unique_ptr<MicrotaskQueue> New();
6788 virtual void EnqueueMicrotask(
Isolate* isolate,
6794 virtual void EnqueueMicrotask(
v8::Isolate* isolate,
6795 MicrotaskCallback callback,
6796 void* data =
nullptr) = 0;
6810 virtual void AddMicrotasksCompletedCallback(
6811 MicrotasksCompletedCallbackWithData callback,
void* data =
nullptr) = 0;
6816 virtual void RemoveMicrotasksCompletedCallback(
6817 MicrotasksCompletedCallbackWithData callback,
void* data =
nullptr) = 0;
6822 virtual void PerformCheckpoint(
Isolate* isolate) = 0;
6827 virtual bool IsRunningMicrotasks()
const = 0;
6830 friend class internal::MicrotaskQueue;
6847 enum Type { kRunMicrotasks, kDoNotRunMicrotasks };
6856 static void PerformCheckpoint(
Isolate* isolate);
6861 static int GetCurrentDepth(
Isolate* isolate);
6866 static bool IsRunningMicrotasks(
Isolate* isolate);
6873 internal::Isolate*
const isolate_;
6874 internal::MicrotaskQueue*
const microtask_queue_;
6880 typedef void (*FailedAccessCheckCallback)(
Local<Object> target,
6896 typedef bool (*AllowWasmCodeGenerationCallback)(
Local<Context> context,
6907 typedef bool (*WasmThreadsEnabledCallback)(
Local<Context> context);
6919 kGCTypeScavenge = 1 << 0,
6920 kGCTypeMarkSweepCompact = 1 << 1,
6921 kGCTypeIncrementalMarking = 1 << 2,
6922 kGCTypeProcessWeakCallbacks = 1 << 3,
6923 kGCTypeAll = kGCTypeScavenge | kGCTypeMarkSweepCompact |
6924 kGCTypeIncrementalMarking | kGCTypeProcessWeakCallbacks
6942 kNoGCCallbackFlags = 0,
6943 kGCCallbackFlagConstructRetainedObjectInfos = 1 << 1,
6944 kGCCallbackFlagForced = 1 << 2,
6945 kGCCallbackFlagSynchronousPhantomCallbackProcessing = 1 << 3,
6946 kGCCallbackFlagCollectAllAvailableGarbage = 1 << 4,
6947 kGCCallbackFlagCollectAllExternalMemory = 1 << 5,
6948 kGCCallbackScheduleIdleGarbageCollection = 1 << 6,
6953 typedef void (*InterruptCallback)(Isolate* isolate,
void* data);
6963 size_t initial_heap_limit);
6974 size_t total_heap_size() {
return total_heap_size_; }
6975 size_t total_heap_size_executable() {
return total_heap_size_executable_; }
6976 size_t total_physical_size() {
return total_physical_size_; }
6977 size_t total_available_size() {
return total_available_size_; }
6978 size_t used_heap_size() {
return used_heap_size_; }
6979 size_t heap_size_limit() {
return heap_size_limit_; }
6980 size_t malloced_memory() {
return malloced_memory_; }
6981 size_t external_memory() {
return external_memory_; }
6982 size_t peak_malloced_memory() {
return peak_malloced_memory_; }
6983 size_t number_of_native_contexts() {
return number_of_native_contexts_; }
6984 size_t number_of_detached_contexts() {
return number_of_detached_contexts_; }
6993 size_t total_heap_size_;
6994 size_t total_heap_size_executable_;
6995 size_t total_physical_size_;
6996 size_t total_available_size_;
6997 size_t used_heap_size_;
6998 size_t heap_size_limit_;
6999 size_t malloced_memory_;
7000 size_t external_memory_;
7001 size_t peak_malloced_memory_;
7002 bool does_zap_garbage_;
7003 size_t number_of_native_contexts_;
7004 size_t number_of_detached_contexts_;
7014 const char* space_name() {
return space_name_; }
7015 size_t space_size() {
return space_size_; }
7016 size_t space_used_size() {
return space_used_size_; }
7017 size_t space_available_size() {
return space_available_size_; }
7018 size_t physical_space_size() {
return physical_space_size_; }
7021 const char* space_name_;
7023 size_t space_used_size_;
7024 size_t space_available_size_;
7025 size_t physical_space_size_;
7034 const char* object_type() {
return object_type_; }
7035 const char* object_sub_type() {
return object_sub_type_; }
7036 size_t object_count() {
return object_count_; }
7037 size_t object_size() {
return object_size_; }
7040 const char* object_type_;
7041 const char* object_sub_type_;
7042 size_t object_count_;
7043 size_t object_size_;
7051 size_t code_and_metadata_size() {
return code_and_metadata_size_; }
7052 size_t bytecode_and_metadata_size() {
return bytecode_and_metadata_size_; }
7053 size_t external_script_source_size() {
return external_script_source_size_; }
7056 size_t code_and_metadata_size_;
7057 size_t bytecode_and_metadata_size_;
7058 size_t external_script_source_size_;
7073 CODE_ADD_LINE_POS_INFO,
7074 CODE_START_LINE_INFO_RECORDING,
7075 CODE_END_LINE_INFO_RECORDING
7082 enum PositionType { POSITION, STATEMENT_POSITION };
7090 enum CodeType { BYTE_CODE, JIT_CODE };
7121 PositionType position_type;
7132 void* new_code_start;
7147 PERFORMANCE_RESPONSE,
7151 PERFORMANCE_ANIMATION,
7164 kJitCodeEventDefault = 0,
7166 kJitCodeEventEnumExisting = 1
7195 uint16_t class_id) {}
7218 enum EmbedderStackState {
7247 virtual void RegisterV8References(
7248 const std::vector<std::pair<void*, void*> >& embedder_fields) = 0;
7255 virtual void TracePrologue() = 0;
7267 virtual bool AdvanceTracing(
double deadline_in_ms) = 0;
7273 virtual bool IsTracingDone() = 0;
7280 virtual void TraceEpilogue() = 0;
7286 virtual void EnterFinalPause(EmbedderStackState stack_state) = 0;
7297 void FinalizeTracing();
7315 void GarbageCollectionForTesting(EmbedderStackState stack_state);
7326 friend class internal::LocalEmbedderHeapTracer;
7341 void* data_arg =
nullptr)
7342 : callback(
function), data(data_arg) {}
7343 CallbackFunction callback;
7355 typedef void (*CallbackFunction)(
Local<Object> holder,
int index,
7358 void* data_arg =
nullptr)
7359 : callback(
function), data(data_arg) {}
7381 : code_event_handler(
nullptr),
7382 snapshot_blob(
nullptr),
7383 counter_lookup_callback(
nullptr),
7384 create_histogram_callback(
nullptr),
7385 add_histogram_sample_callback(
nullptr),
7386 array_buffer_allocator(
nullptr),
7387 external_references(
nullptr),
7388 allow_atomics_wait(
true),
7389 only_terminate_in_safe_scope(
false) {}
7421 AddHistogramSampleCallback add_histogram_sample_callback;
7460 ~
Scope() { isolate_->Exit(); }
7476 enum OnFailure { CRASH_ON_FAILURE, THROW_ON_FAILURE, DUMP_ON_FAILURE };
7488 OnFailure on_failure_;
7508 void* internal_throws_;
7509 void* internal_assert_;
7510 void* internal_dump_;
7530 internal::Isolate*
const isolate_;
7531 internal::MicrotaskQueue*
const microtask_queue_;
7548 internal::Isolate* isolate_;
7557 kFullGarbageCollection,
7558 kMinorGarbageCollection
7570 kMarkDequeOverflow = 3,
7571 kStoreBufferOverflow = 4,
7572 kSlotsBufferOverflow = 5,
7578 kRegExpPrototypeStickyGetter = 11,
7579 kRegExpPrototypeToString = 12,
7580 kRegExpPrototypeUnicodeGetter = 13,
7585 kPromiseAccept = 18,
7587 kHtmlCommentInExternalScript = 20,
7589 kSloppyModeBlockScopedFunctionRedefinition = 22,
7590 kForInInitializer = 23,
7591 kArrayProtectorDirtied = 24,
7592 kArraySpeciesModified = 25,
7593 kArrayPrototypeConstructorModified = 26,
7594 kArrayInstanceProtoModified = 27,
7595 kArrayInstanceConstructorModified = 28,
7596 kLegacyFunctionDeclaration = 29,
7597 kRegExpPrototypeSourceGetter = 30,
7598 kRegExpPrototypeOldFlagGetter = 31,
7599 kDecimalWithLeadingZeroInStrictMode = 32,
7600 kLegacyDateParser = 33,
7601 kDefineGetterOrSetterWouldThrow = 34,
7602 kFunctionConstructorReturnedUndefined = 35,
7603 kAssigmentExpressionLHSIsCallInSloppy = 36,
7604 kAssigmentExpressionLHSIsCallInStrict = 37,
7605 kPromiseConstructorReturnedUndefined = 38,
7606 kConstructorNonUndefinedPrimitiveReturn = 39,
7607 kLabeledExpressionStatement = 40,
7608 kLineOrParagraphSeparatorAsLineTerminator = 41,
7609 kIndexAccessor = 42,
7610 kErrorCaptureStackTrace = 43,
7611 kErrorPrepareStackTrace = 44,
7612 kErrorStackTraceLimit = 45,
7613 kWebAssemblyInstantiation = 46,
7614 kDeoptimizerDisableSpeculation = 47,
7615 kArrayPrototypeSortJSArrayModifiedPrototype = 48,
7616 kFunctionTokenOffsetTooLongForToString = 49,
7617 kWasmSharedMemory = 50,
7618 kWasmThreadOpcodes = 51,
7619 kAtomicsNotify = 52,
7623 kDateTimeFormat = 56,
7625 kRelativeTimeFormat = 58,
7629 kStringLocaleCompare = 62,
7630 kStringToLocaleUpperCase = 63,
7631 kStringToLocaleLowerCase = 64,
7632 kNumberToLocaleString = 65,
7633 kDateToLocaleString = 66,
7634 kDateToLocaleDateString = 67,
7635 kDateToLocaleTimeString = 68,
7636 kAttemptOverrideReadOnlyOnPrototypeSloppy = 69,
7637 kAttemptOverrideReadOnlyOnPrototypeStrict = 70,
7638 kOptimizedFunctionWithOneShotBytecode = 71,
7639 kRegExpMatchIsTrueishOnNonJSRegExp = 72,
7640 kRegExpMatchIsFalseishOnJSRegExp = 73,
7641 kDateGetTimezoneOffset = 74,
7642 kStringNormalize = 75,
7647 kUseCounterFeatureCount
7650 enum MessageErrorLevel {
7651 kMessageLog = (1 << 0),
7652 kMessageDebug = (1 << 1),
7653 kMessageInfo = (1 << 2),
7654 kMessageError = (1 << 3),
7655 kMessageWarning = (1 << 4),
7656 kMessageAll = kMessageLog | kMessageDebug | kMessageInfo | kMessageError |
7660 typedef void (*UseCounterCallback)(Isolate* isolate,
7661 UseCounterFeature feature);
7677 static Isolate* Allocate();
7682 static void Initialize(Isolate* isolate,
const CreateParams& params);
7693 static Isolate* New(
const CreateParams& params);
7701 static Isolate* GetCurrent();
7712 typedef bool (*AbortOnUncaughtExceptionCallback)(
Isolate*);
7713 void SetAbortOnUncaughtExceptionCallback(
7714 AbortOnUncaughtExceptionCallback callback);
7720 void SetHostImportModuleDynamicallyCallback(
7727 void SetHostInitializeImportMetaObjectCallback(
7775 void DumpAndResetStats();
7784 void DiscardThreadSpecificMetadata();
7790 V8_INLINE
void SetData(uint32_t slot,
void* data);
7796 V8_INLINE
void* GetData(uint32_t slot);
7802 V8_INLINE
static uint32_t GetNumberOfDataSlots();
7810 V8_INLINE
MaybeLocal<T> GetDataFromSnapshotOnce(
size_t index);
7820 size_t NumberOfHeapSpaces();
7837 size_t NumberOfTrackedHeapObjectTypes();
7872 void GetStackSample(
const RegisterState& state,
void** frames,
7873 size_t frames_limit,
SampleInfo* sample_info);
7889 AdjustAmountOfExternalAllocatedMemory(int64_t change_in_bytes);
7895 size_t NumberOfPhantomHandleResetsSinceLastCall();
7906 void SetIdle(
bool is_idle);
7921 V8_DEPRECATED(
"Use GetEnteredOrMicrotaskContext().",
7948 typedef void (*GCCallbackWithData)(
Isolate* isolate,
GCType type,
7960 void AddGCPrologueCallback(GCCallbackWithData callback,
void* data =
nullptr,
7961 GCType gc_type_filter = kGCTypeAll);
7962 void AddGCPrologueCallback(GCCallback callback,
7963 GCType gc_type_filter = kGCTypeAll);
7969 void RemoveGCPrologueCallback(GCCallbackWithData,
void* data =
nullptr);
7970 void RemoveGCPrologueCallback(GCCallback callback);
7993 kTerminatedExecution,
8048 size_t offset_in_bytes, int64_t value,
8049 double timeout_in_ms,
8059 void SetAtomicsWaitCallback(AtomicsWaitCallback callback,
void* data);
8070 void AddGCEpilogueCallback(GCCallbackWithData callback,
void* data =
nullptr,
8071 GCType gc_type_filter = kGCTypeAll);
8072 void AddGCEpilogueCallback(GCCallback callback,
8073 GCType gc_type_filter = kGCTypeAll);
8079 void RemoveGCEpilogueCallback(GCCallbackWithData callback,
8080 void* data =
nullptr);
8081 void RemoveGCEpilogueCallback(GCCallback callback);
8083 typedef size_t (*GetExternallyAllocatedMemoryInBytesCallback)();
8091 void SetGetExternallyAllocatedMemoryInBytesCallback(
8092 GetExternallyAllocatedMemoryInBytesCallback callback);
8101 void TerminateExecution();
8111 bool IsExecutionTerminating();
8127 void CancelTerminateExecution();
8137 void RequestInterrupt(InterruptCallback callback,
void* data);
8154 void SetEventLogger(LogEventCallback that);
8162 void AddBeforeCallEnteredCallback(BeforeCallEnteredCallback callback);
8167 void RemoveBeforeCallEnteredCallback(BeforeCallEnteredCallback callback);
8176 void AddCallCompletedCallback(CallCompletedCallback callback);
8181 void RemoveCallCompletedCallback(CallCompletedCallback callback);
8187 void SetPromiseHook(PromiseHook hook);
8193 void SetPromiseRejectCallback(PromiseRejectCallback callback);
8199 void RunMicrotasks();
8209 void EnqueueMicrotask(MicrotaskCallback callback,
void* data =
nullptr);
8234 void AddMicrotasksCompletedCallback(MicrotasksCompletedCallback callback);
8239 void RemoveMicrotasksCompletedCallback(MicrotasksCompletedCallback callback);
8244 void SetUseCounterCallback(UseCounterCallback callback);
8250 void SetCounterFunction(CounterLookupCallback);
8258 void SetCreateHistogramFunction(CreateHistogramCallback);
8259 void SetAddHistogramSampleFunction(AddHistogramSampleCallback);
8275 bool IdleNotificationDeadline(
double deadline_in_seconds);
8281 void LowMemoryNotification();
8292 int ContextDisposedNotification(
bool dependant_context =
true);
8298 void IsolateInForegroundNotification();
8304 void IsolateInBackgroundNotification();
8311 void EnableMemorySavingsMode();
8316 void DisableMemorySavingsMode();
8325 void SetRAILMode(
RAILMode rail_mode);
8331 void IncreaseHeapLimitForDebugging();
8336 void RestoreOriginalHeapLimit();
8342 bool IsHeapLimitIncreasedForDebugging();
8378 void SetStackLimit(uintptr_t stack_limit);
8395 void GetCodeRange(
void** start,
size_t* length_in_bytes);
8403 void SetFatalErrorHandler(FatalErrorCallback that);
8406 void SetOOMErrorHandler(OOMErrorCallback that);
8431 void AutomaticallyRestoreInitialHeapLimit(
double threshold_percent = 0.5);
8437 void SetAllowCodeGenerationFromStringsCallback(
8444 void SetAllowWasmCodeGenerationCallback(
8445 AllowWasmCodeGenerationCallback callback);
8451 void SetWasmModuleCallback(ExtensionCallback callback);
8452 void SetWasmInstanceCallback(ExtensionCallback callback);
8454 void SetWasmStreamingCallback(WasmStreamingCallback callback);
8456 void SetWasmThreadsEnabledCallback(WasmThreadsEnabledCallback callback);
8473 bool AddMessageListener(MessageCallback that,
8487 bool AddMessageListenerWithErrorLevel(MessageCallback that,
8494 void RemoveMessageListeners(MessageCallback that);
8497 void SetFailedAccessCheckCallbackFunction(FailedAccessCheckCallback);
8503 void SetCaptureStackTraceForUncaughtExceptions(
8504 bool capture,
int frame_limit = 10,
8528 "Use VisitHandlesWithClassIds",
8549 void SetAllowAtomicsWait(
bool allow);
8576 void DateTimeConfigurationChangeNotification(
8577 TimeZoneDetection time_zone_detection = TimeZoneDetection::kSkip);
8588 void LocaleConfigurationChangeNotification();
8596 void*
operator new(
size_t size) =
delete;
8597 void*
operator new[](
size_t size) =
delete;
8598 void operator delete(
void*, size_t) =
delete;
8599 void operator delete[](
void*, size_t) =
delete;
8602 template <
class K,
class V,
class Traits>
8605 internal::Address* GetDataFromSnapshotOnce(
size_t index);
8606 void ReportExternalAllocationLimitReached();
8607 void CheckMemoryPressure();
8637 uintptr_t return_addr_location);
8660 static void SetNativesDataBlob(
StartupData* startup_blob);
8661 static void SetSnapshotDataBlob(
StartupData* startup_blob);
8664 static void SetDcheckErrorHandler(DcheckErrorCallback that);
8670 static void SetFlagsFromString(
const char* str,
int length);
8675 static void SetFlagsFromCommandLine(
int* argc,
8680 static const char* GetVersion();
8686 static bool Initialize();
8698 static void SetReturnAddressLocationResolver(
8710 static bool Dispose();
8719 static bool InitializeICU(
const char* icu_data_file =
nullptr);
8733 static bool InitializeICUDefaultLocation(
const char* exec_path,
8734 const char* icu_data_file =
nullptr);
8752 static void InitializeExternalStartupData(
const char* directory_path);
8753 static void InitializeExternalStartupData(
const char* natives_blob,
8754 const char* snapshot_blob);
8759 static void InitializePlatform(
Platform* platform);
8765 static void ShutdownPlatform();
8787 V8_DEPRECATE_SOON(
"Use TryHandleWebAssemblyTrapPosix",
8788 static bool TryHandleSignal(
int signal_number,
void* info,
8790 #endif // V8_OS_POSIX 8798 static bool EnableWebAssemblyTrapHandler(
bool use_v8_signal_handler);
8803 static internal::Address* GlobalizeReference(internal::Isolate* isolate,
8804 internal::Address* handle);
8805 static internal::Address* GlobalizeTracedReference(internal::Isolate* isolate,
8806 internal::Address* handle,
8807 internal::Address* slot);
8808 static void MoveGlobalReference(internal::Address** from,
8809 internal::Address** to);
8810 static void MoveTracedGlobalReference(internal::Address** from,
8811 internal::Address** to);
8812 static internal::Address* CopyGlobalReference(internal::Address* from);
8813 static void DisposeGlobal(internal::Address* global_handle);
8814 static void DisposeTracedGlobal(internal::Address* global_handle);
8815 static void MakeWeak(internal::Address* location,
void* data,
8817 WeakCallbackType type);
8818 static void MakeWeak(internal::Address** location_addr);
8819 static void* ClearWeak(internal::Address* location);
8820 static void SetFinalizationCallbackTraced(
8821 internal::Address* location,
void* parameter,
8823 static void AnnotateStrongRetainer(internal::Address* location,
8827 static void RegisterExternallyReferencedObject(internal::Address* location,
8828 internal::Isolate* isolate);
8830 template <
class K,
class V,
class T>
8833 static void FromJustIsNothing();
8834 static void ToLocalEmpty();
8835 static void InternalFieldOutOfBounds(
int index);
8838 template <
class T>
friend class Local;
8847 template <
class T>
friend class Eternal;
8849 template <
class T,
class M>
friend class Persistent;
8858 enum class FunctionCodeHandling { kClear, kKeep };
8869 const intptr_t* external_references =
nullptr,
8935 V8_INLINE
size_t AddData(
Local<T> object);
8945 StartupData CreateBlob(FunctionCodeHandling function_code_handling);
8952 size_t AddData(
Local<Context> context, internal::Address
object);
8953 size_t AddData(internal::Address
object);
8971 V8_INLINE
bool IsNothing()
const {
return !has_value_; }
8972 V8_INLINE
bool IsJust()
const {
return has_value_; }
8984 if (V8_UNLIKELY(!IsJust())) V8::FromJustIsNothing();
8991 V8_WARN_UNUSED_RESULT V8_INLINE
bool To(T* out)
const {
8992 if (V8_LIKELY(IsJust())) *out = value_;
9001 if (V8_UNLIKELY(!IsJust())) V8::FromJustIsNothing();
9010 return has_value_ ? value_ : default_value;
9013 V8_INLINE
bool operator==(
const Maybe& other)
const {
9014 return (IsJust() == other.IsJust()) &&
9018 V8_INLINE
bool operator!=(
const Maybe& other)
const {
9019 return !operator==(other);
9023 Maybe() : has_value_(false) {}
9024 explicit Maybe(
const T& t) : has_value_(true), value_(t) {}
9030 friend Maybe<U> Nothing();
9032 friend Maybe<U> Just(
const U& u);
9036 inline Maybe<T> Nothing() {
9041 inline Maybe<T> Just(
const T& t) {
9049 V8_INLINE
bool IsNothing()
const {
return !is_valid_; }
9050 V8_INLINE
bool IsJust()
const {
return is_valid_; }
9052 V8_INLINE
bool operator==(
const Maybe& other)
const {
9053 return IsJust() == other.IsJust();
9056 V8_INLINE
bool operator!=(
const Maybe& other)
const {
9057 return !operator==(other);
9063 Maybe() : is_valid_(
false) {}
9064 explicit Maybe(JustTag) : is_valid_(
true) {}
9095 bool HasCaught()
const;
9105 bool CanContinue()
const;
9119 bool HasTerminated()
const;
9174 void SetVerbose(
bool value);
9179 bool IsVerbose()
const;
9186 void SetCaptureMessage(
bool value);
9200 if (handler ==
nullptr)
return nullptr;
9201 return handler->js_stack_comparable_address_;
9205 void operator=(
const TryCatch&) =
delete;
9210 void*
operator new(
size_t size);
9211 void*
operator new[](
size_t size);
9212 void operator delete(
void*, size_t);
9213 void operator delete[](
void*, size_t);
9215 void ResetInternal();
9217 internal::Isolate* isolate_;
9221 void* js_stack_comparable_address_;
9222 bool is_verbose_ : 1;
9223 bool can_continue_ : 1;
9224 bool capture_message_ : 1;
9226 bool has_terminated_ : 1;
9228 friend class internal::Isolate;
9242 : name_count_(name_count), names_(names) { }
9244 const char** begin()
const {
return &names_[0]; }
9245 const char** end()
const {
return &names_[name_count_]; }
9248 const int name_count_;
9249 const char** names_;
9276 void DetachGlobal();
9323 Isolate* isolate,
size_t context_snapshot_index,
9358 void UseDefaultSecurityToken();
9389 uint32_t GetNumberOfEmbedderDataFields();
9418 V8_INLINE
void* GetAlignedPointerFromEmbedderData(
int index);
9425 void SetAlignedPointerInEmbedderData(
int index,
void* value);
9440 void AllowCodeGenerationFromStrings(
bool allow);
9446 bool IsCodeGenerationFromStringsAllowed();
9453 void SetErrorMessageForCodeGenerationFromStrings(
Local<String> message);
9461 V8_INLINE
MaybeLocal<T> GetDataFromSnapshotOnce(
size_t index);
9472 V8_INLINE ~
Scope() { context_->Exit(); }
9498 return js_stack_comparable_address_;
9502 friend class internal::Isolate;
9505 uintptr_t js_stack_comparable_address_ = 0;
9515 internal::Address* GetDataFromSnapshotOnce(
size_t index);
9517 void* SlowGetAlignedPointerFromEmbedderData(
int index);
9606 void Initialize(
Isolate* isolate);
9608 internal::Isolate* isolate_;
9625 static bool IsLocked(
Isolate* isolate);
9630 static bool IsActive();
9634 void operator=(
const Locker&) =
delete;
9637 void Initialize(
Isolate* isolate);
9641 internal::Isolate* isolate_;
9679 static bool TryUnwindV8Frames(
const UnwindState& unwind_state,
9681 const void* stack_base);
9691 static bool PCIsInV8(
const UnwindState& unwind_state,
void* pc);
9698 return New(isolate, that.val_);
9703 return New(isolate, that.val_);
9707 Local<T>
Local<T>::New(Isolate* isolate,
const TracedGlobal<T>& that) {
9708 return New(isolate, that.val_);
9713 if (that ==
nullptr)
return Local<T>();
9715 internal::Address* p = reinterpret_cast<internal::Address*>(that_ptr);
9716 return Local<T>(reinterpret_cast<T*>(HandleScope::CreateHandle(
9717 reinterpret_cast<internal::Isolate*>(isolate), *p)));
9723 void Eternal<T>::Set(Isolate* isolate, Local<S> handle) {
9725 val_ = reinterpret_cast<T*>(
9726 V8::Eternalize(isolate, reinterpret_cast<Value*>(*handle)));
9730 Local<T> Eternal<T>::Get(Isolate* isolate)
const {
9733 return Local<T>(val_);
9739 if (V8_UNLIKELY(val_ ==
nullptr)) V8::ToLocalEmpty();
9746 #ifdef V8_ENABLE_CHECKS 9747 if (index < 0 || index >= kEmbedderFieldsInWeakCallback) {
9748 V8::InternalFieldOutOfBounds(index);
9751 return embedder_fields_[index];
9756 T* PersistentBase<T>::New(Isolate* isolate, T* that) {
9757 if (that ==
nullptr)
return nullptr;
9758 internal::Address* p = reinterpret_cast<internal::Address*>(that);
9759 return reinterpret_cast<T*>(
9760 V8::GlobalizeReference(reinterpret_cast<internal::Isolate*>(isolate),
9765 template <
class T,
class M>
9766 template <
class S,
class M2>
9767 void Persistent<T, M>::Copy(
const Persistent<S, M2>& that) {
9770 if (that.IsEmpty())
return;
9771 internal::Address* p = reinterpret_cast<internal::Address*>(that.val_);
9772 this->val_ = reinterpret_cast<T*>(V8::CopyGlobalReference(p));
9773 M::Copy(that,
this);
9777 bool PersistentBase<T>::IsIndependent()
const {
9778 typedef internal::Internals I;
9779 if (this->IsEmpty())
return false;
9780 return I::GetNodeFlag(reinterpret_cast<internal::Address*>(this->val_),
9781 I::kNodeIsIndependentShift);
9785 bool PersistentBase<T>::IsNearDeath()
const {
9786 typedef internal::Internals I;
9787 if (this->IsEmpty())
return false;
9788 uint8_t node_state =
9789 I::GetNodeState(reinterpret_cast<internal::Address*>(this->val_));
9790 return node_state == I::kNodeStateIsNearDeathValue ||
9791 node_state == I::kNodeStateIsPendingValue;
9798 if (this->IsEmpty())
return false;
9799 return I::GetNodeState(reinterpret_cast<internal::Address*>(this->val_)) ==
9800 I::kNodeStateIsWeakValue;
9806 if (this->IsEmpty())
return;
9807 V8::DisposeGlobal(reinterpret_cast<internal::Address*>(this->val_));
9817 if (other.IsEmpty())
return;
9818 this->val_ = New(isolate, other.val_);
9825 const PersistentBase<S>& other) {
9828 if (other.IsEmpty())
return;
9829 this->val_ = New(isolate, other.val_);
9834 template <
typename P>
9837 WeakCallbackType type) {
9839 V8::MakeWeak(reinterpret_cast<internal::Address*>(this->val_), parameter,
9840 reinterpret_cast<Callback>(callback), type);
9845 V8::MakeWeak(reinterpret_cast<internal::Address**>(&this->val_));
9849 template <
typename P>
9851 return reinterpret_cast<P*>(
9852 V8::ClearWeak(reinterpret_cast<internal::Address*>(this->val_)));
9857 V8::AnnotateStrongRetainer(reinterpret_cast<internal::Address*>(this->val_),
9863 if (IsEmpty())
return;
9864 V8::RegisterExternallyReferencedObject(
9865 reinterpret_cast<internal::Address*>(this->val_),
9866 reinterpret_cast<internal::Isolate*>(isolate));
9870 void PersistentBase<T>::MarkIndependent() {
9871 typedef internal::Internals I;
9872 if (this->IsEmpty())
return;
9873 I::UpdateNodeFlag(reinterpret_cast<internal::Address*>(this->val_),
true,
9874 I::kNodeIsIndependentShift);
9878 void PersistentBase<T>::MarkActive() {
9879 typedef internal::Internals I;
9880 if (this->IsEmpty())
return;
9881 I::UpdateNodeFlag(reinterpret_cast<internal::Address*>(this->val_),
true,
9882 I::kNodeIsActiveShift);
9889 if (this->IsEmpty())
return;
9890 internal::Address* obj = reinterpret_cast<internal::Address*>(this->val_);
9891 uint8_t* addr = reinterpret_cast<uint8_t*>(obj) + I::kNodeClassIdOffset;
9892 *reinterpret_cast<uint16_t*>(addr) = class_id;
9899 if (this->IsEmpty())
return 0;
9900 internal::Address* obj = reinterpret_cast<internal::Address*>(this->val_);
9901 uint8_t* addr = reinterpret_cast<uint8_t*>(obj) + I::kNodeClassIdOffset;
9902 return *reinterpret_cast<uint16_t*>(addr);
9907 if (other.val_ !=
nullptr) {
9908 V8::MoveGlobalReference(reinterpret_cast<internal::Address**>(&other.val_),
9909 reinterpret_cast<internal::Address**>(&this->val_));
9910 other.val_ =
nullptr;
9920 if (rhs.val_ !=
nullptr) {
9921 this->val_ = rhs.val_;
9922 V8::MoveGlobalReference(
9923 reinterpret_cast<internal::Address**>(&rhs.val_),
9924 reinterpret_cast<internal::Address**>(&this->val_));
9932 T* TracedGlobal<T>::New(Isolate* isolate, T* that, T** slot) {
9933 if (that ==
nullptr)
return nullptr;
9934 internal::Address* p = reinterpret_cast<internal::Address*>(that);
9935 return reinterpret_cast<T*>(V8::GlobalizeTracedReference(
9936 reinterpret_cast<internal::Isolate*>(isolate), p,
9937 reinterpret_cast<internal::Address*>(slot)));
9942 if (IsEmpty())
return;
9943 V8::DisposeTracedGlobal(reinterpret_cast<internal::Address*>(val_));
9952 if (other.IsEmpty())
return;
9953 this->val_ = New(isolate, other.val_, &val_);
9958 if (other.val_ !=
nullptr) {
9959 V8::MoveTracedGlobalReference(
9960 reinterpret_cast<internal::Address**>(&other.val_),
9961 reinterpret_cast<internal::Address**>(&this->val_));
9962 other.val_ =
nullptr;
9972 if (rhs.val_ !=
nullptr) {
9973 this->val_ = rhs.val_;
9974 V8::MoveTracedGlobalReference(
9975 reinterpret_cast<internal::Address**>(&rhs.val_),
9976 reinterpret_cast<internal::Address**>(&this->val_));
9986 if (IsEmpty())
return;
9987 internal::Address* obj = reinterpret_cast<internal::Address*>(this->val_);
9988 uint8_t* addr = reinterpret_cast<uint8_t*>(obj) + I::kNodeClassIdOffset;
9989 *reinterpret_cast<uint16_t*>(addr) = class_id;
9995 if (IsEmpty())
return 0;
9996 internal::Address* obj = reinterpret_cast<internal::Address*>(this->val_);
9997 uint8_t* addr = reinterpret_cast<uint8_t*>(obj) + I::kNodeClassIdOffset;
9998 return *reinterpret_cast<uint16_t*>(addr);
10004 V8::SetFinalizationCallbackTraced(
10005 reinterpret_cast<internal::Address*>(this->val_), parameter, callback);
10008 template <
typename T>
10011 template<
typename T>
10012 template<
typename S>
10013 void ReturnValue<T>::Set(
const Persistent<S>& handle) {
10015 if (V8_UNLIKELY(handle.IsEmpty())) {
10016 *value_ = GetDefaultValue();
10018 *value_ = *reinterpret_cast<internal::Address*>(*handle);
10022 template <
typename T>
10023 template <
typename S>
10024 void ReturnValue<T>::Set(
const Global<S>& handle) {
10026 if (V8_UNLIKELY(handle.IsEmpty())) {
10027 *value_ = GetDefaultValue();
10029 *value_ = *reinterpret_cast<internal::Address*>(*handle);
10033 template <
typename T>
10034 template <
typename S>
10035 void ReturnValue<T>::Set(
const TracedGlobal<S>& handle) {
10037 if (V8_UNLIKELY(handle.IsEmpty())) {
10038 *value_ = GetDefaultValue();
10040 *value_ = *reinterpret_cast<internal::Address*>(*handle);
10044 template <
typename T>
10045 template <
typename S>
10046 void ReturnValue<T>::Set(
const Local<S> handle) {
10048 if (V8_UNLIKELY(handle.IsEmpty())) {
10049 *value_ = GetDefaultValue();
10051 *value_ = *reinterpret_cast<internal::Address*>(*handle);
10055 template<
typename T>
10056 void ReturnValue<T>::Set(
double i) {
10057 TYPE_CHECK(T, Number);
10058 Set(Number::New(GetIsolate(), i));
10061 template<
typename T>
10062 void ReturnValue<T>::Set(int32_t i) {
10063 TYPE_CHECK(T, Integer);
10064 typedef internal::Internals I;
10065 if (V8_LIKELY(I::IsValidSmi(i))) {
10066 *value_ = I::IntToSmi(i);
10069 Set(Integer::New(GetIsolate(), i));
10072 template<
typename T>
10073 void ReturnValue<T>::Set(uint32_t i) {
10074 TYPE_CHECK(T, Integer);
10076 bool fits_into_int32_t = (i & (1U << 31)) == 0;
10077 if (V8_LIKELY(fits_into_int32_t)) {
10078 Set(static_cast<int32_t>(i));
10081 Set(Integer::NewFromUnsigned(GetIsolate(), i));
10084 template<
typename T>
10085 void ReturnValue<T>::Set(
bool value) {
10086 TYPE_CHECK(T, Boolean);
10087 typedef internal::Internals I;
10090 root_index = I::kTrueValueRootIndex;
10092 root_index = I::kFalseValueRootIndex;
10094 *value_ = *I::GetRoot(GetIsolate(), root_index);
10097 template<
typename T>
10098 void ReturnValue<T>::SetNull() {
10099 TYPE_CHECK(T, Primitive);
10100 typedef internal::Internals I;
10101 *value_ = *I::GetRoot(GetIsolate(), I::kNullValueRootIndex);
10104 template<
typename T>
10105 void ReturnValue<T>::SetUndefined() {
10106 TYPE_CHECK(T, Primitive);
10107 typedef internal::Internals I;
10108 *value_ = *I::GetRoot(GetIsolate(), I::kUndefinedValueRootIndex);
10111 template<
typename T>
10112 void ReturnValue<T>::SetEmptyString() {
10113 TYPE_CHECK(T, String);
10114 typedef internal::Internals I;
10115 *value_ = *I::GetRoot(GetIsolate(), I::kEmptyStringRootIndex);
10118 template <
typename T>
10119 Isolate* ReturnValue<T>::GetIsolate()
const {
10121 return *reinterpret_cast<Isolate**>(&value_[-2]);
10124 template <
typename T>
10125 Local<Value> ReturnValue<T>::Get()
const {
10126 typedef internal::Internals I;
10127 if (*value_ == *I::GetRoot(GetIsolate(), I::kTheHoleValueRootIndex))
10128 return Local<Value>(*Undefined(GetIsolate()));
10132 template <
typename T>
10133 template <
typename S>
10134 void ReturnValue<T>::Set(S* whatever) {
10136 TYPE_CHECK(S*, Primitive);
10139 template <
typename T>
10140 internal::Address ReturnValue<T>::GetDefaultValue() {
10145 template <
typename T>
10146 FunctionCallbackInfo<T>::FunctionCallbackInfo(internal::Address* implicit_args,
10147 internal::Address* values,
10149 : implicit_args_(implicit_args), values_(values), length_(length) {}
10151 template<
typename T>
10153 if (i < 0 || length_ <= i)
return Local<Value>(*Undefined(GetIsolate()));
10154 return Local<Value>(reinterpret_cast<Value*>(values_ - i));
10158 template<
typename T>
10160 return Local<Object>(reinterpret_cast<Object*>(values_ + 1));
10164 template<
typename T>
10167 &implicit_args_[kHolderIndex]));
10170 template <
typename T>
10173 reinterpret_cast<Value*>(&implicit_args_[kNewTargetIndex]));
10176 template <
typename T>
10178 return Local<Value>(reinterpret_cast<Value*>(&implicit_args_[kDataIndex]));
10182 template<
typename T>
10184 return *reinterpret_cast<Isolate**>(&implicit_args_[kIsolateIndex]);
10188 template<
typename T>
10194 template<
typename T>
10196 return !NewTarget()->IsUndefined();
10200 template<
typename T>
10205 ScriptOrigin::ScriptOrigin(
Local<Value> resource_name,
10214 : resource_name_(resource_name),
10215 resource_line_offset_(resource_line_offset),
10216 resource_column_offset_(resource_column_offset),
10217 options_(!resource_is_shared_cross_origin.IsEmpty() &&
10218 resource_is_shared_cross_origin->IsTrue(),
10219 !resource_is_opaque.IsEmpty() && resource_is_opaque->IsTrue(),
10220 !is_wasm.IsEmpty() && is_wasm->IsTrue(),
10221 !is_module.IsEmpty() && is_module->IsTrue()),
10222 script_id_(script_id),
10223 source_map_url_(source_map_url),
10224 host_defined_options_(host_defined_options) {}
10226 Local<Value> ScriptOrigin::ResourceName()
const {
return resource_name_; }
10228 Local<PrimitiveArray> ScriptOrigin::HostDefinedOptions()
const {
10229 return host_defined_options_;
10232 Local<Integer> ScriptOrigin::ResourceLineOffset()
const {
10233 return resource_line_offset_;
10237 Local<Integer> ScriptOrigin::ResourceColumnOffset()
const {
10238 return resource_column_offset_;
10242 Local<Integer> ScriptOrigin::ScriptID()
const {
return script_id_; }
10245 Local<Value> ScriptOrigin::SourceMapUrl()
const {
return source_map_url_; }
10247 ScriptCompiler::Source::Source(Local<String>
string,
const ScriptOrigin& origin,
10249 : source_string(string),
10250 resource_name(origin.ResourceName()),
10251 resource_line_offset(origin.ResourceLineOffset()),
10252 resource_column_offset(origin.ResourceColumnOffset()),
10253 resource_options(origin.Options()),
10254 source_map_url(origin.SourceMapUrl()),
10255 host_defined_options(origin.HostDefinedOptions()),
10256 cached_data(data) {}
10258 ScriptCompiler::Source::Source(Local<String>
string,
10260 : source_string(string), cached_data(data) {}
10263 ScriptCompiler::Source::~Source() {
10264 delete cached_data;
10268 const ScriptCompiler::CachedData* ScriptCompiler::Source::GetCachedData()
10270 return cached_data;
10273 const ScriptOriginOptions& ScriptCompiler::Source::GetResourceOptions()
const {
10274 return resource_options;
10277 Local<Boolean> Boolean::New(Isolate* isolate,
bool value) {
10278 return value ? True(isolate) : False(isolate);
10281 void Template::Set(Isolate* isolate,
const char* name, Local<Data> value) {
10287 FunctionTemplate* FunctionTemplate::Cast(Data* data) {
10288 #ifdef V8_ENABLE_CHECKS 10291 return reinterpret_cast<FunctionTemplate*>(data);
10294 ObjectTemplate* ObjectTemplate::Cast(Data* data) {
10295 #ifdef V8_ENABLE_CHECKS 10298 return reinterpret_cast<ObjectTemplate*>(data);
10301 Signature* Signature::Cast(Data* data) {
10302 #ifdef V8_ENABLE_CHECKS 10305 return reinterpret_cast<Signature*>(data);
10308 AccessorSignature* AccessorSignature::Cast(Data* data) {
10309 #ifdef V8_ENABLE_CHECKS 10312 return reinterpret_cast<AccessorSignature*>(data);
10316 #if !defined(V8_ENABLE_CHECKS) && !defined(V8_COMPRESS_POINTERS) 10317 typedef internal::Address A;
10319 A obj = *reinterpret_cast<A*>(
this);
10322 auto instance_type = I::GetInstanceType(obj);
10323 if (instance_type == I::kJSObjectType ||
10324 instance_type == I::kJSApiObjectType ||
10325 instance_type == I::kJSSpecialApiObjectType) {
10326 int offset = I::kJSObjectHeaderSize + (I::kEmbedderDataSlotSize * index);
10327 A value = I::ReadTaggedAnyField(obj, offset);
10328 internal::Isolate* isolate =
10329 internal::IsolateFromNeverReadOnlySpaceObject(obj);
10330 A* result = HandleScope::CreateHandle(isolate, value);
10331 return Local<Value>(reinterpret_cast<Value*>(result));
10334 return SlowGetInternalField(index);
10339 #if !defined(V8_ENABLE_CHECKS) && !defined(V8_COMPRESS_POINTERS) 10340 typedef internal::Address A;
10342 A obj = *reinterpret_cast<A*>(
this);
10345 auto instance_type = I::GetInstanceType(obj);
10346 if (V8_LIKELY(instance_type == I::kJSObjectType ||
10347 instance_type == I::kJSApiObjectType ||
10348 instance_type == I::kJSSpecialApiObjectType)) {
10349 int offset = I::kJSObjectHeaderSize + (I::kEmbedderDataSlotSize * index);
10350 return I::ReadRawField<void*>(obj, offset);
10353 return SlowGetAlignedPointerFromInternalField(index);
10357 #ifdef V8_ENABLE_CHECKS 10360 return static_cast<String*>(value);
10365 typedef internal::Address S;
10367 I::CheckInitialized(isolate);
10368 S* slot = I::GetRoot(isolate, I::kEmptyStringRootIndex);
10374 typedef internal::Address A;
10376 A obj = *reinterpret_cast<const A*>(
this);
10379 if (I::IsExternalTwoByteString(I::GetInstanceType(obj))) {
10380 void* value = I::ReadRawField<void*>(obj, I::kStringResourceOffset);
10381 result = reinterpret_cast<String::ExternalStringResource*>(value);
10383 result = GetExternalStringResourceSlow();
10385 #ifdef V8_ENABLE_CHECKS 10386 VerifyExternalStringResource(result);
10393 String::Encoding* encoding_out)
const {
10394 typedef internal::Address A;
10396 A obj = *reinterpret_cast<const A*>(
this);
10397 int type = I::GetInstanceType(obj) & I::kFullStringRepresentationMask;
10398 *encoding_out = static_cast<Encoding>(type & I::kStringEncodingMask);
10400 if (type == I::kExternalOneByteRepresentationTag ||
10401 type == I::kExternalTwoByteRepresentationTag) {
10402 void* value = I::ReadRawField<void*>(obj, I::kStringResourceOffset);
10403 resource = static_cast<ExternalStringResourceBase*>(value);
10405 resource = GetExternalStringResourceBaseSlow(encoding_out);
10407 #ifdef V8_ENABLE_CHECKS 10408 VerifyExternalStringResourceBase(resource, *encoding_out);
10415 #ifdef V8_ENABLE_CHECKS 10416 return FullIsUndefined();
10418 return QuickIsUndefined();
10422 bool Value::QuickIsUndefined()
const {
10423 typedef internal::Address A;
10425 A obj = *reinterpret_cast<const A*>(
this);
10426 if (!I::HasHeapObjectTag(obj))
return false;
10427 if (I::GetInstanceType(obj) != I::kOddballType)
return false;
10428 return (I::GetOddballKind(obj) == I::kUndefinedOddballKind);
10433 #ifdef V8_ENABLE_CHECKS 10434 return FullIsNull();
10436 return QuickIsNull();
10440 bool Value::QuickIsNull()
const {
10441 typedef internal::Address A;
10443 A obj = *reinterpret_cast<const A*>(
this);
10444 if (!I::HasHeapObjectTag(obj))
return false;
10445 if (I::GetInstanceType(obj) != I::kOddballType)
return false;
10446 return (I::GetOddballKind(obj) == I::kNullOddballKind);
10450 #ifdef V8_ENABLE_CHECKS 10451 return FullIsNull() || FullIsUndefined();
10453 return QuickIsNullOrUndefined();
10457 bool Value::QuickIsNullOrUndefined()
const {
10458 typedef internal::Address A;
10460 A obj = *reinterpret_cast<const A*>(
this);
10461 if (!I::HasHeapObjectTag(obj))
return false;
10462 if (I::GetInstanceType(obj) != I::kOddballType)
return false;
10463 int kind = I::GetOddballKind(obj);
10464 return kind == I::kNullOddballKind || kind == I::kUndefinedOddballKind;
10468 #ifdef V8_ENABLE_CHECKS 10469 return FullIsString();
10471 return QuickIsString();
10475 bool Value::QuickIsString()
const {
10476 typedef internal::Address A;
10478 A obj = *reinterpret_cast<const A*>(
this);
10479 if (!I::HasHeapObjectTag(obj))
return false;
10480 return (I::GetInstanceType(obj) < I::kFirstNonstringType);
10484 template <
class T> Value* Value::Cast(T* value) {
10485 return static_cast<Value*>(value);
10489 Boolean* Boolean::Cast(
v8::Value* value) {
10490 #ifdef V8_ENABLE_CHECKS 10493 return static_cast<Boolean*>(value);
10498 #ifdef V8_ENABLE_CHECKS 10501 return static_cast<Name*>(value);
10505 Symbol* Symbol::Cast(
v8::Value* value) {
10506 #ifdef V8_ENABLE_CHECKS 10509 return static_cast<Symbol*>(value);
10513 Private* Private::Cast(Data* data) {
10514 #ifdef V8_ENABLE_CHECKS 10517 return reinterpret_cast<Private*>(data);
10521 Number* Number::Cast(
v8::Value* value) {
10522 #ifdef V8_ENABLE_CHECKS 10525 return static_cast<Number*>(value);
10529 Integer* Integer::Cast(
v8::Value* value) {
10530 #ifdef V8_ENABLE_CHECKS 10533 return static_cast<Integer*>(value);
10538 #ifdef V8_ENABLE_CHECKS 10541 return static_cast<Int32*>(value);
10545 Uint32* Uint32::Cast(
v8::Value* value) {
10546 #ifdef V8_ENABLE_CHECKS 10549 return static_cast<Uint32*>(value);
10552 BigInt* BigInt::Cast(
v8::Value* value) {
10553 #ifdef V8_ENABLE_CHECKS 10556 return static_cast<BigInt*>(value);
10560 #ifdef V8_ENABLE_CHECKS 10563 return static_cast<Date*>(value);
10567 StringObject* StringObject::Cast(
v8::Value* value) {
10568 #ifdef V8_ENABLE_CHECKS 10571 return static_cast<StringObject*>(value);
10575 SymbolObject* SymbolObject::Cast(
v8::Value* value) {
10576 #ifdef V8_ENABLE_CHECKS 10579 return static_cast<SymbolObject*>(value);
10583 NumberObject* NumberObject::Cast(
v8::Value* value) {
10584 #ifdef V8_ENABLE_CHECKS 10587 return static_cast<NumberObject*>(value);
10590 BigIntObject* BigIntObject::Cast(
v8::Value* value) {
10591 #ifdef V8_ENABLE_CHECKS 10594 return static_cast<BigIntObject*>(value);
10597 BooleanObject* BooleanObject::Cast(
v8::Value* value) {
10598 #ifdef V8_ENABLE_CHECKS 10601 return static_cast<BooleanObject*>(value);
10605 RegExp* RegExp::Cast(
v8::Value* value) {
10606 #ifdef V8_ENABLE_CHECKS 10609 return static_cast<RegExp*>(value);
10613 Object* Object::Cast(
v8::Value* value) {
10614 #ifdef V8_ENABLE_CHECKS 10617 return static_cast<Object*>(value);
10622 #ifdef V8_ENABLE_CHECKS 10625 return static_cast<Array*>(value);
10630 #ifdef V8_ENABLE_CHECKS 10633 return static_cast<Map*>(value);
10638 #ifdef V8_ENABLE_CHECKS 10641 return static_cast<Set*>(value);
10645 Promise* Promise::Cast(
v8::Value* value) {
10646 #ifdef V8_ENABLE_CHECKS 10649 return static_cast<Promise*>(value);
10654 #ifdef V8_ENABLE_CHECKS 10657 return static_cast<Proxy*>(value);
10660 WasmModuleObject* WasmModuleObject::Cast(
v8::Value* value) {
10661 #ifdef V8_ENABLE_CHECKS 10664 return static_cast<WasmModuleObject*>(value);
10667 Promise::Resolver* Promise::Resolver::Cast(
v8::Value* value) {
10668 #ifdef V8_ENABLE_CHECKS 10671 return static_cast<Promise::Resolver*>(value);
10675 ArrayBuffer* ArrayBuffer::Cast(
v8::Value* value) {
10676 #ifdef V8_ENABLE_CHECKS 10679 return static_cast<ArrayBuffer*>(value);
10683 ArrayBufferView* ArrayBufferView::Cast(
v8::Value* value) {
10684 #ifdef V8_ENABLE_CHECKS 10687 return static_cast<ArrayBufferView*>(value);
10691 TypedArray* TypedArray::Cast(
v8::Value* value) {
10692 #ifdef V8_ENABLE_CHECKS 10695 return static_cast<TypedArray*>(value);
10699 Uint8Array* Uint8Array::Cast(
v8::Value* value) {
10700 #ifdef V8_ENABLE_CHECKS 10703 return static_cast<Uint8Array*>(value);
10707 Int8Array* Int8Array::Cast(
v8::Value* value) {
10708 #ifdef V8_ENABLE_CHECKS 10711 return static_cast<Int8Array*>(value);
10715 Uint16Array* Uint16Array::Cast(
v8::Value* value) {
10716 #ifdef V8_ENABLE_CHECKS 10719 return static_cast<Uint16Array*>(value);
10723 Int16Array* Int16Array::Cast(
v8::Value* value) {
10724 #ifdef V8_ENABLE_CHECKS 10727 return static_cast<Int16Array*>(value);
10731 Uint32Array* Uint32Array::Cast(
v8::Value* value) {
10732 #ifdef V8_ENABLE_CHECKS 10735 return static_cast<Uint32Array*>(value);
10739 Int32Array* Int32Array::Cast(
v8::Value* value) {
10740 #ifdef V8_ENABLE_CHECKS 10743 return static_cast<Int32Array*>(value);
10747 Float32Array* Float32Array::Cast(
v8::Value* value) {
10748 #ifdef V8_ENABLE_CHECKS 10751 return static_cast<Float32Array*>(value);
10755 Float64Array* Float64Array::Cast(
v8::Value* value) {
10756 #ifdef V8_ENABLE_CHECKS 10759 return static_cast<Float64Array*>(value);
10762 BigInt64Array* BigInt64Array::Cast(
v8::Value* value) {
10763 #ifdef V8_ENABLE_CHECKS 10766 return static_cast<BigInt64Array*>(value);
10769 BigUint64Array* BigUint64Array::Cast(
v8::Value* value) {
10770 #ifdef V8_ENABLE_CHECKS 10773 return static_cast<BigUint64Array*>(value);
10776 Uint8ClampedArray* Uint8ClampedArray::Cast(
v8::Value* value) {
10777 #ifdef V8_ENABLE_CHECKS 10780 return static_cast<Uint8ClampedArray*>(value);
10784 DataView* DataView::Cast(
v8::Value* value) {
10785 #ifdef V8_ENABLE_CHECKS 10788 return static_cast<DataView*>(value);
10792 SharedArrayBuffer* SharedArrayBuffer::Cast(
v8::Value* value) {
10793 #ifdef V8_ENABLE_CHECKS 10796 return static_cast<SharedArrayBuffer*>(value);
10800 Function* Function::Cast(
v8::Value* value) {
10801 #ifdef V8_ENABLE_CHECKS 10804 return static_cast<Function*>(value);
10808 External* External::Cast(
v8::Value* value) {
10809 #ifdef V8_ENABLE_CHECKS 10812 return static_cast<External*>(value);
10816 template<
typename T>
10818 return *reinterpret_cast<Isolate**>(&args_[kIsolateIndex]);
10822 template<
typename T>
10824 return Local<Value>(reinterpret_cast<Value*>(&args_[kDataIndex]));
10828 template<
typename T>
10830 return Local<Object>(reinterpret_cast<Object*>(&args_[kThisIndex]));
10834 template<
typename T>
10836 return Local<Object>(reinterpret_cast<Object*>(&args_[kHolderIndex]));
10840 template<
typename T>
10845 template <
typename T>
10848 if (args_[kShouldThrowOnErrorIndex] !=
10849 I::IntToSmi(I::kInferShouldThrowMode)) {
10850 return args_[kShouldThrowOnErrorIndex] != I::IntToSmi(I::kDontThrow);
10852 return v8::internal::ShouldThrowOnError(
10853 reinterpret_cast<v8::internal::Isolate*>(GetIsolate()));
10857 typedef internal::Address S;
10859 I::CheckInitialized(isolate);
10860 S* slot = I::GetRoot(isolate, I::kUndefinedValueRootIndex);
10865 Local<Primitive> Null(Isolate* isolate) {
10866 typedef internal::Address S;
10867 typedef internal::Internals I;
10868 I::CheckInitialized(isolate);
10869 S* slot = I::GetRoot(isolate, I::kNullValueRootIndex);
10870 return Local<Primitive>(reinterpret_cast<Primitive*>(slot));
10874 Local<Boolean> True(Isolate* isolate) {
10875 typedef internal::Address S;
10876 typedef internal::Internals I;
10877 I::CheckInitialized(isolate);
10878 S* slot = I::GetRoot(isolate, I::kTrueValueRootIndex);
10879 return Local<Boolean>(reinterpret_cast<Boolean*>(slot));
10883 Local<Boolean> False(Isolate* isolate) {
10884 typedef internal::Address S;
10885 typedef internal::Internals I;
10886 I::CheckInitialized(isolate);
10887 S* slot = I::GetRoot(isolate, I::kFalseValueRootIndex);
10888 return Local<Boolean>(reinterpret_cast<Boolean*>(slot));
10894 I::SetEmbedderData(
this, slot, data);
10900 return I::GetEmbedderData(
this, slot);
10906 return I::kNumIsolateDataSlots;
10911 T* data = reinterpret_cast<T*>(GetDataFromSnapshotOnce(index));
10912 if (data) internal::PerformCastCheck(data);
10917 int64_t change_in_bytes) {
10919 constexpr int64_t kMemoryReducerActivationLimit = 32 * 1024 * 1024;
10920 int64_t* external_memory = reinterpret_cast<int64_t*>(
10921 reinterpret_cast<uint8_t*>(
this) + I::kExternalMemoryOffset);
10922 int64_t* external_memory_limit = reinterpret_cast<int64_t*>(
10923 reinterpret_cast<uint8_t*>(
this) + I::kExternalMemoryLimitOffset);
10924 int64_t* external_memory_at_last_mc =
10925 reinterpret_cast<int64_t*>(reinterpret_cast<uint8_t*>(
this) +
10926 I::kExternalMemoryAtLastMarkCompactOffset);
10928 const int64_t amount = *external_memory + change_in_bytes;
10929 *external_memory = amount;
10931 int64_t allocation_diff_since_last_mc =
10932 *external_memory - *external_memory_at_last_mc;
10935 if (allocation_diff_since_last_mc > kMemoryReducerActivationLimit) {
10936 CheckMemoryPressure();
10939 if (change_in_bytes < 0) {
10940 const int64_t lower_limit = *external_memory_limit + change_in_bytes;
10941 if (lower_limit > I::kExternalAllocationSoftLimit)
10942 *external_memory_limit = lower_limit;
10943 }
else if (change_in_bytes > 0 && amount > *external_memory_limit) {
10944 ReportExternalAllocationLimitReached();
10946 return *external_memory;
10950 #if !defined(V8_ENABLE_CHECKS) && !defined(V8_COMPRESS_POINTERS) 10951 typedef internal::Address A;
10953 internal::Isolate* isolate = internal::IsolateFromNeverReadOnlySpaceObject(
10954 *reinterpret_cast<A*>(
this));
10956 HandleScope::CreateHandle(isolate, I::ReadEmbedderData<A>(
this, index));
10957 return Local<Value>(reinterpret_cast<Value*>(result));
10959 return SlowGetEmbedderData(index);
10965 #if !defined(V8_ENABLE_CHECKS) && !defined(V8_COMPRESS_POINTERS) 10967 return I::ReadEmbedderData<void*>(
this, index);
10969 return SlowGetAlignedPointerFromEmbedderData(index);
10975 T* data = reinterpret_cast<T*>(GetDataFromSnapshotOnce(index));
10976 if (data) internal::PerformCastCheck(data);
10982 T* object_ptr = *object;
10983 internal::Address* p = reinterpret_cast<internal::Address*>(object_ptr);
10984 return AddData(context, *p);
10989 T* object_ptr = *object;
10990 internal::Address* p = reinterpret_cast<internal::Address*>(object_ptr);
10991 return AddData(*p);
11012 #endif // INCLUDE_V8_H_ V8_INLINE uint16_t WrapperClassId() const
Definition: v8.h:9897
virtual void Unlock() const
Definition: v8.h:2792
void(* HostInitializeImportMetaObjectCallback)(Local< Context > context, Local< Module > module, Local< Object > meta)
Definition: v8.h:6680
UseCounterFeature
Definition: v8.h:7566
IntegrityLevel
Definition: v8.h:3349
void(* IndexedPropertyDeleterCallback)(uint32_t index, const PropertyCallbackInfo< Boolean > &info)
Definition: v8.h:5778
GCCallbackFlags
Definition: v8.h:6941
constexpr size_t size() const
Definition: v8.h:4416
KeyConversionMode
Definition: v8.h:3344
static V8_INLINE Local< Context > CreationContext(const PersistentBase< Object > &object)
Definition: v8.h:3721
bool only_terminate_in_safe_scope
Definition: v8.h:7446
virtual bool IsRootForNonTracingGC(const v8::TracedGlobal< v8::Value > &handle)
Definition: v8.h:7305
V8_INLINE bool IsNullOrUndefined() const
Definition: v8.h:10449
uintptr_t JSStackComparableAddress() const
Definition: v8.h:9497
WriteOptions
Definition: v8.h:2718
NewStringType
Definition: v8.h:2639
V8_INLINE MaybeLocal< T > GetDataFromSnapshotOnce(size_t index)
void(* GenericNamedPropertyDefinerCallback)(Local< Name > property, const PropertyDescriptor &desc, const PropertyCallbackInfo< Value > &info)
Definition: v8.h:5727
V8_INLINE void Clear()
Definition: v8.h:204
V8_INLINE bool IsString() const
Definition: v8.h:10467
static V8_INLINE int InternalFieldCount(const TracedGlobal< Object > &object)
Definition: v8.h:3594
static V8_INLINE void * GetAlignedPointerFromInternalField(const TracedGlobal< Object > &object, int index)
Definition: v8.h:3618
GarbageCollectionType
Definition: v8.h:7556
V8_INLINE Local< T > Escape(Local< T > value)
Definition: v8.h:1050
IndexFilter
Definition: v8.h:3338
PropertyAttribute
Definition: v8.h:3247
static V8_INLINE int InternalFieldCount(const PersistentBase< Object > &object)
Definition: v8.h:3588
virtual bool IsCacheable() const
Definition: v8.h:2763
V8_INLINE int Length() const
Definition: v8.h:10201
static V8_INLINE Local< T > Cast(Local< S > that)
Definition: v8.h:255
KeyCollectionMode
Definition: v8.h:3332
V8_INLINE Global(Isolate *isolate, const PersistentBase< S > &that)
Definition: v8.h:786
V8_INLINE bool IsWeak() const
Definition: v8.h:9796
V8_INLINE TracedGlobal & operator=(TracedGlobal< S > &&rhs)
static V8_INLINE void * GetAlignedPointerFromInternalField(const PersistentBase< Object > &object, int index)
Definition: v8.h:3612
void(* GenericNamedPropertyDeleterCallback)(Local< Name > property, const PropertyCallbackInfo< Boolean > &info)
Definition: v8.h:5695
Definition: v8-internal.h:120
EmbedderDataFields
Definition: v8.h:9384
void(* IndexedPropertyDescriptorCallback)(uint32_t index, const PropertyCallbackInfo< Value > &info)
Definition: v8.h:5801
size_t does_zap_garbage()
Definition: v8.h:6990
V8_INLINE void SetFinalizationCallback(void *parameter, WeakCallbackInfo< void >::Callback callback)
Definition: v8.h:10002
Local< T > Get(Isolate *isolate) const
Definition: v8.h:899
void(* AccessorGetterCallback)(Local< String > property, const PropertyCallbackInfo< Value > &info)
Definition: v8.h:3263
V8_INLINE bool IsEmpty() const
Definition: v8.h:199
Definition: v8-util.h:160
V8_INLINE Local< Object > Holder() const
Definition: v8.h:10165
V8_INLINE Persistent(Isolate *isolate, Local< S > that)
Definition: v8.h:680
V8_INLINE Local< Value > NewTarget() const
Definition: v8.h:10171
V8_INLINE Isolate * GetIsolate() const
Definition: v8.h:10817
V8_INLINE T FromJust() const
Definition: v8.h:9000
V8_INLINE bool ShouldThrowOnError() const
Definition: v8.h:10846
V8_INLINE void SetWeak()
Definition: v8.h:9844
PropertyHandlerFlags
Definition: v8.h:6057
JitCodeEventOptions
Definition: v8.h:7163
V8_INLINE Local< S > As() const
Definition: v8.h:270
static void * JSStackComparableAddress(TryCatch *handler)
Definition: v8.h:9199
bool(* EntropySource)(unsigned char *buffer, size_t length)
Definition: v8.h:8621
V8_DEPRECATE_SOON("Used TracedGlobal and EmbedderHeapTracer::RegisterEmbedderReference", V8_INLINE void RegisterExternalReference(Isolate *isolate) const)
static V8_WARN_UNUSED_RESULT MaybeLocal< String > NewFromUtf8(Isolate *isolate, const char *data, v8::NewStringType type, int length=-1)
V8_INLINE void * GetAlignedPointerFromEmbedderData(int index)
Definition: v8.h:10964
void(* IndexedPropertyDefinerCallback)(uint32_t index, const PropertyDescriptor &desc, const PropertyCallbackInfo< Value > &info)
Definition: v8.h:5794
V8_INLINE Global()
Definition: v8.h:767
void SetIndexedPropertyHandler(IndexedPropertyGetterCallback getter, IndexedPropertySetterCallback setter=nullptr, IndexedPropertyQueryCallback query=nullptr, IndexedPropertyDeleterCallback deleter=nullptr, IndexedPropertyEnumeratorCallback enumerator=nullptr, Local< Value > data=Local< Value >())
Definition: v8.h:6323
V8_INLINE Unlocker(Isolate *isolate)
Definition: v8.h:9602
V8_INLINE Persistent(const Persistent &that)
Definition: v8.h:700
V8_INLINE void Reset()
Definition: v8.h:9941
V8_WARN_UNUSED_RESULT V8_INLINE bool ToLocal(Local< S > *out) const
Definition: v8.h:354
bool(* AccessCheckCallback)(Local< Context > accessing_context, Local< Object > accessed_object, Local< Value > data)
Definition: v8.h:5820
CreateHistogramCallback create_histogram_callback
Definition: v8.h:7420
void(* GenericNamedPropertyQueryCallback)(Local< Name > property, const PropertyCallbackInfo< Integer > &info)
Definition: v8.h:5671
void(* GenericNamedPropertyEnumeratorCallback)(const PropertyCallbackInfo< Array > &info)
Definition: v8.h:5704
StartupData * snapshot_blob
Definition: v8.h:7405
TimeZoneDetection
Definition: v8.h:5305
V8_INLINE MaybeLocal< T > GetDataFromSnapshotOnce(size_t index)
Definition: v8-internal.h:15
NamedPropertyHandlerConfiguration(GenericNamedPropertyGetterCallback getter=nullptr, GenericNamedPropertySetterCallback setter=nullptr, GenericNamedPropertyQueryCallback query=nullptr, GenericNamedPropertyDeleterCallback deleter=nullptr, GenericNamedPropertyEnumeratorCallback enumerator=nullptr, Local< Value > data=Local< Value >(), PropertyHandlerFlags flags=PropertyHandlerFlags::kNone)
Definition: v8.h:6107
V8_INLINE Local< Value > operator[](int i) const
Definition: v8.h:10152
V8_INLINE Global & operator=(Global< S > &&rhs)
V8_INLINE bool operator!=(const Local< S > &that) const
Definition: v8.h:241
CounterLookupCallback counter_lookup_callback
Definition: v8.h:7412
AccessType
Definition: v8.h:5807
AtomicsWaitEvent
Definition: v8.h:7985
Definition: v8-util.h:442
void(* GenericNamedPropertyDescriptorCallback)(Local< Name > property, const PropertyCallbackInfo< Value > &info)
Definition: v8.h:5750
V8_INLINE bool operator==(const Local< S > &that) const
Definition: v8.h:217
void(* IndexedPropertyGetterCallback)(uint32_t index, const PropertyCallbackInfo< Value > &info)
Definition: v8.h:5756
V8_INLINE Local< Value > GetEmbedderData(int index)
Definition: v8.h:10949
V8_INLINE Local< T > ToLocalChecked()
Definition: v8.h:9738
V8_INLINE Local< Value > Data() const
Definition: v8.h:10177
V8_INLINE ReturnValue< T > GetReturnValue() const
Definition: v8.h:10841
V8_WARN_UNUSED_RESULT V8_INLINE bool To(T *out) const
Definition: v8.h:8991
V8_INLINE ExternalStringResourceBase * GetExternalStringResourceBase(Encoding *encoding_out) const
Definition: v8.h:10392
V8_INLINE Persistent()
Definition: v8.h:673
V8_INLINE Local< Value > Data() const
Definition: v8.h:10823
void(* IndexedPropertySetterCallback)(uint32_t index, Local< Value > value, const PropertyCallbackInfo< Value > &info)
Definition: v8.h:5763
TracedGlobal(Isolate *isolate, Local< S > that)
Definition: v8.h:855
V8_DEPRECATED("Weak objects are always considered independent. " "Use TracedGlobal when trying to use EmbedderHeapTracer. " "Use a strong handle when trying to keep an object alive.", V8_INLINE void MarkIndependent())
Flags
Definition: v8.h:5417
V8_INLINE Local(Local< S > that)
Definition: v8.h:186
V8_INLINE Locker(Isolate *isolate)
Definition: v8.h:9617
IndexedPropertyHandlerConfiguration(IndexedPropertyGetterCallback getter=nullptr, IndexedPropertySetterCallback setter=nullptr, IndexedPropertyQueryCallback query=nullptr, IndexedPropertyDeleterCallback deleter=nullptr, IndexedPropertyEnumeratorCallback enumerator=nullptr, Local< Value > data=Local< Value >(), PropertyHandlerFlags flags=PropertyHandlerFlags::kNone)
Definition: v8.h:6177
void(* IndexedPropertyEnumeratorCallback)(const PropertyCallbackInfo< Array > &info)
Definition: v8.h:5788
void(* IndexedPropertyQueryCallback)(uint32_t index, const PropertyCallbackInfo< Integer > &info)
Definition: v8.h:5771
bool allow_atomics_wait
Definition: v8.h:7441
const intptr_t * external_references
Definition: v8.h:7435
V8_INLINE void SetData(uint32_t slot, void *data)
Definition: v8.h:10892
void Set(Local< Name > name, Local< Data > value, PropertyAttribute attributes=None)
Definition: v8-util.h:589
void(* JitCodeEventHandler)(const JitCodeEvent *event)
Definition: v8.h:7175
size_t(* NearHeapLimitCallback)(void *data, size_t current_heap_limit, size_t initial_heap_limit)
Definition: v8.h:6962
constexpr T * data() const
Definition: v8.h:4414
V8_INLINE Persistent(Isolate *isolate, const Persistent< S, M2 > &that)
Definition: v8.h:690
V8_INLINE Global(Isolate *isolate, Local< S > that)
Definition: v8.h:775
V8_INLINE void Check() const
Definition: v8.h:8983
V8_INLINE Local< Object > Holder() const
Definition: v8.h:10835
static V8_INLINE uint32_t GetNumberOfDataSlots()
Definition: v8.h:10904
V8_INLINE ReturnValue< T > GetReturnValue() const
Definition: v8.h:10189
MaybeLocal< Value >(* PrepareStackTraceCallback)(Local< Context > context, Local< Value > error, Local< Array > sites)
Definition: v8.h:6691
SideEffectType
Definition: v8.h:3319
V8_INLINE void SetWrapperClassId(uint16_t class_id)
Definition: v8.h:9887
V8_INLINE void * GetAlignedPointerFromInternalField(int index)
Definition: v8.h:10338
static V8_INLINE Local< T > New(Isolate *isolate, Local< T > that)
Definition: v8.h:9697
V8_INLINE T FromMaybe(const T &default_value) const
Definition: v8.h:9009
void(* GenericNamedPropertyGetterCallback)(Local< Name > property, const PropertyCallbackInfo< Value > &info)
Definition: v8.h:5622
virtual void Lock() const
Definition: v8.h:2787
V8_INLINE ExternalStringResource * GetExternalStringResource() const
Definition: v8.h:10373
StackTraceOptions
Definition: v8.h:1833
JitCodeEventHandler code_event_handler
Definition: v8.h:7395
PromiseHookType
Definition: v8.h:6711
V8_INLINE size_t AddData(Local< Context > context, Local< T > object)
static V8_INLINE Local< String > Empty(Isolate *isolate)
Definition: v8.h:10364
TimeZoneDetection
Definition: v8.h:8564
V8_INLINE void * GetData(uint32_t slot)
Definition: v8.h:10898
ArrayBuffer::Allocator * array_buffer_allocator
Definition: v8.h:7427
V8_INLINE int64_t AdjustAmountOfExternalAllocatedMemory(int64_t change_in_bytes)
Definition: v8.h:10916
V8_INLINE bool IsNull() const
Definition: v8.h:10432
bool(* AllowCodeGenerationFromStringsCallback)(Local< Context > context, Local< String > source)
Definition: v8.h:6890
V8_INLINE uint16_t WrapperClassId() const
Definition: v8.h:9993
MemoryPressureLevel
Definition: v8.h:7206
GCType
Definition: v8.h:6918
MicrotasksPolicy
Definition: v8.h:6759
RAILMode
Definition: v8.h:7143
Definition: v8-profiler.h:742
V8_INLINE Local< Object > This() const
Definition: v8.h:10829
MaybeLocal< Promise >(* HostImportModuleDynamicallyCallback)(Local< Context > context, Local< ScriptOrModule > referrer, Local< String > specifier)
Definition: v8.h:6666
V8_INLINE void SetWrapperClassId(uint16_t class_id)
Definition: v8.h:9984
V8_INLINE void AnnotateStrongRetainer(const char *label)
Definition: v8.h:9856
NoCacheReason
Definition: v8.h:1577
V8_INLINE bool IsUndefined() const
Definition: v8.h:10414
V8_INLINE bool IsConstructCall() const
Definition: v8.h:10195
V8_INLINE T ToChecked() const
Definition: v8.h:8977
V8_INLINE Local< S > FromMaybe(Local< S > default_value) const
Definition: v8.h:370
virtual void Dispose()
Definition: v8.h:2774
void(* GenericNamedPropertySetterCallback)(Local< Name > property, Local< Value > value, const PropertyCallbackInfo< Value > &info)
Definition: v8.h:5646
V8_INLINE Local< Object > This() const
Definition: v8.h:10159
AllocationMode
Definition: v8.h:4709
uintptr_t(* ReturnAddressLocationResolver)(uintptr_t return_addr_location)
Definition: v8.h:8636
Status
Definition: v8.h:1286
PromiseState
Definition: v8.h:4218
V8_INLINE void Reset()
Definition: v8.h:9805
AccessControl
Definition: v8.h:3290
Definition: v8-util.h:366
Global Pass()
Definition: v8.h:807
V8_INLINE Isolate * GetIsolate() const
Definition: v8.h:10183
PropertyFilter
Definition: v8.h:3300
ResourceConstraints constraints
Definition: v8.h:7400
bool IsEmpty() const
Definition: v8.h:881
V8_INLINE Local< Value > GetInternalField(int index)
Definition: v8.h:10315
V8_INLINE ~Persistent()
Definition: v8.h:721