|
v8
9.0.257(node16.0.0)
V8 is Google's open source JavaScript engine
|
Go to the documentation of this file.
25 #include <type_traits>
29 #include "cppgc/common.h"
50 class CallHandlerHelper;
60 class ImplementationUtilities;
70 class ObjectOperationDescriptor;
79 class RawOperationDescriptor;
96 template <
class K,
class V,
class T>
98 template <
class K,
class V,
class T>
100 template<
class T>
class NonCopyablePersistentTraits;
101 template <
class T,
class M = NonCopyablePersistentTraits<T>>
120 template<
class T,
class P>
class WeakCallbackObject;
123 template <
class V,
class T>
130 class BasicTracedReferenceExtractor;
131 class ExternalString;
132 class FunctionCallbackArguments;
137 class LocalEmbedderHeapTracer;
138 class MicrotaskQueue;
139 class PropertyCallbackArguments;
141 class ScopedExternalStringLock;
142 class ThreadLocalTop;
143 struct ScriptStreamingData;
144 enum class ArgumentsType;
145 template <ArgumentsType>
147 template <
typename T>
152 class StreamingDecoder;
162 class ConsoleCallArguments;
204 : val_(
reinterpret_cast<T*>(*that)) {
210 static_assert(std::is_base_of<T, S>::value,
"type check");
241 if (a ==
nullptr)
return b ==
nullptr;
242 if (b ==
nullptr)
return false;
250 if (a ==
nullptr)
return b ==
nullptr;
251 if (b ==
nullptr)
return false;
267 return !operator==(that);
272 return !operator==(that);
281 #ifdef V8_ENABLE_CHECKS
284 if (that.IsEmpty())
return Local<T>();
286 return Local<T>(T::Cast(*that));
296 return Local<S>::Cast(*
this);
316 template<
class F>
friend class Local;
333 template <
class F1,
class F2,
class F3>
347 explicit V8_INLINE Local(T* that) : val_(that) {}
353 #if !defined(V8_IMMINENT_DEPRECATION_WARNINGS)
376 : val_(
reinterpret_cast<T*>(*that)) {
377 static_assert(std::is_base_of<T, S>::value,
"type check");
388 out->val_ =
IsEmpty() ?
nullptr :
this->val_;
415 template <
class T>
class Eternal {
420 Set(isolate, handle);
432 static const int kInternalFieldsInWeakCallback = 2;
433 static const int kEmbedderFieldsInWeakCallback = 2;
435 template <
typename T>
441 void* embedder_fields[kEmbedderFieldsInWeakCallback],
443 : isolate_(isolate), parameter_(parameter), callback_(callback) {
444 for (
int i = 0; i < kEmbedderFieldsInWeakCallback; ++i) {
445 embedder_fields_[i] = embedder_fields[i];
465 void* embedder_fields_[kEmbedderFieldsInWeakCallback];
514 return Local<T>::New(isolate, *
this);
521 if (a ==
nullptr)
return b ==
nullptr;
522 if (b ==
nullptr)
return false;
530 if (a ==
nullptr)
return b ==
nullptr;
531 if (b ==
nullptr)
return false;
537 return !operator==(that);
542 return !operator==(that);
557 template <
typename P>
605 template<
class F>
friend class Local;
611 template <
class F1,
class F2,
class F3>
616 explicit V8_INLINE PersistentBase(T* val) : val_(val) {}
630 class NonCopyablePersistentTraits {
632 using NonCopyablePersistent =
Persistent<T, NonCopyablePersistentTraits<T>>;
634 template<
class S,
class M>
636 NonCopyablePersistent* dest) {
637 static_assert(
sizeof(S) < 0,
638 "NonCopyablePersistentTraits::Copy is not instantiable");
651 template<
class S,
class M>
653 CopyablePersistent* dest) {
681 static_assert(std::is_base_of<T, S>::value,
"type check");
688 template <
class S,
class M2>
691 static_assert(std::is_base_of<T, S>::value,
"type check");
702 template <
class S,
class M2>
710 template <
class S,
class M2>
721 if (M::kResetInDestructor)
this->Reset();
727 #ifdef V8_ENABLE_CHECKS
730 if (!that.IsEmpty()) T::Cast(*that);
744 template<
class F>
friend class Local;
749 V8_INLINE T* operator*()
const {
return this->val_; }
750 template<
class S,
class M2>
776 static_assert(std::is_base_of<T, S>::value,
"type check");
787 static_assert(std::is_base_of<T, S>::value,
"type check");
811 using MoveOnlyTypeForCPP03 =
void;
819 V8_INLINE T* operator*()
const {
return this->val_; }
830 template <
typename T>
876 reinterpret_cast<std::atomic<
void*>*>(&
val_)->store(
877 new_val, std::memory_order_relaxed);
884 return reinterpret_cast<std::atomic<
const void*>
const*>(&
val_)->load(
885 std::memory_order_relaxed);
891 friend class internal::BasicTracedReferenceExtractor;
892 template <
typename F>
894 template <
typename U>
915 template <
typename T>
933 enum DestructionMode { kWithDestructor, kWithoutDestructor };
938 BasicTracedReference() =
default;
941 DestructionMode destruction_mode);
944 template <
typename F>
947 template <
typename F>
949 template <
typename F>
951 template <
typename F>
953 template <
typename F>
961 template <
typename T>
984 this->val_ =
this->New(isolate, that.val_, &
this->val_,
986 static_assert(std::is_base_of<T, S>::value,
"type check");
994 *
this = std::move(other);
1000 template <
typename S>
1003 *
this = std::move(other);
1017 template <
typename S>
1089 template <
typename T>
1107 this->val_ =
this->New(isolate, that.val_, &
this->val_,
1109 static_assert(std::is_base_of<T, S>::value,
"type check");
1118 *
this = std::move(other);
1125 template <
typename S>
1128 *
this = std::move(other);
1144 template <
typename S>
1212 return reinterpret_cast<
Isolate*>(isolate_);
1229 void* operator
new(size_t size);
1230 void* operator
new[](size_t size);
1231 void operator
delete(
void*, size_t);
1232 void operator
delete[](
void*, size_t);
1264 return Local<T>(
reinterpret_cast<T*>(slot));
1269 return Escape(value.FromMaybe(
Local<T>()));
1278 void* operator
new(size_t size);
1279 void* operator
new[](size_t size);
1280 void operator
delete(
void*, size_t);
1281 void operator
delete[](
void*, size_t);
1303 void* operator
new(size_t size);
1304 void* operator
new[](size_t size);
1305 void operator
delete(
void*, size_t);
1306 void operator
delete[](
void*, size_t);
1310 int prev_sealed_level_;
1397 bool is_opaque =
false,
bool is_wasm =
false,
1398 bool is_module =
false)
1399 : flags_((is_shared_cross_origin ? kIsSharedCrossOrigin : 0) |
1400 (is_wasm ? kIsWasm : 0) | (is_opaque ? kIsOpaque : 0) |
1401 (is_module ? kIsModule : 0)) {}
1404 (kIsSharedCrossOrigin | kIsOpaque | kIsWasm | kIsModule)) {}
1407 return (flags_ & kIsSharedCrossOrigin) != 0;
1409 bool IsOpaque()
const {
return (flags_ & kIsOpaque) != 0; }
1410 bool IsWasm()
const {
return (flags_ & kIsWasm) != 0; }
1411 bool IsModule()
const {
return (flags_ & kIsModule) != 0; }
1417 kIsSharedCrossOrigin = 1,
1443 Local<
Value> resource_name,
int resource_line_offset = 0,
1444 int resource_column_offset = 0,
1445 bool resource_is_shared_cross_origin =
false,
int script_id = -1,
1447 bool resource_is_opaque =
false,
bool is_wasm =
false,
1448 bool is_module =
false,
1452 int resource_line_offset = 0,
int resource_column_offset = 0,
1453 bool resource_is_shared_cross_origin =
false,
int script_id = -1,
1455 bool resource_is_opaque =
false,
bool is_wasm =
false,
1456 bool is_module =
false,
1476 int resource_line_offset_;
1477 int resource_column_offset_;
1531 : line_number_(line_number), column_number_(column_number) {}
1579 static void CheckCast(
Data* obj);
1617 int GetModuleRequestsLength()
const;
1624 "Use Module::GetModuleRequests() and ModuleRequest::GetSpecifier().")
1632 "Use Module::GetModuleRequests(), ModuleRequest::GetSourceOffset(), and "
1633 "Module::SourceOffsetToLocation().")
1634 Location GetModuleRequestLocation(
int i)
const;
1667 "Use the version of InstantiateModule that takes a ResolveModuleCallback "
1672 Local<
Context> context, ResolveModuleCallback callback);
1731 using SyntheticModuleEvaluationSteps =
1744 SyntheticModuleEvaluationSteps evaluation_steps);
1756 "Use the preceding SetSyntheticModuleExport with an Isolate parameter, "
1757 "instead of the one that follows. The former will throw a runtime "
1758 "error if called for an export that doesn't exist (as per spec); "
1759 "the latter will crash with a failed CHECK().")
1760 void SetSyntheticModuleExport(
Local<
String> export_name,
1766 static void CheckCast(
Data* obj);
1870 int resource_line_offset;
1871 int resource_column_offset;
1911 virtual size_t
GetMoreData(
const uint8_t** src) = 0;
1942 "This class takes ownership of source_stream, so use the constructor "
1943 "taking a unique_ptr to make these semantics clearer")
1956 std::unique_ptr<
internal::ScriptStreamingData> impl_;
1970 explicit ScriptStreamingTask(
internal::ScriptStreamingData* data)
1973 internal::ScriptStreamingData* data_;
2048 V8_DEPRECATED(
"Use ScriptCompiler::StartStreaming instead.")
2122 Local<
String> arguments[], size_t context_extension_count,
2389 struct CalleeSavedRegisters;
2510 size_t* actual_size);
2576 PrivateData* private_;
2601 Isolate* isolate, uint32_t transfer_id);
2608 Isolate* isolate, uint32_t clone_id);
2673 PrivateData* private_;
3087 V8_INLINE bool QuickIsUndefined()
const;
3089 V8_INLINE bool QuickIsNullOrUndefined()
const;
3091 bool FullIsUndefined()
const;
3092 bool FullIsNull()
const;
3093 bool FullIsString()
const;
3095 static void CheckCast(
Data* that);
3116 static void CheckCast(
v8::
Data* that);
3137 static void CheckCast(
Data* that);
3236 int Write(
Isolate* isolate, uint16_t* buffer,
int start = 0,
int length = -1,
3240 int length = -1,
int options =
NO_OPTIONS)
const;
3243 int* nchars_ref =
nullptr,
int options =
NO_OPTIONS)
const;
3329 virtual const uint16_t*
data()
const = 0;
3334 virtual size_t
length()
const = 0;
3342 CheckCachedDataInvariants();
3343 return cached_data_;
3356 void CheckCachedDataInvariants()
const;
3358 const uint16_t* cached_data_ =
nullptr;
3384 virtual const char*
data()
const = 0;
3387 virtual size_t
length()
const = 0;
3395 CheckCachedDataInvariants();
3396 return cached_data_;
3409 void CheckCachedDataInvariants()
const;
3411 const char* cached_data_ =
nullptr;
3447 Isolate* isolate,
const char (&literal)[N],
3449 static_assert(N <=
kMaxLength,
"String is too long");
3450 return NewFromUtf8Literal(isolate, literal, type, N - 1);
3456 Isolate* isolate,
const char* data,
3462 Isolate* isolate,
const uint8_t* data,
3468 Isolate* isolate,
const uint16_t* data,
3588 const char* literal,
3591 static void CheckCast(
v8::
Data* that);
3655 static void CheckCast(
Data* that);
3693 static void CheckCast(
Data* that);
3702 double Value()
const;
3708 static void CheckCast(
v8::
Data* that);
3719 int64_t
Value()
const;
3724 static void CheckCast(
v8::
Data* that);
3733 int32_t
Value()
const;
3738 static void CheckCast(
v8::
Data* that);
3747 uint32_t
Value()
const;
3752 static void CheckCast(
v8::
Data* that);
3770 int word_count,
const uint64_t* words);
3778 uint64_t
Uint64Value(
bool* lossless =
nullptr)
const;
3785 int64_t
Int64Value(
bool* lossless =
nullptr)
const;
3801 void ToWordsArray(
int* sign_bit,
int* word_count, uint64_t* words)
const;
3807 static void CheckCast(
v8::
Data* that);
3829 using AccessorGetterCallback =
3831 using AccessorNameGetterCallback =
3834 using AccessorSetterCallback =
void (*)(
Local<
String> property,
3837 using AccessorNameSetterCallback =
4018 AccessorNameGetterCallback getter,
4019 AccessorNameSetterCallback setter =
nullptr,
4036 AccessorNameGetterCallback getter,
4037 AccessorNameSetterCallback setter =
nullptr,
4280 "Use MaybeLocal<Context> GetCreationContext(const "
4281 "PersistentBase<Object>& object)")
4377 static void CheckCast(
Value* obj);
4378 Local<
Value> SlowGetInternalField(
int index);
4379 void* SlowGetAlignedPointerFromInternalField(
int index);
4405 static void CheckCast(
Value* obj);
4414 size_t
Size()
const;
4441 static void CheckCast(
Value* obj);
4450 size_t
Size()
const;
4473 static void CheckCast(
Value* obj);
4477 template<
typename T>
4481 : value_(that.value_) {
4482 static_assert(std::is_base_of<T, S>::value,
"type check");
4485 template <
typename S>
4487 template <
typename S>
4489 template <
typename S>
4504 template <
typename S>
4516 template <
class F,
class G,
class H>
4531 template<
typename T>
4570 friend class debug::ConsoleCallArguments;
4590 template<
typename T>
4682 friend class MacroAssembler;
4759 "Use v8::Object::Get() instead to look up \"displayName\". "
4760 "V8 and DevTools no longer use \"displayName\" in stack "
4761 "traces, but the standard \"name\" property. "
4762 "See http://crbug.com/1177685.")
4802 static void CheckCast(
Value* obj);
4805 #ifndef V8_PROMISE_INTERNAL_FIELD_COUNT
4807 #define V8_PROMISE_INTERNAL_FIELD_COUNT 0
4848 static void CheckCast(
Value* obj);
4895 static void CheckCast(
Value* obj);
4968 PrivateData* private_;
4993 static void CheckCast(
Value* obj);
5006 template <
typename T>
5012 constexpr MemorySpan(T* data, size_t size) : data_(data), size_(size) {}
5015 constexpr T*
data()
const {
return data_; }
5017 constexpr size_t
size()
const {
return size_; }
5054 friend class WasmStreaming;
5056 explicit CompiledWasmModule(std::shared_ptr<
internal::
wasm::NativeModule>,
5057 const char* source_url, size_t url_length);
5059 const std::shared_ptr<
internal::
wasm::NativeModule> native_module_;
5060 const std::string source_url_;
5076 static void CheckCast(
Value* object);
5100 static void CheckCast(
Value* obj);
5111 class WasmStreamingImpl;
5118 virtual ~
Client() =
default;
5126 explicit WasmStreaming(std::unique_ptr<WasmStreamingImpl> impl);
5169 void SetUrl(
const char* url, size_t length);
5176 static std::shared_ptr<WasmStreaming>
Unpack(
Isolate* isolate,
5180 std::unique_ptr<WasmStreamingImpl> impl_;
5204 WasmModuleObjectBuilderStreaming(
const WasmModuleObjectBuilderStreaming&) =
5206 WasmModuleObjectBuilderStreaming(WasmModuleObjectBuilderStreaming&&) =
5208 WasmModuleObjectBuilderStreaming& operator=(
5209 const WasmModuleObjectBuilderStreaming&) =
delete;
5210 WasmModuleObjectBuilderStreaming& operator=(
5211 WasmModuleObjectBuilderStreaming&&) =
default;
5222 Persistent<Promise, CopyablePersistentTraits<Promise>> promise_;
5226 std::shared_ptr<
internal::
wasm::StreamingDecoder> streaming_decoder_;
5229 #ifndef V8_ARRAY_BUFFER_INTERNAL_FIELD_COUNT
5231 #define V8_ARRAY_BUFFER_INTERNAL_FIELD_COUNT 2
5277 void operator delete(
void* ptr) { ::operator
delete(ptr); }
5286 size_t byte_length);
5293 using DeleterCallback =
void (*)(
void* data, size_t length,
5294 void* deleter_data);
5305 static void EmptyDeleter(
void* data, size_t length,
void* deleter_data);
5315 #if !defined(V8_IMMINENT_DEPRECATION_WARNINGS)
5317 using BackingStoreDeleterCallback =
void (*)(
void* data, size_t length,
5318 void* deleter_data);
5350 virtual void*
Allocate(size_t length) = 0;
5362 virtual void Free(
void* data, size_t length) = 0;
5376 virtual void*
Reallocate(
void* data, size_t old_length, size_t new_length);
5405 using DeleterCallback =
void (*)(
void* buffer, size_t length,
void* info);
5410 allocation_base_(
nullptr),
5411 allocation_length_(0),
5414 deleter_data_(
nullptr) {}
5419 return allocation_mode_;
5422 void*
Data()
const {
return data_; }
5424 DeleterCallback
Deleter()
const {
return deleter_; }
5428 Contents(
void* data, size_t byte_length,
void* allocation_base,
5429 size_t allocation_length,
5431 void* deleter_data);
5434 size_t byte_length_;
5435 void* allocation_base_;
5436 size_t allocation_length_;
5438 DeleterCallback deleter_;
5439 void* deleter_data_;
5468 "Use the version that takes a BackingStore. "
5469 "See http://crbug.com/v8/9908.")
5499 size_t byte_length);
5509 void* data, size_t byte_length,
v8::
BackingStore::DeleterCallback deleter,
5510 void* deleter_data);
5517 "With v8::BackingStore externalized ArrayBuffers are "
5518 "the same as ordinary ArrayBuffers. See http://crbug.com/v8/9908.")
5519 bool IsExternal()
const;
5544 V8_DEPRECATED(
"Use GetBackingStore or Detach. See http://crbug.com/v8/9908.")
5554 V8_DEPRECATED(
"This will be removed together with IsExternal.")
5565 V8_DEPRECATED(
"Use GetBackingStore. See http://crbug.com/v8/9908.")
5585 static void CheckCast(
Value* obj);
5586 Contents GetContents(
bool externalize);
5590 #ifndef V8_ARRAY_BUFFER_VIEW_INTERNAL_FIELD_COUNT
5592 #define V8_ARRAY_BUFFER_VIEW_INTERNAL_FIELD_COUNT 2
5641 static void CheckCast(
Value* obj);
5657 :
static_cast<size_t>(uint64_t{1} << 32);
5669 static void CheckCast(
Value* obj);
5679 size_t byte_offset, size_t length);
5681 size_t byte_offset, size_t length);
5686 static void CheckCast(
Value* obj);
5696 size_t byte_offset, size_t length);
5703 Uint8ClampedArray();
5704 static void CheckCast(
Value* obj);
5713 size_t byte_offset, size_t length);
5715 size_t byte_offset, size_t length);
5720 static void CheckCast(
Value* obj);
5730 size_t byte_offset, size_t length);
5732 size_t byte_offset, size_t length);
5737 static void CheckCast(
Value* obj);
5747 size_t byte_offset, size_t length);
5749 size_t byte_offset, size_t length);
5754 static void CheckCast(
Value* obj);
5764 size_t byte_offset, size_t length);
5766 size_t byte_offset, size_t length);
5771 static void CheckCast(
Value* obj);
5781 size_t byte_offset, size_t length);
5783 size_t byte_offset, size_t length);
5788 static void CheckCast(
Value* obj);
5798 size_t byte_offset, size_t length);
5800 size_t byte_offset, size_t length);
5805 static void CheckCast(
Value* obj);
5815 size_t byte_offset, size_t length);
5817 size_t byte_offset, size_t length);
5822 static void CheckCast(
Value* obj);
5831 size_t byte_offset, size_t length);
5833 size_t byte_offset, size_t length);
5838 static void CheckCast(
Value* obj);
5847 size_t byte_offset, size_t length);
5849 size_t byte_offset, size_t length);
5854 static void CheckCast(
Value* obj);
5863 size_t byte_offset, size_t length);
5865 size_t byte_offset, size_t length);
5870 static void CheckCast(
Value* obj);
5891 using DeleterCallback =
void (*)(
void* buffer, size_t length,
void* info);
5896 allocation_base_(
nullptr),
5897 allocation_length_(0),
5900 deleter_data_(
nullptr) {}
5905 return allocation_mode_;
5908 void*
Data()
const {
return data_; }
5910 DeleterCallback
Deleter()
const {
return deleter_; }
5914 Contents(
void* data, size_t byte_length,
void* allocation_base,
5915 size_t allocation_length,
5916 Allocator::
AllocationMode allocation_mode, DeleterCallback deleter,
5917 void* deleter_data);
5920 size_t byte_length_;
5921 void* allocation_base_;
5922 size_t allocation_length_;
5924 DeleterCallback deleter_;
5925 void* deleter_data_;
5950 "Use the version that takes a BackingStore. "
5951 "See http://crbug.com/v8/9908.")
5981 size_t byte_length);
5991 void* data, size_t byte_length,
v8::
BackingStore::DeleterCallback deleter,
5992 void* deleter_data);
5999 "Use the version that takes a BackingStore. "
6000 "See http://crbug.com/v8/9908.")
6010 "With v8::BackingStore externalized SharedArrayBuffers are the same "
6011 "as ordinary SharedArrayBuffers. See http://crbug.com/v8/9908.")
6012 bool IsExternal()
const;
6026 V8_DEPRECATED(
"Use GetBackingStore or Detach. See http://crbug.com/v8/9908.")
6036 V8_DEPRECATED(
"This will be removed together with IsExternal.")
6051 V8_DEPRECATED(
"Use GetBackingStore. See http://crbug.com/v8/9908.")
6069 SharedArrayBuffer();
6070 static void CheckCast(
Value* obj);
6071 Contents GetContents(
bool externalize);
6092 static void CheckCast(
Value* obj);
6108 static void CheckCast(
Value* obj);
6123 static void CheckCast(
Value* obj);
6138 static void CheckCast(
Value* obj);
6154 static void CheckCast(
Value* obj);
6170 static void CheckCast(
Value* obj);
6222 uint32_t backtrack_limit);
6252 static void CheckCast(
Value* obj);
6263 void*
Value()
const;
6265 static void CheckCast(
v8::
Value* obj);
6268 #define V8_INTRINSICS_LIST(F)
6269 F(ArrayProto_entries, array_entries_iterator)
6270 F(ArrayProto_forEach, array_for_each_iterator)
6271 F(ArrayProto_keys, array_keys_iterator)
6272 F(ArrayProto_values, array_values_iterator)
6273 F(AsyncIteratorPrototype, initial_async_iterator_prototype)
6274 F(ErrorPrototype, initial_error_prototype)
6275 F(IteratorPrototype, initial_iterator_prototype)
6276 F(ObjProto_valueOf, object_value_of_function)
6279 #define V8_DECL_INTRINSIC(name, iname) k##name,
6281 #undef V8_DECL_INTRINSIC
6339 Local<
String> name, AccessorGetterCallback getter,
6340 AccessorSetterCallback setter =
nullptr,
6347 Local<
Name> name, AccessorNameGetterCallback getter,
6348 AccessorNameSetterCallback setter =
nullptr,
6360 Local<
Name> name, AccessorNameGetterCallback getter,
6418 using GenericNamedPropertyGetterCallback =
6442 using GenericNamedPropertySetterCallback =
6467 using GenericNamedPropertyQueryCallback =
6491 using GenericNamedPropertyDeleterCallback =
6500 using GenericNamedPropertyEnumeratorCallback =
6523 using GenericNamedPropertyDefinerCallback =
6546 using GenericNamedPropertyDescriptorCallback =
6552 using IndexedPropertyGetterCallback =
6558 using IndexedPropertySetterCallback =
6565 using IndexedPropertyQueryCallback =
6571 using IndexedPropertyDeleterCallback =
6580 using IndexedPropertyEnumeratorCallback =
6586 using IndexedPropertyDefinerCallback =
6593 using IndexedPropertyDescriptorCallback =
6612 using AccessCheckCallback =
bool (*)(
Local<
Context> accessing_context,
6727 Isolate* isolate, FunctionCallback callback =
nullptr,
6738 Isolate* isolate, FunctionCallback callback,
6831 static void CheckCast(
Data* that);
6871 GenericNamedPropertyGetterCallback getter,
6872 GenericNamedPropertySetterCallback setter,
6873 GenericNamedPropertyQueryCallback query,
6874 GenericNamedPropertyDeleterCallback deleter,
6875 GenericNamedPropertyEnumeratorCallback enumerator,
6876 GenericNamedPropertyDefinerCallback definer,
6877 GenericNamedPropertyDescriptorCallback descriptor,
6892 GenericNamedPropertyGetterCallback getter =
nullptr,
6893 GenericNamedPropertySetterCallback setter =
nullptr,
6894 GenericNamedPropertyQueryCallback query =
nullptr,
6895 GenericNamedPropertyDeleterCallback deleter =
nullptr,
6896 GenericNamedPropertyEnumeratorCallback enumerator =
nullptr,
6910 GenericNamedPropertyGetterCallback getter,
6911 GenericNamedPropertySetterCallback setter,
6912 GenericNamedPropertyDescriptorCallback descriptor,
6913 GenericNamedPropertyDeleterCallback deleter,
6914 GenericNamedPropertyEnumeratorCallback enumerator,
6915 GenericNamedPropertyDefinerCallback definer,
6930 GenericNamedPropertyQueryCallback
query;
6942 IndexedPropertyGetterCallback getter,
6943 IndexedPropertySetterCallback setter, IndexedPropertyQueryCallback query,
6944 IndexedPropertyDeleterCallback deleter,
6945 IndexedPropertyEnumeratorCallback enumerator,
6946 IndexedPropertyDefinerCallback definer,
6947 IndexedPropertyDescriptorCallback descriptor,
6962 IndexedPropertyGetterCallback getter =
nullptr,
6963 IndexedPropertySetterCallback setter =
nullptr,
6964 IndexedPropertyQueryCallback query =
nullptr,
6965 IndexedPropertyDeleterCallback deleter =
nullptr,
6966 IndexedPropertyEnumeratorCallback enumerator =
nullptr,
6980 IndexedPropertyGetterCallback getter,
6981 IndexedPropertySetterCallback setter,
6982 IndexedPropertyDescriptorCallback descriptor,
6983 IndexedPropertyDeleterCallback deleter,
6984 IndexedPropertyEnumeratorCallback enumerator,
6985 IndexedPropertyDefinerCallback definer,
7056 Local<
String> name, AccessorGetterCallback getter,
7057 AccessorSetterCallback setter =
nullptr,
7064 Local<
Name> name, AccessorNameGetterCallback getter,
7065 AccessorNameSetterCallback setter =
nullptr,
7103 IndexedPropertyGetterCallback getter,
7104 IndexedPropertySetterCallback setter =
nullptr,
7105 IndexedPropertyQueryCallback query =
nullptr,
7106 IndexedPropertyDeleterCallback deleter =
nullptr,
7107 IndexedPropertyEnumeratorCallback enumerator =
nullptr,
7110 deleter
, enumerator
, data
));
7162 AccessCheckCallback callback,
7208 static void CheckCast(
Data* that);
7231 static void CheckCast(
Data* that);
7248 AccessorSignature();
7250 static void CheckCast(
Data* that);
7263 Extension(
const char* name,
const char* source =
nullptr,
int dep_count = 0,
7264 const char** deps =
nullptr,
int source_length = -1);
7271 const char*
name()
const {
return name_; }
7287 size_t source_length_;
7338 size_t maximum_heap_size_in_bytes);
7350 uint64_t virtual_memory_limit);
7373 return max_old_generation_size_;
7376 max_old_generation_size_ = limit;
7385 return max_young_generation_size_;
7388 max_young_generation_size_ = limit;
7392 return initial_old_generation_size_;
7395 initial_old_generation_size_ = initial_size;
7399 return initial_young_generation_size_;
7402 initial_young_generation_size_ = initial_size;
7406 static constexpr size_t kMB = 1048576u;
7407 size_t code_range_size_ = 0;
7408 size_t max_old_generation_size_ = 0;
7409 size_t max_young_generation_size_ = 0;
7410 size_t initial_old_generation_size_ = 0;
7411 size_t initial_young_generation_size_ = 0;
7412 uint32_t* stack_limit_ =
nullptr;
7418 using FatalErrorCallback =
void (*)(
const char* location,
const char* message);
7420 using OOMErrorCallback =
void (*)(
const char* location,
bool is_heap_oom);
7422 using DcheckErrorCallback =
void (*)(
const char* file,
int line,
7423 const char* message);
7429 using LogEventCallback =
void (*)(
const char* name,
int event);
7463 using CounterLookupCallback =
int* (*)(
const char* name);
7465 using CreateHistogramCallback =
void* (*)(
const char* name,
int min,
int max,
7468 using AddHistogramSampleCallback =
void (*)(
void* histogram,
int sample);
7479 using AddCrashKeyCallback =
void (*)(
CrashKeyId id,
const std::string& value);
7482 using BeforeCallEnteredCallback =
void (*)(
Isolate*);
7506 "Use HostImportModuleDynamicallyWithImportAssertionsCallback instead") =
7537 using HostImportModuleDynamicallyWithImportAssertionsCallback =
7553 using HostInitializeImportMetaObjectCallback =
void (*)(
Local<
Context> context,
7601 : promise_(promise), event_(event), value_(value) {}
7616 using MicrotasksCompletedCallbackWithData =
void (*)(
Isolate*,
void*);
7617 using MicrotaskCallback =
void (*)(
void* data);
7664 MicrotaskCallback callback,
7665 void* data =
nullptr) = 0;
7680 MicrotasksCompletedCallbackWithData callback,
void* data =
nullptr) = 0;
7686 MicrotasksCompletedCallbackWithData callback,
void* data =
nullptr) = 0;
7709 MicrotaskQueue() =
default;
7750 internal::MicrotaskQueue*
const microtask_queue_;
7755 using FailedAccessCheckCallback =
void (*)(
Local<
Object> target,
7764 using AllowCodeGenerationFromStringsCallback =
bool (*)(
Local<
Context> context,
7780 using ModifyCodeGenerationFromStringsCallback =
7783 using ModifyCodeGenerationFromStringsCallback2 =
7791 using AllowWasmCodeGenerationCallback =
bool (*)(
Local<
Context> context,
7855 using InterruptCallback =
void (*)(
Isolate* isolate,
void* data);
7864 using NearHeapLimitCallback = size_t (*)(
void* data, size_t current_heap_limit,
7865 size_t initial_heap_limit);
7879 return read_only_space_physical_size_;
7883 size_t read_only_space_size_;
7884 size_t read_only_space_used_size_;
7885 size_t read_only_space_physical_size_;
7921 size_t total_heap_size_;
7922 size_t total_heap_size_executable_;
7923 size_t total_physical_size_;
7924 size_t total_available_size_;
7925 size_t used_heap_size_;
7926 size_t heap_size_limit_;
7927 size_t malloced_memory_;
7928 size_t external_memory_;
7929 size_t peak_malloced_memory_;
7930 bool does_zap_garbage_;
7931 size_t number_of_native_contexts_;
7932 size_t number_of_detached_contexts_;
7933 size_t total_global_handles_size_;
7934 size_t used_global_handles_size_;
7951 const char* space_name_;
7953 size_t space_used_size_;
7954 size_t space_available_size_;
7955 size_t physical_space_size_;
7970 const char* object_type_;
7971 const char* object_sub_type_;
7972 size_t object_count_;
7973 size_t object_size_;
7986 size_t code_and_metadata_size_;
7987 size_t bytecode_and_metadata_size_;
7988 size_t external_script_source_size_;
8076 void* new_code_start;
8124 #if defined(V8_OS_WIN)
8146 uint16_t class_id) {}
8230 const std::vector<std::pair<
void*,
void*> >& embedder_fields) = 0;
8356 void* data_arg =
nullptr)
8370 using CallbackFunction =
void (*)(
Local<
Object> holder,
int index,
8373 void* data_arg =
nullptr)
8424 context_sizes_in_bytes,
8425 size_t unattributed_size_in_bytes) = 0;
8530 "Setting this has no effect. Embedders should ignore import assertions "
8531 "that they do not use.")
8532 std::vector<std::string> supported_import_assertions;
8575 bool was_execution_allowed_assert_;
8576 bool was_execution_allowed_throws_;
8577 bool was_execution_allowed_dump_;
8596 bool was_execution_allowed_assert_;
8597 bool was_execution_allowed_throws_;
8598 bool was_execution_allowed_dump_;
8619 internal::MicrotaskQueue*
const microtask_queue_;
8787 using UseCounterCallback =
void (*)(
Isolate* isolate,
8854 using AbortOnUncaughtExceptionCallback =
bool (*)(
Isolate*);
8856 AbortOnUncaughtExceptionCallback callback);
8863 "Use the version of SetHostImportModuleDynamicallyCallback that takes a "
8864 "HostImportModuleDynamicallyWithImportAssertionsCallback instead")
8865 void SetHostImportModuleDynamicallyCallback(
8866 HostImportModuleDynamicallyCallback callback);
8873 HostImportModuleDynamicallyWithImportAssertionsCallback callback);
8880 HostInitializeImportMetaObjectCallback callback);
9045 size_t frames_limit,
SampleInfo* sample_info);
9115 using GCCallbackWithData =
void (*)(
Isolate* isolate,
GCType type,
9239 size_t offset_in_bytes, int64_t value,
9240 double timeout_in_ms,
9271 void* data =
nullptr);
9274 using GetExternallyAllocatedMemoryInBytesCallback = size_t (*)();
9283 GetExternallyAllocatedMemoryInBytesCallback callback);
9435 MicrotasksCompletedCallbackWithData callback,
void* data =
nullptr);
9441 MicrotasksCompletedCallbackWithData callback,
void* data =
nullptr);
9588 JitCodeEventHandler event_handler);
9616 void GetCodeRange(
void** start, size_t* length_in_bytes);
9682 "Use Isolate::SetModifyCodeGenerationFromStringsCallback with "
9683 "ModifyCodeGenerationFromStringsCallback2 instead. See "
9684 "http://crbug.com/1096017 and TC39 Dynamic Code Brand Checks proposal "
9685 "at https://github.com/tc39/proposal-dynamic-code-brand-checks.")
9686 void SetModifyCodeGenerationFromStringsCallback(
9687 ModifyCodeGenerationFromStringsCallback callback);
9689 ModifyCodeGenerationFromStringsCallback2 callback);
9696 AllowWasmCodeGenerationCallback callback);
9759 bool capture,
int frame_limit = 10,
9840 void*
operator new(size_t size) =
delete;
9841 void*
operator new[](size_t size) =
delete;
9842 void operator delete(
void*, size_t) =
delete;
9843 void operator delete[](
void*, size_t) =
delete;
9846 template <
class K,
class V,
class Traits>
9850 void ReportExternalAllocationLimitReached();
9875 using EntropySource =
bool (*)(
unsigned char* buffer, size_t length);
9890 using ReturnAddressLocationResolver =
9891 uintptr_t (*)(uintptr_t return_addr_location);
9940 const int kBuildConfiguration =
9944 return Initialize(kBuildConfiguration);
9958 ReturnAddressLocationResolver return_address_resolver);
9978 static bool InitializeICU(
const char* icu_data_file =
nullptr);
9993 const char* icu_data_file =
nullptr);
10046 static bool TryHandleSignal(
int signal_number,
void* info,
void* context);
10057 #if defined(V8_OS_WIN)
10085 enum BuildConfigurationFeatures {
10086 kPointerCompression = 1 << 0,
10087 k31BitSmis = 1 << 1,
10088 kHeapSandbox = 1 << 2,
10095 static bool Initialize(
int build_config);
10102 bool has_destructor);
10107 static void CopyTracedGlobalReference(
const internal::
Address*
const* from,
10117 static void SetFinalizationCallbackTraced(
10121 const char* label);
10124 template <
class K,
class V,
class T>
10127 static void FromJustIsNothing();
10128 static void ToLocalEmpty();
10129 static void InternalFieldOutOfBounds(
int index);
10173 const intptr_t* external_references =
nullptr,
10312 return has_value_ ? value_ : default_value;
10316 return (
IsJust() == other.IsJust()) &&
10325 Maybe() : has_value_(
false) {}
10326 explicit Maybe(
const T& t) : has_value_(
true), value_(t) {}
10344 return Maybe<T>(t);
10365 Maybe() : is_valid_(
false) {}
10366 explicit Maybe(JustTag) : is_valid_(
true) {}
10505 if (handler ==
nullptr)
return nullptr;
10506 return handler->js_stack_comparable_address_;
10515 void* operator
new(size_t size);
10516 void* operator
new[](size_t size);
10517 void operator
delete(
void*, size_t);
10518 void operator
delete[](
void*, size_t);
10520 void ResetInternal();
10525 void* message_obj_;
10526 void* js_stack_comparable_address_;
10527 bool is_verbose_ : 1;
10528 bool can_continue_ : 1;
10529 bool capture_message_ : 1;
10531 bool has_terminated_ : 1;
10547 : name_count_(name_count), names_(names) { }
10549 const char**
begin()
const {
return &names_[0]; }
10550 const char**
end()
const {
return &names_[name_count_]; }
10553 const int name_count_;
10554 const char** names_;
10628 Isolate* isolate, size_t context_snapshot_index,
10776 using AbortScriptExecutionCallback =
void (*)(
Isolate* isolate,
10827 return js_stack_comparable_address_;
10834 uintptr_t js_stack_comparable_address_ = 0;
10835 const BackupIncumbentScope* prev_ =
nullptr;
10846 static void CheckCast(
Data* obj);
10849 Local<
Value> SlowGetEmbedderData(
int index);
10850 void* SlowGetAlignedPointerFromEmbedderData(
int index);
10938 void Initialize(
Isolate* isolate);
10969 void Initialize(
Isolate* isolate);
11014 size_t code_pages_length,
11017 const void* stack_base);
11036 return New(isolate, that.val_);
11041 return New(isolate, that.val_);
11046 return New(isolate, *that);
11051 if (that ==
nullptr)
return Local<T>();
11052 T* that_ptr = that;
11055 reinterpret_cast<
internal::Isolate*>(isolate)
, *p
)));
11062 static_assert(std::is_base_of<T, S>::value,
"type check");
11063 val_ =
reinterpret_cast<T*>(
11064 V8::Eternalize(isolate,
reinterpret_cast<
Value*>(*handle)));
11071 return Local<T>(val_);
11078 return Local<T>(val_);
11084 #ifdef V8_ENABLE_CHECKS
11085 if (index < 0 || index >= kEmbedderFieldsInWeakCallback) {
11086 V8::InternalFieldOutOfBounds(index);
11089 return embedder_fields_[index];
11095 if (that ==
nullptr)
return nullptr;
11097 return reinterpret_cast<T*>(
11098 V8::GlobalizeReference(
reinterpret_cast<
internal::Isolate*>(isolate),
11103 template <
class T,
class M>
11104 template <
class S,
class M2>
11106 static_assert(std::is_base_of<T, S>::value,
"type check");
11108 if (that.IsEmpty())
return;
11110 this->val_ =
reinterpret_cast<T*>(
V8::CopyGlobalReference(p));
11111 M::Copy(that,
this);
11117 if (
this->IsEmpty())
return false;
11125 if (
this->IsEmpty())
return;
11134 static_assert(std::is_base_of<T, S>::value,
"type check");
11136 if (other.IsEmpty())
return;
11137 this->val_ = New(isolate, other.val_);
11145 static_assert(std::is_base_of<T, S>::value,
"type check");
11147 if (other.IsEmpty())
return;
11148 this->val_ = New(isolate, other.val_);
11153 template <
typename P>
11158 #if (__GNUC__
>= 8
) && !defined(__clang__
)
11159 #pragma GCC diagnostic push
11160 #pragma GCC diagnostic ignored "-Wcast-function-type"
11163 reinterpret_cast<Callback>(callback), type);
11164 #if (__GNUC__
>= 8
) && !defined(__clang__
)
11165 #pragma GCC diagnostic pop
11175 template <
typename P>
11177 return reinterpret_cast<P*>(
11190 if (
this->IsEmpty())
return;
11193 *
reinterpret_cast<uint16_t*>(addr) = class_id;
11200 if (
this->IsEmpty())
return 0;
11203 return *
reinterpret_cast<uint16_t*>(addr);
11208 if (other.val_ !=
nullptr) {
11211 other.val_ =
nullptr;
11218 static_assert(std::is_base_of<T, S>::value,
"type check");
11219 if (
this != &rhs) {
11221 if (rhs.val_ !=
nullptr) {
11222 this->val_ = rhs.val_;
11223 V8::MoveGlobalReference(
11226 rhs.val_ =
nullptr;
11234 Isolate* isolate, T* that,
void* slot, DestructionMode destruction_mode) {
11235 if (that ==
nullptr)
return nullptr;
11237 return V8::GlobalizeTracedReference(
11238 reinterpret_cast<
internal::Isolate*>(isolate), p,
11240 destruction_mode == kWithDestructor);
11258 if (a ==
nullptr)
return b ==
nullptr;
11259 if (b ==
nullptr)
return false;
11263 template <
typename U>
11268 if (a ==
nullptr)
return b ==
nullptr;
11269 if (b ==
nullptr)
return false;
11273 template <
typename U>
11281 return !(lhs
== rhs);
11284 template <
typename U>
11287 return !(lhs == rhs);
11290 template <
typename U>
11293 return !(rhs == lhs);
11299 static_assert(std::is_base_of<T, S>::value,
"type check");
11301 if (other.IsEmpty())
return;
11302 this->val_ =
this->New(isolate, other.val_, &
this->val_,
11309 static_assert(std::is_base_of<T, S>::value,
"type check");
11310 *
this = std::move(rhs.
template As<T>());
11317 static_assert(std::is_base_of<T, S>::value,
"type check");
11318 *
this = rhs.
template As<T>();
11324 if (
this != &rhs) {
11325 V8::MoveTracedGlobalReference(
11334 if (
this != &rhs) {
11336 if (rhs.val_ !=
nullptr) {
11337 V8::CopyTracedGlobalReference(
11348 static_assert(std::is_base_of<T, S>::value,
"type check");
11350 if (other.IsEmpty())
return;
11351 this->SetSlotThreadSafe(
11352 this->New(isolate, other.val_, &
this->val_,
11359 static_assert(std::is_base_of<T, S>::value,
"type check");
11360 *
this = std::move(rhs.
template As<T>());
11368 static_assert(std::is_base_of<T, S>::value,
"type check");
11369 *
this = rhs.
template As<T>();
11375 if (
this != &rhs) {
11376 V8::MoveTracedGlobalReference(
11385 if (
this != &rhs) {
11387 if (rhs.val_ !=
nullptr) {
11388 V8::CopyTracedGlobalReference(
11401 *
reinterpret_cast<uint16_t*>(addr) = class_id;
11409 return *
reinterpret_cast<uint16_t*>(addr);
11415 V8::SetFinalizationCallbackTraced(
11416 reinterpret_cast<
internal::
Address*>(
this->val_), parameter, callback);
11419 template <
typename T>
11422 template <
typename T>
11423 template <
typename S>
11425 static_assert(std::is_base_of<T, S>::value,
"type check");
11427 *value_ = GetDefaultValue();
11433 template <
typename T>
11434 template <
typename S>
11436 static_assert(std::is_base_of<T, S>::value,
"type check");
11438 *value_ = GetDefaultValue();
11444 template <
typename T>
11445 template <
typename S>
11447 static_assert(std::is_void<T>::value || std::is_base_of<T, S>::value,
11450 *value_ = GetDefaultValue();
11456 template<
typename T>
11458 static_assert(std::is_base_of<T,
Number>::value,
"type check");
11462 template<
typename T>
11464 static_assert(std::is_base_of<T,
Integer>::value,
"type check");
11473 template<
typename T>
11475 static_assert(std::is_base_of<T,
Integer>::value,
"type check");
11477 bool fits_into_int32_t = (i & (1U << 31)) == 0;
11479 Set(
static_cast<int32_t>(i));
11485 template<
typename T>
11487 static_assert(std::is_base_of<T,
Boolean>::value,
"type check");
11498 template<
typename T>
11500 static_assert(std::is_base_of<T,
Primitive>::value,
"type check");
11505 template<
typename T>
11507 static_assert(std::is_base_of<T,
Primitive>::value,
"type check");
11512 template<
typename T>
11514 static_assert(std::is_base_of<T,
String>::value,
"type check");
11519 template <
typename T>
11522 return *
reinterpret_cast<
Isolate**>(&value_[-2]);
11525 template <
typename T>
11533 template <
typename T>
11534 template <
typename S>
11536 static_assert(
sizeof(S) < 0,
"incompilable to prevent inadvertent misuse");
11539 template <
typename T>
11545 template <
typename T>
11551 template<
typename T>
11559 template<
typename T>
11566 template<
typename T>
11572 template <
typename T>
11578 template <
typename T>
11584 template<
typename T>
11590 template<
typename T>
11596 template<
typename T>
11602 template<
typename T>
11625 int column_offset,
bool is_shared_cross_origin,
11627 bool is_opaque,
bool is_wasm,
bool is_module,
11630 resource_name_(resource_name),
11631 resource_line_offset_(line_offset),
11632 resource_column_offset_(column_offset),
11633 options_
(is_shared_cross_origin
, is_opaque
, is_wasm
, is_module
),
11634 script_id_(script_id),
11635 source_map_url_(source_map_url),
11636 host_defined_options_(host_defined_options) {}
11639 int line_offset,
int column_offset,
11640 bool is_shared_cross_origin,
int script_id,
11641 Local<
Value> source_map_url,
bool is_opaque,
11642 bool is_wasm,
bool is_module,
11644 : isolate_(isolate),
11645 resource_name_(resource_name),
11646 resource_line_offset_(line_offset),
11647 resource_column_offset_(column_offset),
11648 options_
(is_shared_cross_origin
, is_opaque
, is_wasm
, is_module
),
11649 script_id_(script_id),
11650 source_map_url_(source_map_url),
11651 host_defined_options_(host_defined_options) {}
11656 return host_defined_options_;
11681 : source_string(string),
11688 cached_data(data) {}
11692 : source_string(string), cached_data(data) {}
11696 delete cached_data;
11702 return cached_data;
11706 return resource_options;
11720 #ifdef V8_ENABLE_CHECKS
11727 #ifdef V8_ENABLE_CHECKS
11734 #ifdef V8_ENABLE_CHECKS
11737 return reinterpret_cast<
Signature*>(data);
11741 #ifdef V8_ENABLE_CHECKS
11748 #ifndef V8_ENABLE_CHECKS
11751 A obj = *
reinterpret_cast<A*>(
this);
11760 #ifdef V8_COMPRESS_POINTERS
11763 value = I::DecompressTaggedAnyField(obj,
static_cast<uint32_t>(value));
11771 return SlowGetInternalField(index);
11776 #ifndef V8_ENABLE_CHECKS
11779 A obj = *
reinterpret_cast<A*>(
this);
11787 #ifdef V8_HEAP_SANDBOX
11788 offset += I::kEmbedderDataSlotRawPayloadOffset;
11793 return reinterpret_cast<
void*>(value);
11796 return SlowGetAlignedPointerFromInternalField(index);
11800 #ifdef V8_ENABLE_CHECKS
11803 return static_cast<
String*>(data);
11818 A obj = *
reinterpret_cast<
const A*>(
this);
11828 result = GetExternalStringResourceSlow();
11830 #ifdef V8_ENABLE_CHECKS
11831 VerifyExternalStringResource(result);
11841 A obj = *
reinterpret_cast<
const A*>(
this);
11853 resource = GetExternalStringResourceBaseSlow(encoding_out);
11855 #ifdef V8_ENABLE_CHECKS
11856 VerifyExternalStringResourceBase(resource, *encoding_out);
11863 #ifdef V8_ENABLE_CHECKS
11864 return FullIsUndefined();
11866 return QuickIsUndefined();
11870 bool Value::QuickIsUndefined()
const {
11873 A obj = *
reinterpret_cast<
const A*>(
this);
11881 #ifdef V8_ENABLE_CHECKS
11882 return FullIsNull();
11884 return QuickIsNull();
11888 bool Value::QuickIsNull()
const {
11891 A obj = *
reinterpret_cast<
const A*>(
this);
11898 #ifdef V8_ENABLE_CHECKS
11899 return FullIsNull() || FullIsUndefined();
11901 return QuickIsNullOrUndefined();
11905 bool Value::QuickIsNullOrUndefined()
const {
11908 A obj = *
reinterpret_cast<
const A*>(
this);
11916 #ifdef V8_ENABLE_CHECKS
11917 return FullIsString();
11919 return QuickIsString();
11923 bool Value::QuickIsString()
const {
11926 A obj = *
reinterpret_cast<
const A*>(
this);
11933 return static_cast<
Value*>(value);
11938 #ifdef V8_ENABLE_CHECKS
11941 return static_cast<
Value*>(value);
11945 #ifdef V8_ENABLE_CHECKS
11948 return static_cast<
Boolean*>(data);
11952 #ifdef V8_ENABLE_CHECKS
11955 return static_cast<
Name*>(data);
11959 #ifdef V8_ENABLE_CHECKS
11962 return static_cast<
Symbol*>(data);
11966 #ifdef V8_ENABLE_CHECKS
11969 return reinterpret_cast<
Private*>(data);
11973 #ifdef V8_ENABLE_CHECKS
11980 #ifdef V8_ENABLE_CHECKS
11983 return reinterpret_cast<
Module*>(data);
11987 #ifdef V8_ENABLE_CHECKS
11990 return static_cast<
Number*>(data);
11994 #ifdef V8_ENABLE_CHECKS
11997 return static_cast<
Integer*>(data);
12001 #ifdef V8_ENABLE_CHECKS
12004 return static_cast<
Int32*>(data);
12008 #ifdef V8_ENABLE_CHECKS
12011 return static_cast<
Uint32*>(data);
12015 #ifdef V8_ENABLE_CHECKS
12018 return static_cast<
BigInt*>(data);
12022 #ifdef V8_ENABLE_CHECKS
12025 return static_cast<
Context*>(data);
12029 #ifdef V8_ENABLE_CHECKS
12032 return static_cast<
Date*>(value);
12037 #ifdef V8_ENABLE_CHECKS
12045 #ifdef V8_ENABLE_CHECKS
12053 #ifdef V8_ENABLE_CHECKS
12060 #ifdef V8_ENABLE_CHECKS
12067 #ifdef V8_ENABLE_CHECKS
12075 #ifdef V8_ENABLE_CHECKS
12078 return static_cast<
RegExp*>(value);
12083 #ifdef V8_ENABLE_CHECKS
12086 return static_cast<
Object*>(value);
12091 #ifdef V8_ENABLE_CHECKS
12094 return static_cast<
Array*>(value);
12099 #ifdef V8_ENABLE_CHECKS
12102 return static_cast<
Map*>(value);
12107 #ifdef V8_ENABLE_CHECKS
12110 return static_cast<
Set*>(value);
12115 #ifdef V8_ENABLE_CHECKS
12118 return static_cast<
Promise*>(value);
12123 #ifdef V8_ENABLE_CHECKS
12126 return static_cast<
Proxy*>(value);
12130 #ifdef V8_ENABLE_CHECKS
12137 #ifdef V8_ENABLE_CHECKS
12144 #ifdef V8_ENABLE_CHECKS
12152 #ifdef V8_ENABLE_CHECKS
12160 #ifdef V8_ENABLE_CHECKS
12168 #ifdef V8_ENABLE_CHECKS
12176 #ifdef V8_ENABLE_CHECKS
12184 #ifdef V8_ENABLE_CHECKS
12192 #ifdef V8_ENABLE_CHECKS
12200 #ifdef V8_ENABLE_CHECKS
12208 #ifdef V8_ENABLE_CHECKS
12216 #ifdef V8_ENABLE_CHECKS
12224 #ifdef V8_ENABLE_CHECKS
12232 #ifdef V8_ENABLE_CHECKS
12239 #ifdef V8_ENABLE_CHECKS
12246 #ifdef V8_ENABLE_CHECKS
12253 #ifdef V8_ENABLE_CHECKS
12261 #ifdef V8_ENABLE_CHECKS
12264 return static_cast<
DataView*>(value);
12269 #ifdef V8_ENABLE_CHECKS
12277 #ifdef V8_ENABLE_CHECKS
12280 return static_cast<
Function*>(value);
12285 #ifdef V8_ENABLE_CHECKS
12288 return static_cast<
External*>(value);
12292 template<
typename T>
12298 template<
typename T>
12304 template<
typename T>
12310 template<
typename T>
12316 template<
typename T>
12321 template <
typename T>
12387 T* data =
reinterpret_cast<T*>(GetDataFromSnapshotOnce(index));
12388 if (data)
internal::PerformCastCheck(data);
12389 return Local<T>(data);
12393 #ifndef V8_ENABLE_CHECKS
12396 A ctx = *
reinterpret_cast<
const A*>(
this);
12402 #ifdef V8_COMPRESS_POINTERS
12406 I::DecompressTaggedAnyField(embedder_data,
static_cast<uint32_t>(value));
12409 *
reinterpret_cast<A*>(
this)
);
12413 return SlowGetEmbedderData(index);
12419 #ifndef V8_ENABLE_CHECKS
12422 A ctx = *
reinterpret_cast<
const A*>(
this);
12427 #ifdef V8_HEAP_SANDBOX
12428 value_offset += I::kEmbedderDataSlotRawPayloadOffset;
12431 return reinterpret_cast<
void*>(
12435 return SlowGetAlignedPointerFromEmbedderData(index);
12441 T* data =
reinterpret_cast<T*>(GetDataFromSnapshotOnce(index));
12442 if (data)
internal::PerformCastCheck(data);
12443 return Local<T>(data);
12448 T* object_ptr = *object;
12450 return AddData(context, *p);
12455 T* object_ptr = *object;
12457 return AddData(*p);
Scope(const Scope &)=delete
static std::unique_ptr< BackingStore > NewBackingStore(Isolate *isolate, size_t byte_length)
static const int kNoColumnInfo
void operator=(const PropertyDescriptor &)=delete
static Allocator * NewDefaultAllocator()
static V8_INLINE Array * Cast(Value *obj)
static const int kIsolateIndex
static Local< Module > CreateSyntheticModule(Isolate *isolate, Local< String > module_name, const std::vector< Local< String >> &export_names, SyntheticModuleEvaluationSteps evaluation_steps)
static Local< Uint8ClampedArray > New(Local< ArrayBuffer > array_buffer, size_t byte_offset, size_t length)
void RegisterEmbedderReference(const BasicTracedReference< v8::Data > &ref)
void RemoveNearHeapLimitCallback(NearHeapLimitCallback callback, size_t heap_limit)
V8_INLINE Local< T > Get(Isolate *isolate) const
V8_WARN_UNUSED_RESULT MaybeLocal< Promise > Catch(Local< Context > context, Local< Function > handler)
#define V8_DEPRECATE_SOON(message)
static const int kFullStringRepresentationMask
Local< Array > AsArray() const
V8_INLINE Persistent< S > & As() const
V8_WARN_UNUSED_RESULT Maybe< PropertyAttribute > GetPropertyAttributes(Local< Context > context, Local< Value > key)
AllowJavascriptExecutionScope & operator=(const AllowJavascriptExecutionScope &)=delete
Local< Script > BindToCurrentContext()
void AddGCPrologueCallback(GCCallback callback, GCType gc_type_filter=kGCTypeAll)
static V8_INLINE External * Cast(Value *obj)
JSEntryStubs GetJSEntryStubs()
V8_WARN_UNUSED_RESULT MaybeLocal< Array > GetPropertyNames(Local< Context > context, KeyCollectionMode mode, PropertyFilter property_filter, IndexFilter index_filter, KeyConversionMode key_conversion=KeyConversionMode::kKeepNumbers)
V8_WARN_UNUSED_RESULT MaybeLocal< Object > ToObject(Local< Context > context) const
#define V8_UNLIKELY(condition)
CallbackFunction callback
static Local< Symbol > GetIterator(Isolate *isolate)
static const int kFalseValueRootIndex
void set_code_range_size_in_bytes(size_t limit)
void operator=(const Global &)=delete
virtual Local< FunctionTemplate > GetNativeFunctionTemplate(Isolate *isolate, Local< String > name)
void operator=(const ValueDeserializer &)=delete
void WriteUint32(uint32_t value)
V8_WARN_UNUSED_RESULT Maybe< bool > ReadHeader(Local< Context > context)
V8_INLINE void * GetInternalField(int index) const
static Local< Symbol > New(Isolate *isolate, Local< String > description=Local< String >())
virtual void RemoveMicrotasksCompletedCallback(MicrotasksCompletedCallbackWithData callback, void *data=nullptr)=0
WasmModuleObjectBuilderStreaming(Isolate *isolate)
V8_INLINE TracedGlobal & operator=(TracedGlobal &&rhs)
static Local< Value > New(Isolate *isolate, Local< String > value)
@ kNoCacheBecauseStreamingSource
virtual ~EmbedderHeapTracer()=default
V8_INLINE Global(Isolate *isolate, const PersistentBase< S > &that)
static V8_INLINE T ReadRawField(internal::Address heap_object_ptr, int offset)
void Initialize(Isolate *isolate)
static V8_INLINE Symbol * Cast(Data *data)
size_t AllocationLength() const
Local< Object > GetExtrasBindingObject()
V8_INLINE Local< Integer > ResourceColumnOffset() const
Scope & operator=(const Scope &)=delete
V8_WARN_UNUSED_RESULT MaybeLocal< Value > GetOwnPropertyDescriptor(Local< Context > context, Local< Name > key)
@ kMinorGarbageCollection
MicrotasksScope & operator=(const MicrotasksScope &)=delete
SnapshotCreator(const intptr_t *external_references=nullptr, StartupData *existing_blob=nullptr)
@ kDecimalWithLeadingZeroInStrictMode
StartupData CreateBlob(FunctionCodeHandling function_code_handling)
~SuppressMicrotaskExecutionScope()
static Local< Array > New(Isolate *isolate, Local< Value > *elements, size_t length)
V8_INLINE uint16_t WrapperClassId() const
V8_INLINE ScriptOriginOptions(bool is_shared_cross_origin=false, bool is_opaque=false, bool is_wasm=false, bool is_module=false)
V8_WARN_UNUSED_RESULT MaybeLocal< Value > Call(Local< Context > context, Local< Value > recv, int argc, Local< Value > argv[])
V8_WARN_UNUSED_RESULT Maybe< bool > Delete(Local< Context > context, uint32_t index)
static V8_INLINE bool Initialize()
static std::unique_ptr< MeasureMemoryDelegate > Default(Isolate *isolate, Local< Context > context, Local< Promise::Resolver > promise_resolver, MeasureMemoryMode mode)
void SetHandler(const IndexedPropertyHandlerConfiguration &configuration)
V8_INLINE bool IsConstructCall() const
Extension(const Extension &)=delete
bool IsUint16Array() const
static const int kNativeContextEmbedderDataOffset
V8_INLINE TracedGlobal(TracedGlobal &&other)
@ kNoCacheBecauseResourceWithNoCacheHandler
void SetWasmExceptionsEnabledCallback(WasmExceptionsEnabledCallback callback)
static const int kJSObjectHeaderSize
V8_INLINE int Length() const
static bool EnableWebAssemblyTrapHandler(bool use_v8_signal_handler)
static Local< PrimitiveArray > New(Isolate *isolate, int length)
static void SetFlagsFromString(const char *str)
void SetPromiseHook(PromiseHook hook)
void SetFatalErrorHandler(FatalErrorCallback that)
size_t max_young_generation_size_in_bytes() const
static void PrintCurrentStackTrace(Isolate *isolate, FILE *out)
ValueDeserializer(const ValueDeserializer &)=delete
void SetAtomicsWaitCallback(AtomicsWaitCallback callback, void *data)
void SetWasmInstanceCallback(ExtensionCallback callback)
static V8_INLINE DataView * Cast(Value *obj)
bool IsUint32Array() const
static const int kNewTargetIndex
PropertyDescriptor(const PropertyDescriptor &)=delete
V8_WARN_UNUSED_RESULT MaybeLocal< Value > Get(Local< Context > context, Local< Value > key)
@ kAssigmentExpressionLHSIsCallInSloppy
V8_INLINE Local(Local< S > that)
static V8_INLINE int GetInstanceType(const internal::Address obj)
SealHandleScope(const SealHandleScope &)=delete
GenericNamedPropertyDescriptorCallback descriptor
V8_WARN_UNUSED_RESULT Maybe< bool > Has(Local< Context > context, Local< Value > key)
void SetAddCrashKeyCallback(AddCrashKeyCallback)
void OnBytesReceived(const uint8_t *, size_t size)
static Local< Private > ForApi(Isolate *isolate, Local< String > name)
std::shared_ptr< BackingStore > GetBackingStore()
static MaybeLocal< WasmModuleObject > FromCompiledModule(Isolate *isolate, const CompiledWasmModule &)
bool has_writable() const
StartupData * snapshot_blob
void operator delete[](void *, size_t)=delete
void SetStackStart(void *stack_start)
V8_INLINE Global(Global &&other)
static V8_INLINE BigUint64Array * Cast(Value *obj)
@ kNoCacheBecauseV8Extension
static void ShutdownPlatform()
void TransferArrayBuffer(uint32_t transfer_id, Local< ArrayBuffer > array_buffer)
Location(int line_number, int column_number)
static Local< BigUint64Array > New(Local< SharedArrayBuffer > shared_array_buffer, size_t byte_offset, size_t length)
friend class FunctionCallbackInfo
bool IsUserJavaScript() const
void SetNativeDataProperty(Local< Name > name, AccessorNameGetterCallback getter, AccessorNameSetterCallback setter=nullptr, Local< Value > data=Local< Value >(), PropertyAttribute attribute=None, Local< AccessorSignature > signature=Local< AccessorSignature >(), AccessControl settings=DEFAULT, SideEffectType getter_side_effect_type=SideEffectType::kHasSideEffect, SideEffectType setter_side_effect_type=SideEffectType::kHasSideEffect)
int embedder_wrapper_type_index
const std::string & source_url() const
V8_INLINE TracedGlobal(const TracedGlobal< S > &other)
V8_INLINE Isolate * GetIsolate() const
virtual ~MicrotaskQueue()=default
static Local< SharedArrayBuffer > New(Isolate *isolate, std::shared_ptr< BackingStore > backing_store)
@ kNoCacheBecauseInspector
void(* callback)(Local< Object > holder, int index, StartupData payload, void *data)
V8_WARN_UNUSED_RESULT Maybe< bool > Resolve(Local< Context > context, Local< Value > value)
static V8_INLINE Module * Cast(Data *data)
static Local< Symbol > GetToStringTag(Isolate *isolate)
static Local< BigUint64Array > New(Local< ArrayBuffer > array_buffer, size_t byte_offset, size_t length)
static Isolate * New(const CreateParams ¶ms)
static V8_INLINE Resolver * Cast(Value *obj)
void SetOOMErrorHandler(OOMErrorCallback that)
bool IsUint8ClampedArray() const
V8_INLINE Local< S > FromMaybe(Local< S > default_value) const
V8_INLINE bool IsWeak() const
@ kNoCacheBecauseCachingDisabled
constexpr size_t size() const
GenericNamedPropertyGetterCallback getter
void UseDefaultSecurityToken()
V8_INLINE ExternalStringResource * GetExternalStringResource() const
static V8_INLINE Uint8Array * Cast(Value *obj)
V8_INLINE TracedReference & operator=(TracedReference &&rhs)
V8_WARN_UNUSED_RESULT Maybe< bool > HasRealNamedProperty(Local< Context > context, Local< Name > key)
V8_WARN_UNUSED_RESULT Maybe< bool > Has(Local< Context > context, uint32_t index)
virtual void * Allocate(size_t length)=0
void Set(const Global< S > &handle)
void Set(Isolate *isolate, Local< S > handle)
static V8_WARN_UNUSED_RESULT MaybeLocal< Script > Compile(Local< Context > context, Source *source, CompileOptions options=kNoCompileOptions, NoCacheReason no_cache_reason=kNoCacheNoReason)
static const char * GetVersion()
static Local< Symbol > GetUnscopables(Isolate *isolate)
~ExternalStringResource() override=default
V8_INLINE void Set(Isolate *isolate, const char *name, Local< Data > value)
bool AddMessageListenerWithErrorLevel(MessageCallback that, int message_levels, Local< Value > data=Local< Value >())
V8_INLINE Local< Value > Data() const
V8_INLINE Local< Value > Data() const
static V8_INLINE void Copy(const Persistent< S, M > &source, NonCopyablePersistent *dest)
static V8_INLINE void SetEmbedderData(v8::Isolate *isolate, uint32_t slot, void *data)
Global< T > & operator=(Global< S > &&rhs)
V8_INLINE void Check() const
static V8_INLINE bool HasHeapObjectTag(const internal::Address value)
static const int kNoWasmFunctionIndexInfo
@ kArrayPrototypeSortJSArrayModifiedPrototype
CppHeap * GetCppHeap() const
void SetClassName(Local< String > name)
size_t NumberOfTrackedHeapObjectTypes()
static V8_INLINE internal::Address ReadExternalPointerField(internal::Isolate *isolate, internal::Address heap_object_ptr, int offset, ExternalPointerTag tag)
V8_WARN_UNUSED_RESULT Maybe< bool > SetNativeDataProperty(Local< Context > context, Local< Name > name, AccessorNameGetterCallback getter, AccessorNameSetterCallback setter=nullptr, Local< Value > data=Local< Value >(), PropertyAttribute attributes=None, SideEffectType getter_side_effect_type=SideEffectType::kHasSideEffect, SideEffectType setter_side_effect_type=SideEffectType::kHasSideEffect)
V8_WARN_UNUSED_RESULT V8_INLINE bool ToLocal(Local< S > *out) const
V8_WARN_UNUSED_RESULT Maybe< bool > SetAccessor(Local< Context > context, Local< Name > name, AccessorNameGetterCallback getter, AccessorNameSetterCallback setter=nullptr, MaybeLocal< Value > data=MaybeLocal< Value >(), AccessControl settings=DEFAULT, PropertyAttribute attribute=None, SideEffectType getter_side_effect_type=SideEffectType::kHasSideEffect, SideEffectType setter_side_effect_type=SideEffectType::kHasSideEffect)
void SetAccessor(Local< String > name, AccessorGetterCallback getter, AccessorSetterCallback setter=nullptr, Local< Value > data=Local< Value >(), AccessControl settings=DEFAULT, PropertyAttribute attribute=None, Local< AccessorSignature > signature=Local< AccessorSignature >(), SideEffectType getter_side_effect_type=SideEffectType::kHasSideEffect, SideEffectType setter_side_effect_type=SideEffectType::kHasSideEffect)
void SetSupportsLegacyWireFormat(bool supports_legacy_wire_format)
static const int kArgsLength
bool IsBooleanObject() const
#define V8_ARRAY_BUFFER_INTERNAL_FIELD_COUNT
bool IsModuleNamespaceObject() const
bool IsExternalTwoByte() const
V8_WARN_UNUSED_RESULT MaybeLocal< String > ToString(Local< Context > context) const
bool IsConstructor() const
virtual void VisitPersistentHandle(Persistent< Value > *value, uint16_t class_id)
V8_INLINE Local< Primitive > Undefined(Isolate *isolate)
void TransferSharedArrayBuffer(uint32_t id, Local< SharedArrayBuffer > shared_array_buffer)
V8_WARN_UNUSED_RESULT MaybeLocal< Promise > Then(Local< Context > context, Local< Function > on_fulfilled, Local< Function > on_rejected)
@ kFunctionConstructorReturnedUndefined
@ kLabeledExpressionStatement
Location SourceOffsetToLocation(int offset) const
CreateHistogramCallback create_histogram_callback
TracedReference< T > & operator=(TracedReference< S > &&rhs)
V8_INLINE T FromJust() const
IndexedPropertySetterCallback setter
static void PerformCheckpoint(Isolate *isolate)
void * DeleterData() const
V8_INLINE Local< T > Escape(Local< T > value)
void SetAbortOnUncaughtExceptionCallback(AbortOnUncaughtExceptionCallback callback)
static constexpr int kFlagCount
static const int kDontThrow
void SetInternalField(int index, Local< Value > value)
static V8_INLINE bool IsExternalTwoByteString(int instance_type)
ScriptOrigin GetScriptOrigin() const
static Local< Private > New(Isolate *isolate, Local< String > name=Local< String >())
static CachedData * CreateCodeCacheForFunction(Local< Function > function)
virtual void Lock() const
static Local< ArrayBuffer > New(Isolate *isolate, std::shared_ptr< BackingStore > backing_store)
V8_INLINE Local< Value > operator[](int i) const
static Local< Array > New(Isolate *isolate, int length=0)
MicrotasksScope(Isolate *isolate, MicrotaskQueue *microtask_queue, Type type)
V8_WARN_UNUSED_RESULT std::pair< uint8_t *, size_t > Release()
V8_INLINE bool IsEmpty() const
const String::ExternalOneByteStringResource * source() const
CachedData(const uint8_t *data, int length, BufferPolicy buffer_policy=BufferNotOwned)
V8_INLINE int ScriptId() const
void OnBytesReceived(const uint8_t *bytes, size_t size)
virtual ~PersistentHandleVisitor()=default
const uint16_t * cached_data() const
bool IsFloat32Array() const
int64_t Int64Value(bool *lossless=nullptr) const
size_t space_available_size()
virtual bool ShouldMeasure(Local< Context > context)=0
static const int kReturnValueIndex
bool IsSharedCrossOrigin() const
static const int kReturnValueIndex
friend Maybe< U > Nothing()
bool IsInt32Array() const
int Utf8Length(Isolate *isolate) const
V8_WARN_UNUSED_RESULT Maybe< bool > InstantiateModule(Local< Context > context, ResolveModuleCallback callback)
void SetIntrinsicDataProperty(Local< Name > name, Intrinsic intrinsic, PropertyAttribute attribute=None)
int GetStartPosition() const
V8_WARN_UNUSED_RESULT bool ReadUint32(uint32_t *value)
friend Maybe< U > Just(const U &u)
@ kGCCallbackFlagCollectAllExternalMemory
static constexpr size_t kMaxLength
static bool TryUnwindV8Frames(const JSEntryStubs &entry_stubs, size_t code_pages_length, const MemoryRange *code_pages, RegisterState *register_state, const void *stack_base)
static std::unique_ptr< BackingStore > NewBackingStore(void *data, size_t byte_length, v8::BackingStore::DeleterCallback deleter, void *deleter_data)
bool IsNumberObject() const
bool IsSetIterator() const
bool SetCompiledModuleBytes(const uint8_t *bytes, size_t size)
V8_WARN_UNUSED_RESULT Maybe< bool > WriteValue(Local< Context > context, Local< Value > value)
SuppressMicrotaskExecutionScope & operator=(const SuppressMicrotaskExecutionScope &)=delete
@ kJitCodeEventEnumExisting
void SetPrepareStackTraceCallback(PrepareStackTraceCallback callback)
constexpr MemorySpan()=default
@ kInvalidatedArrayIteratorLookupChainProtector
BufferPolicy buffer_policy
V8_WARN_UNUSED_RESULT MaybeLocal< Uint32 > ToUint32(Local< Context > context) const
bool IsHeapLimitIncreasedForDebugging()
V8_EXPORT bool ShouldThrowOnError(v8::internal::Isolate *isolate)
void NotifyEmptyEmbedderStack()
SerializeInternalFieldsCallback(CallbackFunction function=nullptr, void *data_arg=nullptr)
@ kGCTypeIncrementalMarking
IndexedPropertyHandlerConfiguration(IndexedPropertyGetterCallback getter, IndexedPropertySetterCallback setter, IndexedPropertyQueryCallback query, IndexedPropertyDeleterCallback deleter, IndexedPropertyEnumeratorCallback enumerator, IndexedPropertyDefinerCallback definer, IndexedPropertyDescriptorCallback descriptor, Local< Value > data=Local< Value >(), PropertyHandlerFlags flags=PropertyHandlerFlags::kNone)
const int kApiSystemPointerSize
bool IsNativeError() const
const char * space_name()
static constexpr V8_INLINE internal::Address IntToSmi(int value)
void IsolateInForegroundNotification()
V8_WARN_UNUSED_RESULT MaybeLocal< String > FunctionProtoToString(Local< Context > context)
void operator delete(void *, size_t)=delete
size_t total_global_handles_size()
V8_INLINE bool IsNullOrUndefined() const
V8_INLINE Local< Object > This() const
virtual void * AllocateUninitialized(size_t length)=0
void WriteUint64(uint64_t value)
MaybeLocal< T > GetDataFromSnapshotOnce(size_t index)
Local< Value > set() const
void IterateTracedGlobalHandles(TracedGlobalHandleVisitor *visitor)
Maybe< bool > HasPrivate(Local< Context > context, Local< Private > key)
static V8_INLINE Local< T > Cast(Local< S > that)
V8_INLINE void SetUndefined()
V8_WARN_UNUSED_RESULT Maybe< bool > Equals(Local< Context > context, Local< Value > that) const
virtual void FreeBufferMemory(void *buffer)
Local< ObjectTemplate > PrototypeTemplate()
Local< String > GetSpecifier() const
void AddMicrotasksCompletedCallback(MicrotasksCompletedCallbackWithData callback, void *data=nullptr)
@ kDateTimeFormatDateTimeStyle
@ kRegExpPrototypeUnicodeGetter
const char ** dependencies() const
V8_INLINE T * GetParameter() const
size_t ByteLength() const
void SetSlotThreadSafe(void *new_val)
size_t AddContext(Local< Context > context, SerializeInternalFieldsCallback callback=SerializeInternalFieldsCallback())
void set_initial_old_generation_size_in_bytes(size_t initial_size)
V8_WARN_UNUSED_RESULT MaybeLocal< Function > GetFunction(Local< Context > context)
static V8_INLINE Signature * Cast(Data *data)
static Local< Value > New(Isolate *isolate, Local< Symbol > value)
static V8_INLINE Context * Cast(Data *data)
void WriteRawBytes(const void *source, size_t length)
MaybeLocal< Value > GetPrivate(Local< Context > context, Local< Private > key)
V8_WARN_UNUSED_RESULT MaybeLocal< Value > GetRealNamedPropertyInPrototypeChain(Local< Context > context, Local< Name > key)
constexpr bool SmiValuesAre31Bits()
static V8_WARN_UNUSED_RESULT MaybeLocal< String > NewFromOneByte(Isolate *isolate, const uint8_t *data, NewStringType type=NewStringType::kNormal, int length=-1)
EmbedderHeapTracer * GetEmbedderHeapTracer()
V8_INLINE void SetWrapperClassId(uint16_t class_id)
int GetFrameCount() const
size_t source_length() const
static Local< Set > New(Isolate *isolate)
@ kWebAssemblyInstantiation
bool BooleanValue(Isolate *isolate) const
static V8_INLINE WasmModuleObject * Cast(Value *obj)
V8_WARN_UNUSED_RESULT MaybeLocal< Object > NewInstance(Local< Context > context) const
@ kStringToLocaleLowerCase
void set_auto_enable(bool value)
int WriteUtf8(Isolate *isolate, char *buffer, int length=-1, int *nchars_ref=nullptr, int options=NO_OPTIONS) const
JSEntryStub js_entry_stub
void SetAcceptAnyReceiver(bool value)
virtual ~Delegate()=default
V8_INLINE Local< T > ToLocalChecked()
V8_INLINE void ClearWeak()
V8_INLINE PropertyCallbackInfo(internal::Address *args)
virtual MaybeLocal< WasmModuleObject > GetWasmModuleFromId(Isolate *isolate, uint32_t transfer_id)
void SetIdle(bool is_idle)
void SetName(Local< String > name)
@ kArrayInstanceConstructorModified
static const int kReturnValueDefaultValueIndex
V8_WARN_UNUSED_RESULT MaybeLocal< Object > NewInstance(Local< Context > context, int argc, Local< Value > argv[]) const
Local< Value > GetTarget()
uint32_t * stack_limit() const
void SetCaptureStackTraceForUncaughtExceptions(bool capture, int frame_limit=10, StackTrace::StackTraceOptions options=StackTrace::kOverview)
void SetPrivate(Local< Private > name, Local< Data > value, PropertyAttribute attributes=None)
Local< Value > export_value
void set_initial_young_generation_size_in_bytes(size_t initial_size)
static Local< Value > SyntaxError(Local< String > message)
V8_WARN_UNUSED_RESULT Maybe< uint32_t > Uint32Value(Local< Context > context) const
V8_WARN_UNUSED_RESULT Maybe< int32_t > Int32Value(Local< Context > context) const
@ kInvalidatedIsConcatSpreadableLookupChainProtector
TryCatch(Isolate *isolate)
static const int kEmbedderFieldCount
static Local< Int8Array > New(Local< ArrayBuffer > array_buffer, size_t byte_offset, size_t length)
V8_WARN_UNUSED_RESULT MaybeLocal< Number > ToNumber(Local< Context > context) const
static const int kNodeClassIdOffset
static const int kInternalFieldCount
bool IsArrayBufferView() const
static Local< Float64Array > New(Local< ArrayBuffer > array_buffer, size_t byte_offset, size_t length)
ResourceConstraints constraints
V8_INLINE void SetData(uint32_t slot, void *data)
friend class PersistentValueMapBase
Local< Value > GetName() const
void PerformMicrotaskCheckpoint()
void SetEmbedderData(int index, Local< Value > value)
static int NumberOfHandles(Isolate *isolate)
ValueDeserializer(Isolate *isolate, const uint8_t *data, size_t size)
static V8_WARN_UNUSED_RESULT MaybeLocal< String > NewExternalOneByte(Isolate *isolate, ExternalOneByteStringResource *resource)
static Local< Uint16Array > New(Local< ArrayBuffer > array_buffer, size_t byte_offset, size_t length)
static Local< Int32Array > New(Local< SharedArrayBuffer > shared_array_buffer, size_t byte_offset, size_t length)
static Local< Symbol > ForApi(Isolate *isolate, Local< String > description)
virtual bool IsRunningMicrotasks() const =0
void ToWordsArray(int *sign_bit, int *word_count, uint64_t *words) const
static V8_INLINE NumberObject * Cast(Value *obj)
V8_INLINE T * operator->() const
void operator=(const Utf8Value &)=delete
void AddCallCompletedCallback(CallCompletedCallback callback)
bool HasInstance(Local< Value > object)
bool IsObjectTemplate() const
static Local< Value > WasmCompileError(Local< String > message)
@ kAssigmentExpressionLHSIsCallInStrict
virtual int GetMicrotasksScopeDepth() const =0
void operator=(const HandleScope &)=delete
static MaybeLocal< Object > NewRemoteContext(Isolate *isolate, Local< ObjectTemplate > global_template, MaybeLocal< Value > global_object=MaybeLocal< Value >())
virtual ~ExternalSourceStream()=default
CachedData & operator=(const CachedData &)=delete
static V8_INLINE FunctionTemplate * Cast(Data *data)
Maybe< bool > DeletePrivate(Local< Context > context, Local< Private > key)
V8_INLINE bool IsJust() const
@ CODE_END_LINE_INFO_RECORDING
ExternalOneByteStringResource()=default
MemorySpan< const uint8_t > GetWireBytesRef()
static MaybeLocal< Proxy > New(Local< Context > context, Local< Object > local_target, Local< Object > local_handler)
V8_INLINE Local< Integer > ScriptID() const
size_t AddData(Local< Context > context, Local< T > object)
int64_t AdjustAmountOfExternalAllocatedMemory(int64_t change_in_bytes)
V8_INLINE PromiseRejectEvent GetEvent() const
Local< Value > Name() const
DeserializeInternalFieldsCallback(CallbackFunction function=nullptr, void *data_arg=nullptr)
Global(const Global &)=delete
ArrayBuffer::Allocator * array_buffer_allocator
Local< UnboundScript > script
void ConfigureDefaults(uint64_t physical_memory, uint64_t virtual_memory_limit)
void VisitExternalResources(ExternalResourceVisitor *visitor)
V8_INLINE Persistent(const Persistent< S, M2 > &that)
void AddGCEpilogueCallback(GCCallbackWithData callback, void *data=nullptr, GCType gc_type_filter=kGCTypeAll)
static const int kArgsLength
Local< Value > GetHandler()
size_t ByteLength() const
V8_INLINE TracedReference< S > & As() const
const char * object_sub_type()
V8_INLINE void Set(uint32_t i)
@ kEmbedderDataSlotPayloadTag
static std::unique_ptr< BackingStore > NewBackingStore(void *data, size_t byte_length, v8::BackingStore::DeleterCallback deleter, void *deleter_data)
void SetAllowWasmCodeGenerationCallback(AllowWasmCodeGenerationCallback callback)
V8_WARN_UNUSED_RESULT MaybeLocal< String > ObjectProtoToString(Local< Context > context)
V8_INLINE ScriptOrigin(Local< Value > resource_name, Local< Integer > resource_line_offset, Local< Integer > resource_column_offset, Local< Boolean > resource_is_shared_cross_origin=Local< Boolean >(), Local< Integer > script_id=Local< Integer >(), Local< Value > source_map_url=Local< Value >(), Local< Boolean > resource_is_opaque=Local< Boolean >(), Local< Boolean > is_wasm=Local< Boolean >(), Local< Boolean > is_module=Local< Boolean >(), Local< PrimitiveArray > host_defined_options=Local< PrimitiveArray >())
@ kDeoptimizerDisableSpeculation
IndexedPropertyGetterCallback getter
V8_INLINE Local< Value > SourceMapUrl() const
@ kRegExpMatchIsFalseishOnJSRegExp
@ kGCTypeProcessWeakCallbacks
void size_t ArrayBufferCreationMode mode
void DecreaseAllocatedSize(size_t bytes)
void AllowCodeGenerationFromStrings(bool allow)
EscapableHandleScope(Isolate *isolate)
JSEntryStub js_run_microtasks_entry_stub
~SafeForTerminationScope()
V8_INLINE ScriptOriginOptions(int flags)
void operator=(const ValueSerializer &)=delete
bool IsArrayBuffer() const
static const int kJSSpecialApiObjectType
V8_INLINE Persistent & operator=(const Persistent &that)
WasmMemoryObject()=delete
static Local< Float64Array > New(Local< SharedArrayBuffer > shared_array_buffer, size_t byte_offset, size_t length)
static V8_INLINE Uint32Array * Cast(Value *obj)
void SetSecurityToken(Local< Value > token)
Local< Value > GetPrototype()
Local< String > GetSource() const
Local< Value > Description() const
static void SetEntropySource(EntropySource source)
bool CanBeRehashed() const
Isolate(const Isolate &)=delete
static uint32_t CachedDataVersionTag()
AllowJavascriptExecutionScope(const AllowJavascriptExecutionScope &)=delete
GenericNamedPropertySetterCallback setter
static const int kHolderIndex
uint32_t GetWireFormatVersion() const
void Abort(MaybeLocal< Value > exception)
V8_INLINE v8::Local< v8::Value > Get(v8::Isolate *isolate) const
static Local< Symbol > GetHasInstance(Isolate *isolate)
virtual ~Allocator()=default
MicrotasksScope(const MicrotasksScope &)=delete
static void EmptyDeleter(void *data, size_t length, void *deleter_data)
virtual bool IsRootForNonTracingGC(const v8::TracedGlobal< v8::Value > &handle)
static Isolate * GetCurrent()
bool IsInt16Array() const
static const int kJSApiObjectType
const char * cached_data() const
virtual void VisitTracedReference(const TracedReference< Value > &handle)
static CachedData * CreateCodeCache(Local< UnboundScript > unbound_script)
static const int kExternalOneByteRepresentationTag
bool IsFunctionTemplate() const
static V8_WARN_UNUSED_RESULT MaybeLocal< String > NewFromUtf8(Isolate *isolate, const char *data, NewStringType type=NewStringType::kNormal, int length=-1)
size_t ByteLength() const
CounterLookupCallback counter_lookup_callback
V8_INLINE bool operator==(const Maybe &other) const
size_t total_available_size()
ScriptOrigin GetScriptOrigin() const
std::shared_ptr< BackingStore > GetBackingStore()
bool IsExecutionTerminating()
V8_INLINE bool operator!=(const PersistentBase< S > &that) const
Local< Value > GetScriptName()
V8_INLINE MaybeLocal< T > EscapeMaybe(MaybeLocal< T > value)
bool IsSyntheticModule() const
const line_info_t * line_number_table
void CancelTerminateExecution()
bool HasTerminated() const
V8_INLINE bool operator!=(const Maybe &other) const
Local< FixedArray > GetModuleRequests() const
static V8_INLINE internal::Address * GetRoot(v8::Isolate *isolate, int index)
void EnqueueMicrotask(Local< Function > microtask)
V8_INLINE void Set(int32_t i)
static const int kJSObjectType
static V8_INLINE Int16Array * Cast(Value *obj)
void Reset(Isolate *isolate, const Local< S > &other)
void set_max_old_generation_size_in_bytes(size_t limit)
V8_INLINE Local< Value > GetEmbedderData(int index)
IndexedPropertyDefinerCallback definer
bool MakeExternal(ExternalOneByteStringResource *resource)
Value(Isolate *isolate, Local< v8::Value > obj)
void operator=(const ExternalStringResourceBase &)=delete
Source & operator=(const Source &)=delete
void * DeleterData() const
static ScriptStreamingTask * StartStreaming(Isolate *isolate, StreamedSource *source, ScriptType type=ScriptType::kClassic)
static Local< Symbol > GetReplace(Isolate *isolate)
virtual void EnqueueMicrotask(v8::Isolate *isolate, MicrotaskCallback callback, void *data=nullptr)=0
JitCodeEventHandler code_event_handler
static Local< SharedArrayBuffer > New(Isolate *isolate, size_t byte_length)
V8_WARN_UNUSED_RESULT Maybe< int > GetStartColumn(Local< Context > context) const
constexpr MemorySpan(T *data, size_t size)
static Local< Value > Error(Local< String > message)
virtual void AddMicrotasksCompletedCallback(MicrotasksCompletedCallbackWithData callback, void *data=nullptr)=0
bool IsWasmMemoryObject() const
bool IsGeneratorFunction() const
static V8_INLINE Boolean * Cast(v8::Data *data)
static Local< Symbol > GetToPrimitive(Isolate *isolate)
Local< T > Get(Isolate *isolate) const
void DateTimeConfigurationChangeNotification(TimeZoneDetection time_zone_detection=TimeZoneDetection::kSkip)
bool IsBigUint64Array() const
void SetHostImportModuleDynamicallyCallback(HostImportModuleDynamicallyWithImportAssertionsCallback callback)
V8_INLINE ScriptOriginOptions Options() const
void Set(Local< Name > name, Local< Data > value, PropertyAttribute attributes=None)
static void InitializePlatform(Platform *platform)
StreamedSource(std::unique_ptr< ExternalSourceStream > source_stream, Encoding encoding)
static Local< Symbol > GetSearch(Isolate *isolate)
V8_WARN_UNUSED_RESULT MaybeLocal< Set > Add(Local< Context > context, Local< Value > key)
V8_WARN_UNUSED_RESULT Maybe< bool > HasOwnProperty(Local< Context > context, Local< Name > key)
size_t initial_old_generation_size_in_bytes() const
static V8_INLINE Int32 * Cast(v8::Data *data)
V8_INLINE Isolate * GetIsolate() const
void Reset(Isolate *isolate, const Local< S > &other)
Local< Value > GetContinuationPreservedEmbedderData() const
static V8_INLINE Uint32 * Cast(v8::Data *data)
bool IdleNotificationDeadline(double deadline_in_seconds)
void EnqueueMicrotask(MicrotaskCallback callback, void *data=nullptr)
static V8_INLINE StringObject * Cast(Value *obj)
static const int kStringEncodingMask
MaybeLocal< Context > GetCreationContext()
void RemoveGCPrologueCallback(GCCallbackWithData, void *data=nullptr)
SuppressMicrotaskExecutionScope(Isolate *isolate, MicrotaskQueue *microtask_queue=nullptr)
Local< StackFrame > GetFrame(Isolate *isolate, uint32_t index) const
virtual ~TracedGlobalHandleVisitor()=default
static const int kNullOddballKind
static V8_WARN_UNUSED_RESULT MaybeLocal< String > NewFromTwoByte(Isolate *isolate, const uint16_t *data, NewStringType type=NewStringType::kNormal, int length=-1)
size_t AllocationLength() const
static const int kIsolateIndex
V8_INLINE ScriptOrigin(Local< Value > resource_name, int resource_line_offset=0, int resource_column_offset=0, bool resource_is_shared_cross_origin=false, int script_id=-1, Local< Value > source_map_url=Local< Value >(), bool resource_is_opaque=false, bool is_wasm=false, bool is_module=false, Local< PrimitiveArray > host_defined_options=Local< PrimitiveArray >())
@ kRegExpPrototypeStickyGetter
void RemoveGCPrologueCallback(GCCallback callback)
V8_INLINE bool operator==(const Maybe &other) const
static Local< Int32Array > New(Local< ArrayBuffer > array_buffer, size_t byte_offset, size_t length)
Local< FixedArray > GetImportAssertions() const
V8_WARN_UNUSED_RESULT MaybeLocal< Value > CallAsConstructor(Local< Context > context, int argc, Local< Value > argv[])
V8_WARN_UNUSED_RESULT Maybe< int > GetEndColumn(Local< Context > context) const
@ kReadonlySpaceFirstPageAddress
static const int kInternalFieldCount
size_t CopyContents(void *dest, size_t byte_length)
void SetAlignedPointerInInternalField(int index, void *value)
virtual void MeasurementComplete(const std::vector< std::pair< Local< Context >, size_t >> &context_sizes_in_bytes, size_t unattributed_size_in_bytes)=0
static V8_WARN_UNUSED_RESULT MaybeLocal< RegExp > New(Local< Context > context, Local< String > pattern, Flags flags)
virtual void ThrowDataCloneError(Local< String > message)=0
@ CODE_START_LINE_INFO_RECORDING
virtual Maybe< uint32_t > GetWasmModuleTransferId(Isolate *isolate, Local< WasmModuleObject > module)
V8_WARN_UNUSED_RESULT MaybeLocal< Int32 > ToInt32(Local< Context > context) const
static Local< Symbol > GetIsConcatSpreadable(Isolate *isolate)
@ kNoCacheBecauseInlineScript
@ kObjectPrototypeHasElements
bool IsExternalOneByte() const
V8_INLINE TracedGlobal(TracedGlobal< S > &&other)
@ kNoCacheBecauseCacheTooCold
static std::unique_ptr< BackingStore > NewBackingStore(Isolate *isolate, size_t byte_length)
IndexedPropertyDeleterCallback deleter
bool GetHeapObjectStatisticsAtLastGC(HeapObjectStatistics *object_statistics, size_t type_index)
static const int kNoLineNumberInfo
bool IsSharedArrayBuffer() const
static Local< Symbol > GetMatch(Isolate *isolate)
size_t total_heap_size_executable()
PropertyHandlerFlags flags
~AllowJavascriptExecutionScope()
static V8_INLINE Local< T > New(Isolate *isolate, Local< T > that)
void MarkAsUndetectable()
void SetWasmLoadSourceMapCallback(WasmLoadSourceMapCallback callback)
V8_INLINE TracedGlobal & operator=(const TracedGlobal &rhs)
static void SetReturnAddressLocationResolver(ReturnAddressLocationResolver return_address_resolver)
@ kPromiseRejectWithNoHandler
V8_INLINE Isolate * GetIsolate() const
virtual size_t length() const =0
static const bool kResetInDestructor
MicrotasksScope(Isolate *isolate, Type type)
@ kAttemptOverrideReadOnlyOnPrototypeStrict
void SetAccessorProperty(Local< Name > name, Local< Function > getter, Local< Function > setter=Local< Function >(), PropertyAttribute attribute=None, AccessControl settings=DEFAULT)
void operator=(const SnapshotCreator &)=delete
GenericNamedPropertyDefinerCallback definer
static std::shared_ptr< WasmStreaming > Unpack(Isolate *isolate, Local< Value > value)
V8_WARN_UNUSED_RESULT V8_INLINE bool To(T *out) const
V8_WARN_UNUSED_RESULT MaybeLocal< Map > Set(Local< Context > context, Local< Value > key, Local< Value > value)
TracedGlobal(Isolate *isolate, Local< S > that)
void GetStackSample(const RegisterState &state, void **frames, size_t frames_limit, SampleInfo *sample_info)
V8_WARN_UNUSED_RESULT Maybe< bool > DefineOwnProperty(Local< Context > context, Local< Name > key, Local< Value > value, PropertyAttribute attributes=None)
@ kGCCallbackFlagCollectAllAvailableGarbage
static V8_INLINE void * GetAlignedPointerFromInternalField(const BasicTracedReference< Object > &object, int index)
PropertyDescriptor(Local< Value > get, Local< Value > set)
void IsolateInBackgroundNotification()
GenericNamedPropertyQueryCallback query
void AttachCppHeap(CppHeap *)
static Local< Value > TypeError(Local< String > message)
V8_WARN_UNUSED_RESULT Maybe< bool > Delete(Local< Context > context, Local< Value > key)
static V8_INLINE Local< T > New(Isolate *isolate, const PersistentBase< T > &that)
MicrotasksPolicy GetMicrotasksPolicy() const
TracedReference(Isolate *isolate, Local< S > that)
static V8_INLINE BigInt * Cast(v8::Data *data)
V8_WARN_UNUSED_RESULT Maybe< int64_t > IntegerValue(Local< Context > context) const
Local< Value > GetScriptResourceName() const
void VisitWeakHandles(PersistentHandleVisitor *visitor)
Local< StackTrace > GetStackTrace() const
static Local< StackTrace > CurrentStackTrace(Isolate *isolate, int frame_limit, StackTraceOptions options=kDetailed)
const char ** end() const
static V8_WARN_UNUSED_RESULT MaybeLocal< Script > Compile(Local< Context > context, StreamedSource *source, Local< String > full_source_string, const ScriptOrigin &origin)
HeapProfiler * GetHeapProfiler()
static constexpr V8_INLINE bool IsValidSmi(intptr_t value)
#define V8_PROMISE_INTERNAL_FIELD_COUNT
V8_INLINE bool operator!=(const Local< S > &that) const
const V8_INLINE CachedData * GetCachedData() const
V8_INLINE Persistent(Isolate *isolate, const Persistent< S, M2 > &that)
V8_WARN_UNUSED_RESULT MaybeLocal< Value > Evaluate(Local< Context > context)
static const int kUndefinedOddballKind
static Local< Value > ReferenceError(Local< String > message)
static Local< Uint32Array > New(Local< SharedArrayBuffer > shared_array_buffer, size_t byte_offset, size_t length)
bool StringEquals(Local< String > str)
@ kUseCounterFeatureCount
std::unique_ptr< const uint8_t[]> buffer
static Local< Value > New(Isolate *isolate, double value)
Local< ArrayBuffer > Buffer()
Local< Value > GetModuleNamespace()
static V8_INLINE ArrayBuffer * Cast(Value *obj)
void GetCodeRange(void **start, size_t *length_in_bytes)
static V8_INLINE Date * Cast(Value *obj)
V8_WARN_UNUSED_RESULT Maybe< bool > Set(Local< Context > context, uint32_t index, Local< Value > value)
void GarbageCollectionForTesting(EmbedderStackState stack_state)
const uint16_t * operator*() const
static const int kEmbedderFieldCount
void SetHandler(const NamedPropertyHandlerConfiguration &configuration)
static Local< Int8Array > New(Local< SharedArrayBuffer > shared_array_buffer, size_t byte_offset, size_t length)
HandleScope(const HandleScope &)=delete
static const int kNoScriptId
void SetAllowAtomicsWait(bool allow)
@ kInvalidatedArrayBufferDetachingProtector
void SetCreateHistogramFunction(CreateHistogramCallback)
void SetAccessorProperty(Local< Name > name, Local< FunctionTemplate > getter=Local< FunctionTemplate >(), Local< FunctionTemplate > setter=Local< FunctionTemplate >(), PropertyAttribute attribute=None, AccessControl settings=DEFAULT)
void SetErrorMessageForCodeGenerationFromStrings(Local< String > message)
V8_WARN_UNUSED_RESULT Maybe< bool > HasRealNamedCallbackProperty(Local< Context > context, Local< Name > key)
void SetTreatArrayBufferViewsAsHostObjects(bool mode)
int GetSourceOffset() const
friend class internal::CustomArguments
TracedReference< T > & operator=(const TracedReference< S > &rhs)
V8_INLINE uint16_t WrapperClassId() const
bool IsDetachable() const
bool configurable() const
@ kCodeSpaceFirstPageAddress
static V8_INLINE Integer * Cast(v8::Data *data)
friend class WeakCallbackInfo
V8_EXPORT internal::Isolate * IsolateFromNeverReadOnlySpaceObject(Address obj)
static std::unique_ptr< BackingStore > Reallocate(v8::Isolate *isolate, std::unique_ptr< BackingStore > backing_store, size_t byte_length)
V8_INLINE Local< Object > Holder() const
Local< ArrayBuffer > Buffer()
void RemoveMicrotasksCompletedCallback(MicrotasksCompletedCallbackWithData callback, void *data=nullptr)
@ kInvalidatedSetIteratorLookupChainProtector
void operator=(const Extension &)=delete
ExtensionConfiguration(int name_count, const char *names[])
MaybeLocal< String > modified_source
V8_INLINE Unlocker(Isolate *isolate)
uint32_t GetNumberOfEmbedderDataFields()
bool MakeExternal(ExternalStringResource *resource)
SnapshotCreator(Isolate *isolate, const intptr_t *external_references=nullptr, StartupData *existing_blob=nullptr)
void TransferArrayBuffer(uint32_t transfer_id, Local< ArrayBuffer > array_buffer)
virtual void OnModuleCompiled(CompiledWasmModule compiled_module)=0
Local< Boolean > ToBoolean(Isolate *isolate) const
SafeForTerminationScope(const SafeForTerminationScope &)=delete
V8_WARN_UNUSED_RESULT Maybe< bool > HasOwnProperty(Local< Context > context, uint32_t index)
@ kDateToLocaleTimeString
IndexedPropertyHandlerConfiguration(IndexedPropertyGetterCallback getter, IndexedPropertySetterCallback setter, IndexedPropertyDescriptorCallback descriptor, IndexedPropertyDeleterCallback deleter, IndexedPropertyEnumeratorCallback enumerator, IndexedPropertyDefinerCallback definer, Local< Value > data=Local< Value >(), PropertyHandlerFlags flags=PropertyHandlerFlags::kNone)
virtual size_t length() const =0
static V8_WARN_UNUSED_RESULT MaybeLocal< String > Stringify(Local< Context > context, Local< Value > json_object, Local< String > gap=Local< String >())
wasm_source_info_t * wasm_source_info
bool IsEmptyThreadSafe() const
static const int kFirstNonstringType
void SetAccessor(Local< Name > name, AccessorNameGetterCallback getter, AccessorNameSetterCallback setter=nullptr, Local< Value > data=Local< Value >(), AccessControl settings=DEFAULT, PropertyAttribute attribute=None, Local< AccessorSignature > signature=Local< AccessorSignature >(), SideEffectType getter_side_effect_type=SideEffectType::kHasSideEffect, SideEffectType setter_side_effect_type=SideEffectType::kHasSideEffect)
V8_INLINE ScriptOrigin(Isolate *isolate, Local< Value > resource_name, int resource_line_offset=0, int resource_column_offset=0, bool resource_is_shared_cross_origin=false, int script_id=-1, Local< Value > source_map_url=Local< Value >(), bool resource_is_opaque=false, bool is_wasm=false, bool is_module=false, Local< PrimitiveArray > host_defined_options=Local< PrimitiveArray >())
static V8_WARN_UNUSED_RESULT MaybeLocal< Value > New(Local< Context > context, double time)
void SetMetricsRecorder(const std::shared_ptr< metrics::Recorder > &metrics_recorder)
void RequestGarbageCollectionForTesting(GarbageCollectionType type)
void AddBeforeCallEnteredCallback(BeforeCallEnteredCallback callback)
static const int kExternalTwoByteRepresentationTag
static Local< ObjectTemplate > New(Isolate *isolate, Local< FunctionTemplate > constructor=Local< FunctionTemplate >())
SafeForTerminationScope(v8::Isolate *isolate)
static V8_WARN_UNUSED_RESULT MaybeLocal< Value > Parse(Local< Context > context, Local< String > json_string)
static const int kEmbedderDataSlotSize
Local< Promise > GetPromise()
void * AllocationBase() const
internal::Address * args_
~DisallowJavascriptExecutionScope()
V8_INLINE Local< Value > GetInternalField(int index)
Locker(const Locker &)=delete
static const int kTrueValueRootIndex
static Local< BigInt64Array > New(Local< SharedArrayBuffer > shared_array_buffer, size_t byte_offset, size_t length)
@ kNoCacheBecauseNoResource
V8_INLINE void * GetAlignedPointerFromEmbedderData(int index)
Local< Value > Exception() const
NamedPropertyHandlerConfiguration(GenericNamedPropertyGetterCallback getter, GenericNamedPropertySetterCallback setter, GenericNamedPropertyDescriptorCallback descriptor, GenericNamedPropertyDeleterCallback deleter, GenericNamedPropertyEnumeratorCallback enumerator, GenericNamedPropertyDefinerCallback definer, Local< Value > data=Local< Value >(), PropertyHandlerFlags flags=PropertyHandlerFlags::kNone)
virtual void VisitTracedGlobalHandle(const TracedGlobal< Value > &handle)
static const bool kResetInDestructor
@ kFunctionTokenOffsetTooLongForToString
static Local< Symbol > GetAsyncIterator(Isolate *isolate)
V8_INLINE T FromMaybe(const T &default_value) const
bool IsGeneratorObject() const
DeleterCallback Deleter() const
size_t code_and_metadata_size()
@ HINT_MANY_WRITES_EXPECTED
static V8_INLINE internal::Isolate * GetIsolateForHeapSandbox(internal::Address obj)
void RemoveGCEpilogueCallback(GCCallbackWithData callback, void *data=nullptr)
@ kInvalidatedMapIteratorLookupChainProtector
@ kRegExpExecCalledOnSlowRegExp
void RemoveCallCompletedCallback(CallCompletedCallback callback)
V8_WARN_UNUSED_RESULT Maybe< bool > Reject(Local< Context > context, Local< Value > value)
@ kPromiseHandlerAddedAfterReject
void SetAccessCheckCallbackAndHandler(AccessCheckCallback callback, const NamedPropertyHandlerConfiguration &named_handler, const IndexedPropertyHandlerConfiguration &indexed_handler, Local< Value > data=Local< Value >())
@ kStringToLocaleUpperCase
static V8_WARN_UNUSED_RESULT MaybeLocal< Value > StackTrace(Local< Context > context, Local< Value > exception)
@ kInvalidatedStringIteratorLookupChainProtector
void SetFailedAccessCheckCallbackFunction(FailedAccessCheckCallback)
static const int kDataIndex
void MemoryPressureNotification(MemoryPressureLevel level)
static void SetSnapshotDataBlob(StartupData *startup_blob)
virtual void EnqueueMicrotask(Isolate *isolate, Local< Function > microtask)=0
TracedGlobal< T > & operator=(TracedGlobal< S > &&rhs)
int ContextDisposedNotification(bool dependant_context=true)
void set_enumerable(bool enumerable)
static V8_INLINE Set * Cast(Value *obj)
HandleScope(Isolate *isolate)
V8_INLINE bool ShouldThrowOnError() const
V8_INLINE ReturnValue< T > GetReturnValue() const
V8_INLINE Source(Local< String > source_string, const ScriptOrigin &origin, CachedData *cached_data=nullptr)
static const int kLineOffsetNotFound
MicrotaskQueue & operator=(const MicrotaskQueue &)=delete
V8_INLINE bool operator!=(const TracedReferenceBase &lhs, const v8::Local< U > &rhs)
V8_INLINE bool IsJust() const
friend class TracedGlobal
static V8_INLINE Name * Cast(Data *data)
static void SetIsCrossOriginIsolated()
void Reset(Isolate *isolate, const PersistentBase< S > &other)
static Local< Float32Array > New(Local< SharedArrayBuffer > shared_array_buffer, size_t byte_offset, size_t length)
Local< Context > CreationContext()
TryCatch(const TryCatch &)=delete
static V8_INLINE Number * Cast(v8::Data *data)
V8_INLINE Eternal(Isolate *isolate, Local< S > handle)
static V8_INLINE void Copy(const Persistent< S, M > &source, CopyablePersistent *dest)
virtual Maybe< bool > WriteHostObject(Isolate *isolate, Local< Object > object)
V8_WARN_UNUSED_RESULT Maybe< bool > CreateDataProperty(Local< Context > context, Local< Name > key, Local< Value > value)
void operator=(const Locker &)=delete
bool HasIndexedLookupInterceptor()
V8_INLINE void Set(double i)
V8_INLINE ReturnValue(const ReturnValue< S > &that)
virtual void VisitExternalString(Local< String > string)
Maybe< T > Just(const T &t)
Value(const Value &)=delete
internal::Address * implicit_args_
Local< UnboundScript > GetUnboundScript()
V8_WARN_UNUSED_RESULT Maybe< bool > SetSyntheticModuleExport(Isolate *isolate, Local< String > export_name, Local< Value > export_value)
V8_WARN_UNUSED_RESULT MaybeLocal< Value > Run(Local< Context > context)
static V8_INLINE BigInt64Array * Cast(Value *obj)
void operator=(const EscapableHandleScope &)=delete
AddHistogramSampleCallback add_histogram_sample_callback
int Write(Isolate *isolate, uint16_t *buffer, int start=0, int length=-1, int options=NO_OPTIONS) const
#define V8_LIKELY(condition)
Local< Value > Name() const
static Isolate * Allocate()
V8_INLINE bool operator!=(const Local< S > &that) const
const ExternalOneByteStringResource * GetExternalOneByteStringResource() const
int GetLineNumber(int code_pos)
size_t does_zap_garbage()
static V8_INLINE Int32Array * Cast(Value *obj)
Local< Value > ThrowException(Local< Value > exception)
Local< String > ValueOf() const
static CachedData * CreateCodeCache(Local< UnboundModuleScript > unbound_module_script)
void SetAlignedPointerInEmbedderData(int index, void *value)
bool IsSourceTextModule() const
V8_INLINE Local< Object > This() const
void AddGCPrologueCallback(GCCallbackWithData callback, void *data=nullptr, GCType gc_type_filter=kGCTypeAll)
V8_INLINE Isolate * GetIsolate() const
void SetLength(int length)
V8_INLINE ~EscapableHandleScope()=default
size_t external_script_source_size()
size_t number_of_native_contexts()
static V8_INLINE Private * Cast(Data *data)
ArrayBuffer::Allocator * GetArrayBufferAllocator()
MicrotaskQueue * GetMicrotaskQueue()
bool IsBigInt64Array() const
bool has_enumerable() const
size_t ByteLength() const
size_t read_only_space_physical_size()
V8_INLINE void Set(bool value)
int dependency_count() const
static V8_INLINE Uint16Array * Cast(Value *obj)
std::unique_ptr< CalleeSavedRegisters > callee_saved
ExternalStringResource()=default
V8_INLINE void SetWrapperClassId(uint16_t class_id)
void set_max_young_generation_size_in_bytes(size_t limit)
V8_WARN_UNUSED_RESULT MaybeLocal< BigInt > ToBigInt(Local< Context > context) const
Local< UnboundModuleScript > GetUnboundModuleScript()
CompiledWasmModule GetCompiledModule()
@ kInvalidatedPromiseSpeciesLookupChainProtector
const V8_INLINE ScriptOriginOptions & GetResourceOptions() const
virtual void * Reallocate(void *data, size_t old_length, size_t new_length)
void V8_EXPORT RegisterExtension(std::unique_ptr< Extension >)
~ExternalOneByteStringResource() override=default
static Local< Uint8Array > New(Local< ArrayBuffer > array_buffer, size_t byte_offset, size_t length)
Local< Value > GetSecurityToken()
@ kErrorCaptureStackTrace
V8_INLINE bool operator==(const TracedReferenceBase &lhs, const v8::Local< U > &rhs)
static bool IsRunningMicrotasks(Isolate *isolate)
static void Initialize(Isolate *isolate, const CreateParams ¶ms)
@ kInvalidatedNoElementsProtector
static void * JSStackComparableAddress(TryCatch *handler)
@ kMapSpaceFirstPageAddress
constexpr bool HeapSandboxIsEnabled()
@ kCallSiteAPIGetFunctionSloppyCall
@ kPromiseResolveAfterResolved
static V8_INLINE SymbolObject * Cast(Value *obj)
V8_INLINE Local< Value > Get() const
void SetLazyDataProperty(Local< Name > name, AccessorNameGetterCallback getter, Local< Value > data=Local< Value >(), PropertyAttribute attribute=None, SideEffectType getter_side_effect_type=SideEffectType::kHasSideEffect, SideEffectType setter_side_effect_type=SideEffectType::kHasSideEffect)
static void SetDcheckErrorHandler(DcheckErrorCallback that)
Utf8Value(Isolate *isolate, Local< v8::Value > obj)
MaybeLocal< Array > PreviewEntries(bool *is_key_value)
size_t read_only_space_size()
static const int kNullValueRootIndex
static const int kInternalFieldCount
@ kNoCacheBecausePacScript
static V8_INLINE uint8_t GetNodeState(internal::Address *obj)
Local< Data > Get(Local< Context > context, int i) const
bool StrictEquals(Local< Value > that) const
static Local< DataView > New(Local< SharedArrayBuffer > shared_array_buffer, size_t byte_offset, size_t length)
void SetNativeDataProperty(Local< String > name, AccessorGetterCallback getter, AccessorSetterCallback setter=nullptr, Local< Value > data=Local< Value >(), PropertyAttribute attribute=None, Local< AccessorSignature > signature=Local< AccessorSignature >(), AccessControl settings=DEFAULT, SideEffectType getter_side_effect_type=SideEffectType::kHasSideEffect, SideEffectType setter_side_effect_type=SideEffectType::kHasSideEffect)
bool HasPendingBackgroundTasks()
void SetSecondPassCallback(Callback callback) const
static Local< Value > WasmLinkError(Local< String > message)
DisallowJavascriptExecutionScope(Isolate *isolate, OnFailure on_failure)
bool IsCodeLike(Isolate *isolate)
JSEntryStub js_construct_entry_stub
V8_INLINE bool IsNull() const
Local< String > Get() const
static const int kThisIndex
@ kRegExpReplaceCalledOnSlowRegExp
virtual ~Client()=default
void SetAddHistogramSampleFunction(AddHistogramSampleCallback)
void Set(const BasicTracedReference< S > &handle)
bool IsBigIntObject() const
void RemoveMessageListeners(MessageCallback that)
static V8_WARN_UNUSED_RESULT Local< String > NewFromUtf8Literal(Isolate *isolate, const char(&literal)[N], NewStringType type=NewStringType::kNormal)
static Local< FunctionTemplate > New(Isolate *isolate, FunctionCallback callback=nullptr, Local< Value > data=Local< Value >(), Local< Signature > signature=Local< Signature >(), int length=0, ConstructorBehavior behavior=ConstructorBehavior::kAllow, SideEffectType side_effect_type=SideEffectType::kHasSideEffect, const CFunction *c_function=nullptr)
#define V8_ARRAY_BUFFER_VIEW_INTERNAL_FIELD_COUNT
static bool IsLocked(Isolate *isolate)
size_t AddData(Local< T > object)
void SetStackLimit(uintptr_t stack_limit)
static void GetSharedMemoryStatistics(SharedMemoryStatistics *statistics)
virtual bool IsRootForNonTracingGC(const v8::TracedReference< v8::Value > &handle)
const SharedArrayBuffer::Contents ArrayBufferCreationMode mode
void SetJitCodeEventHandler(JitCodeEventOptions options, JitCodeEventHandler event_handler)
bool ContainsOnlyOneByte() const
std::shared_ptr< ArrayBuffer::Allocator > array_buffer_allocator_shared
V8_WARN_UNUSED_RESULT Maybe< double > NumberValue(Local< Context > context) const
void DiscardThreadSpecificMetadata()
static bool PCIsInV8(size_t code_pages_length, const MemoryRange *code_pages, void *pc)
V8_WARN_UNUSED_RESULT MaybeLocal< Integer > ToInteger(Local< Context > context) const
Local< Value > GetBoundFunction() const
static Local< BigInt > NewFromUnsigned(Isolate *isolate, uint64_t value)
virtual const char * data() const =0
@ kHasSideEffectToReceiver
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)
size_t max_old_generation_size_in_bytes() const
void WriteDouble(double value)
bool IsGraphAsync() const
Utf8Value(const Utf8Value &)=delete
@ kExposeFramesAcrossSecurityOrigins
const char * name() const
Local< String > GetScriptNameOrSourceURL() const
bool IsSymbolObject() const
V8_WARN_UNUSED_RESULT bool ReadRawBytes(size_t length, const void **data)
static Local< Number > New(Isolate *isolate, double value)
@ kLineOrParagraphSeparatorAsLineTerminator
@ kSharedArrayBufferConstructed
static MaybeLocal< BigInt > NewFromWords(Local< Context > context, int sign_bit, int word_count, const uint64_t *words)
bool IsCodeGenerationFromStringsAllowed()
size_t peak_malloced_memory()
Local< Value > GetSourceURL()
V8_INLINE Local< T > Get(Isolate *isolate) const
static internal::Address * CreateHandle(internal::Isolate *isolate, internal::Address value)
virtual ~MeasureMemoryDelegate()=default
PropertyDescriptor(Local< Value > value)
V8_INLINE MaybeLocal(Local< S > that)
const void * GetSlotThreadSafe() const
static V8_INLINE ModuleRequest * Cast(Data *data)
V8_INLINE Persistent(Isolate *isolate, Local< S > that)
@ kNoCacheBecauseScriptTooSmall
static Local< BigInt64Array > New(Local< ArrayBuffer > array_buffer, size_t byte_offset, size_t length)
V8_INLINE Local< Primitive > Null(Isolate *isolate)
@ kGCCallbackScheduleIdleGarbageCollection
V8_INLINE bool operator==(const v8::Local< U > &lhs, const TracedReferenceBase &rhs)
V8_WARN_UNUSED_RESULT bool ReadDouble(double *value)
static V8_WARN_UNUSED_RESULT MaybeLocal< UnboundScript > CompileUnboundScript(Isolate *isolate, Source *source, CompileOptions options=kNoCompileOptions, NoCacheReason no_cache_reason=kNoCacheNoReason)
size_t physical_space_size()
static Local< Value > New(Isolate *isolate, bool value)
#define V8_DEPRECATED(message)
@ kHtmlCommentInExternalScript
void Set(Isolate *isolate, int index, Local< Primitive > item)
static const int kHolderIndex
Local< PrimitiveArray > GetHostDefinedOptions()
Local< ObjectTemplate > InstanceTemplate()
@ kDefineGetterOrSetterWouldThrow
PositionType position_type
SafeForTerminationScope & operator=(const SafeForTerminationScope &)=delete
virtual bool IsTracingDone()=0
static Local< AccessorSignature > New(Isolate *isolate, Local< FunctionTemplate > receiver=Local< FunctionTemplate >())
V8_INLINE bool IsNothing() const
static V8_INLINE Uint8ClampedArray * Cast(Value *obj)
static V8_INLINE AccessorSignature * Cast(Data *data)
int GetScriptLineNumber() const
V8_WARN_UNUSED_RESULT Maybe< bool > Delete(Local< Context > context, Local< Value > key)
virtual void Unlock() const
static Local< Float32Array > New(Local< ArrayBuffer > array_buffer, size_t byte_offset, size_t length)
V8_INLINE Local< Object > Holder() const
int GetWasmFunctionIndex() const
void * operator new(size_t size)=delete
size_t initial_young_generation_size_in_bytes() const
static V8_INLINE ObjectTemplate * Cast(Data *data)
@ kRegExpPrototypeToString
static Local< Value > WasmRuntimeError(Local< String > message)
V8_INLINE Local< PrimitiveArray > HostDefinedOptions() const
static Local< Integer > NewFromUnsigned(Isolate *isolate, uint32_t value)
V8_INLINE bool operator!=(const TracedReferenceBase &lhs, const TracedReferenceBase &rhs)
static V8_INLINE void CheckInitialized(v8::Isolate *isolate)
V8_INLINE bool operator==(const Local< S > &that) const
@ kErrorPrepareStackTrace
V8_INLINE bool IsUndefined() const
SnapshotCreator(const SnapshotCreator &)=delete
static MaybeLocal< Function > New(Local< Context > context, FunctionCallback callback, Local< Value > data=Local< Value >(), int length=0, ConstructorBehavior behavior=ConstructorBehavior::kAllow, SideEffectType side_effect_type=SideEffectType::kHasSideEffect)
V8_INLINE TracedReference & operator=(const TracedReference &rhs)
static V8_INLINE BooleanObject * Cast(Value *obj)
Local< Value > get() const
Local< Array > AsArray() const
Local< Value > GetDebugName() const
DeleterCallback Deleter() const
MicrotaskQueue(const MicrotaskQueue &)=delete
IndexedPropertyQueryCallback query
@ kExternalStringResourceTag
AllowJavascriptExecutionScope(Isolate *isolate)
TracedGlobal< T > & operator=(const TracedGlobal< S > &rhs)
void IncreaseHeapLimitForDebugging()
V8_INLINE Persistent(const Persistent &that)
static const int kReturnValueDefaultValueIndex
bool IsStringObject() const
void GetEmbeddedCodeRange(const void **start, size_t *length_in_bytes)
static V8_WARN_UNUSED_RESULT MaybeLocal< Script > Compile(Local< Context > context, Local< String > source, ScriptOrigin *origin=nullptr)
static Local< Object > New(Isolate *isolate, Local< Value > prototype_or_null, Local< Name > *names, Local< Value > *values, size_t length)
V8_WARN_UNUSED_RESULT MaybeLocal< Value > StackTrace(Local< Context > context) const
void SetCallAsFunctionHandler(FunctionCallback callback, Local< Value > data=Local< Value >())
size_t used_global_handles_size()
virtual void RegisterV8References(const std::vector< std::pair< void *, void * > > &embedder_fields)=0
bool has_configurable() const
V8_WARN_UNUSED_RESULT MaybeLocal< String > ToDetailString(Local< Context > context) const
void SetEmbedderHeapTracer(EmbedderHeapTracer *tracer)
void SetClient(std::shared_ptr< Client > client)
V8_WARN_UNUSED_RESULT Maybe< bool > SetLazyDataProperty(Local< Context > context, Local< Name > name, AccessorNameGetterCallback getter, Local< Value > data=Local< Value >(), PropertyAttribute attributes=None, SideEffectType getter_side_effect_type=SideEffectType::kHasSideEffect, SideEffectType setter_side_effect_type=SideEffectType::kHasSideEffect)
V8_INLINE T ToChecked() const
@ kDateToLocaleDateString
GenericNamedPropertyDeleterCallback deleter
static Local< Context > New(Isolate *isolate, ExtensionConfiguration *extensions=nullptr, MaybeLocal< ObjectTemplate > global_template=MaybeLocal< ObjectTemplate >(), MaybeLocal< Value > global_object=MaybeLocal< Value >(), DeserializeInternalFieldsCallback internal_fields_deserializer=DeserializeInternalFieldsCallback(), MicrotaskQueue *microtask_queue=nullptr)
size_t total_physical_size()
void RestoreOriginalHeapLimit()
V8_WARN_UNUSED_RESULT bool ReadUint64(uint64_t *value)
@ kInvalidatedPromiseHookProtector
Local< Context > GetCurrentContext()
static Local< FunctionTemplate > NewWithCache(Isolate *isolate, FunctionCallback callback, Local< Private > cache_property, Local< Value > data=Local< Value >(), Local< Signature > signature=Local< Signature >(), int length=0, SideEffectType side_effect_type=SideEffectType::kHasSideEffect)
static V8_INLINE TypedArray * Cast(Value *obj)
virtual void TraceEpilogue(TraceSummary *trace_summary)
void DisableMemorySavingsMode()
~WasmModuleObjectBuilderStreaming()=default
void SetGetExternallyAllocatedMemoryInBytesCallback(GetExternallyAllocatedMemoryInBytesCallback callback)
ValueSerializer(const ValueSerializer &)=delete
static V8_INLINE Float64Array * Cast(Value *obj)
internal::Address * values_
V8_WARN_UNUSED_RESULT Maybe< PropertyAttribute > GetRealNamedPropertyAttributes(Local< Context > context, Local< Name > key)
static Local< DataView > New(Local< ArrayBuffer > array_buffer, size_t byte_offset, size_t length)
void SetWasmStreamingCallback(WasmStreamingCallback callback)
bool GetHeapSpaceStatistics(HeapSpaceStatistics *space_statistics, size_t index)
IndexedPropertyEnumeratorCallback enumerator
void LowMemoryNotification()
V8_INLINE FunctionCallbackInfo(internal::Address *implicit_args, internal::Address *values, int length)
V8_INLINE Local< Boolean > False(Isolate *isolate)
@ kArrayPrototypeConstructorModified
V8_INLINE bool IsString() const
static V8_INLINE void * GetAlignedPointerFromInternalField(const PersistentBase< Object > &object, int index)
static V8_INLINE WasmMemoryObject * Cast(Value *obj)
static const int kStringResourceOffset
@ kInvalidatedRegExpSpeciesLookupChainProtector
static Local< BigInt > New(Isolate *isolate, int64_t value)
const intptr_t * external_references
RegisterState(const RegisterState &other)
void EnableMemorySavingsMode()
static Local< Uint32Array > New(Local< ArrayBuffer > array_buffer, size_t byte_offset, size_t length)
static Local< Signature > New(Isolate *isolate, Local< FunctionTemplate > receiver=Local< FunctionTemplate >())
static Local< ArrayBuffer > New(Isolate *isolate, size_t byte_length)
size_t CopyCodePages(size_t capacity, MemoryRange *code_pages_out)
@ kGCTypeMarkSweepCompact
@ kPromiseRejectAfterResolved
static constexpr int kMaxLength
PrivateData * get_private() const
@ kAttemptOverrideReadOnlyOnPrototypeSloppy
static Local< String > Concat(Isolate *isolate, Local< String > left, Local< String > right)
void SetPromiseRejectCallback(PromiseRejectCallback callback)
bool SameValue(Local< Value > that) const
void set_stack_limit(uint32_t *value)
void operator=(const Value &)=delete
static const int kEmbedderDataArrayHeaderSize
static V8_WARN_UNUSED_RESULT MaybeLocal< String > NewExternalTwoByte(Isolate *isolate, ExternalStringResource *resource)
static V8_INLINE int InternalFieldCount(const PersistentBase< Object > &object)
V8_WARN_UNUSED_RESULT Maybe< int > GetLineNumber(Local< Context > context) const
@ kArrayInstanceProtoModified
void TerminateExecution()
Local< String > TypeOf(Isolate *)
static const uint32_t kNumIsolateDataSlots
static void InitializeExternalStartupData(const char *directory_path)
V8_WARN_UNUSED_RESULT MaybeLocal< Array > GetOwnPropertyNames(Local< Context > context)
Extension(const char *name, const char *source=nullptr, int dep_count=0, const char **deps=nullptr, int source_length=-1)
V8_INLINE Local< Boolean > True(Isolate *isolate)
void SetContinuationPreservedEmbedderData(Local< Value > context)
DisallowJavascriptExecutionScope & operator=(const DisallowJavascriptExecutionScope &)=delete
V8_INLINE void * GetAlignedPointerFromInternalField(int index)
size_t code_range_size_in_bytes() const
void SetWasmSimdEnabledCallback(WasmSimdEnabledCallback callback)
V8_INLINE HandleScope()=default
V8_WARN_UNUSED_RESULT Maybe< bool > Set(Local< Context > context, Local< Value > key, Local< Value > value)
V8_WARN_UNUSED_RESULT MaybeLocal< Object > NewRemoteInstance()
int embedder_wrapper_object_index
@ kInvalidatedPromiseResolveLookupChainProtector
V8_INLINE Local< Value > NewTarget() const
V8_WARN_UNUSED_RESULT MaybeLocal< Object > NewInstance(Local< Context > context)
void SetAccessCheckCallback(AccessCheckCallback callback, Local< Value > data=Local< Value >())
GenericNamedPropertyEnumeratorCallback enumerator
static V8_WARN_UNUSED_RESULT MaybeLocal< RegExp > NewWithBacktrackLimit(Local< Context > context, Local< String > pattern, Flags flags, uint32_t backtrack_limit)
void Externalize(const std::shared_ptr< BackingStore > &backing_store)
RegisterState & operator=(const RegisterState &other)
V8_INLINE TracedReference(const TracedReference< S > &other)
Local< String > GetConstructorName()
MaybeLocal< T > GetDataFromSnapshotOnce(size_t index)
@ kInvalidatedTypedArraySpeciesLookupChainProtector
V8_INLINE Local< Value > ResourceName() const
Local< Value > GetException() const
static void InitializeExternalStartupDataFromFile(const char *snapshot_blob)
NamedPropertyHandlerConfiguration(GenericNamedPropertyGetterCallback getter, GenericNamedPropertySetterCallback setter, GenericNamedPropertyQueryCallback query, GenericNamedPropertyDeleterCallback deleter, GenericNamedPropertyEnumeratorCallback enumerator, GenericNamedPropertyDefinerCallback definer, GenericNamedPropertyDescriptorCallback descriptor, Local< Value > data=Local< Value >(), PropertyHandlerFlags flags=PropertyHandlerFlags::kNone)
static V8_INLINE internal::Address ReadTaggedPointerField(internal::Address heap_object_ptr, int offset)
V8_WARN_UNUSED_RESULT MaybeLocal< Value > GetRealNamedProperty(Local< Context > context, Local< Name > key)
OwnedBuffer(std::unique_ptr< const uint8_t[]> buffer, size_t size)
@ kLegacyFunctionDeclaration
Maybe< bool > SetIntegrityLevel(Local< Context > context, IntegrityLevel level)
friend class PersistentBase
static Local< Int16Array > New(Local< ArrayBuffer > array_buffer, size_t byte_offset, size_t length)
void SetCallHandler(FunctionCallback callback, Local< Value > data=Local< Value >(), SideEffectType side_effect_type=SideEffectType::kHasSideEffect, const CFunction *c_function=nullptr)
bool AddMessageListener(MessageCallback that, Local< Value > data=Local< Value >())
bool GetHeapCodeAndMetadataStatistics(HeapCodeStatistics *object_statistics)
DisallowJavascriptExecutionScope(const DisallowJavascriptExecutionScope &)=delete
static const int kDataIndex
V8_WARN_UNUSED_RESULT MaybeLocal< Object > NewInstanceWithSideEffectType(Local< Context > context, int argc, Local< Value > argv[], SideEffectType side_effect_type=SideEffectType::kHasSideEffect) const
size_t bytecode_and_metadata_size()
void set_configurable(bool configurable)
StreamedSource & operator=(const StreamedSource &)=delete
static ScriptStreamingTask * StartStreamingScript(Isolate *isolate, StreamedSource *source, CompileOptions options=kNoCompileOptions)
static V8_INLINE Promise * Cast(Value *obj)
friend class BasicTracedReference
V8_INLINE bool operator!=(const Persistent< S > &that) const
V8_INLINE bool IsNothing() const
static Local< Int16Array > New(Local< SharedArrayBuffer > shared_array_buffer, size_t byte_offset, size_t length)
void SetCounterFunction(CounterLookupCallback)
V8_WARN_UNUSED_RESULT Maybe< bool > CreateDataProperty(Local< Context > context, uint32_t index, Local< Value > value)
void Inherit(Local< FunctionTemplate > parent)
bool IsArgumentsObject() const
Local< Context > GetIncumbentContext()
static Local< Map > New(Isolate *isolate)
IndexedPropertyDescriptorCallback descriptor
V8_WARN_UNUSED_RESULT Maybe< bool > Has(Local< Context > context, Local< Value > key)
V8_INLINE Locker(Isolate *isolate)
V8_WARN_UNUSED_RESULT MaybeLocal< Value > CallAsFunction(Local< Context > context, Local< Value > recv, int argc, Local< Value > argv[])
int GetEndPosition() const
void operator=(const SealHandleScope &)=delete
MaybeLocal< Promise > MeasureMemory(Local< Context > context, MeasureMemoryMode mode)
Maybe< bool > SetPrivate(Local< Context > context, Local< Private > key, Local< Value > value)
int GetScriptColumnNumber() const
V8_WARN_UNUSED_RESULT Maybe< bool > HasRealIndexedProperty(Local< Context > context, uint32_t index)
V8_INLINE Global(Isolate *isolate, Local< S > that)
Local< Symbol > ValueOf() const
void SetAbortScriptExecution(AbortScriptExecutionCallback callback)
V8_INLINE Scope(Local< Context > context)
size_t NumberOfPhantomHandleResetsSinceLastCall()
virtual void PerformCheckpoint(Isolate *isolate)=0
static const int kOddballType
@ kNoCacheBecauseExtensionModule
static V8_WARN_UNUSED_RESULT MaybeLocal< Module > CompileModule(Isolate *isolate, Source *source, CompileOptions options=kNoCompileOptions, NoCacheReason no_cache_reason=kNoCacheNoReason)
constexpr T * data() const
PromiseRejectMessage(Local< Promise > promise, PromiseRejectEvent event, Local< Value > value)
virtual Maybe< uint32_t > GetSharedArrayBufferId(Isolate *isolate, Local< SharedArrayBuffer > shared_array_buffer)
bool IsUint8Array() const
constexpr bool PointerCompressionIsEnabled()
V8_INLINE Local< Integer > ResourceLineOffset() const
void SetDefaultContext(Local< Context > context, SerializeInternalFieldsCallback callback=SerializeInternalFieldsCallback())
V8_INLINE bool operator!=(const Maybe &other) const
static Local< Value > RangeError(Local< String > message)
static V8_INLINE Map * Cast(Value *obj)
void RemoveGCEpilogueCallback(GCCallback callback)
static V8_INLINE Float32Array * Cast(Value *obj)
bool IsWasmModuleObject() const
#define V8_INTRINSICS_LIST(F)
PersistentBase(const PersistentBase &other)=delete
CachedData(const CachedData &)=delete
void * external_callback_entry
void SetPrototypeProviderTemplate(Local< FunctionTemplate > prototype_provider)
PropertyDescriptor(Local< Value > value, bool writable)
@ kVarRedeclaredCatchBinding
Isolate * GetIsolate() const
Local< Value > GetSourceMappingURL()
static constexpr size_t kMinCodePagesBufferSize
void Abort(MaybeLocal< Value > exception)
V8_INLINE TracedReference(const TracedReference &other)
V8_INLINE bool operator==(const PersistentBase< S > &that) const
void operator=(const TryCatch &)=delete
static V8_INLINE int InternalFieldCount(const BasicTracedReference< Object > &object)
virtual const uint16_t * data() const =0
bool IsFloat64Array() const
static Local< Message > CreateMessage(Isolate *isolate, Local< Value > exception)
static V8_INLINE RegExp * Cast(Value *obj)
int WriteOneByte(Isolate *isolate, uint8_t *buffer, int start=0, int length=-1, int options=NO_OPTIONS) const
void SetUrl(const char *url, size_t length)
static Local< Symbol > GetSplit(Isolate *isolate)
void GetHeapStatistics(HeapStatistics *heap_statistics)
virtual bool AdvanceTracing(double deadline_in_ms)=0
V8_WARN_UNUSED_RESULT Maybe< bool > SetPrototype(Local< Context > context, Local< Value > prototype)
void SetUseCounterCallback(UseCounterCallback callback)
bool IsTypedArray() const
#define V8_WARN_UNUSED_RESULT
@ kRegExpMatchAllWithNonGlobalRegExp
V8_INLINE Local< Promise > GetPromise() const
virtual void EnterFinalPause(EmbedderStackState stack_state)=0
void AutomaticallyRestoreInitialHeapLimit(double threshold_percent=0.5)
void RequestInterrupt(InterruptCallback callback, void *data)
@ kInvalidatedStringLengthOverflowLookupChainProtector
friend class PersistentValueVector
static V8_INLINE Local< String > Empty(Isolate *isolate)
V8_INLINE TracedGlobal< S > & As() const
static const int kEmbedderFieldCount
static int GetCurrentDepth(Isolate *isolate)
StreamedSource(const StreamedSource &)=delete
int GetStartColumn() const
void SetCaptureMessage(bool value)
Local< String > GetFunctionName() const
v8::Isolate * isolate() const
static std::unique_ptr< MicrotaskQueue > New(Isolate *isolate, MicrotasksPolicy policy=MicrotasksPolicy::kAuto)
int GetLineNumber() const
V8_INLINE int ColumnOffset() const
static const int kShouldThrowOnErrorIndex
static V8_WARN_UNUSED_RESULT MaybeLocal< Module > CompileModule(Local< Context > context, StreamedSource *v8_source, Local< String > full_source_string, const ScriptOrigin &origin)
V8_WARN_UNUSED_RESULT MaybeLocal< Object > Exec(Local< Context > context, Local< String > subject)
uint64_t Uint64Value(bool *lossless=nullptr) const
virtual ~ExternalResourceVisitor()=default
V8_INLINE int LineOffset() const
@ kArrayPrototypeHasElements
const char ** begin() const
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)
static V8_WARN_UNUSED_RESULT MaybeLocal< Resolver > New(Local< Context > context)
V8_WARN_UNUSED_RESULT Maybe< bool > Delete(Local< Context > context, Local< Value > key)
V8_INLINE P * ClearWeak()
static MaybeLocal< Context > FromSnapshot(Isolate *isolate, size_t context_snapshot_index, DeserializeInternalFieldsCallback embedder_fields_deserializer=DeserializeInternalFieldsCallback(), ExtensionConfiguration *extensions=nullptr, MaybeLocal< Value > global_object=MaybeLocal< Value >(), MicrotaskQueue *microtask_queue=nullptr)
V8_INLINE BasicTracedReference< S > & As() const
static Local< Integer > New(Isolate *isolate, int32_t value)
virtual MaybeLocal< SharedArrayBuffer > GetSharedArrayBufferFromId(Isolate *isolate, uint32_t clone_id)
@ kNoCacheBecauseDeferredProduceCodeCache
void * operator new[](size_t size)=delete
V8_WARN_UNUSED_RESULT MaybeLocal< Value > Get(Local< Context > context, uint32_t index)
@ kPromiseConstructorReturnedUndefined
void LocaleConfigurationChangeNotification()
V8_INLINE Isolate * GetIsolate() const
V8_WARN_UNUSED_RESULT Maybe< bool > Has(Local< Context > context, Local< Value > key)
void SetModifyCodeGenerationFromStringsCallback(ModifyCodeGenerationFromStringsCallback2 callback)
V8_INLINE T * operator*() const
Local< Primitive > Get(Isolate *isolate, int index)
V8_INLINE TracedReference(TracedReference &&other)
Local< Value > GetInferredName() const
bool only_terminate_in_safe_scope
bool IsAsyncFunction() const
ValueSerializer(Isolate *isolate, Delegate *delegate)
void SetHostInitializeImportMetaObjectCallback(HostInitializeImportMetaObjectCallback callback)
void IncreaseAllocatedSize(size_t bytes)
virtual size_t GetMoreData(const uint8_t **src)=0
static Local< StackTrace > GetStackTrace(Local< Value > exception)
static V8_INLINE Local< Boolean > New(Isolate *isolate, bool value)
static V8_INLINE void * GetEmbedderData(const v8::Isolate *isolate, uint32_t slot)
void ConfigureDefaultsFromHeapSize(size_t initial_heap_size_in_bytes, size_t maximum_heap_size_in_bytes)
V8_INLINE Local< S > As() const
static Local< Object > New(Isolate *isolate)
V8_WARN_UNUSED_RESULT MaybeLocal< Promise > Then(Local< Context > context, Local< Function > handler)
bool HasNamedLookupInterceptor()
static bool InitializeICU(const char *icu_data_file=nullptr)
static V8_INLINE Int8Array * Cast(Value *obj)
static const int kUndefinedValueRootIndex
Local< Value > GetResourceName()
void operator delete(void *ptr)
static V8_INLINE int GetOddballKind(const internal::Address obj)
static V8_INLINE MaybeLocal< Context > GetCreationContext(const PersistentBase< Object > &object)
friend class PropertyCallbackInfo
Local< String > GetScriptName() const
void SetAlignedPointerInInternalFields(int argc, int indices[], void *values[])
bool IsMapIterator() const
V8_WARN_UNUSED_RESULT MaybeLocal< Value > Get(Local< Context > context, Local< Value > key)
void Reset(Isolate *isolate, const Local< S > &other)
size_t NumberOfHeapSpaces()
V8_INLINE void SetWeak(P *parameter, typename WeakCallbackInfo< P >::Callback callback, WeakCallbackType type)
@ kGCCallbackFlagConstructRetainedObjectInfos
virtual void * ReallocateBufferMemory(void *old_buffer, size_t size, size_t *actual_size)
SealHandleScope(Isolate *isolate)
Maybe< bool > InstanceOf(Local< Context > context, Local< Object > object)
void SetRAILMode(RAILMode rail_mode)
WeakCallbackInfo(Isolate *isolate, T *parameter, void *embedder_fields[kEmbedderFieldsInWeakCallback], Callback *callback)
V8_INLINE void AnnotateStrongRetainer(const char *label)
WasmModuleObject()=delete
void AddGCEpilogueCallback(GCCallback callback, GCType gc_type_filter=kGCTypeAll)
EscapableHandleScope(const EscapableHandleScope &)=delete
V8_INLINE Persistent & operator=(const Persistent< S, M2 > &that)
PropertyHandlerFlags flags
static const int kNodeStateIsWeakValue
@ kGCCallbackFlagSynchronousPhantomCallbackProcessing
@ kOptimizedFunctionWithOneShotBytecode
Local< BigInt > ValueOf() const
@ kNoCacheBecauseInDocumentWrite
Isolate & operator=(const Isolate &)=delete
friend class TracedReference
V8_INLINE bool IsEmpty() const
ExternalStringResourceBase(const ExternalStringResourceBase &)=delete
void SetEventLogger(LogEventCallback that)
static V8_INLINE uint32_t GetNumberOfDataSlots()
virtual MaybeLocal< Object > ReadHostObject(Isolate *isolate)
void Externalize(const std::shared_ptr< BackingStore > &backing_store)
virtual ~ExternalStringResourceBase()=default
WasmStreaming(std::unique_ptr< WasmStreamingImpl > impl)
virtual ~Delegate()=default
V8_WARN_UNUSED_RESULT Maybe< bool > DefineProperty(Local< Context > context, Local< Name > key, PropertyDescriptor &descriptor)
void SetMicrotasksPolicy(MicrotasksPolicy policy)
virtual void TracePrologue(TraceFlags flags)
V8_INLINE void SetFinalizationCallback(void *parameter, WeakCallbackInfo< void >::Callback callback)
SuppressMicrotaskExecutionScope(const SuppressMicrotaskExecutionScope &)=delete
static V8_INLINE Persistent< T > & Cast(const Persistent< S > &that)
V8_INLINE TracedReference(TracedReference< S > &&other)
@ kConstructorNonUndefinedPrimitiveReturn
V8_WARN_UNUSED_RESULT MaybeLocal< Array > GetOwnPropertyNames(Local< Context > context, PropertyFilter filter, KeyConversionMode key_conversion=KeyConversionMode::kKeepNumbers)
virtual void Free(void *data, size_t length)=0
@ kSloppyModeBlockScopedFunctionRedefinition
friend Maybe< U > Nothing()
Local< Promise > GetPromise()
static const int kNoScriptIdInfo
static void SetFlagsFromCommandLine(int *argc, char **argv, bool remove_flags)
void SetInternalFieldCount(int value)
static const int kInferShouldThrowMode
static void SetFlagsFromString(const char *str, size_t length)
static Local< External > New(Isolate *isolate, void *value)
V8_WARN_UNUSED_RESULT Maybe< PropertyAttribute > GetRealNamedPropertyAttributesInPrototypeChain(Local< Context > context, Local< Name > key)
V8_INLINE bool IsEmpty() const
virtual bool IsCacheable() const
const char * operator*() const
V8_WARN_UNUSED_RESULT MaybeLocal< Uint32 > ToArrayIndex(Local< Context > context) const
void RemoveBeforeCallEnteredCallback(BeforeCallEnteredCallback callback)
static V8_INLINE Local< T > New(Isolate *isolate, const BasicTracedReference< T > &that)
void SetIndexedPropertyHandler(IndexedPropertyGetterCallback getter, IndexedPropertySetterCallback setter=nullptr, IndexedPropertyQueryCallback query=nullptr, IndexedPropertyDeleterCallback deleter=nullptr, IndexedPropertyEnumeratorCallback enumerator=nullptr, Local< Value > data=Local< Value >())
virtual void ResetToBookmark()
uintptr_t JSStackComparableAddress() const
Source(const Source &)=delete
void SetVerbose(bool value)
static Local< Value > New(Isolate *isolate, int64_t value)
@ kRegExpPrototypeSourceGetter
static Local< Symbol > For(Isolate *isolate, Local< String > description)
V8_WARN_UNUSED_RESULT MaybeLocal< String > GetSourceLine(Local< Context > context) const
V8_WARN_UNUSED_RESULT MaybeLocal< Value > ReadValue(Local< Context > context)
static Local< Uint16Array > New(Local< SharedArrayBuffer > shared_array_buffer, size_t byte_offset, size_t length)
virtual bool SetBookmark()
@ kRegExpMatchIsTrueishOnNonJSRegExp
V8_INLINE TracedGlobal(const TracedGlobal &other)
void size_t ArrayBufferCreationMode mode
static V8_INLINE Proxy * Cast(Value *obj)
void SetWasmModuleCallback(ExtensionCallback callback)
@ kCallSiteAPIGetThisSloppyCall
static V8_INLINE BigIntObject * Cast(Value *obj)
BackupIncumbentScope(Local< Context > backup_incumbent_context)
Local< Value > value() const
void operator=(const PersistentBase &)=delete
const char * object_type()
static Local< Uint8ClampedArray > New(Local< SharedArrayBuffer > shared_array_buffer, size_t byte_offset, size_t length)
V8_INLINE bool IsEmpty() const
void VisitHandlesWithClassIds(PersistentHandleVisitor *visitor)
ValueDeserializer(Isolate *isolate, const uint8_t *data, size_t size, Delegate *delegate)
ValueSerializer(Isolate *isolate)
@ kInvalidatedArrayConstructorProtector
void Set(const Local< S > handle)
void * AllocationBase() const
ExternalStringResourceBase()=default
size_t line_number_table_size
static V8_INLINE SharedArrayBuffer * Cast(Value *obj)
void Copy(const Persistent< S, M2 > &that)
static V8_INLINE String * Cast(v8::Data *data)
static bool InitializeICUDefaultLocation(const char *exec_path, const char *icu_data_file=nullptr)
V8_INLINE void SetEmptyString()
static const int kTheHoleValueRootIndex
static V8_INLINE ArrayBufferView * Cast(Value *obj)
V8_WARN_UNUSED_RESULT MaybeLocal< Array > GetPropertyNames(Local< Context > context)
bool MeasureMemory(std::unique_ptr< MeasureMemoryDelegate > delegate, MeasureMemoryExecution execution=MeasureMemoryExecution::kDefault)
static V8_INLINE Object * Cast(Value *obj)
static V8_WARN_UNUSED_RESULT MaybeLocal< Function > CompileFunctionInContext(Local< Context > context, Source *source, size_t arguments_count, Local< String > arguments[], size_t context_extension_count, Local< Object > context_extensions[], CompileOptions options=kNoCompileOptions, NoCacheReason no_cache_reason=kNoCacheNoReason, Local< ScriptOrModule > *script_or_module_out=nullptr)
bool IsSharedCrossOrigin() const
V8_INLINE bool operator==(const PersistentBase< S > &that) const
@ kInvalidatedArraySpeciesLookupChainProtector
V8_INLINE bool operator!=(const v8::Local< U > &lhs, const TracedReferenceBase &rhs)
V8_INLINE ExternalStringResourceBase * GetExternalStringResourceBase(Encoding *encoding_out) const
V8_INLINE void * GetData(uint32_t slot)
size_t ByteLength() const
size_t number_of_detached_contexts()
Local< Object > FindInstanceInPrototypeChain(Local< FunctionTemplate > tmpl)
V8_INLINE bool operator==(const TracedReferenceBase &lhs, const TracedReferenceBase &rhs)
V8_INLINE Source(Local< String > source_string, CachedData *cached_data=nullptr)
@ kInvalidatedPromiseThenLookupChainProtector
size_t read_only_space_used_size()
virtual void ResetHandleInNonTracingGC(const v8::TracedReference< v8::Value > &handle)
static const int kEmptyStringRootIndex
static Local< Uint8Array > New(Local< SharedArrayBuffer > shared_array_buffer, size_t byte_offset, size_t length)
@ kRegExpPrototypeOldFlagGetter
static V8_INLINE Function * Cast(Value *obj)
V8_INLINE bool operator==(const Local< S > &that) const
void AddNearHeapLimitCallback(NearHeapLimitCallback callback, void *data)
V8_INLINE ReturnValue< T > GetReturnValue() const
int GetIdentityHash() const
Local< Context > GetEnteredOrMicrotaskContext()
internal::ScriptStreamingData * impl() const
V8_INLINE Local< Value > GetValue() const