v8  9.0.257(node16.0.0)
V8 is Google's open source JavaScript engine
v8.h File Reference
#include <stddef.h>
#include <stdint.h>
#include <stdio.h>
#include <atomic>
#include <memory>
#include <string>
#include <type_traits>
#include <utility>
#include <vector>
#include "cppgc/common.h"
#include "v8-internal.h"
#include "v8-version.h"
#include "v8config.h"
Include dependency graph for v8.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

class  GlobalValueMap< K, V, Traits >
 
class  PersistentValueMapBase< K, V, Traits >
 
class  NonCopyablePersistentTraits< T >
 
class  Persistent< T, M >
 
class  BasicTracedReference< T >
 
class  Eternal< T >
 
class  Global< T >
 
class  Local< T >
 
class  Maybe< T >
 
class  MaybeLocal< T >
 
class  TracedGlobal< T >
 
class  TracedReference< T >
 
class  PersistentValueMap< K, V, Traits >
 
class  WeakCallbackObject< T, P >
 
class  PersistentBase< T >
 
class  PersistentValueVector< V, Traits >
 
class  FunctionCallbackInfo< T >
 
class  PropertyCallbackInfo< T >
 
class  ReturnValue< T >
 
class  Arguments< ArgumentsType >
 
class  CustomArguments< T >
 
class  Local< T >
 
class  MaybeLocal< T >
 
class  Eternal< T >
 
class  WeakCallbackInfo< T >
 
class  PersistentBase< T >
 
class  NonCopyablePersistentTraits< T >
 
struct  CopyablePersistentTraits< T >
 
class  Persistent< T, M >
 
class  Global< T >
 
struct  TracedGlobalTrait< T >
 
class  TracedReferenceBase
 
class  BasicTracedReference< T >
 
class  TracedGlobal< T >
 
class  TracedReference< T >
 
class  HandleScope
 
class  EscapableHandleScope
 
class  SealHandleScope
 
class  Data
 
class  ScriptOrModule
 
class  PrimitiveArray
 
class  ScriptOriginOptions
 
class  ScriptOrigin
 
class  UnboundScript
 
class  UnboundModuleScript
 
class  Location
 
class  FixedArray
 
class  ModuleRequest
 
class  Module
 
class  Script
 
class  ScriptCompiler
 
struct  ScriptCompiler::CachedData
 
class  ScriptCompiler::Source
 
class  ScriptCompiler::ExternalSourceStream
 
class  ScriptCompiler::StreamedSource
 
class  ScriptCompiler::ScriptStreamingTask
 
class  Message
 
class  StackTrace
 
class  StackFrame
 
struct  RegisterState
 
struct  SampleInfo
 
struct  MemoryRange
 
struct  JSEntryStub
 
struct  JSEntryStubs
 
class  JSON
 
class  ValueSerializer
 
class  ValueSerializer::Delegate
 
class  ValueDeserializer
 
class  ValueDeserializer::Delegate
 
class  Value
 
class  Primitive
 
class  Boolean
 
class  Name
 
class  String
 
class  String::ExternalStringResourceBase
 
class  String::ExternalStringResource
 
class  String::ExternalOneByteStringResource
 
class  String::Utf8Value
 
class  String::Value
 
class  Symbol
 
class  Private
 
class  Number
 
class  Integer
 
class  Int32
 
class  Uint32
 
class  BigInt
 
class  Object
 
class  Array
 
class  Map
 
class  Set
 
class  ReturnValue< T >
 
class  FunctionCallbackInfo< T >
 
class  PropertyCallbackInfo< T >
 
class  Function
 
class  Promise
 
class  Promise::Resolver
 
class  PropertyDescriptor
 
class  Proxy
 
class  MemorySpan< T >
 
struct  OwnedBuffer
 
class  CompiledWasmModule
 
class  WasmMemoryObject
 
class  WasmModuleObject
 
class  WasmStreaming
 
class  WasmStreaming::Client
 
class  WasmModuleObjectBuilderStreaming
 
class  BackingStore
 
class  ArrayBuffer
 
class  ArrayBuffer::Allocator
 
class  ArrayBuffer::Contents
 
class  ArrayBufferView
 
class  TypedArray
 
class  Uint8Array
 
class  Uint8ClampedArray
 
class  Int8Array
 
class  Uint16Array
 
class  Int16Array
 
class  Uint32Array
 
class  Int32Array
 
class  Float32Array
 
class  Float64Array
 
class  BigInt64Array
 
class  BigUint64Array
 
class  DataView
 
class  SharedArrayBuffer
 
class  SharedArrayBuffer::Contents
 
class  Date
 
class  NumberObject
 
class  BigIntObject
 
class  BooleanObject
 
class  StringObject
 
class  SymbolObject
 
class  RegExp
 
class  External
 
class  Template
 
class  FunctionTemplate
 
struct  NamedPropertyHandlerConfiguration
 
struct  IndexedPropertyHandlerConfiguration
 
class  ObjectTemplate
 
class  Signature
 
class  AccessorSignature
 
class  Extension
 
class  ResourceConstraints
 
class  Exception
 
class  PromiseRejectMessage
 
class  MicrotaskQueue
 
class  MicrotasksScope
 
struct  ModifyCodeGenerationFromStringsResult
 
class  SharedMemoryStatistics
 
class  HeapStatistics
 
class  HeapSpaceStatistics
 
class  HeapObjectStatistics
 
class  HeapCodeStatistics
 
struct  JitCodeEvent
 
struct  JitCodeEvent::name_t
 
struct  JitCodeEvent::line_info_t
 
struct  JitCodeEvent::wasm_source_info_t
 
class  ExternalResourceVisitor
 
class  PersistentHandleVisitor
 
class  EmbedderHeapTracer
 
class  EmbedderHeapTracer::TracedGlobalHandleVisitor
 
struct  EmbedderHeapTracer::TraceSummary
 
struct  SerializeInternalFieldsCallback
 
struct  DeserializeInternalFieldsCallback
 
class  MeasureMemoryDelegate
 
class  Isolate
 
struct  Isolate::CreateParams
 
class  Isolate::Scope
 
class  Isolate::DisallowJavascriptExecutionScope
 
class  Isolate::AllowJavascriptExecutionScope
 
class  Isolate::SuppressMicrotaskExecutionScope
 
class  Isolate::SafeForTerminationScope
 
class  Isolate::AtomicsWaitWakeHandle
 
class  StartupData
 
class  V8
 
class  SnapshotCreator
 
class  Maybe< T >
 
class  Maybe< void >
 
class  TryCatch
 
class  ExtensionConfiguration
 
class  Context
 
class  Context::Scope
 
class  Context::BackupIncumbentScope
 
class  Unlocker
 
class  Locker
 
class  Unwinder
 

Namespaces

 v8
 
 v8::internal
 
 v8::internal::wasm
 
 v8::metrics
 
 v8::debug
 

Macros

#define V8_PROMISE_INTERNAL_FIELD_COUNT   0
 
#define V8_ARRAY_BUFFER_INTERNAL_FIELD_COUNT   2
 
#define V8_ARRAY_BUFFER_VIEW_INTERNAL_FIELD_COUNT   2
 
#define V8_INTRINSICS_LIST(F)
 
#define V8_DECL_INTRINSIC(name, iname)   k##name,
 

Typedefs

template<class T >
using Handle = Local< T >
 
template<class T >
using UniquePersistent = Global< T >
 
using AccessorGetterCallback = void(*)(Local< String > property, const PropertyCallbackInfo< Value > &info)
 
using AccessorNameGetterCallback = void(*)(Local< Name > property, const PropertyCallbackInfo< Value > &info)
 
using AccessorSetterCallback = void(*)(Local< String > property, Local< Value > value, const PropertyCallbackInfo< void > &info)
 
using AccessorNameSetterCallback = void(*)(Local< Name > property, Local< Value > value, const PropertyCallbackInfo< void > &info)
 
using FunctionCallback = void(*)(const FunctionCallbackInfo< Value > &info)
 
using BackingStoreDeleterCallback = void(*)(void *data, size_t length, void *deleter_data)
 
using GenericNamedPropertyGetterCallback = void(*)(Local< Name > property, const PropertyCallbackInfo< Value > &info)
 
using GenericNamedPropertySetterCallback = void(*)(Local< Name > property, Local< Value > value, const PropertyCallbackInfo< Value > &info)
 
using GenericNamedPropertyQueryCallback = void(*)(Local< Name > property, const PropertyCallbackInfo< Integer > &info)
 
using GenericNamedPropertyDeleterCallback = void(*)(Local< Name > property, const PropertyCallbackInfo< Boolean > &info)
 
using GenericNamedPropertyEnumeratorCallback = void(*)(const PropertyCallbackInfo< Array > &info)
 
using GenericNamedPropertyDefinerCallback = void(*)(Local< Name > property, const PropertyDescriptor &desc, const PropertyCallbackInfo< Value > &info)
 
using GenericNamedPropertyDescriptorCallback = void(*)(Local< Name > property, const PropertyCallbackInfo< Value > &info)
 
using IndexedPropertyGetterCallback = void(*)(uint32_t index, const PropertyCallbackInfo< Value > &info)
 
using IndexedPropertySetterCallback = void(*)(uint32_t index, Local< Value > value, const PropertyCallbackInfo< Value > &info)
 
using IndexedPropertyQueryCallback = void(*)(uint32_t index, const PropertyCallbackInfo< Integer > &info)
 
using IndexedPropertyDeleterCallback = void(*)(uint32_t index, const PropertyCallbackInfo< Boolean > &info)
 
using IndexedPropertyEnumeratorCallback = void(*)(const PropertyCallbackInfo< Array > &info)
 
using IndexedPropertyDefinerCallback = void(*)(uint32_t index, const PropertyDescriptor &desc, const PropertyCallbackInfo< Value > &info)
 
using IndexedPropertyDescriptorCallback = void(*)(uint32_t index, const PropertyCallbackInfo< Value > &info)
 
using AccessCheckCallback = bool(*)(Local< Context > accessing_context, Local< Object > accessed_object, Local< Value > data)
 
using FatalErrorCallback = void(*)(const char *location, const char *message)
 
using OOMErrorCallback = void(*)(const char *location, bool is_heap_oom)
 
using DcheckErrorCallback = void(*)(const char *file, int line, const char *message)
 
using MessageCallback = void(*)(Local< Message > message, Local< Value > data)
 
using LogEventCallback = void(*)(const char *name, int event)
 
using CounterLookupCallback = int *(*)(const char *name)
 
using CreateHistogramCallback = void *(*)(const char *name, int min, int max, size_t buckets)
 
using AddHistogramSampleCallback = void(*)(void *histogram, int sample)
 
using AddCrashKeyCallback = void(*)(CrashKeyId id, const std::string &value)
 
using BeforeCallEnteredCallback = void(*)(Isolate *)
 
using CallCompletedCallback = void(*)(Isolate *)
 
using instead = MaybeLocal< Promise >(*)(Local< Context > context, Local< ScriptOrModule > referrer, Local< String > specifier)
 
using HostImportModuleDynamicallyWithImportAssertionsCallback = MaybeLocal< Promise >(*)(Local< Context > context, Local< ScriptOrModule > referrer, Local< String > specifier, Local< FixedArray > import_assertions)
 
using HostInitializeImportMetaObjectCallback = void(*)(Local< Context > context, Local< Module > module, Local< Object > meta)
 
using PrepareStackTraceCallback = MaybeLocal< Value >(*)(Local< Context > context, Local< Value > error, Local< Array > sites)
 
using PromiseHook = void(*)(PromiseHookType type, Local< Promise > promise, Local< Value > parent)
 
using PromiseRejectCallback = void(*)(PromiseRejectMessage message)
 
using MicrotasksCompletedCallbackWithData = void(*)(Isolate *, void *)
 
using MicrotaskCallback = void(*)(void *data)
 
using FailedAccessCheckCallback = void(*)(Local< Object > target, AccessType type, Local< Value > data)
 
using AllowCodeGenerationFromStringsCallback = bool(*)(Local< Context > context, Local< String > source)
 
using ModifyCodeGenerationFromStringsCallback = ModifyCodeGenerationFromStringsResult(*)(Local< Context > context, Local< Value > source)
 
using ModifyCodeGenerationFromStringsCallback2 = ModifyCodeGenerationFromStringsResult(*)(Local< Context > context, Local< Value > source, bool is_code_like)
 
using ExtensionCallback = bool(*)(const FunctionCallbackInfo< Value > &)
 
using AllowWasmCodeGenerationCallback = bool(*)(Local< Context > context, Local< String > source)
 
using ApiImplementationCallback = void(*)(const FunctionCallbackInfo< Value > &)
 
using WasmStreamingCallback = void(*)(const FunctionCallbackInfo< Value > &)
 
using WasmLoadSourceMapCallback = Local< String >(*)(Isolate *isolate, const char *name)
 
using WasmSimdEnabledCallback = bool(*)(Local< Context > context)
 
using WasmExceptionsEnabledCallback = bool(*)(Local< Context > context)
 
using GCCallback = void(*)(GCType type, GCCallbackFlags flags)
 
using InterruptCallback = void(*)(Isolate *isolate, void *data)
 
using NearHeapLimitCallback = size_t(*)(void *data, size_t current_heap_limit, size_t initial_heap_limit)
 
using JitCodeEventHandler = void(*)(const JitCodeEvent *event)
 
using SerializeEmbedderFieldsCallback = SerializeInternalFieldsCallback
 
using DeserializeEmbedderFieldsCallback = DeserializeInternalFieldsCallback
 
using EntropySource = bool(*)(unsigned char *buffer, size_t length)
 
using ReturnAddressLocationResolver = uintptr_t(*)(uintptr_t return_addr_location)
 

Enumerations

enum  WeakCallbackType { kParameter, kInternalFields, kFinalizer }
 
enum  ScriptType { kClassic, kModule }
 
enum  StateTag {
  JS, GC, PARSER, BYTECODE_COMPILER,
  COMPILER, OTHER, EXTERNAL, ATOMICS_WAIT,
  IDLE
}
 
enum  NewStringType { kNormal, kInternalized }
 
enum  PropertyAttribute { None = 0, ReadOnly = 1 << 0, DontEnum = 1 << 1, DontDelete = 1 << 2 }
 
enum  AccessControl { DEFAULT = 0, ALL_CAN_READ = 1, ALL_CAN_WRITE = 1 << 1, PROHIBITS_OVERWRITING = 1 << 2 }
 
enum  PropertyFilter {
  ALL_PROPERTIES = 0, ONLY_WRITABLE = 1, ONLY_ENUMERABLE = 2, ONLY_CONFIGURABLE = 4,
  SKIP_STRINGS = 8, SKIP_SYMBOLS = 16
}
 
enum  SideEffectType { kHasSideEffect, kHasNoSideEffect, kHasSideEffectToReceiver }
 
enum  KeyCollectionMode { kOwnOnly, kIncludePrototypes }
 
enum  IndexFilter { kIncludeIndices, kSkipIndices }
 
enum  KeyConversionMode { kConvertToString, kKeepNumbers, kNoNumbers }
 
enum  IntegrityLevel { kFrozen, kSealed }
 
enum  ConstructorBehavior { kThrow, kAllow }
 
enum  ArrayBufferCreationMode { kInternalized, kExternalized }
 
enum  Intrinsic
 
enum  AccessType {
  ACCESS_GET, ACCESS_SET, ACCESS_HAS, ACCESS_DELETE,
  ACCESS_KEYS
}
 
enum  PropertyHandlerFlags {
  kNone = 0, kAllCanRead = 1, kNonMasking = 1 << 1, kOnlyInterceptStrings = 1 << 2,
  kHasNoSideEffect = 1 << 3
}
 
enum  CrashKeyId {
  kIsolateAddress, kReadonlySpaceFirstPageAddress, kMapSpaceFirstPageAddress, kCodeSpaceFirstPageAddress,
  kDumpType
}
 
enum  PromiseHookType { kInit, kResolve, kBefore, kAfter }
 
enum  PromiseRejectEvent { kPromiseRejectWithNoHandler = 0, kPromiseHandlerAddedAfterReject = 1, kPromiseRejectAfterResolved = 2, kPromiseResolveAfterResolved = 3 }
 
enum  MicrotasksPolicy { kExplicit, kScoped, kAuto }
 
enum  GCType {
  kGCTypeScavenge = 1 << 0, kGCTypeMarkSweepCompact = 1 << 1, kGCTypeIncrementalMarking = 1 << 2, kGCTypeProcessWeakCallbacks = 1 << 3,
  kGCTypeAll
}
 
enum  GCCallbackFlags {
  kNoGCCallbackFlags = 0, kGCCallbackFlagConstructRetainedObjectInfos = 1 << 1, kGCCallbackFlagForced = 1 << 2, kGCCallbackFlagSynchronousPhantomCallbackProcessing = 1 << 3,
  kGCCallbackFlagCollectAllAvailableGarbage = 1 << 4, kGCCallbackFlagCollectAllExternalMemory = 1 << 5, kGCCallbackScheduleIdleGarbageCollection = 1 << 6
}
 
enum  RAILMode : unsigned { PERFORMANCE_RESPONSE, PERFORMANCE_ANIMATION, PERFORMANCE_IDLE, PERFORMANCE_LOAD }
 
enum  JitCodeEventOptions { kJitCodeEventDefault = 0, kJitCodeEventEnumExisting = 1 }
 
enum  MemoryPressureLevel { kNone, kModerate, kCritical }
 
enum  MeasureMemoryMode { kSummary, kDetailed }
 
enum  MeasureMemoryExecution { kDefault, kEager, kLazy }
 

Functions

void V8_EXPORT RegisterExtension (std::unique_ptr< Extension >)
 
V8_INLINE Local< Primitive > Undefined (Isolate *isolate)
 
V8_INLINE Local< Primitive > Null (Isolate *isolate)
 
V8_INLINE Local< Boolean > True (Isolate *isolate)
 
V8_INLINE Local< Boolean > False (Isolate *isolate)
 
template<class T >
Maybe< T > Nothing ()
 
template<class T >
Maybe< T > Just (const T &t)
 
Maybe< void > JustVoid ()
 
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)
 

Macro Definition Documentation

◆ V8_ARRAY_BUFFER_INTERNAL_FIELD_COUNT

#define V8_ARRAY_BUFFER_INTERNAL_FIELD_COUNT   2

Definition at line 5231 of file v8.h.

◆ V8_ARRAY_BUFFER_VIEW_INTERNAL_FIELD_COUNT

#define V8_ARRAY_BUFFER_VIEW_INTERNAL_FIELD_COUNT   2

Definition at line 5592 of file v8.h.

◆ V8_DECL_INTRINSIC

#define V8_DECL_INTRINSIC (   name,
  iname 
)    k##name,

Definition at line 6279 of file v8.h.

◆ V8_INTRINSICS_LIST

#define V8_INTRINSICS_LIST (   F)
Value:
F(ArrayProto_entries, array_entries_iterator) \
F(ArrayProto_forEach, array_for_each_iterator) \
F(ArrayProto_keys, array_keys_iterator) \
F(ArrayProto_values, array_values_iterator) \
F(AsyncIteratorPrototype, initial_async_iterator_prototype) \
F(ErrorPrototype, initial_error_prototype) \
F(IteratorPrototype, initial_iterator_prototype) \
F(ObjProto_valueOf, object_value_of_function)

Definition at line 6268 of file v8.h.

◆ V8_PROMISE_INTERNAL_FIELD_COUNT

#define V8_PROMISE_INTERNAL_FIELD_COUNT   0

Definition at line 4807 of file v8.h.