v8
V8 is Google’s open source high-performance JavaScript and WebAssembly engine, written in C++.
Loading...
Searching...
No Matches
v8 Namespace Reference

Namespaces

namespace  api_internal
 
namespace  base
 
namespace  bigint
 
namespace  debug
 
namespace  detail
 
namespace  internal
 
namespace  metrics
 
namespace  platform
 
namespace  sampler
 
namespace  tracing
 

Classes

struct  AcquireLoadTag
 
class  ActivityControl
 
class  AllocationProfile
 
union  AnyCType
 
class  ApiFunction
 
class  Array
 
class  ArrayBuffer
 
class  ArrayBufferView
 
struct  AsyncContext
 
class  AsyncHooks
 
class  AsyncHooksWrap
 
class  BackingStore
 
class  BasicTracedReference
 
class  BigInt
 
class  BigInt64Array
 
class  BigIntObject
 
class  BigUint64Array
 
class  Boolean
 
class  BooleanObject
 
class  CallDepthScope
 
class  CFunction
 
class  CFunctionInfo
 
class  CheckMessageFromWorkerTask
 
class  CleanUpWorkerTask
 
class  CodeEvent
 
class  CodeEventHandler
 
class  CompiledWasmModule
 
class  CompileHintsCollector
 
class  ContainsOnlyOneByteHelper
 
class  Context
 
class  ConvertableToTraceFormat
 
class  Counter
 
class  CounterCollection
 
class  CppHeap
 
struct  CppHeapCreateParams
 
struct  CppHeapPointerTagRange
 
class  CpuProfile
 
struct  CpuProfileDeoptFrame
 
struct  CpuProfileDeoptInfo
 
class  CpuProfileNode
 
class  CpuProfiler
 
class  CpuProfilingOptions
 
struct  CpuProfilingResult
 
class  CTypeInfo
 
class  CTypeInfoBuilder
 
class  CustomSpaceStatisticsReceiver
 
class  D8Console
 
class  D8Testing
 
class  Data
 
class  DataView
 
class  Date
 
class  DefaultGlobalMapTraits
 
class  DefaultPersistentValueMapTraits
 
class  DelayedTasksPlatform
 
struct  DeserializeAPIWrapperCallback
 
struct  DeserializeContextDataCallback
 
struct  DeserializeInternalFieldsCallback
 
class  Deserializer
 
class  DictionaryTemplate
 
class  DiscardedSamplesDelegate
 
class  DummySourceStream
 
struct  DynamicImportData
 
class  EmbedderGraph
 
class  EmbedderRootsHandler
 
class  EmbedderStateScope
 
class  EscapableHandleScope
 
class  EscapableHandleScopeBase
 
class  Eternal
 
class  Exception
 
class  ExceptionPropagationMessage
 
class  ExecArgs
 
class  Extension
 
class  ExtensionConfiguration
 
class  External
 
class  ExternalMemoryAccounter
 
class  ExternalOwningOneByteStringResource
 
class  ExternalResourceVisitor
 
struct  FastApiCallbackOptions
 
struct  FastOneByteString
 
class  FixedArray
 
class  Float16Array
 
class  Float32Array
 
class  Float64Array
 
class  Function
 
class  FunctionCallbackInfo
 
class  FunctionTemplate
 
class  FuzzerMonitor
 
class  Global
 
class  GlobalValueMap
 
class  HandleScope
 
class  HeapCodeStatistics
 
class  HeapGraphEdge
 
class  HeapGraphNode
 
class  HeapObjectStatistics
 
class  HeapProfiler
 
class  HeapSnapshot
 
class  HeapSpaceStatistics
 
class  HeapStatistics
 
struct  HeapStatsUpdate
 
class  HighAllocationThroughputObserver
 
class  IdleTask
 
struct  IndexedPropertyHandlerConfiguration
 
class  InspectorClient
 
class  InspectorFrontend
 
class  Int16Array
 
class  Int32
 
class  Int32Array
 
class  Int8Array
 
class  Integer
 
class  InternalEscapableScope
 
struct  InvokeBootstrapper
 
struct  InvokeBootstrapper< i::JSGlobalProxy >
 
struct  InvokeBootstrapper< i::NativeContext >
 
class  Isolate
 
class  IsolateGroup
 
struct  JitCodeEvent
 
class  JobDelegate
 
class  JobHandle
 
class  JobTask
 
struct  JSEntryStub
 
struct  JSEntryStubs
 
class  JSON
 
class  JSVisitor
 
class  Local
 
class  LocalBase
 
class  LocalVector
 
class  Location
 
class  Locker
 
class  Map
 
class  Maybe
 
class  Maybe< void >
 
class  MaybeLocal
 
class  MeasureMemoryDelegate
 
struct  MemoryRange
 
class  MemorySpan
 
class  Message
 
class  MicrotaskQueue
 
class  MicrotasksScope
 
struct  ModifyCodeGenerationFromStringsResult
 
class  Module
 
class  ModuleRequest
 
class  Name
 
struct  NamedPropertyHandlerConfiguration
 
class  NonCopyablePersistentTraits
 
class  Number
 
class  NumberObject
 
class  Numeric
 
class  Object
 
class  ObjectTemplate
 
struct  OneByteMask
 
struct  OneByteMask< 4 >
 
struct  OneByteMask< 8 >
 
class  OnMessageFromWorkerTask
 
struct  OOMDetails
 
class  OpenFDCloser
 
class  OutputStream
 
struct  OwnedBuffer
 
class  PageAllocator
 
class  PerIsolateData
 
class  Persistent
 
class  PersistentBase
 
class  PersistentHandleVisitor
 
class  PersistentValueMap
 
class  PersistentValueMapBase
 
class  Platform
 
class  PredictablePlatform
 
class  Primitive
 
class  PrimitiveArray
 
class  Private
 
class  ProcessMessageTask
 
class  Promise
 
class  PromiseRejectMessage
 
class  PropertyCallbackInfo
 
class  PropertyDescriptor
 
class  Proxy
 
class  QueryObjectPredicate
 
class  RegExp
 
class  RegisteredExtension
 
struct  RegisterState
 
struct  RelaxedLoadTag
 
struct  RelaxedStoreTag
 
struct  ReleaseStoreTag
 
class  ResourceConstraints
 
class  ReturnValue
 
struct  SampleInfo
 
class  SandboxHardwareSupport
 
class  ScopedBlockingCall
 
class  Script
 
class  ScriptCompiler
 
class  ScriptOrigin
 
class  ScriptOriginOptions
 
class  ScriptOrModule
 
class  SealHandleScope
 
struct  SeqCstAccessTag
 
class  SerializationData
 
class  SerializationDataQueue
 
struct  SerializeAPIWrapperCallback
 
struct  SerializeContextDataCallback
 
struct  SerializeInternalFieldsCallback
 
class  Serializer
 
class  Set
 
class  SetTimeoutTask
 
class  SharedArrayBuffer
 
class  SharedMemoryStatistics
 
class  SharedValueConveyor
 
class  Shell
 
class  ShellOptions
 
class  Signature
 
class  SnapshotCreator
 
class  SourceGroup
 
class  SourceLocation
 
class  StackFrame
 
class  StackTrace
 
class  StartupData
 
class  StdGlobalValueMap
 
class  StdMapTraits
 
class  StdPersistentValueMap
 
class  StreamerThread
 
class  String
 
class  StringObject
 
class  Symbol
 
class  SymbolObject
 
class  Task
 
class  TaskRunner
 
class  Template
 
class  TerminateTask
 
class  ThreadIsolatedAllocator
 
class  Traced
 
class  TracedReference
 
class  TracedReferenceBase
 
class  TracingController
 
class  TryCatch
 
class  TypecheckWitness
 
class  TypedArray
 
class  Uint16Array
 
class  Uint32
 
class  Uint32Array
 
class  Uint8Array
 
class  Uint8ClampedArray
 
class  UnboundModuleScript
 
class  UnboundScript
 
class  Unlocker
 
class  Unwinder
 
class  Utils
 
class  V8
 
class  Value
 
class  ValueDeserializer
 
class  ValueSerializer
 
class  VirtualAddressSpace
 
class  WasmMemoryMapDescriptor
 
class  WasmMemoryObject
 
class  WasmModuleObject
 
class  WasmStreaming
 
class  WeakCallbackInfo
 
class  Worker
 
class  ZombieProtector
 

Typedefs

using async_id_t = double
 
using CounterMap = std::unordered_map<std::string, Counter*>
 
using BackingStoreDeleterCallback
 
using JitCodeEventHandler = void (*)(const JitCodeEvent* event)
 
using GCCallback = void (*)(GCType type, GCCallbackFlags flags)
 
using InterruptCallback = void (*)(Isolate* isolate, void* data)
 
using PrintCurrentStackTraceFilterCallback
 
using NearHeapLimitCallback
 
using CounterLookupCallback = int* (*)(const char* name)
 
using CreateHistogramCallback
 
using AddHistogramSampleCallback = void (*)(void* histogram, int sample)
 
using FatalErrorCallback = void (*)(const char* location, const char* message)
 
using OOMErrorCallback
 
using MessageCallback = void (*)(Local<Message> message, Local<Value> data)
 
using LogEventCallback
 
using AddCrashKeyCallback = void (*)(CrashKeyId id, const std::string& value)
 
using BeforeCallEnteredCallback = void (*)(Isolate*)
 
using CallCompletedCallback = void (*)(Isolate*)
 
using ModifyCodeGenerationFromStringsCallback
 
using ModifyCodeGenerationFromStringsCallback2
 
using FailedAccessCheckCallback
 
using ExtensionCallback = bool (*)(const FunctionCallbackInfo<Value>&)
 
using AllowWasmCodeGenerationCallback
 
using ApiImplementationCallback = void (*)(const FunctionCallbackInfo<Value>&)
 
using WasmStreamingCallback = void (*)(const FunctionCallbackInfo<Value>&)
 
using WasmAsyncResolvePromiseCallback
 
using WasmLoadSourceMapCallback
 
using WasmImportedStringsEnabledCallback = bool (*)(Local<Context> context)
 
using SharedArrayBufferConstructorEnabledCallback
 
using JavaScriptCompileHintsMagicEnabledCallback
 
using WasmJSPIEnabledCallback = bool (*)(Local<Context> context)
 
using HostImportModuleDynamicallyCallback
 
using HostImportModuleWithPhaseDynamicallyCallback
 
using CompileHintCallback = bool (*)(int, void*)
 
using HostInitializeImportMetaObjectCallback
 
using HostCreateShadowRealmContextCallback
 
using IsJSApiWrapperNativeErrorCallback
 
using PrepareStackTraceCallback
 
using ExceptionPropagationCallback
 
using CFunctionBuilder = internal::CFunctionBuilder
 
using FunctionCallback = void (*)(const FunctionCallbackInfo<Value>& info)
 
using EntropySource = bool (*)(unsigned char* buffer, size_t length)
 
using ReturnAddressLocationResolver
 
using DcheckErrorCallback
 
using V8FatalErrorCallback
 
using StackState = cppgc::EmbedderStackState
 
template<class T >
using Handle = Local<T>
 
using MicrotasksCompletedCallbackWithData = void (*)(Isolate*, void*)
 
using MicrotaskCallback = void (*)(void* data)
 
using AccessorNameGetterCallback
 
using AccessorNameSetterCallback
 
template<class T >
using UniquePersistent = Global<T>
 
using PlatformSharedMemoryHandle = intptr_t
 
using NativeObject = void*
 
using SnapshotObjectId = uint32_t
 
using ProfilerId = uint32_t
 
using PromiseHook
 
using PromiseRejectCallback = void (*)(PromiseRejectMessage message)
 
using NamedPropertyGetterCallback
 
using NamedPropertySetterCallback
 
using NamedPropertyQueryCallback
 
using NamedPropertyDeleterCallback
 
using NamedPropertyEnumeratorCallback
 
using NamedPropertyDefinerCallback
 
using NamedPropertyDescriptorCallback
 
using IndexedPropertyGetterCallbackV2
 
using IndexedPropertySetterCallbackV2
 
using IndexedPropertyQueryCallbackV2
 
using IndexedPropertyDeleterCallbackV2
 
using IndexedPropertyEnumeratorCallback
 
using IndexedPropertyDefinerCallbackV2
 
using IndexedPropertyDescriptorCallbackV2
 
using AccessCheckCallback
 
typedef uintptr_t PersistentContainerValue
 

Enumerations

enum class  JSApiInstanceType : uint16_t {
  kGenericApiObject = 0 , kEventTarget , kNode , kElement ,
  kHTMLElement , kHTMLDivElement
}
 
enum class  ModuleType { kJavaScript , kJSON , kWebAssembly , kInvalid }
 
enum class  ArrayBufferCreationMode { kInternalized , kExternalized }
 
enum class  BackingStoreInitializationMode { kZeroInitialized , kUninitialized }
 
enum class  BackingStoreOnFailureMode { kReturnNull , kOutOfMemory }
 
enum  JitCodeEventOptions { kJitCodeEventDefault = 0 , kJitCodeEventEnumExisting = 1 , kLastJitCodeEventOption = kJitCodeEventEnumExisting }
 
enum  GCType {
  kGCTypeScavenge = 1 << 0 , kGCTypeMinorMarkSweep = 1 << 1 , kGCTypeMarkSweepCompact = 1 << 2 , kGCTypeIncrementalMarking = 1 << 3 ,
  kGCTypeProcessWeakCallbacks = 1 << 4 , kGCTypeAll
}
 
enum  GCCallbackFlags {
  kNoGCCallbackFlags = 0 , kGCCallbackFlagConstructRetainedObjectInfos = 1 << 1 , kGCCallbackFlagForced = 1 << 2 , kGCCallbackFlagSynchronousPhantomCallbackProcessing = 1 << 3 ,
  kGCCallbackFlagCollectAllAvailableGarbage = 1 << 4 , kGCCallbackFlagCollectAllExternalMemory = 1 << 5 , kGCCallbackScheduleIdleGarbageCollection = 1 << 6
}
 
enum  LogEventStatus : int { kStart = 0 , kEnd = 1 , kLog = 2 }
 
enum class  CrashKeyId {
  kIsolateAddress , kReadonlySpaceFirstPageAddress , V8_ENUM_DEPRECATE_SOON =("Map space got removed") , kOldSpaceFirstPageAddress ,
  kCodeRangeBaseAddress , kCodeSpaceFirstPageAddress , kDumpType , kSnapshotChecksumCalculated ,
  kSnapshotChecksumExpected
}
 
enum  AccessType {
  ACCESS_GET , ACCESS_SET , ACCESS_HAS , ACCESS_DELETE ,
  ACCESS_KEYS
}
 
enum class  WasmAsyncSuccess { kSuccess , kFail }
 
enum class  ModuleImportPhase { kSource , kEvaluation }
 
enum class  EmbedderStateTag : uint8_t { EMPTY = 0 , OTHER = 1 }
 
enum class  ExceptionContext : uint32_t {
  kUnknown , kConstructor , kOperation , kAttributeGet ,
  kAttributeSet , kIndexedQuery , kIndexedGetter , kIndexedDescriptor ,
  kIndexedSetter , kIndexedDefiner , kIndexedDeleter , kNamedQuery ,
  kNamedGetter , kNamedDescriptor , kNamedSetter , kNamedDefiner ,
  kNamedDeleter , kNamedEnumerator
}
 
enum class  MemoryPressureLevel { kNone , kModerate , kCritical }
 
enum class  ContextDependants { kNoDependants , kSomeDependants }
 
enum class  MicrotasksPolicy { kExplicit , kScoped , kAuto }
 
enum  PropertyAttribute { None = 0 , ReadOnly = 1 << 0 , DontEnum = 1 << 1 , DontDelete = 1 << 2 }
 
enum  PropertyFilter {
  ALL_PROPERTIES = 0 , ONLY_WRITABLE = 1 , ONLY_ENUMERABLE = 2 , ONLY_CONFIGURABLE = 4 ,
  SKIP_STRINGS = 8 , SKIP_SYMBOLS = 16
}
 
enum class  SideEffectType { kHasSideEffect , kHasNoSideEffect , kHasSideEffectToReceiver }
 
enum class  KeyCollectionMode { kOwnOnly , kIncludePrototypes }
 
enum class  IndexFilter { kIncludeIndices , kSkipIndices }
 
enum class  KeyConversionMode { kConvertToString , kKeepNumbers , kNoNumbers }
 
enum class  IntegrityLevel { kFrozen , kSealed }
 
enum class  TaskPriority : uint8_t { kBestEffort , kUserVisible , kUserBlocking , kMaxPriority = kUserBlocking }
 
enum class  BlockingType { kMayBlock , kWillBlock }
 
enum class  PagePermissions {
  kNoAccess , kRead , kReadWrite , kReadWriteExecute ,
  kReadExecute
}
 
enum class  NewStringType { kNormal , kInternalized }
 
enum  CpuProfilingMode { kLeafNodeLineNumbers , kCallerLineNumbers }
 
enum  CpuProfilingNamingMode { kStandardNaming , kDebugNaming }
 
enum  CpuProfilingLoggingMode { kLazyLogging , kEagerLogging }
 
enum class  CpuProfilingStatus { kStarted , kAlreadyStarted , kErrorTooManyProfilers }
 
enum  CodeEventType { kUnknownType }
 
enum class  PromiseHookType { kInit , kResolve , kBefore , kAfter }
 
enum  PromiseRejectEvent { kPromiseRejectWithNoHandler = 0 , kPromiseHandlerAddedAfterReject = 1 , kPromiseRejectAfterResolved = 2 , kPromiseResolveAfterResolved = 3 }
 
enum class  CppHeapPointerTag : uint16_t {
  kFirstTag = 0 , kNullTag = 0 , kDefaultTag = 0x7000 , kZappedEntryTag = 0x7ffd ,
  kEvacuationEntryTag = 0x7ffe , kFreeEntryTag = 0x7fff , kLastTag = 0x7fff
}
 
enum class  ScriptType { kClassic , kModule }
 
enum class  MeasureMemoryMode { kSummary , kDetailed }
 
enum class  MeasureMemoryExecution { kDefault , kEager , kLazy }
 
enum  Intrinsic
 
enum class  Intercepted : uint8_t { kNo = 0 , kYes = 1 }
 
enum class  ConstructorBehavior { kThrow , kAllow }
 
enum class  PropertyHandlerFlags {
  kNone = 0 , kNonMasking = 1 , kOnlyInterceptStrings = 1 << 1 , kHasNoSideEffect = 1 << 2 ,
  kInternalNewCallbacksSignatures = 1 << 10
}
 
enum  StateTag : uint16_t {
  JS , GC , PARSER , BYTECODE_COMPILER ,
  COMPILER , OTHER , EXTERNAL , ATOMICS_WAIT ,
  IDLE , LOGGING
}
 
enum  PersistentContainerCallbackType { kNotWeak , kWeakWithParameter , kWeakWithInternalFields }
 
enum class  WeakCallbackType { kParameter , kInternalFields }
 

Functions

template<typename T , internal::ExternalPointerTag tag>
T ToCData (i::Isolate *isolate, v8::internal::Tagged< v8::internal::Object > obj)
 
template<internal::ExternalPointerTag tag>
v8::internal::Address ToCData (i::Isolate *isolate, v8::internal::Tagged< v8::internal::Object > obj)
 
template<internal::ExternalPointerTag tag, typename T >
v8::internal::DirectHandle< i::UnionOf< i::Smi, i::Foreign > > FromCData (v8::internal::Isolate *isolate, T obj)
 
template<internal::ExternalPointerTag tag>
v8::internal::DirectHandle< i::UnionOf< i::Smi, i::Foreign > > FromCData (v8::internal::Isolate *isolate, v8::internal::Address obj)
 
template<typename T >
void CopySmiElementsToTypedBuffer (T *dst, uint32_t length, i::Tagged< i::FixedArray > elements)
 
template<typename T >
void CopyDoubleElementsToTypedBuffer (T *dst, uint32_t length, i::Tagged< i::FixedDoubleArray > elements)
 
template<CTypeInfo::Identifier type_info_id, typename T >
bool CopyAndConvertArrayToCppBuffer (Local< Array > src, T *dst, uint32_t max_length)
 
template<const CTypeInfo * type_info, typename T >
bool V8_EXPORT TryCopyAndConvertArrayToCppBuffer (Local< Array > src, T *dst, uint32_t max_length)
 
template<CTypeInfo::Identifier type_info_id, typename T >
bool V8_EXPORT TryToCopyAndConvertArrayToCppBuffer (Local< Array > src, T *dst, uint32_t max_length)
 
static ScriptOrigin GetScriptOriginForScript (i::Isolate *i_isolate, i::DirectHandle< i::Script > script)
 
void RegisterExtension (std::unique_ptr< Extension > extension)
 
static i::DirectHandle< i::EmbedderDataArrayEmbedderDataFor (Context *context, int index, bool can_grow, const char *location)
 
template<typename Getter , typename Setter , typename Data >
static Maybe< bool > ObjectSetAccessor (Local< Context > context, Object *self, Local< Name > name, Getter getter, Setter setter, Data data, PropertyAttribute attributes, bool replace_on_access, SideEffectType getter_side_effect_type, SideEffectType setter_side_effect_type)
 
static bool Unaligned (const uint16_t *chars)
 
static const uint16_t * Align (const uint16_t *chars)
 
template<typename CharType >
static int WriteHelper (i::Isolate *i_isolate, const String *string, CharType *buffer, int start, int length, int options)
 
template<typename CharType >
static void WriteHelperV2 (i::Isolate *i_isolate, const String *string, CharType *buffer, uint32_t offset, uint32_t length, int flags)
 
static V8_INLINE bool InternalFieldOK (i::DirectHandle< i::JSReceiver > obj, int index, const char *location)
 
template<typename ObjectType >
static i::DirectHandle< ObjectType > CreateEnvironment (i::Isolate *i_isolate, v8::ExtensionConfiguration *extensions, v8::MaybeLocal< ObjectTemplate > maybe_global_template, v8::MaybeLocal< Value > maybe_global_proxy, size_t context_snapshot_index, i::DeserializeEmbedderFieldsCallback embedder_fields_deserializer, v8::MicrotaskQueue *microtask_queue)
 
Local< ContextNewContext (v8::Isolate *external_isolate, v8::ExtensionConfiguration *extensions, v8::MaybeLocal< ObjectTemplate > global_template, v8::MaybeLocal< Value > global_object, size_t context_snapshot_index, i::DeserializeEmbedderFieldsCallback embedder_fields_deserializer, v8::MicrotaskQueue *microtask_queue)
 
 REGEXP_FLAG_ASSERT_EQ (kNone)
 
 REGEXP_FLAG_ASSERT_EQ (kGlobal)
 
 REGEXP_FLAG_ASSERT_EQ (kIgnoreCase)
 
 REGEXP_FLAG_ASSERT_EQ (kMultiline)
 
 REGEXP_FLAG_ASSERT_EQ (kSticky)
 
 REGEXP_FLAG_ASSERT_EQ (kUnicode)
 
 REGEXP_FLAG_ASSERT_EQ (kHasIndices)
 
 REGEXP_FLAG_ASSERT_EQ (kLinear)
 
 REGEXP_FLAG_ASSERT_EQ (kUnicodeSets)
 
static void CallGCCallbackWithoutData (Isolate *v8_isolate, GCType type, GCCallbackFlags flags, void *data)
 
 CALLBACK_SETTER (ModifyCodeGenerationFromStringsCallback, ModifyCodeGenerationFromStringsCallback2, modify_code_gen_callback) CALLBACK_SETTER(AllowWasmCodeGenerationCallback
 
allow_wasm_code_gen_callback CALLBACK_SETTER (WasmStreamingCallback, WasmStreamingCallback, wasm_streaming_callback) CALLBACK_SETTER(WasmAsyncResolvePromiseCallback
 
allow_wasm_code_gen_callback wasm_async_resolve_promise_callback CALLBACK_SETTER (WasmLoadSourceMapCallback, WasmLoadSourceMapCallback, wasm_load_source_map_callback) CALLBACK_SETTER(WasmImportedStringsEnabledCallback
 
allow_wasm_code_gen_callback wasm_async_resolve_promise_callback wasm_imported_strings_enabled_callback CALLBACK_SETTER (WasmJSPIEnabledCallback, WasmJSPIEnabledCallback, wasm_jspi_enabled_callback) CALLBACK_SETTER(SharedArrayBufferConstructorEnabledCallback
 
allow_wasm_code_gen_callback wasm_async_resolve_promise_callback wasm_imported_strings_enabled_callback sharedarraybuffer_constructor_enabled_callback CALLBACK_SETTER (JavaScriptCompileHintsMagicEnabledCallback, JavaScriptCompileHintsMagicEnabledCallback, compile_hints_magic_enabled_callback) CALLBACK_SETTER(IsJSApiWrapperNativeErrorCallback
 
static i::CpuProfileToInternal (const CpuProfile *profile)
 
static i::HeapGraphEdgeToInternal (const HeapGraphEdge *edge)
 
static i::HeapEntryToInternal (const HeapGraphNode *entry)
 
static i::HeapSnapshotToInternal (const HeapSnapshot *snapshot)
 
template<internal::ExternalPointerTag tag, typename T >
v8::internal::DirectHandle< v8::internal::UnionOf< v8::internal::Smi, v8::internal::Foreign > > FromCData (v8::internal::Isolate *isolate, T obj)
 
template<internal::ExternalPointerTag tag>
v8::internal::DirectHandle< v8::internal::UnionOf< v8::internal::Smi, v8::internal::Foreign > > FromCData (v8::internal::Isolate *isolate, v8::internal::Address obj)
 
template<class T >
v8::Local< TToApiHandle (v8::internal::DirectHandle< v8::internal::Object > obj)
 
template<class T >
bool ToLocal (v8::internal::MaybeDirectHandle< v8::internal::Object > maybe, Local< T > *local)
 
 ASSERT_TRIVIALLY_COPYABLE (api_internal::IndirectHandleBase)
 
 ASSERT_TRIVIALLY_COPYABLE (LocalBase< Object >)
 
 ASSERT_TRIVIALLY_COPYABLE (Local< Object >)
 
 ASSERT_TRIVIALLY_COPYABLE (internal::LocalUnchecked< Object >)
 
 ASSERT_TRIVIALLY_COPYABLE (MaybeLocal< Object >)
 
std::unique_ptr< PlatformMakePredictablePlatform (std::unique_ptr< Platform > platform)
 
std::unique_ptr< PlatformMakeDelayedTasksPlatform (std::unique_ptr< Platform > platform, int64_t random_seed)
 
static int LengthWithoutIncompleteUtf8 (char *buffer, int len)
 
static bool WaitOnFD (int fd, int read_timeout, int total_timeout, const struct timeval &start_time)
 
static bool TimeIsOut (const struct timeval &start_time, const int &total_time)
 
static bool GetTimeouts (const v8::FunctionCallbackInfo< v8::Value > &info, int *read_timeout, int *total_timeout)
 
static void ExecSubprocess (int *exec_error_fds, int *stdout_fds, const ExecArgs &exec_args)
 
static bool ChildLaunchedOK (Isolate *isolate, int *exec_error_fds)
 
static Local< ValueGetStdout (Isolate *isolate, int child_fd, const struct timeval &start_time, int read_timeout, int total_timeout)
 
static bool WaitForChild (Isolate *isolate, int pid, ZombieProtector &child_waiter, const struct timeval &start_time, int read_timeout, int total_timeout)
 
static bool CheckItsADirectory (Isolate *isolate, char *directory)
 
static bool mkdirp (Isolate *isolate, char *directory, mode_t mask)
 
void CreateFastCAPIObject (const FunctionCallbackInfo< Value > &info)
 
void CreateLeafInterfaceObject (const FunctionCallbackInfo< Value > &info)
 
void WriteToFile (FILE *file, const v8::FunctionCallbackInfo< v8::Value > &info, int first_arg_index=0)
 
void WriteAndFlush (FILE *file, const v8::FunctionCallbackInfo< v8::Value > &info)
 
Local< FunctionTemplateNewDOMFunctionTemplate (Isolate *isolate, JSApiInstanceType instance_type)
 
static void PrintMessageCallback (Local< Message > message, Local< Value > error)
 
void Dummy (char *arg)
 
bool ends_with (const char *input, const char *suffix)
 
void GetCalleeSavedRegistersFromEntryFrame (void *fp, RegisterState *register_state)
 
i::Address Load (i::Address address)
 
internal::Address Load (internal::Address address)
 
static i::DirectHandle< i::FunctionTemplateInfoNewFunctionTemplate (i::Isolate *i_isolate, FunctionCallback func, bool has_prototype, SideEffectType side_effect_type=SideEffectType::kHasSideEffect)
 
static i::DirectHandle< i::ObjectTemplateInfoNewObjectTemplate (i::Isolate *i_isolate)
 
template<CTypeInfo::Identifier type_info_id, typename T >
bool V8_EXPORT V8_WARN_UNUSED_RESULT TryToCopyAndConvertArrayToCppBuffer (Local< Array > src, T *dst, uint32_t max_length)
 
template<class T >
Maybe< TNothing ()
 
template<class T >
Maybe< TJust (const T &t)
 
template<class T , std::enable_if_t<!std::is_lvalue_reference_v< T > > * = nullptr>
Maybe< TJust (T &&t)
 
Maybe< void > JustVoid ()
 
template<class T , std::size_t N>
constexpr std::array< std::remove_cv_t< T >, N > to_array (T(&a)[N])
 
template<class T , std::size_t N>
constexpr std::array< std::remove_cv_t< T >, N > to_array (T(&&a)[N])
 
enum V8_DEPRECATE_SOON ("This enum is no longer used and will be removed in V8 12.9.") AccessControl
 
PlatformSharedMemoryHandle SharedMemoryHandleFromFileDescriptor (int fd)
 
int FileDescriptorFromSharedMemoryHandle (PlatformSharedMemoryHandle handle)
 
V8_INLINE Local< PrimitiveUndefined (Isolate *isolate)
 
V8_INLINE Local< PrimitiveNull (Isolate *isolate)
 
V8_INLINE Local< BooleanTrue (Isolate *isolate)
 
V8_INLINE Local< BooleanFalse (Isolate *isolate)
 
constexpr CppHeapPointerTagRange kAnyCppHeapPointer (CppHeapPointerTag::kFirstTag, CppHeapPointerTag::kLastTag)
 
V8_INLINE bool operator== (const TracedReferenceBase &lhs, const TracedReferenceBase &rhs)
 
template<typename U >
V8_INLINE bool operator== (const TracedReferenceBase &lhs, const v8::Local< U > &rhs)
 
template<typename U >
V8_INLINE bool operator== (const v8::Local< U > &lhs, const TracedReferenceBase &rhs)
 
V8_INLINE bool operator!= (const TracedReferenceBase &lhs, const TracedReferenceBase &rhs)
 
template<typename U >
V8_INLINE bool operator!= (const TracedReferenceBase &lhs, const v8::Local< U > &rhs)
 
template<typename U >
V8_INLINE bool operator!= (const v8::Local< U > &lhs, const TracedReferenceBase &rhs)
 
constexpr uint32_t CurrentValueSerializerFormatVersion ()
 
V8_EXPORT bool TryHandleWebAssemblyTrapPosix (int sig_code, siginfo_t *info, void *context)
 
V8_EXPORT bool TryHandleWebAssemblyTrapWindows (EXCEPTION_POINTERS *exception)
 

Variables

static OOMErrorCallback g_oom_error_callback = nullptr
 
static const uintptr_t kOneByteMask = OneByteMask<sizeof(uintptr_t)>::value
 
static const uintptr_t kAlignmentMask = sizeof(uintptr_t) - 1
 
 else
 
static constexpr AcquireLoadTag kAcquireLoad
 
static constexpr RelaxedLoadTag kRelaxedLoad
 
static constexpr ReleaseStoreTag kReleaseStore
 
static constexpr RelaxedStoreTag kRelaxedStore
 
static constexpr SeqCstAccessTag kSeqCstAccess
 
constexpr IsolatekProcessGlobalPredictablePlatformWorkerTaskQueue = nullptr
 
static const int kReadFD = 0
 
static const int kWriteFD = 1
 
bool check_d8_flag_contradictions = true
 
static v8::debug::DebugDelegate dummy_delegate
 
static constexpr CTypeInfo kTypeInfoInt32 = CTypeInfo(CTypeInfo::Type::kInt32)
 
static constexpr CTypeInfo kTypeInfoFloat64
 
static constexpr PlatformSharedMemoryHandle kInvalidSharedMemoryHandle = -1
 
static const uintptr_t kPersistentContainerNotFound = 0
 
static constexpr int kInternalFieldsInWeakCallback = 2
 
static constexpr int kEmbedderFieldsInWeakCallback = 2
 

Detailed Description

This file provides additional API on top of the default one for making API calls, which come from embedder C++ functions. The functions are being called directly from optimized code, doing all the necessary typechecks in the compiler itself, instead of on the embedder side. Hence the "fast" in the name. Example usage might look like:

void FastMethod(int param, bool another_param);
v8::FunctionTemplate::New(isolate, SlowCallback, data,
signature, length, constructor_behavior
side_effect_type,
&v8::CFunction::Make(FastMethod));
static CFunction Make(F *func, CFunctionInfo::Int64Representation int64_rep=CFunctionInfo::Int64Representation::kNumber)
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, uint16_t instance_type=0, uint16_t allowed_receiver_instance_type_range_start=0, uint16_t allowed_receiver_instance_type_range_end=0)
Definition api.cc:1101

By design, fast calls are limited by the following requirements, which the embedder should enforce themselves:

Due to these limitations, it's not directly possible to report errors by throwing a JS exception or to otherwise do an allocation. There is an alternative way of creating fast calls that supports falling back to the slow call and then performing the necessary allocation. When one creates the fast method by using CFunction::MakeWithFallbackSupport instead of CFunction::Make, the fast callback gets as last parameter an output variable, through which it can request falling back to the slow call. So one might declare their method like:

void FastMethodWithFallback(int param, FastApiCallbackOptions& options);

If the callback wants to signal an error condition or to perform an allocation, it must set options.fallback to true and do an early return from the fast method. Then V8 checks the value of options.fallback and if it's true, falls back to executing the SlowCallback, which is capable of reporting the error (either by throwing a JS exception or logging to the console) or doing the allocation. It's the embedder's responsibility to ensure that the fast callback is idempotent up to the point where error and fallback conditions are checked, because otherwise executing the slow callback might produce visible side-effects twice.

An example for custom embedder type support might employ a way to wrap/ unwrap various C++ types in JSObject instances, e.g:

// Helper method with a check for field count.
template <typename T, int offset>
inline T* GetInternalField(v8::Local<v8::Object> wrapper) {
assert(offset < wrapper->InternalFieldCount());
return reinterpret_cast<T*>(
wrapper->GetAlignedPointerFromInternalField(offset));
}
class CustomEmbedderType {
public:
// Returns the raw C object from a wrapper JS object.
static CustomEmbedderType* Unwrap(v8::Local<v8::Object> wrapper) {
return GetInternalField<CustomEmbedderType,
kV8EmbedderWrapperObjectIndex>(wrapper);
}
static void FastMethod(v8::Local<v8::Object> receiver_obj, int param) {
CustomEmbedderType* receiver = static_cast<CustomEmbedderType*>(
receiver_obj->GetAlignedPointerFromInternalField(
kV8EmbedderWrapperObjectIndex));
// Type checks are already done by the optimized code.
// Then call some performance-critical method like:
// receiver->Method(param);
}
static void SlowMethod(
CustomEmbedderType* receiver = Unwrap(instance);
// TODO: Do type checks and extract {param}.
receiver->Method(param);
}
};
// TODO(mslekova): Clean-up these constants
// The constants kV8EmbedderWrapperTypeIndex and
// kV8EmbedderWrapperObjectIndex describe the offsets for the type info
// struct and the native object, when expressed as internal field indices
// within a JSObject. The existance of this helper function assumes that
// all embedder objects have their JSObject-side type info at the same
// offset, but this is not a limitation of the API itself. For a detailed
// use case, see the third example.
static constexpr int kV8EmbedderWrapperTypeIndex = 0;
static constexpr int kV8EmbedderWrapperObjectIndex = 1;
// The following setup function can be templatized based on
// the {embedder_object} argument.
void SetupCustomEmbedderObject(v8::Isolate* isolate,
CustomEmbedderType* embedder_object) {
isolate->set_embedder_wrapper_type_index(
kV8EmbedderWrapperTypeIndex);
isolate->set_embedder_wrapper_object_index(
kV8EmbedderWrapperObjectIndex);
v8::CFunction c_func =
MakeV8CFunction(CustomEmbedderType::FastMethod);
Local<v8::FunctionTemplate> method_template =
isolate, CustomEmbedderType::SlowMethod, v8::Local<v8::Value>(),
object_template->SetInternalFieldCount(
kV8EmbedderWrapperObjectIndex + 1);
object_template->Set(isolate, "method", method_template);
// Instantiate the wrapper JS object.
object_template->NewInstance(context).ToLocalChecked();
object->SetAlignedPointerInInternalField(
kV8EmbedderWrapperObjectIndex,
reinterpret_cast<void*>(embedder_object));
// TODO: Expose {object} where it's necessary.
}
static V8_INLINE Local< T > Cast(Local< S > that)
static Local< ObjectTemplate > New(Isolate *isolate, Local< FunctionTemplate > constructor=Local< FunctionTemplate >())
Definition api.cc:1376
int32_t offset
TNode< Object > receiver

For instance if {object} is exposed via a global "obj" variable, one could write in JS: function hot_func() { obj.method(42); } and once {hot_func} gets optimized, CustomEmbedderType::FastMethod will be called instead of the slow version, with the following arguments: receiver := the {embedder_object} from above param := 42

Currently supported return types:

  • void
  • bool
  • int32_t
  • uint32_t
  • float32_t
  • float64_t Currently supported argument types:

pointer to an embedder type

  • JavaScript array of primitive types
  • bool
  • int32_t
  • uint32_t
  • int64_t
  • uint64_t
  • float32_t
  • float64_t

The 64-bit integer types currently have the IDL (unsigned) long long semantics: https://heycam.github.io/webidl/#abstract-opdef-converttoint In the future we'll extend the API to also provide conversions from/to BigInt to preserve full precision. The floating point types currently have the IDL (unrestricted) semantics, which is the only one used by WebGL. We plan to add support also for restricted floats/doubles, similarly to the BigInt conversion policies. We also differ from the specific NaN bit pattern that WebIDL prescribes (https://heycam.github.io/webidl/#es-unrestricted-float) in that Blink passes NaN values as-is, i.e. doesn't normalize them.

To be supported types:

  • TypedArrays and ArrayBuffers
  • arrays of embedder types

The API offers a limited support for function overloads:

void FastMethod_2Args(int param, bool another_param);
void FastMethod_3Args(int param, bool another_param, int third_param);
v8::CFunction fast_method_2args_c_func =
MakeV8CFunction(FastMethod_2Args);
v8::CFunction fast_method_3args_c_func =
MakeV8CFunction(FastMethod_3Args);
const v8::CFunction fast_method_overloads[] = {fast_method_2args_c_func,
fast_method_3args_c_func};
Local<v8::FunctionTemplate> method_template =
isolate, SlowCallback, data, signature, length,
constructor_behavior, side_effect_type,
{fast_method_overloads, 2});
static Local< FunctionTemplate > NewWithCFunctionOverloads(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 MemorySpan< const CFunction > &c_function_overloads={})
Definition api.cc:1158

In this example a single FunctionTemplate is associated to multiple C++ functions. The overload resolution is currently only based on the number of arguments passed in a call. For example, if this method_template is registered with a wrapper JS object as described above, a call with two arguments: obj.method(42, true); will result in a fast call to FastMethod_2Args, while a call with three or more arguments: obj.method(42, true, 11); will result in a fast call to FastMethod_3Args. Instead a call with less than two arguments, like: obj.method(42); would not result in a fast call but would fall back to executing the associated SlowCallback.

The v8 JavaScript engine.

Profiler support for the V8 JavaScript engine.

Support for Persistent containers.

C++11 embedders can use STL containers with Global values, but pre-C++11 does not support the required move semantic and hence may want these container classes.

Compile-time constants.

This header provides access to information about the value serializer at compile time, without declaring or defining any symbols that require linking to V8.

Typedef Documentation

◆ AccessCheckCallback

Initial value:
bool (*)(Local<Context> accessing_context,
Local<Object> accessed_object,
Local<Value> data)
union v8::internal::@341::BuiltinMetadata::KindSpecificData data

Returns true if the given context should be allowed to access the given object.

Definition at line 471 of file v8-template.h.

◆ AccessorNameGetterCallback

Initial value:
void (*)(Local<Name> property, const PropertyCallbackInfo<Value>& info)
Handle< SharedFunctionInfo > info
const std::string property

Accessor[Getter|Setter] are used as callback functions when setting|getting a particular data property. See Object::SetNativeDataProperty and ObjectTemplate::SetNativeDataProperty methods.

Definition at line 155 of file v8-object.h.

◆ AccessorNameSetterCallback

Initial value:
void (*)(Local<Name> property, Local<Value> value,
const PropertyCallbackInfo<void>& info)
std::unique_ptr< ValueMirror > value

Definition at line 158 of file v8-object.h.

◆ AddCrashKeyCallback

using v8::AddCrashKeyCallback = void (*)(CrashKeyId id, const std::string& value)

Definition at line 256 of file v8-callbacks.h.

◆ AddHistogramSampleCallback

using v8::AddHistogramSampleCallback = void (*)(void* histogram, int sample)

Definition at line 221 of file v8-callbacks.h.

◆ AllowWasmCodeGenerationCallback

Initial value:
bool (*)(Local<Context> context,
Local<String> source)
TNode< Context > context
InstructionOperand source

Definition at line 303 of file v8-callbacks.h.

◆ ApiImplementationCallback

Definition at line 308 of file v8-callbacks.h.

◆ async_id_t

using v8::async_id_t = double

Definition at line 22 of file async-hooks-wrapper.h.

◆ BackingStoreDeleterCallback

Initial value:
void (*)(void* data, size_t length,
void* deleter_data)

Definition at line 123 of file v8-array-buffer.h.

◆ BeforeCallEnteredCallback

Definition at line 259 of file v8-callbacks.h.

◆ CallCompletedCallback

using v8::CallCompletedCallback = void (*)(Isolate*)

Definition at line 260 of file v8-callbacks.h.

◆ CFunctionBuilder

◆ CompileHintCallback

using v8::CompileHintCallback = bool (*)(int, void*)

Callback for requesting a compile hint for a function from the embedder. The first parameter is the position of the function in source code and the second parameter is embedder data to be passed back.

Definition at line 423 of file v8-callbacks.h.

◆ CounterLookupCallback

using v8::CounterLookupCallback = int* (*)(const char* name)

Callback function passed to SetUnhandledExceptionCallback.

Definition at line 216 of file v8-callbacks.h.

◆ CounterMap

using v8::CounterMap = std::unordered_map<std::string, Counter*>

Definition at line 86 of file d8.h.

◆ CreateHistogramCallback

Initial value:
void* (*)(const char* name, int min, int max,
size_t buckets)

Definition at line 218 of file v8-callbacks.h.

◆ DcheckErrorCallback

Initial value:
void (*)(const char* file, int line,
const char* message)
Symbol file

Definition at line 52 of file v8-initialization.h.

◆ EntropySource

using v8::EntropySource = bool (*)(unsigned char* buffer, size_t length)

EntropySource is used as a callback function when v8 needs a source of entropy.

Definition at line 34 of file v8-initialization.h.

◆ ExceptionPropagationCallback

Initial value:
void (*)(ExceptionPropagationMessage message)

Definition at line 132 of file v8-exception.h.

◆ ExtensionCallback

Definition at line 301 of file v8-callbacks.h.

◆ FailedAccessCheckCallback

Initial value:
void (*)(Local<Object> target,
AccessType type, Local<Value> data)
TNode< Object > target
wasm::ValueType type

Definition at line 297 of file v8-callbacks.h.

◆ FatalErrorCallback

using v8::FatalErrorCallback = void (*)(const char* location, const char* message)

Definition at line 225 of file v8-callbacks.h.

◆ FunctionCallback

using v8::FunctionCallback = void (*)(const FunctionCallbackInfo<Value>& info)

Definition at line 314 of file v8-function-callback.h.

◆ GCCallback

using v8::GCCallback = void (*)(GCType type, GCCallbackFlags flags)

Definition at line 189 of file v8-callbacks.h.

◆ Handle

template<class T >
using v8::Handle = Local<T>

Definition at line 621 of file v8-local-handle.h.

◆ HostCreateShadowRealmContextCallback

Initial value:
MaybeLocal<Context> (*)(Local<Context> initiator_context)

HostCreateShadowRealmContextCallback is called each time a ShadowRealm is being constructed in the initiator_context.

The method combines Context creation and implementation defined abstract operation HostInitializeShadowRealm into one.

The embedder should use v8::Context::New or v8::Context:NewFromSnapshot to create a new context. If the creation fails, the embedder must propagate that exception by returning an empty MaybeLocal.

Definition at line 450 of file v8-callbacks.h.

◆ HostImportModuleDynamicallyCallback

Initial value:
MaybeLocal<Promise> (*)(
Local<Context> context, Local<Data> host_defined_options,
Local<Value> resource_name, Local<String> specifier,
Local<FixedArray> import_attributes)

HostImportModuleDynamicallyCallback is called when we require the embedder to load a module. This is used as part of the dynamic import syntax.

The referrer contains metadata about the script/module that calls import.

The specifier is the name of the module that should be imported.

The import_attributes are import attributes for this request in the form: [key1, value1, key2, value2, ...] where the keys and values are of type v8::String. Note, unlike the FixedArray passed to ResolveModuleCallback and returned from ModuleRequest::GetImportAttributes(), this array does not contain the source Locations of the attributes.

The embedder must compile, instantiate, evaluate the Module, and obtain its namespace object.

The Promise returned from this function is forwarded to userland JavaScript. The embedder must resolve this promise with the module namespace object. In case of an exception, the embedder must reject this promise with the exception. If the promise creation itself fails (e.g. due to stack overflow), the embedder must propagate that exception by returning an empty MaybeLocal.

Definition at line 372 of file v8-callbacks.h.

◆ HostImportModuleWithPhaseDynamicallyCallback

Initial value:
MaybeLocal<Promise> (*)(
Local<Context> context, Local<Data> host_defined_options,
Local<Value> resource_name, Local<String> specifier,
ModuleImportPhase phase, Local<FixedArray> import_attributes)
ModuleImportPhase

HostImportModuleWithPhaseDynamicallyCallback is called when we require the embedder to load a module with a specific phase. This is used as part of the dynamic import syntax.

The referrer contains metadata about the script/module that calls import.

The specifier is the name of the module that should be imported.

The phase is the phase of the import requested.

The import_attributes are import attributes for this request in the form: [key1, value1, key2, value2, ...] where the keys and values are of type v8::String. Note, unlike the FixedArray passed to ResolveModuleCallback and returned from ModuleRequest::GetImportAttributes(), this array does not contain the source Locations of the attributes.

The Promise returned from this function is forwarded to userland JavaScript. The embedder must resolve this promise according to the phase requested:

  • For ModuleImportPhase::kSource, the promise must be resolved with a compiled ModuleSource object, or rejected with a SyntaxError if the module does not support source representation.
  • For ModuleImportPhase::kEvaluation, the promise must be resolved with a ModuleNamespace object of a module that has been compiled, instantiated, and evaluated.

In case of an exception, the embedder must reject this promise with the exception. If the promise creation itself fails (e.g. due to stack overflow), the embedder must propagate that exception by returning an empty MaybeLocal.

This callback is still experimental and is only invoked for source phase imports.

Definition at line 413 of file v8-callbacks.h.

◆ HostInitializeImportMetaObjectCallback

Initial value:
void (*)(Local<Context> context,
Local<Module> module,
Local<Object> meta)

HostInitializeImportMetaObjectCallback is called the first time import.meta is accessed for a module. Subsequent access will reuse the same value.

The method combines two implementation-defined abstract operations into one: HostGetImportMetaProperties and HostFinalizeImportMeta.

The embedder should use v8::Object::CreateDataProperty to add properties on the meta object.

Definition at line 435 of file v8-callbacks.h.

◆ IndexedPropertyDefinerCallbackV2

Initial value:
Intercepted (*)(uint32_t index, const PropertyDescriptor& desc,
const PropertyCallbackInfo<void>& info)
OptionalOpIndex index
Intercepted

See v8::NamedPropertyDefinerCallback.

Definition at line 448 of file v8-template.h.

◆ IndexedPropertyDeleterCallbackV2

Initial value:
Intercepted (*)(uint32_t index, const PropertyCallbackInfo<Boolean>& info)

See v8::NamedPropertyDeleterCallback.

Definition at line 429 of file v8-template.h.

◆ IndexedPropertyDescriptorCallbackV2

Initial value:
Intercepted (*)(uint32_t index, const PropertyCallbackInfo<Value>& info)

See v8::NamedPropertyDescriptorCallback.

Definition at line 460 of file v8-template.h.

◆ IndexedPropertyEnumeratorCallback

Initial value:
void (*)(const PropertyCallbackInfo<Array>& info)

Returns an array containing the indices of the properties the indexed property getter intercepts.

Note: The values in the array must be uint32_t.

Definition at line 442 of file v8-template.h.

◆ IndexedPropertyGetterCallbackV2

Initial value:
Intercepted (*)(uint32_t index, const PropertyCallbackInfo<Value>& info)

See v8::NamedPropertyGetterCallback.

Definition at line 398 of file v8-template.h.

◆ IndexedPropertyQueryCallbackV2

Initial value:
Intercepted (*)(uint32_t index, const PropertyCallbackInfo<Integer>& info)

See v8::NamedPropertyQueryCallback.

Definition at line 419 of file v8-template.h.

◆ IndexedPropertySetterCallbackV2

Initial value:
uint32_t index, Local<Value> value, const PropertyCallbackInfo<void>& info)

See v8::NamedPropertySetterCallback.

Definition at line 408 of file v8-template.h.

◆ InterruptCallback

using v8::InterruptCallback = void (*)(Isolate* isolate, void* data)

Definition at line 191 of file v8-callbacks.h.

◆ IsJSApiWrapperNativeErrorCallback

allow_wasm_code_gen_callback wasm_async_resolve_promise_callback wasm_imported_strings_enabled_callback sharedarraybuffer_constructor_enabled_callback v8::IsJSApiWrapperNativeErrorCallback
Initial value:
bool (*)(Isolate* isolate,
Local<Object> obj)
Isolate * isolate

IsJSApiWrapperNativeErrorCallback is called on an JSApiWrapper object to determine if Error.isError should return true or false. For instance, in an HTML embedder, DOMExceptions return true when passed to Error.isError.

Definition at line 458 of file v8-callbacks.h.

◆ JavaScriptCompileHintsMagicEnabledCallback

Initial value:
bool (*)(Local<Context> context)

Definition at line 332 of file v8-callbacks.h.

◆ JitCodeEventHandler

using v8::JitCodeEventHandler = void (*)(const JitCodeEvent* event)

Callback function passed to SetJitCodeEventHandler.

Parameters
eventcode add, move or removal event.

Definition at line 142 of file v8-callbacks.h.

◆ LogEventCallback

Initial value:
void (*)(const char* name,
int status)
const char * name
Definition builtins.cc:39

Definition at line 240 of file v8-callbacks.h.

◆ MessageCallback

using v8::MessageCallback = void (*)(Local<Message> message, Local<Value> data)

Definition at line 235 of file v8-callbacks.h.

◆ MicrotaskCallback

using v8::MicrotaskCallback = void (*)(void* data)

Definition at line 14 of file v8-microtask.h.

◆ MicrotasksCompletedCallbackWithData

Definition at line 13 of file v8-microtask.h.

◆ ModifyCodeGenerationFromStringsCallback

Initial value:
ModifyCodeGenerationFromStringsResult (*)(Local<Context> context,
Local<Value> source)

Callback to check if codegen is allowed from a source object, and convert the source to string if necessary. See: ModifyCodeGenerationFromStrings.

Definition at line 276 of file v8-callbacks.h.

◆ ModifyCodeGenerationFromStringsCallback2

Initial value:
ModifyCodeGenerationFromStringsResult (*)(Local<Context> context,
Local<Value> source,
bool is_code_like)

Definition at line 279 of file v8-callbacks.h.

◆ NamedPropertyDefinerCallback

Initial value:
Intercepted (*)(Local<Name> property, const PropertyDescriptor& desc,
const PropertyCallbackInfo<void>& info)

Interceptor for defineProperty requests on an object.

If the interceptor handles the request (i.e. the property should not be looked up beyond the interceptor or in case an exception was thrown) it should return Intercepted::kYes. If the interceptor does not handle the request it must return Intercepted::kNo and it must not produce side effects.

Parameters
propertyThe name of the property for which the request was intercepted.
descThe property descriptor which is used to define the property if the request is not intercepted.
infoInformation about the intercepted request, such as isolate, receiver, return value, or whether running in ‘'use strict’mode. SeePropertyCallbackInfo`.

See also ObjectTemplate::SetHandler.

Definition at line 339 of file v8-template.h.

◆ NamedPropertyDeleterCallback

Initial value:
Local<Name> property, const PropertyCallbackInfo<Boolean>& info)

Interceptor for delete requests on an object.

If the interceptor handles the request (i.e. the property should not be looked up beyond the interceptor or in case an exception was thrown) it should

  • (optionally) use info.GetReturnValue().Set() to set to a Boolean value indicating whether the property deletion was successful or not,
  • return Intercepted::kYes. If the interceptor does not handle the request it must return Intercepted::kNo and it must not produce side effects.
Parameters
propertyThe name of the property for which the request was intercepted.
infoInformation about the intercepted request, such as isolate, receiver, return value, or whether running in ‘'use strict’mode. SeePropertyCallbackInfo`.
Note
If you need to mimic the behavior of delete, i.e., throw in strict mode instead of returning false, use info.ShouldThrowOnError() to determine if you are in strict mode.

See also ObjectTemplate::SetHandler.

Definition at line 292 of file v8-template.h.

◆ NamedPropertyDescriptorCallback

Initial value:
Local<Name> property, const PropertyCallbackInfo<Value>& info)

Interceptor for getOwnPropertyDescriptor requests on an object.

If the interceptor handles the request (i.e. the property should not be looked up beyond the interceptor or in case an exception was thrown) it should

  • (optionally) use info.GetReturnValue().Set() to set the return value which must be object that can be converted to a PropertyDescriptor (for example, a value returned by v8::Object::getOwnPropertyDescriptor),
  • return Intercepted::kYes. If the interceptor does not handle the request it must return Intercepted::kNo and it must not produce side effects.
Parameters
propertyThe name of the property for which the request was intercepted. \info Information about the intercepted request, such as isolate, receiver, return value, or whether running in ‘'use strict’mode. SeePropertyCallbackInfo`.
Note
If GetOwnPropertyDescriptor is intercepted, it will always return true, i.e., indicate that the property was found.

See also ObjectTemplate::SetHandler.

Definition at line 379 of file v8-template.h.

◆ NamedPropertyEnumeratorCallback

Initial value:
void (*)(const PropertyCallbackInfo<Array>& info)

Returns an array containing the names of the properties the named property getter intercepts.

Note: The values in the array must be of type v8::Name.

Definition at line 312 of file v8-template.h.

◆ NamedPropertyGetterCallback

Initial value:
Local<Name> property, const PropertyCallbackInfo<Value>& info)

Interceptor for get requests on an object.

If the interceptor handles the request (i.e. the property should not be looked up beyond the interceptor or in case an exception was thrown) it should

  • (optionally) use info.GetReturnValue().Set()to set the return value (by default the result is set to v8::Undefined),
  • returnIntercepted::kYes. If the interceptor does not handle the request it must return Intercepted::kNo` and it must not produce side effects.
Parameters
propertyThe name of the property for which the request was intercepted.
infoInformation about the intercepted request, such as isolate, receiver, return value, or whether running in ‘'use strict’mode. SeePropertyCallbackInfo`.
Intercepted GetterCallback(
if (!IsKnownProperty(info.GetIsolate(), name)) return Intercepted::kNo;
info.GetReturnValue().Set(v8_num(42));
}
templ->InstanceTemplate()->SetHandler(
LocalContext env;
env->Global()
->Set(env.local(), v8_str("obj"), templ->GetFunction(env.local())
.ToLocalChecked()
->NewInstance(env.local())
.ToLocalChecked())
.FromJust();
v8::Local<v8::Value> result = CompileRun("obj.a = 17; obj.a");
CHECK(v8_num(42)->Equals(env.local(), result).FromJust());
ZoneVector< RpoNumber > & result
#define CHECK(condition)
Definition logging.h:124

See also ObjectTemplate::SetHandler.

Definition at line 184 of file v8-template.h.

◆ NamedPropertyQueryCallback

Initial value:
Local<Name> property, const PropertyCallbackInfo<Integer>& info)

Intercepts all requests that query the attributes of the property, e.g., getOwnPropertyDescriptor(), propertyIsEnumerable(), and defineProperty().

If the interceptor handles the request (i.e. the property should not be looked up beyond the interceptor or in case an exception was thrown) it should

Parameters
propertyThe name of the property for which the request was intercepted.
infoInformation about the intercepted request, such as isolate, receiver, return value, or whether running in ‘'use strict’mode. SeePropertyCallbackInfo`.
Note
Some functions query the property attributes internally, even though they do not return the attributes. For example, hasOwnProperty() can trigger this interceptor depending on the state of the object.

See also ObjectTemplate::SetHandler.

Definition at line 256 of file v8-template.h.

◆ NamedPropertySetterCallback

Initial value:
Intercepted (*)(Local<Name> property, Local<Value> value,
const PropertyCallbackInfo<void>& info)

Interceptor for set requests on an object.

If the interceptor handles the request (i.e. the property should not be looked up beyond the interceptor or in case an exception was thrown) it should return Intercepted::kYes. If the interceptor does not handle the request it must return Intercepted::kNo and it must not produce side effects.

Parameters
propertyThe name of the property for which the request was intercepted.
valueThe value which the property will have if the request is not intercepted.
infoInformation about the intercepted request, such as isolate, receiver, return value, or whether running in ‘'use strict’mode. SeePropertyCallbackInfo`.

See also ObjectTemplate::SetHandler.

Definition at line 214 of file v8-template.h.

◆ NativeObject

using v8::NativeObject = void*

Definition at line 30 of file v8-profiler.h.

◆ NearHeapLimitCallback

Initial value:
size_t (*)(void* data, size_t current_heap_limit,
size_t initial_heap_limit)

This callback is invoked when the heap size is close to the heap limit and V8 is likely to abort with out-of-memory error. The callback can extend the heap limit by returning a value that is greater than the current_heap_limit. The initial heap limit is the limit that was set after heap setup.

Definition at line 203 of file v8-callbacks.h.

◆ OOMErrorCallback

Initial value:
void (*)(const char* location,
const OOMDetails& details)

Definition at line 232 of file v8-callbacks.h.

◆ PersistentContainerValue

typedef uintptr_t v8::PersistentContainerValue

Definition at line 28 of file v8-util.h.

◆ PlatformSharedMemoryHandle

Definition at line 669 of file v8-platform.h.

◆ PrepareStackTraceCallback

Initial value:
MaybeLocal<Value> (*)(Local<Context> context,
Local<Value> error,
Local<Array> sites)

PrepareStackTraceCallback is called when the stack property of an error is first accessed. The return value will be used as the stack value. If this callback is registed, the |Error.prepareStackTrace| API will be disabled. |sites| is an array of call sites, specified in https://v8.dev/docs/stack-trace-api

Definition at line 468 of file v8-callbacks.h.

◆ PrintCurrentStackTraceFilterCallback

Initial value:
bool (*)(Isolate* isolate, Local<String> script_name)

Definition at line 193 of file v8-callbacks.h.

◆ ProfilerId

using v8::ProfilerId = uint32_t

Definition at line 32 of file v8-profiler.h.

◆ PromiseHook

Initial value:
void (*)(PromiseHookType type, Local<Promise> promise,
Local<Value> parent)
PromiseHookType
Definition v8-promise.h:141

Definition at line 143 of file v8-promise.h.

◆ PromiseRejectCallback

Definition at line 170 of file v8-promise.h.

◆ ReturnAddressLocationResolver

Initial value:
uintptr_t (*)(uintptr_t return_addr_location)

ReturnAddressLocationResolver is used as a callback function when v8 is resolving the location of a return address on the stack. Profilers that change the return address on the stack can use this to resolve the stack location to wherever the profiler stashed the original return address.

Parameters
return_addr_locationA location on stack where a machine return address resides.
Returns
Either return_addr_location, or else a pointer to the profiler's copy of the original return address.
Note
The resolver function must not cause garbage collection.

Definition at line 49 of file v8-initialization.h.

◆ SharedArrayBufferConstructorEnabledCallback

allow_wasm_code_gen_callback wasm_async_resolve_promise_callback wasm_imported_strings_enabled_callback v8::SharedArrayBufferConstructorEnabledCallback
Initial value:
bool (*)(Local<Context> context)

Definition at line 328 of file v8-callbacks.h.

◆ SnapshotObjectId

using v8::SnapshotObjectId = uint32_t

Definition at line 31 of file v8-profiler.h.

◆ StackState

Indicator for the stack state.

Definition at line 192 of file v8-isolate.h.

◆ UniquePersistent

template<class T >
using v8::UniquePersistent = Global<T>

Definition at line 411 of file v8-persistent-handle.h.

◆ V8FatalErrorCallback

Initial value:
void (*)(const char* file, int line,
const char* message)

Definition at line 55 of file v8-initialization.h.

◆ WasmAsyncResolvePromiseCallback

allow_wasm_code_gen_callback v8::WasmAsyncResolvePromiseCallback
Initial value:
void (*)(
Isolate* isolate, Local<Context> context, Local<Promise::Resolver> resolver,
Local<Value> result, WasmAsyncSuccess success)
WasmAsyncSuccess

Definition at line 316 of file v8-callbacks.h.

◆ WasmImportedStringsEnabledCallback

allow_wasm_code_gen_callback wasm_async_resolve_promise_callback v8::WasmImportedStringsEnabledCallback = bool (*)(Local<Context> context)

Definition at line 325 of file v8-callbacks.h.

◆ WasmJSPIEnabledCallback

using v8::WasmJSPIEnabledCallback = bool (*)(Local<Context> context)

Definition at line 336 of file v8-callbacks.h.

◆ WasmLoadSourceMapCallback

Initial value:
Local<String> (*)(Isolate* isolate,
const char* name)

Definition at line 321 of file v8-callbacks.h.

◆ WasmStreamingCallback

Definition at line 311 of file v8-callbacks.h.

Enumeration Type Documentation

◆ AccessType

Access type specification.

Enumerator
ACCESS_GET 
ACCESS_SET 
ACCESS_HAS 
ACCESS_DELETE 
ACCESS_KEYS 

Definition at line 289 of file v8-callbacks.h.

◆ ArrayBufferCreationMode

enum class v8::ArrayBufferCreationMode
strong
Enumerator
kInternalized 
kExternalized 

Definition at line 32 of file v8-array-buffer.h.

◆ BackingStoreInitializationMode

Enumerator
kZeroInitialized 
kUninitialized 

Definition at line 33 of file v8-array-buffer.h.

◆ BackingStoreOnFailureMode

enum class v8::BackingStoreOnFailureMode
strong
Enumerator
kReturnNull 
kOutOfMemory 

Definition at line 34 of file v8-array-buffer.h.

◆ BlockingType

enum class v8::BlockingType
strong

A "blocking call" refers to any call that causes the calling thread to wait off-CPU. It includes but is not limited to calls that wait on synchronous file I/O operations: read or write a file from disk, interact with a pipe or a socket, rename or delete a file, enumerate files in a directory, etc. Acquiring a low contention lock is not considered a blocking call. BlockingType indicates the likelihood that a blocking call will actually block.

Enumerator
kMayBlock 
kWillBlock 

Definition at line 332 of file v8-platform.h.

◆ CodeEventType

Note that this enum may be extended in the future. Please include a default case if this enum is used in a switch statement.

Enumerator
kUnknownType 

Definition at line 1275 of file v8-profiler.h.

◆ ConstructorBehavior

enum class v8::ConstructorBehavior
strong
Enumerator
kThrow 
kAllow 

Definition at line 475 of file v8-template.h.

◆ ContextDependants

enum class v8::ContextDependants
strong

Signal for dependants of contexts. Useful for ContextDisposedNotification() to implement different strategies.

Enumerator
kNoDependants 

Context has no dependants. These are usually top-level contexts.

kSomeDependants 

Context has some dependants, i.e., it may depend on other contexts. This is usually the case for inner contexts.

Definition at line 181 of file v8-isolate.h.

◆ CppHeapPointerTag

enum class v8::CppHeapPointerTag : uint16_t
strong

A pointer tag used for wrapping and unwrapping CppHeap pointers as used with JS API wrapper objects that rely on v8::Object::Wrap() and v8::Object::Unwrap().

The CppHeapPointers use a range-based type checking scheme, where on access to a pointer, the actual type of the pointer is checked to be within a specified range of types. This allows supporting type hierarchies, where a type check for a supertype must succeed for any subtype.

The tag is currently in practice limited to 15 bits since it needs to fit together with a marking bit into the unused parts of a pointer.

Enumerator
kFirstTag 
kNullTag 
kDefaultTag 

The lower type ids are reserved for the embedder to assign. For that, the main requirement is that all (transitive) child classes of a given parent class have type ids in the same range, and that there are no unrelated types in that range. For example, given the following type hierarchy:

     A     F
    / \
   B   E
  / \
 C   D

a potential type id assignment that satistifes these requirements is {C: 0, D: 1, B: 2, A: 3, E: 4, F: 5}. With that, the type check for type A would check for the range [0, 4], while the check for B would check range [0, 2], and for F it would simply check [5, 5].

In addition, there is an option for performance tweaks: if the size of the type range corresponding to a supertype is a power of two and starts at a power of two (e.g. [0x100, 0x13f]), then the compiler can often optimize the type check to use even fewer instructions (essentially replace a AND + SUB with a single AND).

kZappedEntryTag 
kEvacuationEntryTag 
kFreeEntryTag 
kLastTag 

Definition at line 28 of file v8-sandbox.h.

◆ CpuProfilingLoggingMode

Enumerator
kLazyLogging 
kEagerLogging 

Definition at line 308 of file v8-profiler.h.

◆ CpuProfilingMode

Enumerator
kLeafNodeLineNumbers 
kCallerLineNumbers 

Definition at line 289 of file v8-profiler.h.

◆ CpuProfilingNamingMode

Enumerator
kStandardNaming 
kDebugNaming 

Definition at line 300 of file v8-profiler.h.

◆ CpuProfilingStatus

enum class v8::CpuProfilingStatus
strong
Enumerator
kStarted 
kAlreadyStarted 
kErrorTooManyProfilers 

Definition at line 320 of file v8-profiler.h.

◆ CrashKeyId

enum class v8::CrashKeyId
strong
Enumerator
kIsolateAddress 
kReadonlySpaceFirstPageAddress 
V8_ENUM_DEPRECATE_SOON 
kOldSpaceFirstPageAddress 
kCodeRangeBaseAddress 
kCodeSpaceFirstPageAddress 
kDumpType 
kSnapshotChecksumCalculated 
kSnapshotChecksumExpected 

Definition at line 244 of file v8-callbacks.h.

◆ EmbedderStateTag

enum class v8::EmbedderStateTag : uint8_t
strong
Enumerator
EMPTY 
OTHER 

Definition at line 22 of file v8-embedder-state-scope.h.

◆ ExceptionContext

enum class v8::ExceptionContext : uint32_t
strong

This is a part of experimental Api and might be changed without further notice. Do not use it.

Enumerator
kUnknown 
kConstructor 
kOperation 
kAttributeGet 
kAttributeSet 
kIndexedQuery 
kIndexedGetter 
kIndexedDescriptor 
kIndexedSetter 
kIndexedDefiner 
kIndexedDeleter 
kNamedQuery 
kNamedGetter 
kNamedDescriptor 
kNamedSetter 
kNamedDefiner 
kNamedDeleter 
kNamedEnumerator 

Definition at line 78 of file v8-exception.h.

◆ GCCallbackFlags

GCCallbackFlags is used to notify additional information about the GC callback.

  • kGCCallbackFlagConstructRetainedObjectInfos: The GC callback is for constructing retained object infos.
  • kGCCallbackFlagForced: The GC callback is for a forced GC for testing.
  • kGCCallbackFlagSynchronousPhantomCallbackProcessing: The GC callback is called synchronously without getting posted to an idle task.
  • kGCCallbackFlagCollectAllAvailableGarbage: The GC callback is called in a phase where V8 is trying to collect all available garbage (e.g., handling a low memory notification).
  • kGCCallbackScheduleIdleGarbageCollection: The GC callback is called to trigger an idle garbage collection.
Enumerator
kNoGCCallbackFlags 
kGCCallbackFlagConstructRetainedObjectInfos 
kGCCallbackFlagForced 
kGCCallbackFlagSynchronousPhantomCallbackProcessing 
kGCCallbackFlagCollectAllAvailableGarbage 
kGCCallbackFlagCollectAllExternalMemory 
kGCCallbackScheduleIdleGarbageCollection 

Definition at line 179 of file v8-callbacks.h.

◆ GCType

enum v8::GCType

Applications can register callback functions which will be called before and after certain garbage collection operations. Allocations are not allowed in the callback functions, you therefore cannot manipulate objects (set or delete properties for example) since it is possible such operations will result in the allocation of objects. TODO(v8:12612): Deprecate kGCTypeMinorMarkSweep after updating blink.

Enumerator
kGCTypeScavenge 
kGCTypeMinorMarkSweep 
kGCTypeMarkSweepCompact 
kGCTypeIncrementalMarking 
kGCTypeProcessWeakCallbacks 
kGCTypeAll 

Definition at line 154 of file v8-callbacks.h.

◆ IndexFilter

enum class v8::IndexFilter
strong

kIncludesIndices allows for integer indices to be collected, while kSkipIndices will exclude integer indices from being collected.

Enumerator
kIncludeIndices 
kSkipIndices 

Definition at line 217 of file v8-object.h.

◆ IntegrityLevel

enum class v8::IntegrityLevel
strong

Integrity level for objects.

Enumerator
kFrozen 
kSealed 

Definition at line 228 of file v8-object.h.

◆ Intercepted

enum class v8::Intercepted : uint8_t
strong

Interceptor callbacks use this value to indicate whether the request was intercepted or not.

Enumerator
kNo 
kYes 

Definition at line 139 of file v8-template.h.

◆ Intrinsic

Definition at line 41 of file v8-template.h.

◆ JitCodeEventOptions

Option flags passed to the SetJitCodeEventHandler function.

Enumerator
kJitCodeEventDefault 
kJitCodeEventEnumExisting 
kLastJitCodeEventOption 

Definition at line 129 of file v8-callbacks.h.

◆ JSApiInstanceType

enum class v8::JSApiInstanceType : uint16_t
strong
Enumerator
kGenericApiObject 
kEventTarget 
kNode 
kElement 
kHTMLElement 
kHTMLDivElement 

Definition at line 3832 of file d8.cc.

◆ KeyCollectionMode

enum class v8::KeyCollectionMode
strong

Keys/Properties filter enums:

KeyCollectionMode limits the range of collected properties. kOwnOnly limits the collected properties to the given Object only. kIncludesPrototypes will include all keys of the objects's prototype chain as well.

Enumerator
kOwnOnly 
kIncludePrototypes 

Definition at line 211 of file v8-object.h.

◆ KeyConversionMode

enum class v8::KeyConversionMode
strong

kConvertToString will convert integer indices to strings. kKeepNumbers will return numbers for integer indices.

Enumerator
kConvertToString 
kKeepNumbers 
kNoNumbers 

Definition at line 223 of file v8-object.h.

◆ LogEventStatus

enum v8::LogEventStatus : int
Enumerator
kStart 
kEnd 
kLog 

Definition at line 239 of file v8-callbacks.h.

◆ MeasureMemoryExecution

enum class v8::MeasureMemoryExecution
strong

Controls how promptly a memory measurement request is executed. By default the measurement is folded with the next scheduled GC which may happen after a while and is forced after some timeout. The kEager mode starts incremental GC right away and is useful for testing. The kLazy mode does not force GC.

Enumerator
kDefault 
kEager 
kLazy 

Definition at line 43 of file v8-statistics.h.

◆ MeasureMemoryMode

enum class v8::MeasureMemoryMode
strong

Controls how the default MeasureMemoryDelegate reports the result of the memory measurement to JS. With kSummary only the total size is reported. With kDetailed the result includes the size of each native context.

Enumerator
kSummary 
kDetailed 

Definition at line 34 of file v8-statistics.h.

◆ MemoryPressureLevel

enum class v8::MemoryPressureLevel
strong

Memory pressure level for the MemoryPressureNotification. kNone hints V8 that there is no memory pressure. kModerate hints V8 to speed up incremental garbage collection at the cost of of higher latency due to garbage collection pauses. kCritical hints V8 to free memory as soon as possible. Garbage collection pauses at this level will be large.

Enumerator
kNone 
kModerate 
kCritical 

Definition at line 175 of file v8-isolate.h.

◆ MicrotasksPolicy

enum class v8::MicrotasksPolicy
strong

Policy for running microtasks:

Enumerator
kExplicit 
kScoped 
kAuto 

Definition at line 24 of file v8-microtask.h.

◆ ModuleImportPhase

enum class v8::ModuleImportPhase
strong

Import phases in import requests.

Enumerator
kSource 
kEvaluation 

Definition at line 341 of file v8-callbacks.h.

◆ ModuleType

enum class v8::ModuleType
strong
Enumerator
kJavaScript 
kJSON 
kWebAssembly 
kInvalid 

Definition at line 37 of file d8.h.

◆ NewStringType

enum class v8::NewStringType
strong

A flag describing different modes of string creation.

Aside from performance implications there are no differences between the two creation modes.

Enumerator
kNormal 

Create a new string, always allocating new storage memory.

kInternalized 

Acts as a hint that the string should be created in the old generation heap space and be deduplicated if an identical string already exists.

Definition at line 107 of file v8-primitive.h.

◆ PagePermissions

enum class v8::PagePermissions
strong

Possible permissions for memory pages.

Enumerator
kNoAccess 
kRead 
kReadWrite 
kReadWriteExecute 
kReadExecute 

Definition at line 722 of file v8-platform.h.

◆ PersistentContainerCallbackType

Enumerator
kNotWeak 
kWeakWithParameter 
kWeakWithInternalFields 

Definition at line 30 of file v8-util.h.

◆ PromiseHookType

enum class v8::PromiseHookType
strong

PromiseHook with type kInit is called when a new promise is created. When a new promise is created as part of the chain in the case of Promise.then or in the intermediate promises created by Promise.{race, all}/AsyncFunctionAwait, we pass the parent promise otherwise we pass undefined.

PromiseHook with type kResolve is called at the beginning of resolve or reject function defined by CreateResolvingFunctions.

PromiseHook with type kBefore is called at the beginning of the PromiseReactionJob.

PromiseHook with type kAfter is called right at the end of the PromiseReactionJob.

Enumerator
kInit 
kResolve 
kBefore 
kAfter 

Definition at line 141 of file v8-promise.h.

◆ PromiseRejectEvent

Enumerator
kPromiseRejectWithNoHandler 
kPromiseHandlerAddedAfterReject 
kPromiseRejectAfterResolved 
kPromiseResolveAfterResolved 

Definition at line 147 of file v8-promise.h.

◆ PropertyAttribute

PropertyAttribute.

Enumerator
None 

None.

ReadOnly 

ReadOnly, i.e., not writable.

DontEnum 

DontEnum, i.e., not enumerable.

DontDelete 

DontDelete, i.e., not configurable.

Definition at line 139 of file v8-object.h.

◆ PropertyFilter

Property filter bits. They can be or'ed to build a composite filter.

Enumerator
ALL_PROPERTIES 
ONLY_WRITABLE 
ONLY_ENUMERABLE 
ONLY_CONFIGURABLE 
SKIP_STRINGS 
SKIP_SYMBOLS 

Definition at line 179 of file v8-object.h.

◆ PropertyHandlerFlags

enum class v8::PropertyHandlerFlags
strong

Configuration flags for v8::NamedPropertyHandlerConfiguration or v8::IndexedPropertyHandlerConfiguration.

Enumerator
kNone 

None.

kNonMasking 

Will not call into interceptor for properties on the receiver or prototype chain, i.e., only call into interceptor for properties that do not exist. Currently only valid for named interceptors.

kOnlyInterceptStrings 

Will not call into interceptor for symbol lookup. Only meaningful for named interceptors.

kHasNoSideEffect 

The getter, query, enumerator callbacks do not produce side effects.

kInternalNewCallbacksSignatures 

This flag is used to distinguish which callbacks were provided - GenericNamedPropertyXXXCallback (old signature) or NamedPropertyXXXCallback (new signature). DO NOT use this flag, it'll be removed once embedders migrate to new callbacks signatures.

Definition at line 740 of file v8-template.h.

◆ ScriptType

enum class v8::ScriptType
strong
Enumerator
kClassic 
kModule 

Definition at line 397 of file v8-script.h.

◆ SideEffectType

enum class v8::SideEffectType
strong

Options for marking whether callbacks may trigger JS-observable side effects. Side-effect-free callbacks are allowlisted during debug evaluation with throwOnSideEffect. It applies when calling a Function, FunctionTemplate, or an Accessor callback. For Interceptors, please see PropertyHandlerFlags's kHasNoSideEffect. Callbacks that only cause side effects to the receiver are allowlisted if invoked on receiver objects that are created within the same debug-evaluate call, as these objects are temporary and the side effect does not escape.

Enumerator
kHasSideEffect 
kHasNoSideEffect 
kHasSideEffectToReceiver 

Definition at line 198 of file v8-object.h.

◆ StateTag

enum v8::StateTag : uint16_t
Enumerator
JS 
GC 
PARSER 
BYTECODE_COMPILER 
COMPILER 
OTHER 
EXTERNAL 
ATOMICS_WAIT 
IDLE 
LOGGING 

Definition at line 36 of file v8-unwinder.h.

◆ TaskPriority

enum class v8::TaskPriority : uint8_t
strong
Enumerator
kBestEffort 

Best effort tasks are not critical for performance of the application. The platform implementation should preempt such tasks if higher priority tasks arrive.

kUserVisible 

User visible tasks are long running background tasks that will improve performance and memory usage of the application upon completion. Example: background compilation and garbage collection.

kUserBlocking 

User blocking tasks are highest priority tasks that block the execution thread (e.g. major garbage collection). They must be finished as soon as possible.

kMaxPriority 

Definition at line 24 of file v8-platform.h.

◆ WasmAsyncSuccess

enum class v8::WasmAsyncSuccess
strong
Enumerator
kSuccess 
kFail 

Definition at line 313 of file v8-callbacks.h.

◆ WeakCallbackType

enum class v8::WeakCallbackType
strong

Weakness type for weak handles.

Enumerator
kParameter 

Passes a user-defined void* parameter back to the callback.

kInternalFields 

Passes the first two internal fields of the object back to the callback.

Definition at line 65 of file v8-weak-callback-info.h.

Function Documentation

◆ Align()

static const uint16_t * v8::Align ( const uint16_t * chars)
inlinestatic

Definition at line 5641 of file api.cc.

Here is the caller graph for this function:

◆ ASSERT_TRIVIALLY_COPYABLE() [1/5]

v8::ASSERT_TRIVIALLY_COPYABLE ( api_internal::IndirectHandleBase )

◆ ASSERT_TRIVIALLY_COPYABLE() [2/5]

v8::ASSERT_TRIVIALLY_COPYABLE ( internal::LocalUnchecked< Object > )

◆ ASSERT_TRIVIALLY_COPYABLE() [3/5]

v8::ASSERT_TRIVIALLY_COPYABLE ( Local< Object > )

◆ ASSERT_TRIVIALLY_COPYABLE() [4/5]

v8::ASSERT_TRIVIALLY_COPYABLE ( LocalBase< Object > )

◆ ASSERT_TRIVIALLY_COPYABLE() [5/5]

v8::ASSERT_TRIVIALLY_COPYABLE ( MaybeLocal< Object > )

◆ CALLBACK_SETTER() [1/5]

allow_wasm_code_gen_callback wasm_async_resolve_promise_callback wasm_imported_strings_enabled_callback sharedarraybuffer_constructor_enabled_callback v8::CALLBACK_SETTER ( JavaScriptCompileHintsMagicEnabledCallback ,
JavaScriptCompileHintsMagicEnabledCallback ,
compile_hints_magic_enabled_callback  )

◆ CALLBACK_SETTER() [2/5]

v8::CALLBACK_SETTER ( ModifyCodeGenerationFromStringsCallback ,
ModifyCodeGenerationFromStringsCallback2 ,
modify_code_gen_callback  )

◆ CALLBACK_SETTER() [3/5]

allow_wasm_code_gen_callback wasm_async_resolve_promise_callback wasm_imported_strings_enabled_callback v8::CALLBACK_SETTER ( WasmJSPIEnabledCallback ,
WasmJSPIEnabledCallback ,
wasm_jspi_enabled_callback  )

◆ CALLBACK_SETTER() [4/5]

allow_wasm_code_gen_callback wasm_async_resolve_promise_callback v8::CALLBACK_SETTER ( WasmLoadSourceMapCallback ,
WasmLoadSourceMapCallback ,
wasm_load_source_map_callback  )

◆ CALLBACK_SETTER() [5/5]

allow_wasm_code_gen_callback v8::CALLBACK_SETTER ( WasmStreamingCallback ,
WasmStreamingCallback ,
wasm_streaming_callback  )

◆ CallGCCallbackWithoutData()

static void v8::CallGCCallbackWithoutData ( Isolate * v8_isolate,
GCType type,
GCCallbackFlags flags,
void * data )
static

Definition at line 9841 of file api.cc.

Here is the caller graph for this function:

◆ CheckItsADirectory()

static bool v8::CheckItsADirectory ( Isolate * isolate,
char * directory )
static

Definition at line 528 of file d8-posix.cc.

Here is the caller graph for this function:

◆ ChildLaunchedOK()

static bool v8::ChildLaunchedOK ( Isolate * isolate,
int * exec_error_fds )
static

Definition at line 274 of file d8-posix.cc.

Here is the caller graph for this function:

◆ CopyAndConvertArrayToCppBuffer()

template<CTypeInfo::Identifier type_info_id, typename T >
bool v8::CopyAndConvertArrayToCppBuffer ( Local< Array > src,
T * dst,
uint32_t max_length )

Definition at line 287 of file api-inl.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ CopyDoubleElementsToTypedBuffer()

template<typename T >
void v8::CopyDoubleElementsToTypedBuffer ( T * dst,
uint32_t length,
i::Tagged< i::FixedDoubleArray > elements )

Definition at line 276 of file api-inl.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ CopySmiElementsToTypedBuffer()

template<typename T >
void v8::CopySmiElementsToTypedBuffer ( T * dst,
uint32_t length,
i::Tagged< i::FixedArray > elements )

Definition at line 264 of file api-inl.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ CreateEnvironment()

template<typename ObjectType >
static i::DirectHandle< ObjectType > v8::CreateEnvironment ( i::Isolate * i_isolate,
v8::ExtensionConfiguration * extensions,
v8::MaybeLocal< ObjectTemplate > maybe_global_template,
v8::MaybeLocal< Value > maybe_global_proxy,
size_t context_snapshot_index,
i::DeserializeEmbedderFieldsCallback embedder_fields_deserializer,
v8::MicrotaskQueue * microtask_queue )
static

Definition at line 6648 of file api.cc.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ CreateFastCAPIObject()

void v8::CreateFastCAPIObject ( const FunctionCallbackInfo< Value > & info)

Definition at line 1455 of file d8-test.cc.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ CreateLeafInterfaceObject()

void v8::CreateLeafInterfaceObject ( const FunctionCallbackInfo< Value > & info)

Definition at line 1955 of file d8-test.cc.

Here is the caller graph for this function:

◆ CurrentValueSerializerFormatVersion()

uint32_t v8::CurrentValueSerializerFormatVersion ( )
constexpr

Definition at line 20 of file v8-value-serializer-version.h.

◆ Dummy()

void v8::Dummy ( char * arg)

Definition at line 4558 of file d8.cc.

Here is the caller graph for this function:

◆ EmbedderDataFor()

static i::DirectHandle< i::EmbedderDataArray > v8::EmbedderDataFor ( Context * context,
int index,
bool can_grow,
const char * location )
static

Definition at line 873 of file api.cc.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ends_with()

bool v8::ends_with ( const char * input,
const char * suffix )

Definition at line 4979 of file d8.cc.

Here is the caller graph for this function:

◆ ExecSubprocess()

static void v8::ExecSubprocess ( int * exec_error_fds,
int * stdout_fds,
const ExecArgs & exec_args )
static

Definition at line 253 of file d8-posix.cc.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ False()

V8_INLINE Local< Boolean > v8::False ( Isolate * isolate)

Definition at line 1081 of file v8-primitive.h.

Here is the caller graph for this function:

◆ FileDescriptorFromSharedMemoryHandle()

int v8::FileDescriptorFromSharedMemoryHandle ( PlatformSharedMemoryHandle handle)
inline

Definition at line 713 of file v8-platform.h.

◆ FromCData() [1/4]

template<internal::ExternalPointerTag tag, typename T >
v8::internal::DirectHandle< i::UnionOf< i::Smi, i::Foreign > > v8::FromCData ( v8::internal::Isolate * isolate,
T obj )
inline

Definition at line 41 of file api-inl.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ FromCData() [2/4]

Definition at line 41 of file api-inl.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ FromCData() [3/4]

Definition at line 50 of file api-inl.h.

Here is the call graph for this function:

◆ FromCData() [4/4]

Definition at line 50 of file api-inl.h.

Here is the call graph for this function:

◆ GetCalleeSavedRegistersFromEntryFrame()

void v8::GetCalleeSavedRegistersFromEntryFrame ( void * fp,
RegisterState * register_state )

Definition at line 14 of file unwinder-arm.cc.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetScriptOriginForScript()

static ScriptOrigin v8::GetScriptOriginForScript ( i::Isolate * i_isolate,
i::DirectHandle< i::Script > script )
static

Definition at line 187 of file api.cc.

Here is the caller graph for this function:

◆ GetStdout()

static Local< Value > v8::GetStdout ( Isolate * isolate,
int child_fd,
const struct timeval & start_time,
int read_timeout,
int total_timeout )
static

Definition at line 289 of file d8-posix.cc.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetTimeouts()

static bool v8::GetTimeouts ( const v8::FunctionCallbackInfo< v8::Value > & info,
int * read_timeout,
int * total_timeout )
static

Definition at line 216 of file d8-posix.cc.

Here is the caller graph for this function:

◆ InternalFieldOK()

static V8_INLINE bool v8::InternalFieldOK ( i::DirectHandle< i::JSReceiver > obj,
int index,
const char * location )
static

Definition at line 6282 of file api.cc.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ Just() [1/2]

template<class T >
Maybe< T > v8::Just ( const T & t)
inline

Definition at line 117 of file v8-maybe.h.

◆ Just() [2/2]

template<class T , std::enable_if_t<!std::is_lvalue_reference_v< T > > * = nullptr>
Maybe< T > v8::Just ( T && t)
inline

Definition at line 125 of file v8-maybe.h.

◆ JustVoid()

Maybe< void > v8::JustVoid ( )
inline

Definition at line 157 of file v8-maybe.h.

Here is the caller graph for this function:

◆ kAnyCppHeapPointer()

Here is the caller graph for this function:

◆ LengthWithoutIncompleteUtf8()

static int v8::LengthWithoutIncompleteUtf8 ( char * buffer,
int len )
static

Definition at line 33 of file d8-posix.cc.

Here is the caller graph for this function:

◆ Load() [1/2]

i::Address v8::Load ( i::Address address)

Definition at line 19 of file unwinder.cc.

◆ Load() [2/2]

internal::Address v8::Load ( internal::Address address)

◆ MakeDelayedTasksPlatform()

std::unique_ptr< Platform > v8::MakeDelayedTasksPlatform ( std::unique_ptr< Platform > platform,
int64_t random_seed )

Definition at line 348 of file d8-platforms.cc.

Here is the caller graph for this function:

◆ MakePredictablePlatform()

std::unique_ptr< Platform > v8::MakePredictablePlatform ( std::unique_ptr< Platform > platform)

Definition at line 112 of file d8-platforms.cc.

Here is the caller graph for this function:

◆ mkdirp()

static bool v8::mkdirp ( Isolate * isolate,
char * directory,
mode_t mask )
static

Definition at line 542 of file d8-posix.cc.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ NewContext()

Local< Context > v8::NewContext ( v8::Isolate * external_isolate,
v8::ExtensionConfiguration * extensions,
v8::MaybeLocal< ObjectTemplate > global_template,
v8::MaybeLocal< Value > global_object,
size_t context_snapshot_index,
i::DeserializeEmbedderFieldsCallback embedder_fields_deserializer,
v8::MicrotaskQueue * microtask_queue )

Definition at line 6754 of file api.cc.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ NewDOMFunctionTemplate()

Local< FunctionTemplate > v8::NewDOMFunctionTemplate ( Isolate * isolate,
JSApiInstanceType instance_type )

Definition at line 3841 of file d8.cc.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ NewFunctionTemplate()

static i::DirectHandle< i::FunctionTemplateInfo > v8::NewFunctionTemplate ( i::Isolate * i_isolate,
FunctionCallback func,
bool has_prototype,
SideEffectType side_effect_type = SideEffectType::kHasSideEffect )
static

Definition at line 3223 of file wasm-js.cc.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ NewObjectTemplate()

static i::DirectHandle< i::ObjectTemplateInfo > v8::NewObjectTemplate ( i::Isolate * i_isolate)
static

Definition at line 3235 of file wasm-js.cc.

Here is the call graph for this function:

◆ Nothing()

template<class T >
Maybe< T > v8::Nothing ( )
inline

Definition at line 112 of file v8-maybe.h.

◆ Null()

V8_INLINE Local< Primitive > v8::Null ( Isolate * isolate)

Definition at line 1065 of file v8-primitive.h.

Here is the caller graph for this function:

◆ ObjectSetAccessor()

template<typename Getter , typename Setter , typename Data >
static Maybe< bool > v8::ObjectSetAccessor ( Local< Context > context,
Object * self,
Local< Name > name,
Getter getter,
Setter setter,
Data data,
PropertyAttribute attributes,
bool replace_on_access,
SideEffectType getter_side_effect_type,
SideEffectType setter_side_effect_type )
static

Definition at line 4914 of file api.cc.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ operator!=() [1/3]

V8_INLINE bool v8::operator!= ( const TracedReferenceBase & lhs,
const TracedReferenceBase & rhs )

Definition at line 334 of file v8-traced-handle.h.

◆ operator!=() [2/3]

template<typename U >
V8_INLINE bool v8::operator!= ( const TracedReferenceBase & lhs,
const v8::Local< U > & rhs )

Definition at line 340 of file v8-traced-handle.h.

◆ operator!=() [3/3]

template<typename U >
V8_INLINE bool v8::operator!= ( const v8::Local< U > & lhs,
const TracedReferenceBase & rhs )

Definition at line 346 of file v8-traced-handle.h.

◆ operator==() [1/3]

V8_INLINE bool v8::operator== ( const TracedReferenceBase & lhs,
const TracedReferenceBase & rhs )

Definition at line 317 of file v8-traced-handle.h.

◆ operator==() [2/3]

template<typename U >
V8_INLINE bool v8::operator== ( const TracedReferenceBase & lhs,
const v8::Local< U > & rhs )

Definition at line 323 of file v8-traced-handle.h.

◆ operator==() [3/3]

template<typename U >
V8_INLINE bool v8::operator== ( const v8::Local< U > & lhs,
const TracedReferenceBase & rhs )

Definition at line 329 of file v8-traced-handle.h.

◆ PrintMessageCallback()

static void v8::PrintMessageCallback ( Local< Message > message,
Local< Value > error )
static

Definition at line 4201 of file d8.cc.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ REGEXP_FLAG_ASSERT_EQ() [1/9]

v8::REGEXP_FLAG_ASSERT_EQ ( kGlobal )

◆ REGEXP_FLAG_ASSERT_EQ() [2/9]

v8::REGEXP_FLAG_ASSERT_EQ ( kHasIndices )

◆ REGEXP_FLAG_ASSERT_EQ() [3/9]

v8::REGEXP_FLAG_ASSERT_EQ ( kIgnoreCase )

◆ REGEXP_FLAG_ASSERT_EQ() [4/9]

v8::REGEXP_FLAG_ASSERT_EQ ( kLinear )

◆ REGEXP_FLAG_ASSERT_EQ() [5/9]

v8::REGEXP_FLAG_ASSERT_EQ ( kMultiline )

◆ REGEXP_FLAG_ASSERT_EQ() [6/9]

v8::REGEXP_FLAG_ASSERT_EQ ( kNone )

◆ REGEXP_FLAG_ASSERT_EQ() [7/9]

v8::REGEXP_FLAG_ASSERT_EQ ( kSticky )

◆ REGEXP_FLAG_ASSERT_EQ() [8/9]

v8::REGEXP_FLAG_ASSERT_EQ ( kUnicode )

◆ REGEXP_FLAG_ASSERT_EQ() [9/9]

v8::REGEXP_FLAG_ASSERT_EQ ( kUnicodeSets )

◆ RegisterExtension()

void V8_EXPORT v8::RegisterExtension ( std::unique_ptr< Extension > extension)

Definition at line 486 of file api.cc.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ SharedMemoryHandleFromFileDescriptor()

PlatformSharedMemoryHandle v8::SharedMemoryHandleFromFileDescriptor ( int fd)
inline

Definition at line 710 of file v8-platform.h.

◆ TimeIsOut()

static bool v8::TimeIsOut ( const struct timeval & start_time,
const int & total_time )
static

Definition at line 116 of file d8-posix.cc.

Here is the caller graph for this function:

◆ to_array() [1/2]

template<class T , std::size_t N>
std::array< std::remove_cv_t< T >, N > v8::to_array ( T(&&) a[N])
nodiscardconstexpr

Definition at line 316 of file v8-memory-span.h.

Here is the call graph for this function:

◆ to_array() [2/2]

template<class T , std::size_t N>
std::array< std::remove_cv_t< T >, N > v8::to_array ( T(&) a[N])
nodiscardconstexpr

Definition at line 311 of file v8-memory-span.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ToApiHandle()

template<class T >
v8::Local< T > v8::ToApiHandle ( v8::internal::DirectHandle< v8::internal::Object > obj)
inline

Definition at line 297 of file api.h.

Here is the call graph for this function:

◆ ToCData() [1/2]

template<typename T , internal::ExternalPointerTag tag>
T v8::ToCData ( i::Isolate * isolate,
v8::internal::Tagged< v8::internal::Object > obj )
inline

Definition at line 23 of file api-inl.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ToCData() [2/2]

Definition at line 33 of file api-inl.h.

Here is the call graph for this function:

◆ ToInternal() [1/4]

static i::CpuProfile * v8::ToInternal ( const CpuProfile * profile)
static

Definition at line 11372 of file api.cc.

Here is the caller graph for this function:

◆ ToInternal() [2/4]

static i::HeapGraphEdge * v8::ToInternal ( const HeapGraphEdge * edge)
static

Definition at line 11580 of file api.cc.

◆ ToInternal() [3/4]

static i::HeapEntry * v8::ToInternal ( const HeapGraphNode * entry)
static

Definition at line 11619 of file api.cc.

◆ ToInternal() [4/4]

static i::HeapSnapshot * v8::ToInternal ( const HeapSnapshot * snapshot)
static

Definition at line 11648 of file api.cc.

◆ ToLocal()

template<class T >
bool v8::ToLocal ( v8::internal::MaybeDirectHandle< v8::internal::Object > maybe,
Local< T > * local )
inline

Definition at line 303 of file api.h.

Here is the call graph for this function:

◆ True()

V8_INLINE Local< Boolean > v8::True ( Isolate * isolate)

Definition at line 1073 of file v8-primitive.h.

Here is the caller graph for this function:

◆ TryCopyAndConvertArrayToCppBuffer()

template<const CTypeInfo * type_info, typename T >
bool V8_EXPORT v8::TryCopyAndConvertArrayToCppBuffer ( Local< Array > src,
T * dst,
uint32_t max_length )
inline

Definition at line 329 of file api-inl.h.

Here is the call graph for this function:

◆ TryHandleWebAssemblyTrapPosix()

V8_EXPORT bool v8::TryHandleWebAssemblyTrapPosix ( int sig_code,
siginfo_t * info,
void * context )

This function determines whether a memory access violation has been an out-of-bounds memory access in WebAssembly. If so, it will modify the context parameter and add a return address where the execution can continue after the signal handling, and return true. Otherwise, false will be returned.

The parameters to this function correspond to those passed to a Posix signal handler. Use this function only on Linux and Mac.

Parameters
sig_codeThe signal code, e.g. SIGSEGV.
infoA pointer to the siginfo_t struct provided to the signal handler.
contextA pointer to a ucontext_t struct provided to the signal handler.

◆ TryHandleWebAssemblyTrapWindows()

V8_EXPORT bool v8::TryHandleWebAssemblyTrapWindows ( EXCEPTION_POINTERS * exception)

This function determines whether a memory access violation has been an out-of-bounds memory access in WebAssembly. If so, it will modify the exception parameter and add a return address where the execution can continue after the exception handling, and return true. Otherwise the return value will be false.

The parameter to this function corresponds to the one passed to a Windows vectored exception handler. Use this function only on Windows.

Parameters
exceptionAn EXCEPTION_POINTERS* as provided to the exception handler.

◆ TryToCopyAndConvertArrayToCppBuffer() [1/2]

template<CTypeInfo::Identifier type_info_id, typename T >
bool V8_EXPORT V8_WARN_UNUSED_RESULT v8::TryToCopyAndConvertArrayToCppBuffer ( Local< Array > src,
T * dst,
uint32_t max_length )
inline

Copies the contents of this JavaScript array to a C++ buffer with a given max_length. A CTypeInfo is passed as an argument, instructing different rules for conversion (e.g. restricted float/double). The element type T of the destination array must match the C type corresponding to the CTypeInfo (specified by CTypeInfoTraits). If the array length is larger than max_length or the array is of unsupported type, the operation will fail, returning false. Generally, an array which contains objects, undefined, null or anything not convertible to the requested destination type, is considered unsupported. The operation returns true on success. type_info will be used for conversions.

Definition at line 337 of file api-inl.h.

Here is the call graph for this function:

◆ TryToCopyAndConvertArrayToCppBuffer() [2/2]

template<CTypeInfo::Identifier type_info_id, typename T >
bool V8_EXPORT v8::TryToCopyAndConvertArrayToCppBuffer ( Local< Array > src,
T * dst,
uint32_t max_length )
inline

Copies the contents of this JavaScript array to a C++ buffer with a given max_length. A CTypeInfo is passed as an argument, instructing different rules for conversion (e.g. restricted float/double). The element type T of the destination array must match the C type corresponding to the CTypeInfo (specified by CTypeInfoTraits). If the array length is larger than max_length or the array is of unsupported type, the operation will fail, returning false. Generally, an array which contains objects, undefined, null or anything not convertible to the requested destination type, is considered unsupported. The operation returns true on success. type_info will be used for conversions.

Definition at line 337 of file api-inl.h.

Here is the call graph for this function:

◆ Unaligned()

static bool v8::Unaligned ( const uint16_t * chars)
inlinestatic

Definition at line 5637 of file api.cc.

Here is the caller graph for this function:

◆ Undefined()

V8_INLINE Local< Primitive > v8::Undefined ( Isolate * isolate)

Definition at line 1057 of file v8-primitive.h.

Here is the caller graph for this function:

◆ V8_DEPRECATE_SOON()

enum v8::V8_DEPRECATE_SOON ( "This enum is no longer used and will be removed in V8 12.9." )

Access control specifications.

Some accessors should be accessible across contexts. These accessors have an explicit access control parameter which specifies the kind of cross-context access that should be allowed.

Definition at line 91 of file v8-object.h.

◆ WaitForChild()

static bool v8::WaitForChild ( Isolate * isolate,
int pid,
ZombieProtector & child_waiter,
const struct timeval & start_time,
int read_timeout,
int total_timeout )
static

Definition at line 352 of file d8-posix.cc.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ WaitOnFD()

static bool v8::WaitOnFD ( int fd,
int read_timeout,
int total_timeout,
const struct timeval & start_time )
static

Definition at line 85 of file d8-posix.cc.

Here is the caller graph for this function:

◆ WriteAndFlush()

void v8::WriteAndFlush ( FILE * file,
const v8::FunctionCallbackInfo< v8::Value > & info )

Definition at line 2910 of file d8.cc.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ WriteHelper()

template<typename CharType >
static int v8::WriteHelper ( i::Isolate * i_isolate,
const String * string,
CharType * buffer,
int start,
int length,
int options )
inlinestatic

Definition at line 5920 of file api.cc.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ WriteHelperV2()

template<typename CharType >
static void v8::WriteHelperV2 ( i::Isolate * i_isolate,
const String * string,
CharType * buffer,
uint32_t offset,
uint32_t length,
int flags )
inlinestatic

Definition at line 5953 of file api.cc.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ WriteToFile()

void v8::WriteToFile ( FILE * file,
const v8::FunctionCallbackInfo< v8::Value > & info,
int first_arg_index = 0 )

Definition at line 2879 of file d8.cc.

Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ check_d8_flag_contradictions

bool v8::check_d8_flag_contradictions = true

Definition at line 556 of file d8.cc.

◆ dummy_delegate

v8::debug::DebugDelegate v8::dummy_delegate
static

Definition at line 2727 of file d8.cc.

◆ else

v8::else
Initial value:
{
return target_constant_address_at(pc)

Definition at line 1607 of file assembler-riscv.cc.

◆ g_oom_error_callback

OOMErrorCallback v8::g_oom_error_callback = nullptr
static

Definition at line 185 of file api.cc.

◆ kAcquireLoad

AcquireLoadTag v8::kAcquireLoad
staticconstexpr

Definition at line 2908 of file globals.h.

◆ kAlignmentMask

const uintptr_t v8::kAlignmentMask = sizeof(uintptr_t) - 1
static

Definition at line 5636 of file api.cc.

◆ kEmbedderFieldsInWeakCallback

int v8::kEmbedderFieldsInWeakCallback = 2
staticconstexpr

Definition at line 22 of file v8-weak-callback-info.h.

◆ kInternalFieldsInWeakCallback

int v8::kInternalFieldsInWeakCallback = 2
staticconstexpr

Definition at line 21 of file v8-weak-callback-info.h.

◆ kInvalidSharedMemoryHandle

PlatformSharedMemoryHandle v8::kInvalidSharedMemoryHandle = -1
staticconstexpr

Definition at line 670 of file v8-platform.h.

◆ kOneByteMask

const uintptr_t v8::kOneByteMask = OneByteMask<sizeof(uintptr_t)>::value
static

Definition at line 5635 of file api.cc.

◆ kPersistentContainerNotFound

const uintptr_t v8::kPersistentContainerNotFound = 0
static

Definition at line 29 of file v8-util.h.

◆ kProcessGlobalPredictablePlatformWorkerTaskQueue

Isolate* v8::kProcessGlobalPredictablePlatformWorkerTaskQueue = nullptr
constexpr

Definition at line 33 of file d8-platforms.h.

◆ kReadFD

const int v8::kReadFD = 0
static

Definition at line 247 of file d8-posix.cc.

◆ kRelaxedLoad

RelaxedLoadTag v8::kRelaxedLoad
staticconstexpr

Definition at line 2909 of file globals.h.

◆ kRelaxedStore

RelaxedStoreTag v8::kRelaxedStore
staticconstexpr

Definition at line 2911 of file globals.h.

◆ kReleaseStore

ReleaseStoreTag v8::kReleaseStore
staticconstexpr

Definition at line 2910 of file globals.h.

◆ kSeqCstAccess

SeqCstAccessTag v8::kSeqCstAccess
staticconstexpr

Definition at line 2912 of file globals.h.

◆ kTypeInfoFloat64

CTypeInfo v8::kTypeInfoFloat64
staticconstexpr
Initial value:
=
CTypeInfo(CTypeInfo::Type::kFloat64)

Definition at line 774 of file v8-fast-api-calls.h.

◆ kTypeInfoInt32

CTypeInfo v8::kTypeInfoInt32 = CTypeInfo(CTypeInfo::Type::kInt32)
staticconstexpr

Definition at line 773 of file v8-fast-api-calls.h.

◆ kWriteFD

const int v8::kWriteFD = 1
static

Definition at line 248 of file d8-posix.cc.