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

#include <v8-isolate.h>

Collaboration diagram for v8::Isolate:

Classes

class  AllowJavascriptExecutionScope
 
struct  CreateParams
 
class  DisallowJavascriptExecutionScope
 
class  Scope
 
class  SuppressMicrotaskExecutionScope
 

Public Types

enum  GarbageCollectionType { kFullGarbageCollection , kMinorGarbageCollection }
 
enum  UseCounterFeature {
  kUseAsm = 0 , kBreakIterator = 1 , kOBSOLETE_LegacyConst = 2 , kOBSOLETE_MarkDequeOverflow = 3 ,
  kOBSOLETE_StoreBufferOverflow = 4 , kOBSOLETE_SlotsBufferOverflow = 5 , kOBSOLETE_ObjectObserve = 6 , kForcedGC = 7 ,
  kSloppyMode = 8 , kStrictMode = 9 , kOBSOLETE_StrongMode = 10 , kRegExpPrototypeStickyGetter = 11 ,
  kRegExpPrototypeToString = 12 , kRegExpPrototypeUnicodeGetter = 13 , kOBSOLETE_IntlV8Parse = 14 , kOBSOLETE_IntlPattern = 15 ,
  kOBSOLETE_IntlResolved = 16 , kOBSOLETE_PromiseChain = 17 , kOBSOLETE_PromiseAccept = 18 , kOBSOLETE_PromiseDefer = 19 ,
  kHtmlCommentInExternalScript = 20 , kHtmlComment = 21 , kSloppyModeBlockScopedFunctionRedefinition = 22 , kForInInitializer = 23 ,
  kOBSOLETE_ArrayProtectorDirtied = 24 , kArraySpeciesModified = 25 , kArrayPrototypeConstructorModified = 26 , kOBSOLETE_ArrayInstanceProtoModified = 27 ,
  kArrayInstanceConstructorModified = 28 , kOBSOLETE_LegacyFunctionDeclaration = 29 , kOBSOLETE_RegExpPrototypeSourceGetter = 30 , kOBSOLETE_RegExpPrototypeOldFlagGetter = 31 ,
  kDecimalWithLeadingZeroInStrictMode = 32 , kLegacyDateParser = 33 , kDefineGetterOrSetterWouldThrow = 34 , kFunctionConstructorReturnedUndefined = 35 ,
  kAssigmentExpressionLHSIsCallInSloppy = 36 , kAssigmentExpressionLHSIsCallInStrict = 37 , kPromiseConstructorReturnedUndefined = 38 , kOBSOLETE_ConstructorNonUndefinedPrimitiveReturn = 39 ,
  kOBSOLETE_LabeledExpressionStatement = 40 , kOBSOLETE_LineOrParagraphSeparatorAsLineTerminator = 41 , kIndexAccessor = 42 , kErrorCaptureStackTrace = 43 ,
  kErrorPrepareStackTrace = 44 , kErrorStackTraceLimit = 45 , kWebAssemblyInstantiation = 46 , kDeoptimizerDisableSpeculation = 47 ,
  kOBSOLETE_ArrayPrototypeSortJSArrayModifiedPrototype = 48 , kFunctionTokenOffsetTooLongForToString = 49 , kWasmSharedMemory = 50 , kWasmThreadOpcodes = 51 ,
  kOBSOLETE_AtomicsNotify = 52 , kOBSOLETE_AtomicsWake = 53 , kCollator = 54 , kNumberFormat = 55 ,
  kDateTimeFormat = 56 , kPluralRules = 57 , kRelativeTimeFormat = 58 , kLocale = 59 ,
  kListFormat = 60 , kSegmenter = 61 , kStringLocaleCompare = 62 , kOBSOLETE_StringToLocaleUpperCase = 63 ,
  kStringToLocaleLowerCase = 64 , kNumberToLocaleString = 65 , kDateToLocaleString = 66 , kDateToLocaleDateString = 67 ,
  kDateToLocaleTimeString = 68 , kAttemptOverrideReadOnlyOnPrototypeSloppy = 69 , kAttemptOverrideReadOnlyOnPrototypeStrict = 70 , kOBSOLETE_OptimizedFunctionWithOneShotBytecode = 71 ,
  kRegExpMatchIsTrueishOnNonJSRegExp = 72 , kRegExpMatchIsFalseishOnJSRegExp = 73 , kOBSOLETE_DateGetTimezoneOffset = 74 , kStringNormalize = 75 ,
  kCallSiteAPIGetFunctionSloppyCall = 76 , kCallSiteAPIGetThisSloppyCall = 77 , kOBSOLETE_RegExpMatchAllWithNonGlobalRegExp = 78 , kRegExpExecCalledOnSlowRegExp = 79 ,
  kRegExpReplaceCalledOnSlowRegExp = 80 , kDisplayNames = 81 , kSharedArrayBufferConstructed = 82 , kArrayPrototypeHasElements = 83 ,
  kObjectPrototypeHasElements = 84 , kNumberFormatStyleUnit = 85 , kDateTimeFormatRange = 86 , kDateTimeFormatDateTimeStyle = 87 ,
  kBreakIteratorTypeWord = 88 , kBreakIteratorTypeLine = 89 , kInvalidatedArrayBufferDetachingProtector = 90 , kInvalidatedArrayConstructorProtector = 91 ,
  kInvalidatedArrayIteratorLookupChainProtector = 92 , kInvalidatedArraySpeciesLookupChainProtector = 93 , kInvalidatedIsConcatSpreadableLookupChainProtector = 94 , kInvalidatedMapIteratorLookupChainProtector = 95 ,
  kInvalidatedNoElementsProtector = 96 , kInvalidatedPromiseHookProtector = 97 , kInvalidatedPromiseResolveLookupChainProtector = 98 , kInvalidatedPromiseSpeciesLookupChainProtector = 99 ,
  kInvalidatedPromiseThenLookupChainProtector = 100 , kInvalidatedRegExpSpeciesLookupChainProtector = 101 , kInvalidatedSetIteratorLookupChainProtector = 102 , kInvalidatedStringIteratorLookupChainProtector = 103 ,
  kInvalidatedStringLengthOverflowLookupChainProtector = 104 , kInvalidatedTypedArraySpeciesLookupChainProtector = 105 , kWasmSimdOpcodes = 106 , kVarRedeclaredCatchBinding = 107 ,
  kWasmRefTypes = 108 , kOBSOLETE_WasmBulkMemory = 109 , kOBSOLETE_WasmMultiValue = 110 , kWasmExceptionHandling = 111 ,
  kInvalidatedMegaDOMProtector = 112 , kFunctionPrototypeArguments = 113 , kFunctionPrototypeCaller = 114 , kTurboFanOsrCompileStarted = 115 ,
  kAsyncStackTaggingCreateTaskCall = 116 , kDurationFormat = 117 , kInvalidatedNumberStringNotRegexpLikeProtector = 118 , kOBSOLETE_RegExpUnicodeSetIncompatibilitiesWithUnicodeMode = 119 ,
  kOBSOLETE_ImportAssertionDeprecatedSyntax = 120 , kLocaleInfoObsoletedGetters = 121 , kLocaleInfoFunctions = 122 , kCompileHintsMagicAll = 123 ,
  kInvalidatedNoProfilingProtector = 124 , kWasmMemory64 = 125 , kWasmMultiMemory = 126 , kWasmGC = 127 ,
  kWasmImportedStrings = 128 , kSourceMappingUrlMagicCommentAtSign = 129 , kTemporalObject = 130 , kWasmModuleCompilation = 131 ,
  kInvalidatedNoUndetectableObjectsProtector = 132 , kWasmJavaScriptPromiseIntegration = 133 , kWasmReturnCall = 134 , kWasmExtendedConst = 135 ,
  kWasmRelaxedSimd = 136 , kWasmTypeReflection = 137 , kWasmExnRef = 138 , kWasmTypedFuncRef = 139 ,
  kInvalidatedStringWrapperToPrimitiveProtector = 140 , kDocumentAllLegacyCall = 141 , kDocumentAllLegacyConstruct = 142 , kConsoleContext = 143 ,
  kWasmImportedStringsUtf8 = 144 , kResizableArrayBuffer = 145 , kGrowableSharedArrayBuffer = 146 , kArrayByCopy = 147 ,
  kArrayFromAsync = 148 , kIteratorMethods = 149 , kPromiseAny = 150 , kSetMethods = 151 ,
  kArrayFindLast = 152 , kArrayGroup = 153 , kArrayBufferTransfer = 154 , kPromiseWithResolvers = 155 ,
  kAtomicsWaitAsync = 156 , kExtendingNonExtensibleWithPrivate = 157 , kPromiseTry = 158 , kStringReplaceAll = 159 ,
  kStringWellFormed = 160 , kWeakReferences = 161 , kErrorIsError = 162 , kInvalidatedTypedArrayLengthLookupChainProtector = 163 ,
  kRegExpEscape = 164 , kFloat16Array = 165 , kExplicitResourceManagement = 166 , kWasmBranchHinting = 167 ,
  kUseCounterFeatureCount
}
 
enum  MessageErrorLevel {
  kMessageLog = (1 << 0) , kMessageDebug = (1 << 1) , kMessageInfo = (1 << 2) , kMessageError = (1 << 3) ,
  kMessageWarning = (1 << 4) , kMessageAll
}
 
enum class  Priority { kBestEffort , kUserVisible , kUserBlocking }
 
enum class  TimeZoneDetection { kSkip , kRedetect }
 
using UseCounterCallback
 
using AbortOnUncaughtExceptionCallback = bool (*)(Isolate*)
 
using GCCallback
 
using GCCallbackWithData
 
using ReleaseCppHeapCallback = void (*)(std::unique_ptr<CppHeap>)
 
using GetExternallyAllocatedMemoryInBytesCallback = size_t (*)()
 

Public Member Functions

IsolateGroup GetGroup () const
 
bool IsCurrent () const
 
void ClearKeptObjects ()
 
void SetAbortOnUncaughtExceptionCallback (AbortOnUncaughtExceptionCallback callback)
 
void SetHostImportModuleDynamicallyCallback (HostImportModuleDynamicallyCallback callback)
 
void SetHostImportModuleWithPhaseDynamicallyCallback (HostImportModuleWithPhaseDynamicallyCallback callback)
 
void SetHostInitializeImportMetaObjectCallback (HostInitializeImportMetaObjectCallback callback)
 
void SetHostCreateShadowRealmContextCallback (HostCreateShadowRealmContextCallback callback)
 
void SetIsJSApiWrapperNativeErrorCallback (IsJSApiWrapperNativeErrorCallback callback)
 
void SetPrepareStackTraceCallback (PrepareStackTraceCallback callback)
 
int GetStackTraceLimit ()
 
void MemoryPressureNotification (MemoryPressureLevel level)
 
void SetBatterySaverMode (bool battery_saver_mode_enabled)
 
void SetMemorySaverMode (bool memory_saver_mode_enabled)
 
void ClearCachesForTesting ()
 
void Enter ()
 
void Exit ()
 
void Dispose ()
 
void DumpAndResetStats ()
 
void DiscardThreadSpecificMetadata ()
 
V8_INLINE void SetData (uint32_t slot, void *data)
 
V8_INLINE void * GetData (uint32_t slot)
 
template<class T >
V8_INLINE MaybeLocal< TGetDataFromSnapshotOnce (size_t index)
 
Local< ValueGetContinuationPreservedEmbedderData ()
 
void SetContinuationPreservedEmbedderData (Local< Value > data)
 
void GetHeapStatistics (HeapStatistics *heap_statistics)
 
size_t NumberOfHeapSpaces ()
 
bool GetHeapSpaceStatistics (HeapSpaceStatistics *space_statistics, size_t index)
 
size_t NumberOfTrackedHeapObjectTypes ()
 
bool GetHeapObjectStatisticsAtLastGC (HeapObjectStatistics *object_statistics, size_t type_index)
 
bool GetHeapCodeAndMetadataStatistics (HeapCodeStatistics *object_statistics)
 
bool MeasureMemory (std::unique_ptr< MeasureMemoryDelegate > delegate, MeasureMemoryExecution execution=MeasureMemoryExecution::kDefault)
 
void GetStackSample (const RegisterState &state, void **frames, size_t frames_limit, SampleInfo *sample_info)
 
int64_t AdjustAmountOfExternalAllocatedMemory (int64_t change_in_bytes)
 
HeapProfilerGetHeapProfiler ()
 
void SetIdle (bool is_idle)
 
ArrayBuffer::AllocatorGetArrayBufferAllocator ()
 
bool InContext ()
 
Local< ContextGetCurrentContext ()
 
Local< ContextGetEnteredOrMicrotaskContext ()
 
Local< ContextGetIncumbentContext ()
 
MaybeLocal< DataGetCurrentHostDefinedOptions ()
 
template<int N>
Local< ValueThrowError (const char(&message)[N])
 
Local< ValueThrowError (Local< String > message)
 
Local< ValueThrowException (Local< Value > exception)
 
bool HasPendingException ()
 
void AddGCPrologueCallback (GCCallback callback, GCType gc_type_filter=kGCTypeAll)
 
void AddGCPrologueCallback (GCCallbackWithData callback, void *data=nullptr, GCType gc_type_filter=kGCTypeAll)
 
void RemoveGCPrologueCallback (GCCallback callback)
 
void RemoveGCPrologueCallback (GCCallbackWithData, void *data=nullptr)
 
void AddGCEpilogueCallback (GCCallback callback, GCType gc_type_filter=kGCTypeAll)
 
void AddGCEpilogueCallback (GCCallbackWithData callback, void *data=nullptr, GCType gc_type_filter=kGCTypeAll)
 
void RemoveGCEpilogueCallback (GCCallback callback)
 
void RemoveGCEpilogueCallback (GCCallbackWithData callback, void *data=nullptr)
 
void SetEmbedderRootsHandler (EmbedderRootsHandler *handler)
 
void SetReleaseCppHeapCallbackForTesting (ReleaseCppHeapCallback callback)
 
CppHeapGetCppHeap () const
 
void SetGetExternallyAllocatedMemoryInBytesCallback (GetExternallyAllocatedMemoryInBytesCallback callback)
 
void TerminateExecution ()
 
bool IsExecutionTerminating ()
 
void CancelTerminateExecution ()
 
void RequestInterrupt (InterruptCallback callback, void *data)
 
bool HasPendingBackgroundTasks ()
 
void RequestGarbageCollectionForTesting (GarbageCollectionType type)
 
void RequestGarbageCollectionForTesting (GarbageCollectionType type, StackState stack_state)
 
void SetEventLogger (LogEventCallback that)
 
void AddBeforeCallEnteredCallback (BeforeCallEnteredCallback callback)
 
void RemoveBeforeCallEnteredCallback (BeforeCallEnteredCallback callback)
 
void AddCallCompletedCallback (CallCompletedCallback callback)
 
void RemoveCallCompletedCallback (CallCompletedCallback callback)
 
void SetPromiseHook (PromiseHook hook)
 
void SetPromiseRejectCallback (PromiseRejectCallback callback)
 
void SetExceptionPropagationCallback (ExceptionPropagationCallback callback)
 
void PerformMicrotaskCheckpoint ()
 
void EnqueueMicrotask (Local< Function > microtask)
 
void EnqueueMicrotask (MicrotaskCallback callback, void *data=nullptr)
 
void SetMicrotasksPolicy (MicrotasksPolicy policy)
 
MicrotasksPolicy GetMicrotasksPolicy () const
 
void AddMicrotasksCompletedCallback (MicrotasksCompletedCallbackWithData callback, void *data=nullptr)
 
void RemoveMicrotasksCompletedCallback (MicrotasksCompletedCallbackWithData callback, void *data=nullptr)
 
void SetUseCounterCallback (UseCounterCallback callback)
 
void SetCounterFunction (CounterLookupCallback)
 
void SetCreateHistogramFunction (CreateHistogramCallback)
 
void SetAddHistogramSampleFunction (AddHistogramSampleCallback)
 
void SetMetricsRecorder (const std::shared_ptr< metrics::Recorder > &metrics_recorder)
 
void SetAddCrashKeyCallback (AddCrashKeyCallback)
 
void LowMemoryNotification ()
 
int ContextDisposedNotification (bool dependant_context=true)
 
void ContextDisposedNotification (ContextDependants dependants)
 
void IsolateInForegroundNotification ()
 
void IsolateInBackgroundNotification ()
 
void SetPriority (Priority priority)
 
void SetIsLoading (bool is_loading)
 
void Freeze (bool is_frozen)
 
void IncreaseHeapLimitForDebugging ()
 
void RestoreOriginalHeapLimit ()
 
bool IsHeapLimitIncreasedForDebugging ()
 
void SetJitCodeEventHandler (JitCodeEventOptions options, JitCodeEventHandler event_handler)
 
void SetStackLimit (uintptr_t stack_limit)
 
void GetCodeRange (void **start, size_t *length_in_bytes)
 
void GetEmbeddedCodeRange (const void **start, size_t *length_in_bytes)
 
JSEntryStubs GetJSEntryStubs ()
 
size_t CopyCodePages (size_t capacity, MemoryRange *code_pages_out)
 
void SetFatalErrorHandler (FatalErrorCallback that)
 
void SetOOMErrorHandler (OOMErrorCallback that)
 
void AddNearHeapLimitCallback (NearHeapLimitCallback callback, void *data)
 
void RemoveNearHeapLimitCallback (NearHeapLimitCallback callback, size_t heap_limit)
 
void AutomaticallyRestoreInitialHeapLimit (double threshold_percent=0.5)
 
void SetModifyCodeGenerationFromStringsCallback (ModifyCodeGenerationFromStringsCallback2 callback)
 
void SetAllowWasmCodeGenerationCallback (AllowWasmCodeGenerationCallback callback)
 
void SetWasmModuleCallback (ExtensionCallback callback)
 
void SetWasmInstanceCallback (ExtensionCallback callback)
 
void SetWasmStreamingCallback (WasmStreamingCallback callback)
 
void SetWasmAsyncResolvePromiseCallback (WasmAsyncResolvePromiseCallback callback)
 
void SetWasmLoadSourceMapCallback (WasmLoadSourceMapCallback callback)
 
void SetWasmImportedStringsEnabledCallback (WasmImportedStringsEnabledCallback callback)
 
void SetSharedArrayBufferConstructorEnabledCallback (SharedArrayBufferConstructorEnabledCallback callback)
 
void SetWasmJSPIEnabledCallback (WasmJSPIEnabledCallback callback)
 
 V8_DEPRECATED ("Will be removed, use ScriptCompiler::CompileOptions for enabling the " "compile hints magic comments") void SetJavaScriptCompileHintsMagicEnabledCallback(JavaScriptCompileHintsMagicEnabledCallback callback)
 
void InstallConditionalFeatures (Local< Context > context)
 
bool IsDead ()
 
bool AddMessageListener (MessageCallback that, Local< Value > data=Local< Value >())
 
bool AddMessageListenerWithErrorLevel (MessageCallback that, int message_levels, Local< Value > data=Local< Value >())
 
void RemoveMessageListeners (MessageCallback that)
 
void SetFailedAccessCheckCallbackFunction (FailedAccessCheckCallback)
 
void SetCaptureStackTraceForUncaughtExceptions (bool capture, int frame_limit=10, StackTrace::StackTraceOptions options=StackTrace::kOverview)
 
bool IsInUse ()
 
void SetAllowAtomicsWait (bool allow)
 
void DateTimeConfigurationChangeNotification (TimeZoneDetection time_zone_detection=TimeZoneDetection::kSkip)
 
void LocaleConfigurationChangeNotification ()
 
std::string GetDefaultLocale ()
 
uint64_t GetHashSeed ()
 
 Isolate ()=delete
 
 ~Isolate ()=delete
 
 Isolate (const Isolate &)=delete
 
Isolateoperator= (const Isolate &)=delete
 
void * operator new (size_t size)=delete
 
void * operator new[] (size_t size)=delete
 
void operator delete (void *, size_t)=delete
 
void operator delete[] (void *, size_t)=delete
 
template<class T >
MaybeLocal< TGetDataFromSnapshotOnce (size_t index)
 

Static Public Member Functions

static IsolateAllocate ()
 
static IsolateAllocate (const IsolateGroup &group)
 
static void Initialize (Isolate *isolate, const CreateParams &params)
 
static IsolateNew (const CreateParams &params)
 
static IsolateNew (const IsolateGroup &group, const CreateParams &params)
 
static IsolateGetCurrent ()
 
static IsolateTryGetCurrent ()
 
static V8_INLINE uint32_t GetNumberOfDataSlots ()
 

Static Public Attributes

static constexpr size_t kMinCodePagesBufferSize = 32
 

Private Member Functions

internal::ValueHelper::InternalRepresentationType GetDataFromSnapshotOnce (size_t index)
 
int64_t AdjustAmountOfExternalAllocatedMemoryImpl (int64_t change_in_bytes)
 
void HandleExternalMemoryInterrupt ()
 

Friends

template<class K , class V , class Traits >
class PersistentValueMapBase
 
class ExternalMemoryAccounter
 

Detailed Description

Isolate represents an isolated instance of the V8 engine. V8 isolates have completely separate states. Objects from one isolate must not be used in other isolates. The embedder can create multiple isolates and use them in parallel in multiple threads. An isolate can be entered by at most one thread at any given time. The Locker/Unlocker API must be used to synchronize.

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

Member Typedef Documentation

◆ AbortOnUncaughtExceptionCallback

Custom callback used by embedders to help V8 determine if it should abort when it throws and no internal handler is predicted to catch the exception. If –abort-on-uncaught-exception is used on the command line, then V8 will abort if either:

  • no custom callback is set.
  • the custom callback set returns true. Otherwise, the custom callback will not be called and V8 will not abort.

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

◆ GCCallback

Initial value:
void (*)(Isolate* isolate, GCType type,
Isolate()=delete
other heap size flags(e.g. initial_heap_size) take precedence") DEFINE_SIZE_T( max_shared_heap_size
Isolate * isolate
GCCallbackFlags
wasm::ValueType type

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

◆ GCCallbackWithData

Initial value:
void (*)(Isolate* isolate, GCType type,
union v8::internal::@341::BuiltinMetadata::KindSpecificData data

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

◆ GetExternallyAllocatedMemoryInBytesCallback

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

◆ ReleaseCppHeapCallback

using v8::Isolate::ReleaseCppHeapCallback = void (*)(std::unique_ptr<CppHeap>)

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

◆ UseCounterCallback

Initial value:
void (*)(Isolate* isolate,

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

Member Enumeration Documentation

◆ GarbageCollectionType

Types of garbage collections that can be requested via RequestGarbageCollectionForTesting.

Enumerator
kFullGarbageCollection 
kMinorGarbageCollection 

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

◆ MessageErrorLevel

Enumerator
kMessageLog 
kMessageDebug 
kMessageInfo 
kMessageError 
kMessageWarning 
kMessageAll 

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

◆ Priority

enum class v8::Isolate::Priority
strong
Enumerator
kBestEffort 
kUserVisible 
kUserBlocking 

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

◆ TimeZoneDetection

enum class v8::Isolate::TimeZoneDetection
strong

Time zone redetection indicator for DateTimeConfigurationChangeNotification.

kSkip indicates V8 that the notification should not trigger redetecting host time zone. kRedetect indicates V8 that host time zone should be redetected, and used to set the default time zone.

The host time zone detection may require file system access or similar operations unlikely to be available inside a sandbox. If v8 is run inside a sandbox, the host time zone has to be detected outside the sandbox before calling DateTimeConfigurationChangeNotification function.

Enumerator
kSkip 
kRedetect 

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

◆ UseCounterFeature

Features reported via the SetUseCounterCallback callback. Do not change assigned numbers of existing items; add new features to the end of this list. Dead features can be marked V8_DEPRECATE_SOON, then V8_DEPRECATED, and then finally be renamed to kOBSOLETE_... to stop embedders from using them.

Enumerator
kUseAsm 
kBreakIterator 
kOBSOLETE_LegacyConst 
kOBSOLETE_MarkDequeOverflow 
kOBSOLETE_StoreBufferOverflow 
kOBSOLETE_SlotsBufferOverflow 
kOBSOLETE_ObjectObserve 
kForcedGC 
kSloppyMode 
kStrictMode 
kOBSOLETE_StrongMode 
kRegExpPrototypeStickyGetter 
kRegExpPrototypeToString 
kRegExpPrototypeUnicodeGetter 
kOBSOLETE_IntlV8Parse 
kOBSOLETE_IntlPattern 
kOBSOLETE_IntlResolved 
kOBSOLETE_PromiseChain 
kOBSOLETE_PromiseAccept 
kOBSOLETE_PromiseDefer 
kHtmlCommentInExternalScript 
kHtmlComment 
kSloppyModeBlockScopedFunctionRedefinition 
kForInInitializer 
kOBSOLETE_ArrayProtectorDirtied 
kArraySpeciesModified 
kArrayPrototypeConstructorModified 
kOBSOLETE_ArrayInstanceProtoModified 
kArrayInstanceConstructorModified 
kOBSOLETE_LegacyFunctionDeclaration 
kOBSOLETE_RegExpPrototypeSourceGetter 
kOBSOLETE_RegExpPrototypeOldFlagGetter 
kDecimalWithLeadingZeroInStrictMode 
kLegacyDateParser 
kDefineGetterOrSetterWouldThrow 
kFunctionConstructorReturnedUndefined 
kAssigmentExpressionLHSIsCallInSloppy 
kAssigmentExpressionLHSIsCallInStrict 
kPromiseConstructorReturnedUndefined 
kOBSOLETE_ConstructorNonUndefinedPrimitiveReturn 
kOBSOLETE_LabeledExpressionStatement 
kOBSOLETE_LineOrParagraphSeparatorAsLineTerminator 
kIndexAccessor 
kErrorCaptureStackTrace 
kErrorPrepareStackTrace 
kErrorStackTraceLimit 
kWebAssemblyInstantiation 
kDeoptimizerDisableSpeculation 
kOBSOLETE_ArrayPrototypeSortJSArrayModifiedPrototype 
kFunctionTokenOffsetTooLongForToString 
kWasmSharedMemory 
kWasmThreadOpcodes 
kOBSOLETE_AtomicsNotify 
kOBSOLETE_AtomicsWake 
kCollator 
kNumberFormat 
kDateTimeFormat 
kPluralRules 
kRelativeTimeFormat 
kLocale 
kListFormat 
kSegmenter 
kStringLocaleCompare 
kOBSOLETE_StringToLocaleUpperCase 
kStringToLocaleLowerCase 
kNumberToLocaleString 
kDateToLocaleString 
kDateToLocaleDateString 
kDateToLocaleTimeString 
kAttemptOverrideReadOnlyOnPrototypeSloppy 
kAttemptOverrideReadOnlyOnPrototypeStrict 
kOBSOLETE_OptimizedFunctionWithOneShotBytecode 
kRegExpMatchIsTrueishOnNonJSRegExp 
kRegExpMatchIsFalseishOnJSRegExp 
kOBSOLETE_DateGetTimezoneOffset 
kStringNormalize 
kCallSiteAPIGetFunctionSloppyCall 
kCallSiteAPIGetThisSloppyCall 
kOBSOLETE_RegExpMatchAllWithNonGlobalRegExp 
kRegExpExecCalledOnSlowRegExp 
kRegExpReplaceCalledOnSlowRegExp 
kDisplayNames 
kSharedArrayBufferConstructed 
kArrayPrototypeHasElements 
kObjectPrototypeHasElements 
kNumberFormatStyleUnit 
kDateTimeFormatRange 
kDateTimeFormatDateTimeStyle 
kBreakIteratorTypeWord 
kBreakIteratorTypeLine 
kInvalidatedArrayBufferDetachingProtector 
kInvalidatedArrayConstructorProtector 
kInvalidatedArrayIteratorLookupChainProtector 
kInvalidatedArraySpeciesLookupChainProtector 
kInvalidatedIsConcatSpreadableLookupChainProtector 
kInvalidatedMapIteratorLookupChainProtector 
kInvalidatedNoElementsProtector 
kInvalidatedPromiseHookProtector 
kInvalidatedPromiseResolveLookupChainProtector 
kInvalidatedPromiseSpeciesLookupChainProtector 
kInvalidatedPromiseThenLookupChainProtector 
kInvalidatedRegExpSpeciesLookupChainProtector 
kInvalidatedSetIteratorLookupChainProtector 
kInvalidatedStringIteratorLookupChainProtector 
kInvalidatedStringLengthOverflowLookupChainProtector 
kInvalidatedTypedArraySpeciesLookupChainProtector 
kWasmSimdOpcodes 
kVarRedeclaredCatchBinding 
kWasmRefTypes 
kOBSOLETE_WasmBulkMemory 
kOBSOLETE_WasmMultiValue 
kWasmExceptionHandling 
kInvalidatedMegaDOMProtector 
kFunctionPrototypeArguments 
kFunctionPrototypeCaller 
kTurboFanOsrCompileStarted 
kAsyncStackTaggingCreateTaskCall 
kDurationFormat 
kInvalidatedNumberStringNotRegexpLikeProtector 
kOBSOLETE_RegExpUnicodeSetIncompatibilitiesWithUnicodeMode 
kOBSOLETE_ImportAssertionDeprecatedSyntax 
kLocaleInfoObsoletedGetters 
kLocaleInfoFunctions 
kCompileHintsMagicAll 
kInvalidatedNoProfilingProtector 
kWasmMemory64 
kWasmMultiMemory 
kWasmGC 
kWasmImportedStrings 
kSourceMappingUrlMagicCommentAtSign 
kTemporalObject 
kWasmModuleCompilation 
kInvalidatedNoUndetectableObjectsProtector 
kWasmJavaScriptPromiseIntegration 
kWasmReturnCall 
kWasmExtendedConst 
kWasmRelaxedSimd 
kWasmTypeReflection 
kWasmExnRef 
kWasmTypedFuncRef 
kInvalidatedStringWrapperToPrimitiveProtector 
kDocumentAllLegacyCall 
kDocumentAllLegacyConstruct 
kConsoleContext 
kWasmImportedStringsUtf8 
kResizableArrayBuffer 
kGrowableSharedArrayBuffer 
kArrayByCopy 
kArrayFromAsync 
kIteratorMethods 
kPromiseAny 
kSetMethods 
kArrayFindLast 
kArrayGroup 
kArrayBufferTransfer 
kPromiseWithResolvers 
kAtomicsWaitAsync 
kExtendingNonExtensibleWithPrivate 
kPromiseTry 
kStringReplaceAll 
kStringWellFormed 
kWeakReferences 
kErrorIsError 
kInvalidatedTypedArrayLengthLookupChainProtector 
kRegExpEscape 
kFloat16Array 
kExplicitResourceManagement 
kWasmBranchHinting 
kUseCounterFeatureCount 

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

Constructor & Destructor Documentation

◆ Isolate() [1/2]

v8::Isolate::Isolate ( )
delete

◆ ~Isolate()

v8::Isolate::~Isolate ( )
delete

◆ Isolate() [2/2]

v8::Isolate::Isolate ( const Isolate & )
delete

Member Function Documentation

◆ AddBeforeCallEnteredCallback()

void v8::Isolate::AddBeforeCallEnteredCallback ( BeforeCallEnteredCallback callback)

Adds a callback to notify the host application right before a script is about to run. If a script re-enters the runtime during executing, the BeforeCallEnteredCallback is invoked for each re-entrance. Executing scripts inside the callback will re-trigger the callback.

Definition at line 10449 of file api.cc.

Here is the call graph for this function:

◆ AddCallCompletedCallback()

void v8::Isolate::AddCallCompletedCallback ( CallCompletedCallback callback)

Adds a callback to notify the host application when a script finished running. If a script re-enters the runtime during executing, the CallCompletedCallback is only invoked when the outer-most script execution ends. Executing scripts inside the callback do not trigger further callbacks.

Definition at line 10461 of file api.cc.

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

◆ AddGCEpilogueCallback() [1/2]

void v8::Isolate::AddGCEpilogueCallback ( GCCallback callback,
GCType gc_type_filter = kGCTypeAll )

Enables the host application to receive a notification after a garbage collection.

Enables the host application to receive a notification before a garbage collection.

Parameters
callbackThe callback to be invoked. The callback is allowed to allocate but invocation is not re-entrant: a callback triggering garbage collection will not be called again. JS execution is prohibited from these callbacks. A single callback may only be registered once.
gc_type_filterA filter in case it should be applied.

Definition at line 9856 of file api.cc.

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

◆ AddGCEpilogueCallback() [2/2]

void v8::Isolate::AddGCEpilogueCallback ( GCCallbackWithData callback,
void * data = nullptr,
GCType gc_type_filter = kGCTypeAll )

Enables the host application to receive a notification after a garbage collection.

Enables the host application to receive a notification before a garbage collection.

Parameters
callbackThe callback to be invoked. The callback is allowed to allocate but invocation is not re-entrant: a callback triggering garbage collection will not be called again. JS execution is prohibited from these callbacks. A single callback may only be registered once.
gc_type_filterA filter in case it should be applied.
dataAdditional data that should be passed to the callback.

Definition at line 9829 of file api.cc.

Here is the call graph for this function:

◆ AddGCPrologueCallback() [1/2]

void v8::Isolate::AddGCPrologueCallback ( GCCallback callback,
GCType gc_type_filter = kGCTypeAll )

Enables the host application to receive a notification before a garbage collection.

Parameters
callbackThe callback to be invoked. The callback is allowed to allocate but invocation is not re-entrant: a callback triggering garbage collection will not be called again. JS execution is prohibited from these callbacks. A single callback may only be registered once.
gc_type_filterA filter in case it should be applied.

Definition at line 9846 of file api.cc.

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

◆ AddGCPrologueCallback() [2/2]

void v8::Isolate::AddGCPrologueCallback ( GCCallbackWithData callback,
void * data = nullptr,
GCType gc_type_filter = kGCTypeAll )

Enables the host application to receive a notification before a garbage collection.

Parameters
callbackThe callback to be invoked. The callback is allowed to allocate but invocation is not re-entrant: a callback triggering garbage collection will not be called again. JS execution is prohibited from these callbacks. A single callback may only be registered once.
gc_type_filterA filter in case it should be applied.
dataAdditional data that should be passed to the callback.

Definition at line 9817 of file api.cc.

Here is the call graph for this function:

◆ AddMessageListener()

bool v8::Isolate::AddMessageListener ( MessageCallback that,
Local< Value > data = Local<Value>() )

Adds a message listener (errors only).

The same message listener can be added more than once and in that case it will be called more than once for each message.

If data is specified, it will be passed to the callback when it is called. Otherwise, the exception object will be passed to the callback instead.

Definition at line 10830 of file api.cc.

Here is the call graph for this function:

◆ AddMessageListenerWithErrorLevel()

bool v8::Isolate::AddMessageListenerWithErrorLevel ( MessageCallback that,
int message_levels,
Local< Value > data = Local<Value>() )

Adds a message listener.

The same message listener can be added more than once and in that case it will be called more than once for each message.

If data is specified, it will be passed to the callback when it is called. Otherwise, the exception object will be passed to the callback instead.

A listener can listen for particular error levels by providing a mask.

Definition at line 10834 of file api.cc.

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

◆ AddMicrotasksCompletedCallback()

void v8::Isolate::AddMicrotasksCompletedCallback ( MicrotasksCompletedCallbackWithData callback,
void * data = nullptr )

Adds a callback to notify the host application after microtasks were run on the default MicrotaskQueue. The callback is triggered by explicit RunMicrotasks call or automatic microtasks execution (see SetMicrotaskPolicy).

Callback will trigger even if microtasks were attempted to run, but the microtasks queue was empty and no single microtask was actually executed.

Executing scripts inside the callback will not re-trigger microtasks and the callback.

Definition at line 10523 of file api.cc.

◆ AddNearHeapLimitCallback()

void v8::Isolate::AddNearHeapLimitCallback ( v8::NearHeapLimitCallback callback,
void * data )

Add a callback to invoke in case the heap size is close to the heap limit. If multiple callbacks are added, only the most recently added callback is invoked.

Definition at line 10806 of file api.cc.

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

◆ AdjustAmountOfExternalAllocatedMemory()

int64_t v8::Isolate::AdjustAmountOfExternalAllocatedMemory ( int64_t change_in_bytes)

Adjusts the amount of registered external memory.

Parameters
change_in_bytesthe change in externally allocated memory that is kept alive by JavaScript objects.
Returns
the adjusted value.

Definition at line 10439 of file api.cc.

Here is the call graph for this function:

◆ AdjustAmountOfExternalAllocatedMemoryImpl()

int64_t v8::Isolate::AdjustAmountOfExternalAllocatedMemoryImpl ( int64_t change_in_bytes)
private

Definition at line 9640 of file api.cc.

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

◆ Allocate() [1/2]

Isolate * v8::Isolate::Allocate ( )
static

Allocates a new isolate but does not initialize it. Does not change the currently entered isolate.

Only Isolate::GetData() and Isolate::SetData(), which access the embedder-controlled parts of the isolate, as well as Isolate::GetGroup(), are allowed to be called on the uninitialized isolate. To initialize the isolate, call Isolate::Initialize() or initialize a SnapshotCreator.

When an isolate is no longer used its resources should be freed by calling Dispose(). Using the delete operator is not allowed.

V8::Initialize() must have run prior to this.

Definition at line 9964 of file api.cc.

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

◆ Allocate() [2/2]

Isolate * v8::Isolate::Allocate ( const IsolateGroup & group)
static

Definition at line 9969 of file api.cc.

Here is the call graph for this function:

◆ AutomaticallyRestoreInitialHeapLimit()

void v8::Isolate::AutomaticallyRestoreInitialHeapLimit ( double threshold_percent = 0.5)

If the heap limit was changed by the NearHeapLimitCallback, then the initial heap limit will be restored once the heap size falls below the given threshold percentage of the initial heap limit. The threshold percentage is a number in (0.0, 1.0) range.

Definition at line 10818 of file api.cc.

Here is the call graph for this function:

◆ CancelTerminateExecution()

void v8::Isolate::CancelTerminateExecution ( )

Resume execution capability in the given isolate, whose execution was previously forcefully terminated using TerminateExecution().

When execution is forcefully terminated using TerminateExecution(), the isolate can not resume execution until all JavaScript frames have propagated the uncatchable exception which is generated. This method allows the program embedding the engine to handle the termination event and resume execution capability, even if JavaScript frames remain on the stack.

This method can be used by any thread even if that thread has not acquired the V8 lock with a Locker object.

Definition at line 9898 of file api.cc.

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

◆ ClearCachesForTesting()

void v8::Isolate::ClearCachesForTesting ( )

Drop non-essential caches. Should only be called from testing code. The method can potentially block for a long time and does not necessarily trigger GC.

Definition at line 10646 of file api.cc.

Here is the call graph for this function:

◆ ClearKeptObjects()

void v8::Isolate::ClearKeptObjects ( )

Clears the set of objects held strongly by the heap. This set of objects are originally built when a WeakRef is created or successfully dereferenced.

This is invoked automatically after microtasks are run. See MicrotasksPolicy for when microtasks are run.

This needs to be manually invoked only if the embedder is manually running microtasks via a custom MicrotaskQueue class's PerformCheckpoint. In that case, it is the embedder's responsibility to make this call at a time which does not interrupt synchronous ECMAScript code execution.

Definition at line 9751 of file api.cc.

Here is the call graph for this function:

◆ ContextDisposedNotification() [1/2]

int v8::Isolate::ContextDisposedNotification ( bool dependant_context = true)

Optional notification that a context has been disposed. V8 uses these notifications to guide the GC heuristic and cancel FinalizationRegistry cleanup tasks. Returns the number of context disposals - including this one

  • since the last time V8 had a chance to clean up.

The optional parameter |dependant_context| specifies whether the disposed context was depending on state from other contexts or not.

Definition at line 10582 of file api.cc.

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

◆ ContextDisposedNotification() [2/2]

void v8::Isolate::ContextDisposedNotification ( ContextDependants dependants)

Optional notification that a context has been disposed. V8 uses these notifications to guide heuristics on e.g. GC or compilers.

Parameters
dependantsA signal on whether this context possibly had any dependants.

Definition at line 10604 of file api.cc.

Here is the call graph for this function:

◆ CopyCodePages()

size_t v8::Isolate::CopyCodePages ( size_t capacity,
MemoryRange * code_pages_out )

Copies the code heap pages currently in use by V8 into |code_pages_out|. |code_pages_out| must have at least kMinCodePagesBufferSize capacity and must be empty.

Signal-safe, does not allocate, does not access the V8 heap. No code on the stack can rely on pages that might be missing.

Returns the number of pages available to be copied, which might be greater than |capacity|. In this case, only |capacity| pages will be copied into |code_pages_out|. The caller should provide a bigger buffer on the next call in order to get all available code pages, but this is not required.

Definition at line 10722 of file api.cc.

Here is the call graph for this function:

◆ DateTimeConfigurationChangeNotification()

void v8::Isolate::DateTimeConfigurationChangeNotification ( TimeZoneDetection time_zone_detection = TimeZoneDetection::kSkip)

Notification that the embedder has changed the time zone, daylight savings time or other date / time configuration parameters. V8 keeps a cache of various values used for date / time computation. This notification will reset those cached values for the current context so that date / time configuration changes would be reflected.

This API should not be called more than needed as it will negatively impact the performance of date operations.

Definition at line 10900 of file api.cc.

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

◆ DiscardThreadSpecificMetadata()

void v8::Isolate::DiscardThreadSpecificMetadata ( )

Discards all V8 thread-specific data for the Isolate. Should be used if a thread is terminating and it has used an Isolate that will outlive the thread – all thread-specific data for an Isolate is discarded when an Isolate is disposed so this call is pointless if an Isolate is about to be Disposed.

Definition at line 10114 of file api.cc.

Here is the call graph for this function:

◆ Dispose()

void v8::Isolate::Dispose ( )

Disposes the isolate. The isolate must not be entered by any thread to be disposable.

Definition at line 10100 of file api.cc.

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

◆ DumpAndResetStats()

void v8::Isolate::DumpAndResetStats ( )

Dumps activated low-level V8 internal stats. This can be used instead of performing a full isolate disposal.

Definition at line 10109 of file api.cc.

Here is the call graph for this function:

◆ EnqueueMicrotask() [1/2]

void v8::Isolate::EnqueueMicrotask ( Local< Function > microtask)

Enqueues the callback to the default MicrotaskQueue

Definition at line 10496 of file api.cc.

Here is the call graph for this function:

◆ EnqueueMicrotask() [2/2]

void v8::Isolate::EnqueueMicrotask ( MicrotaskCallback callback,
void * data = nullptr )

Enqueues the callback to the default MicrotaskQueue

Definition at line 10507 of file api.cc.

◆ Enter()

void v8::Isolate::Enter ( )

Methods below this point require holding a lock (using Locker) in a multi-threaded environment. Sets this isolate as the entered one for the current thread. Saves the previously entered one (if any), so that it can be restored when exiting. Re-entering an isolate is allowed.

Definition at line 10119 of file api.cc.

Here is the call graph for this function:

◆ Exit()

void v8::Isolate::Exit ( )

Exits this isolate by restoring the previously entered one in the current thread. The isolate may still stay the same, if it was entered more than once.

Requires: this == Isolate::GetCurrent().

Definition at line 10124 of file api.cc.

Here is the call graph for this function:

◆ Freeze()

void v8::Isolate::Freeze ( bool is_frozen)

Optional notification to tell V8 whether the embedder is currently frozen. V8 uses these notifications to guide heuristics. This is an unfinished experimental feature. Semantics and implementation may change frequently.

Definition at line 10658 of file api.cc.

Here is the call graph for this function:

◆ GetArrayBufferAllocator()

ArrayBuffer::Allocator * v8::Isolate::GetArrayBufferAllocator ( )

Returns the ArrayBuffer::Allocator used in this isolate.

Definition at line 9741 of file api.cc.

Here is the call graph for this function:

◆ GetCodeRange()

void v8::Isolate::GetCodeRange ( void ** start,
size_t * length_in_bytes )

Returns a memory range that can potentially contain jitted code. Code for V8's 'builtins' will not be in this range if embedded builtins is enabled.

On Win64, embedders are advised to install function table callbacks for these ranges, as default SEH won't be able to unwind through jitted code. The first page of the code range is reserved for the embedder and is committed, writable, and executable, to be used to store unwind data, as documented in https://docs.microsoft.com/en-us/cpp/build/exception-handling-x64.

Might be empty on other platforms.

https://code.google.com/p/v8/issues/detail?id=3598

Definition at line 10688 of file api.cc.

Here is the call graph for this function:

◆ GetContinuationPreservedEmbedderData()

Local< Value > v8::Isolate::GetContinuationPreservedEmbedderData ( )

Returns the value that was set or restored by SetContinuationPreservedEmbedderData(), if any.

Definition at line 10246 of file api.cc.

Here is the call graph for this function:

◆ GetCppHeap()

CppHeap * v8::Isolate::GetCppHeap ( ) const
Returns
the C++ heap managed by V8. Only available if such a heap has been attached using AttachCppHeap().

Definition at line 9871 of file api.cc.

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

◆ GetCurrent()

Isolate * v8::Isolate::GetCurrent ( )
static

Returns the entered isolate for the current thread or NULL in case there is no current isolate.

This method must not be invoked before V8::Initialize() was invoked.

Definition at line 9949 of file api.cc.

Here is the caller graph for this function:

◆ GetCurrentContext()

v8::Local< v8::Context > v8::Isolate::GetCurrentContext ( )

Returns the context of the currently running JavaScript, or the context on the top of the stack if no JavaScript is running.

Definition at line 9756 of file api.cc.

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

◆ GetCurrentHostDefinedOptions()

v8::MaybeLocal< v8::Data > v8::Isolate::GetCurrentHostDefinedOptions ( )

Returns the host defined options set for currently running script or module, if available.

Definition at line 9779 of file api.cc.

Here is the call graph for this function:

◆ GetData()

void * v8::Isolate::GetData ( uint32_t slot)

Retrieve embedder-specific data from the isolate. Returns NULL if SetData has never been called for the given |slot|.

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

Here is the caller graph for this function:

◆ GetDataFromSnapshotOnce() [1/3]

template<class T >
V8_INLINE MaybeLocal< T > v8::Isolate::GetDataFromSnapshotOnce ( size_t index)

Return data that was previously attached to the isolate snapshot via SnapshotCreator, and removes the reference to it. Repeated call with the same index returns an empty MaybeLocal.

◆ GetDataFromSnapshotOnce() [2/3]

i::ValueHelper::InternalRepresentationType v8::Isolate::GetDataFromSnapshotOnce ( size_t index)
private

Definition at line 10239 of file api.cc.

Here is the call graph for this function:

◆ GetDataFromSnapshotOnce() [3/3]

template<class T >
MaybeLocal< T > v8::Isolate::GetDataFromSnapshotOnce ( size_t index)

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

◆ GetDefaultLocale()

std::string v8::Isolate::GetDefaultLocale ( )

Returns the default locale in a string if Intl support is enabled. Otherwise returns an empty string.

Definition at line 10927 of file api.cc.

◆ GetEmbeddedCodeRange()

void v8::Isolate::GetEmbeddedCodeRange ( const void ** start,
size_t * length_in_bytes )

As GetCodeRange, but for embedded builtins (these live in a distinct memory region from other V8 Code objects).

Definition at line 10695 of file api.cc.

◆ GetEnteredOrMicrotaskContext()

v8::Local< v8::Context > v8::Isolate::GetEnteredOrMicrotaskContext ( )

Returns either the last context entered through V8's C++ API, or the context of the currently running microtask while processing microtasks. If a context is entered while executing a microtask, that context is returned.

Definition at line 9765 of file api.cc.

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

◆ GetGroup()

IsolateGroup v8::Isolate::GetGroup ( ) const

Return the group for this isolate.

Definition at line 9974 of file api.cc.

Here is the call graph for this function:

◆ GetHashSeed()

uint64_t v8::Isolate::GetHashSeed ( )

Returns the hash seed for that isolate, for testing purposes.

Definition at line 10938 of file api.cc.

◆ GetHeapCodeAndMetadataStatistics()

bool v8::Isolate::GetHeapCodeAndMetadataStatistics ( HeapCodeStatistics * object_statistics)

Get statistics about code and its metadata in the heap.

Parameters
object_statisticsThe HeapCodeStatistics object to fill in statistics of code, bytecode and their metadata.
Returns
true on success.

Definition at line 10392 of file api.cc.

Here is the call graph for this function:

◆ GetHeapObjectStatisticsAtLastGC()

bool v8::Isolate::GetHeapObjectStatisticsAtLastGC ( HeapObjectStatistics * object_statistics,
size_t type_index )

Get statistics about objects in the heap.

Parameters
object_statisticsThe HeapObjectStatistics object to fill in statistics of objects of given type, which were live in the previous GC.
type_indexThe index of the type of object to fill details about, which ranges from 0 to NumberOfTrackedHeapObjectTypes() - 1.
Returns
true on success.

Definition at line 10365 of file api.cc.

Here is the call graph for this function:

◆ GetHeapProfiler()

HeapProfiler * v8::Isolate::GetHeapProfiler ( )

Returns heap profiler for this isolate. Will return NULL until the isolate is initialized.

Definition at line 9730 of file api.cc.

Here is the caller graph for this function:

◆ GetHeapSpaceStatistics()

bool v8::Isolate::GetHeapSpaceStatistics ( HeapSpaceStatistics * space_statistics,
size_t index )

Get the memory usage of a space in the heap.

Parameters
space_statisticsThe HeapSpaceStatistics object to fill in statistics.
indexThe index of the space to get statistics from, which ranges from 0 to NumberOfHeapSpaces() - 1.
Returns
true on success.

Definition at line 10327 of file api.cc.

Here is the call graph for this function:

◆ GetHeapStatistics()

void v8::Isolate::GetHeapStatistics ( HeapStatistics * heap_statistics)

Get statistics about the heap memory usage.

Definition at line 10267 of file api.cc.

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

◆ GetIncumbentContext()

v8::Local< v8::Context > v8::Isolate::GetIncumbentContext ( )

Returns the Context that corresponds to the Incumbent realm in HTML spec. https://html.spec.whatwg.org/multipage/webappapis.html#incumbent

Definition at line 9773 of file api.cc.

Here is the call graph for this function:

◆ GetJSEntryStubs()

JSEntryStubs v8::Isolate::GetJSEntryStubs ( )

Returns the JSEntryStubs necessary for use with the Unwinder API.

Definition at line 10703 of file api.cc.

Here is the call graph for this function:

◆ GetMicrotasksPolicy()

MicrotasksPolicy v8::Isolate::GetMicrotasksPolicy ( ) const

Returns the policy controlling how Microtasks are invoked.

Definition at line 10517 of file api.cc.

Here is the caller graph for this function:

◆ GetNumberOfDataSlots()

uint32_t v8::Isolate::GetNumberOfDataSlots ( )
static

Returns the maximum number of available embedder data slots. Valid slots are in the range of 0 - GetNumberOfDataSlots() - 1.

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

◆ GetStackSample()

void v8::Isolate::GetStackSample ( const RegisterState & state,
void ** frames,
size_t frames_limit,
SampleInfo * sample_info )

Get a call stack sample from the isolate.

Parameters
stateExecution state.
framesCaller allocated buffer to store stack frames.
frames_limitMaximum number of frames to capture. The buffer must be large enough to hold the number of frames.
sample_infoThe sample info is filled up by the function provides number of actual captured stack frames and the current VM state.
Note
GetStackSample should only be called when the JS thread is paused or interrupted. Otherwise the behavior is undefined.

Definition at line 10425 of file api.cc.

◆ GetStackTraceLimit()

int v8::Isolate::GetStackTraceLimit ( )

Get the stackTraceLimit property of Error.

Definition at line 10164 of file api.cc.

Here is the call graph for this function:

◆ HandleExternalMemoryInterrupt()

void v8::Isolate::HandleExternalMemoryInterrupt ( )
private

Definition at line 9663 of file api.cc.

Here is the caller graph for this function:

◆ HasPendingBackgroundTasks()

bool v8::Isolate::HasPendingBackgroundTasks ( )

Returns true if there is ongoing background work within V8 that will eventually post a foreground task, like asynchronous WebAssembly compilation.

Definition at line 9909 of file api.cc.

◆ HasPendingException()

bool v8::Isolate::HasPendingException ( )

Returns true if an exception was thrown but not processed yet by an exception handler on JavaScript side or by v8::TryCatch handler.

This is an experimental feature and may still change significantly.

Definition at line 9807 of file api.cc.

Here is the call graph for this function:

◆ InContext()

bool v8::Isolate::InContext ( )

Returns true if this isolate has a current context.

Definition at line 9746 of file api.cc.

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

◆ IncreaseHeapLimitForDebugging()

void v8::Isolate::IncreaseHeapLimitForDebugging ( )

Optional notification to tell V8 the current isolate is used for debugging and requires higher heap limit.

Definition at line 10663 of file api.cc.

◆ Initialize()

void v8::Isolate::Initialize ( Isolate * isolate,
const CreateParams & params )
static

Initialize an Isolate previously allocated by Isolate::Allocate().

Definition at line 9985 of file api.cc.

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

◆ InstallConditionalFeatures()

allow_wasm_code_gen_callback wasm_async_resolve_promise_callback wasm_imported_strings_enabled_callback sharedarraybuffer_constructor_enabled_callback is_js_api_wrapper_native_error_callback void v8::Isolate::InstallConditionalFeatures ( Local< Context > context)

This function can be called by the embedder to signal V8 that the dynamic enabling of features has finished. V8 can now set up dynamically added features.

Definition at line 10793 of file api.cc.

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

◆ IsCurrent()

bool v8::Isolate::IsCurrent ( ) const

Return true if this isolate is currently active.

Definition at line 9959 of file api.cc.

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

◆ IsDead()

bool v8::Isolate::IsDead ( )

Check if V8 is dead and therefore unusable. This is the case after fatal errors such as out-of-memory situations.

Definition at line 10825 of file api.cc.

Here is the call graph for this function:

◆ IsExecutionTerminating()

bool v8::Isolate::IsExecutionTerminating ( )

Is V8 terminating JavaScript execution.

Returns true if JavaScript execution is currently terminating because of a call to TerminateExecution. In that case there are still JavaScript frames on the stack and the termination exception is still active.

Definition at line 9893 of file api.cc.

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

◆ IsHeapLimitIncreasedForDebugging()

bool v8::Isolate::IsHeapLimitIncreasedForDebugging ( )

Returns true if the heap limit was increased for debugging and the original heap limit was not restored yet.

Definition at line 10671 of file api.cc.

◆ IsInUse()

bool v8::Isolate::IsInUse ( )

Check if this isolate is in use. True if at least one thread Enter'ed this isolate.

Definition at line 10890 of file api.cc.

Here is the call graph for this function:

◆ IsolateInBackgroundNotification()

void v8::Isolate::IsolateInBackgroundNotification ( )

Optional notification that the isolate switched to the background. V8 uses these notifications to guide heuristics.

Definition at line 10617 of file api.cc.

Here is the call graph for this function:

◆ IsolateInForegroundNotification()

void v8::Isolate::IsolateInForegroundNotification ( )

Optional notification that the isolate switched to the foreground. V8 uses these notifications to guide heuristics.

Definition at line 10612 of file api.cc.

Here is the call graph for this function:

◆ LocaleConfigurationChangeNotification()

void v8::Isolate::LocaleConfigurationChangeNotification ( )

Notification that the embedder has changed the locale. V8 keeps a cache of various values used for locale computation. This notification will reset those cached values for the current context so that locale configuration changes would be reflected.

This API should not be called more than needed as it will negatively impact the performance of locale operations.

Definition at line 10917 of file api.cc.

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

◆ LowMemoryNotification()

void v8::Isolate::LowMemoryNotification ( )

Optional notification that the system is running low on memory. V8 uses these notifications to attempt to free memory.

Definition at line 10571 of file api.cc.

Here is the call graph for this function:

◆ MeasureMemory()

bool v8::Isolate::MeasureMemory ( std::unique_ptr< MeasureMemoryDelegate > delegate,
MeasureMemoryExecution execution = MeasureMemoryExecution::kDefault )

This API is experimental and may change significantly.

Enqueues a memory measurement request and invokes the delegate with the results.

Parameters
delegatethe delegate that defines which contexts to measure and reports the results.
executionpromptness executing the memory measurement. The kEager value is expected to be used only in tests.

Definition at line 10411 of file api.cc.

Here is the call graph for this function:

◆ MemoryPressureNotification()

void v8::Isolate::MemoryPressureNotification ( MemoryPressureLevel level)

Optional notification that the system is running low on memory. V8 uses these notifications to guide heuristics. It is allowed to call this function from another thread while the isolate is executing long running JavaScript code.

Definition at line 10627 of file api.cc.

Here is the call graph for this function:

◆ New() [1/2]

Isolate * v8::Isolate::New ( const CreateParams & params)
static

Creates a new isolate. Does not change the currently entered isolate.

When an isolate is no longer used its resources should be freed by calling Dispose(). Using the delete operator is not allowed.

V8::Initialize() must have run prior to this.

Definition at line 10089 of file api.cc.

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

◆ New() [2/2]

Isolate * v8::Isolate::New ( const IsolateGroup & group,
const CreateParams & params )
static

Definition at line 10093 of file api.cc.

Here is the call graph for this function:

◆ NumberOfHeapSpaces()

size_t v8::Isolate::NumberOfHeapSpaces ( )

Returns the number of spaces in the heap.

Definition at line 10323 of file api.cc.

◆ NumberOfTrackedHeapObjectTypes()

size_t v8::Isolate::NumberOfTrackedHeapObjectTypes ( )

Returns the number of types of objects tracked in the heap at GC.

Definition at line 10359 of file api.cc.

Here is the call graph for this function:

◆ operator delete()

void v8::Isolate::operator delete ( void * ,
size_t  )
delete

◆ operator delete[]()

void v8::Isolate::operator delete[] ( void * ,
size_t  )
delete

◆ operator new()

void * v8::Isolate::operator new ( size_t size)
delete

◆ operator new[]()

void * v8::Isolate::operator new[] ( size_t size)
delete

◆ operator=()

Isolate & v8::Isolate::operator= ( const Isolate & )
delete

◆ PerformMicrotaskCheckpoint()

void v8::Isolate::PerformMicrotaskCheckpoint ( )

Runs the default MicrotaskQueue until it gets empty and perform other microtask checkpoint steps, such as calling ClearKeptObjects. Asserts that the MicrotasksPolicy is not kScoped. Any exceptions thrown by microtask callbacks are swallowed.

Definition at line 10490 of file api.cc.

Here is the call graph for this function:

◆ RemoveBeforeCallEnteredCallback()

void v8::Isolate::RemoveBeforeCallEnteredCallback ( BeforeCallEnteredCallback callback)

Removes callback that was installed by AddBeforeCallEnteredCallback.

Definition at line 10455 of file api.cc.

Here is the call graph for this function:

◆ RemoveCallCompletedCallback()

void v8::Isolate::RemoveCallCompletedCallback ( CallCompletedCallback callback)

Removes callback that was installed by AddCallCompletedCallback.

Definition at line 10467 of file api.cc.

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

◆ RemoveGCEpilogueCallback() [1/2]

void v8::Isolate::RemoveGCEpilogueCallback ( GCCallback callback)

This function removes a callback which was added by AddGCEpilogueCallback.

Parameters
callbackthe callback to remove.

Definition at line 9861 of file api.cc.

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

◆ RemoveGCEpilogueCallback() [2/2]

void v8::Isolate::RemoveGCEpilogueCallback ( GCCallbackWithData callback,
void * data = nullptr )

This function removes a callback which was added by AddGCEpilogueCallback.

Parameters
callbackthe callback to remove.
dataAdditional data that was used to install the callback.

Definition at line 9835 of file api.cc.

Here is the call graph for this function:

◆ RemoveGCPrologueCallback() [1/2]

void v8::Isolate::RemoveGCPrologueCallback ( GCCallback callback)

This function removes a callback which was added by AddGCPrologueCallback.

Parameters
callbackthe callback to remove.

Definition at line 9851 of file api.cc.

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

◆ RemoveGCPrologueCallback() [2/2]

void v8::Isolate::RemoveGCPrologueCallback ( GCCallbackWithData callback,
void * data = nullptr )

Parameters
dataAdditional data that was used to install the callback.

Definition at line 9823 of file api.cc.

Here is the call graph for this function:

◆ RemoveMessageListeners()

void v8::Isolate::RemoveMessageListeners ( MessageCallback that)

Remove all message listeners from the specified callback function.

Definition at line 10857 of file api.cc.

Here is the call graph for this function:

◆ RemoveMicrotasksCompletedCallback()

void v8::Isolate::RemoveMicrotasksCompletedCallback ( MicrotasksCompletedCallbackWithData callback,
void * data = nullptr )

Removes callback that was installed by AddMicrotasksCompletedCallback.

Definition at line 10531 of file api.cc.

◆ RemoveNearHeapLimitCallback()

void v8::Isolate::RemoveNearHeapLimitCallback ( v8::NearHeapLimitCallback callback,
size_t heap_limit )

Remove the given callback and restore the heap limit to the given limit. If the given limit is zero, then it is ignored. If the current heap size is greater than the given limit, then the heap limit is restored to the minimal limit that is possible for the current heap size.

Definition at line 10812 of file api.cc.

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

◆ RequestGarbageCollectionForTesting() [1/2]

void v8::Isolate::RequestGarbageCollectionForTesting ( GarbageCollectionType type)

Request garbage collection in this Isolate. It is only valid to call this function if –expose_gc was specified.

This should only be used for testing purposes and not to enforce a garbage collection schedule. It has strong negative impact on the garbage collection performance. Use MemoryPressureNotification() instead to influence the garbage collection schedule.

Definition at line 9918 of file api.cc.

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

◆ RequestGarbageCollectionForTesting() [2/2]

void v8::Isolate::RequestGarbageCollectionForTesting ( GarbageCollectionType type,
StackState stack_state )

Request garbage collection with a specific embedderstack state in this Isolate. It is only valid to call this function if –expose_gc was specified.

This should only be used for testing purposes and not to enforce a garbage collection schedule. It has strong negative impact on the garbage collection performance. Use MemoryPressureNotification() instead to influence the garbage collection schedule.

Definition at line 9938 of file api.cc.

Here is the call graph for this function:

◆ RequestInterrupt()

void v8::Isolate::RequestInterrupt ( InterruptCallback callback,
void * data )

Request V8 to interrupt long running JavaScript code and invoke the given |callback| passing the given |data| to it. After |callback| returns control will be returned to the JavaScript code. There may be a number of interrupt requests in flight. Can be called from another thread without acquiring a |Locker|. Registered |callback| must not reenter interrupted Isolate.

Definition at line 9904 of file api.cc.

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

◆ RestoreOriginalHeapLimit()

void v8::Isolate::RestoreOriginalHeapLimit ( )

Restores the original heap limit after IncreaseHeapLimitForDebugging().

Definition at line 10667 of file api.cc.

Here is the caller graph for this function:

◆ SetAbortOnUncaughtExceptionCallback()

void v8::Isolate::SetAbortOnUncaughtExceptionCallback ( AbortOnUncaughtExceptionCallback callback)

Definition at line 10129 of file api.cc.

Here is the call graph for this function:

◆ SetAddCrashKeyCallback()

void v8::Isolate::SetAddCrashKeyCallback ( AddCrashKeyCallback callback)

Enables the host application to provide a mechanism for recording a predefined set of data as crash keys to be used in postmortem debugging in case of a crash.

Definition at line 10566 of file api.cc.

Here is the call graph for this function:

◆ SetAddHistogramSampleFunction()

void v8::Isolate::SetAddHistogramSampleFunction ( AddHistogramSampleCallback callback)

Definition at line 10552 of file api.cc.

Here is the caller graph for this function:

◆ SetAllowAtomicsWait()

void v8::Isolate::SetAllowAtomicsWait ( bool allow)

Set whether calling Atomics.wait (a function that may block) is allowed in this isolate. This can also be configured via CreateParams::allow_atomics_wait.

Definition at line 10895 of file api.cc.

Here is the call graph for this function:

◆ SetAllowWasmCodeGenerationCallback()

void v8::Isolate::SetAllowWasmCodeGenerationCallback ( AllowWasmCodeGenerationCallback callback)

Set the callback to invoke to check if wasm code generation should be allowed.

Here is the caller graph for this function:

◆ SetBatterySaverMode()

void v8::Isolate::SetBatterySaverMode ( bool battery_saver_mode_enabled)

Optional request from the embedder to tune v8 towards energy efficiency rather than speed if battery_saver_mode_enabled is true, because the embedder is in battery saver mode. If false, the correct tuning is left to v8 to decide.

Definition at line 10636 of file api.cc.

Here is the call graph for this function:

◆ SetCaptureStackTraceForUncaughtExceptions()

void v8::Isolate::SetCaptureStackTraceForUncaughtExceptions ( bool capture,
int frame_limit = 10,
StackTrace::StackTraceOptions options = StackTrace::kOverview )

Tells V8 to capture current stack trace when uncaught exception occurs and report it to the message listeners. The option is off by default.

Definition at line 10883 of file api.cc.

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

◆ SetContinuationPreservedEmbedderData()

void v8::Isolate::SetContinuationPreservedEmbedderData ( Local< Value > data)

Sets a value that will be stored on continuations and reset while the continuation runs.

Definition at line 10257 of file api.cc.

Here is the call graph for this function:

◆ SetCounterFunction()

void v8::Isolate::SetCounterFunction ( CounterLookupCallback callback)

Enables the host application to provide a mechanism for recording statistics counters.

Definition at line 10542 of file api.cc.

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

◆ SetCreateHistogramFunction()

void v8::Isolate::SetCreateHistogramFunction ( CreateHistogramCallback callback)

Enables the host application to provide a mechanism for recording histograms. The CreateHistogram function returns a histogram which will later be passed to the AddHistogramSample function.

Definition at line 10547 of file api.cc.

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

◆ SetData()

void v8::Isolate::SetData ( uint32_t slot,
void * data )

Associate embedder-specific data with the isolate. |slot| has to be between 0 and GetNumberOfDataSlots() - 1.

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

Here is the caller graph for this function:

◆ SetEmbedderRootsHandler()

void v8::Isolate::SetEmbedderRootsHandler ( EmbedderRootsHandler * handler)

Sets an embedder roots handle that V8 should consider when performing non-unified heap garbage collections. The intended use case is for setting a custom handler after invoking AttachCppHeap().

V8 does not take ownership of the handler.

Definition at line 9866 of file api.cc.

Here is the call graph for this function:

◆ SetEventLogger()

void v8::Isolate::SetEventLogger ( LogEventCallback that)

Set the callback to invoke for logging event.

Definition at line 10444 of file api.cc.

◆ SetExceptionPropagationCallback()

void v8::Isolate::SetExceptionPropagationCallback ( ExceptionPropagationCallback callback)

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

Set callback to notify about a new exception being thrown.

Definition at line 10483 of file api.cc.

Here is the call graph for this function:

◆ SetFailedAccessCheckCallbackFunction()

void v8::Isolate::SetFailedAccessCheckCallbackFunction ( FailedAccessCheckCallback callback)

Callback function for reporting failed access checks.

Definition at line 10877 of file api.cc.

Here is the call graph for this function:

◆ SetFatalErrorHandler()

void v8::Isolate::SetFatalErrorHandler ( FatalErrorCallback that)

Set the callback to invoke in case of fatal errors.

Here is the caller graph for this function:

◆ SetGetExternallyAllocatedMemoryInBytesCallback()

void v8::Isolate::SetGetExternallyAllocatedMemoryInBytesCallback ( GetExternallyAllocatedMemoryInBytesCallback callback)

Set the callback that tells V8 how much memory is currently allocated externally of the V8 heap. Ideally this memory is somehow connected to V8 objects and may get freed-up when the corresponding V8 objects get collected by a V8 garbage collection.

Definition at line 9882 of file api.cc.

Here is the call graph for this function:

◆ SetHostCreateShadowRealmContextCallback()

void v8::Isolate::SetHostCreateShadowRealmContextCallback ( HostCreateShadowRealmContextCallback callback)

This specifies the callback called by the upcoming ShadowRealm construction language feature to retrieve host created globals.

Definition at line 10153 of file api.cc.

Here is the call graph for this function:

◆ SetHostImportModuleDynamicallyCallback()

void v8::Isolate::SetHostImportModuleDynamicallyCallback ( HostImportModuleDynamicallyCallback callback)

This specifies the callback called by the upcoming dynamic import() language feature to load modules.

Definition at line 10135 of file api.cc.

Here is the call graph for this function:

◆ SetHostImportModuleWithPhaseDynamicallyCallback()

void v8::Isolate::SetHostImportModuleWithPhaseDynamicallyCallback ( HostImportModuleWithPhaseDynamicallyCallback callback)

This specifies the callback called by the upcoming dynamic import() and import.source() language feature to load modules.

This API is experimental and is expected to be changed or removed in the future. The callback is currently only called when for source-phase imports. Evaluation-phase imports use the existing HostImportModuleDynamicallyCallback callback.

Definition at line 10141 of file api.cc.

Here is the call graph for this function:

◆ SetHostInitializeImportMetaObjectCallback()

void v8::Isolate::SetHostInitializeImportMetaObjectCallback ( HostInitializeImportMetaObjectCallback callback)

This specifies the callback called by the upcoming import.meta language feature to retrieve host-defined meta data for a module.

Definition at line 10147 of file api.cc.

Here is the call graph for this function:

◆ SetIdle()

void v8::Isolate::SetIdle ( bool is_idle)

Tells the VM whether the embedder is idle or not.

Definition at line 9736 of file api.cc.

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

◆ SetIsJSApiWrapperNativeErrorCallback()

void v8::Isolate::SetIsJSApiWrapperNativeErrorCallback ( IsJSApiWrapperNativeErrorCallback callback)

Set the callback that checks whether a Error.isError should return true for a JSApiWrapper object, i.e. whether it represents a native JS error. For example, in an HTML embedder, DOMExceptions are considered native errors.

◆ SetIsLoading()

void v8::Isolate::SetIsLoading ( bool is_loading)

Optional notification to tell V8 whether the embedder is currently loading resources. If the embedder uses this notification, it should call SetIsLoading(true) when loading starts and SetIsLoading(false) when it ends. It's valid to call SetIsLoading(true) again while loading, which will update the timestamp when V8 considers the load started. Calling SetIsLoading(false) while not loading does nothing. V8 uses these notifications to guide heuristics. This is an unfinished experimental feature. Semantics and implementation may change frequently.

Definition at line 10653 of file api.cc.

Here is the call graph for this function:

◆ SetJitCodeEventHandler()

void v8::Isolate::SetJitCodeEventHandler ( JitCodeEventOptions options,
JitCodeEventHandler event_handler )

Allows the host application to provide the address of a function that is notified each time code is added, moved or removed.

Parameters
optionsoptions for the JIT code event handler.
event_handlerthe JIT code event handler, which will be invoked each time code is added, moved or removed.
Note
event_handler won't get notified of existent code.
since code removal notifications are not currently issued, the event_handler may get notifications of code that overlaps earlier code notifications. This happens when code areas are reused, and the earlier overlapping code areas should therefore be discarded.
the events passed to event_handler and the strings they point to are not guaranteed to live past each call. The event_handler must copy strings and other parameters it needs to keep around.
the set of events declared in JitCodeEvent::EventType is expected to grow over time, and the JitCodeEvent structure is expected to accrue new members. The event_handler function must ignore event codes it does not recognize to maintain future compatibility.
Use Isolate::CreateParams to get events for code executed during Isolate setup.

Definition at line 10673 of file api.cc.

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

◆ SetMemorySaverMode()

void v8::Isolate::SetMemorySaverMode ( bool memory_saver_mode_enabled)

Optional request from the embedder to tune v8 towards memory efficiency rather than speed if memory_saver_mode_enabled is true, because the embedder is in memory saver mode. If false, the correct tuning is left to v8 to decide.

Definition at line 10641 of file api.cc.

Here is the call graph for this function:

◆ SetMetricsRecorder()

void v8::Isolate::SetMetricsRecorder ( const std::shared_ptr< metrics::Recorder > & metrics_recorder)

Enables the host application to provide a mechanism for recording event based metrics. In order to use this interface include/v8-metrics.h needs to be included and the recorder needs to be derived from the Recorder base class defined there. This method can only be called once per isolate and must happen during isolate initialization before background threads are spawned.

Definition at line 10559 of file api.cc.

Here is the call graph for this function:

◆ SetMicrotasksPolicy()

void v8::Isolate::SetMicrotasksPolicy ( MicrotasksPolicy policy)

Controls how Microtasks are invoked. See MicrotasksPolicy for details.

Definition at line 10512 of file api.cc.

◆ SetModifyCodeGenerationFromStringsCallback()

void v8::Isolate::SetModifyCodeGenerationFromStringsCallback ( ModifyCodeGenerationFromStringsCallback2 callback)

Set the callback to invoke to check if code generation from strings should be allowed.

Here is the caller graph for this function:

◆ SetOOMErrorHandler()

void v8::Isolate::SetOOMErrorHandler ( OOMErrorCallback that)

Set the callback to invoke in case of OOM errors.

Here is the caller graph for this function:

◆ SetPrepareStackTraceCallback()

void v8::Isolate::SetPrepareStackTraceCallback ( PrepareStackTraceCallback callback)

This specifies the callback called when the stack property of Error is accessed.

Definition at line 10159 of file api.cc.

Here is the call graph for this function:

◆ SetPriority()

void v8::Isolate::SetPriority ( Priority priority)

Optional notification that the isolate changed priority. V8 uses the priority value to guide heuristics.

Definition at line 10622 of file api.cc.

Here is the call graph for this function:

◆ SetPromiseHook()

void v8::Isolate::SetPromiseHook ( PromiseHook hook)

Set the PromiseHook callback for various promise lifecycle events.

Definition at line 10472 of file api.cc.

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

◆ SetPromiseRejectCallback()

void v8::Isolate::SetPromiseRejectCallback ( PromiseRejectCallback callback)

Set callback to notify about promise reject with no handler, or revocation of such a previous notification once the handler is added.

Definition at line 10477 of file api.cc.

Here is the call graph for this function:

◆ SetReleaseCppHeapCallbackForTesting()

void v8::Isolate::SetReleaseCppHeapCallbackForTesting ( ReleaseCppHeapCallback callback)

Sets a callback on the isolate that gets called when the CppHeap gets detached. The callback can then either take ownership of the CppHeap, or the CppHeap gets deallocated.

Definition at line 9876 of file api.cc.

Here is the call graph for this function:

◆ SetSharedArrayBufferConstructorEnabledCallback()

void v8::Isolate::SetSharedArrayBufferConstructorEnabledCallback ( SharedArrayBufferConstructorEnabledCallback callback)

◆ SetStackLimit()

void v8::Isolate::SetStackLimit ( uintptr_t stack_limit)

Modifies the stack limit for this Isolate.

Parameters
stack_limitAn address beyond which the Vm's stack may not grow.
Note
If you are using threads then you should hold the V8::Locker lock while setting the stack limit and you must set a non-default stack limit separately for each thread.

Definition at line 10681 of file api.cc.

Here is the call graph for this function:

◆ SetUseCounterCallback()

void v8::Isolate::SetUseCounterCallback ( UseCounterCallback callback)

Sets a callback for counting the number of times a feature of V8 is used.

Definition at line 10538 of file api.cc.

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

◆ SetWasmAsyncResolvePromiseCallback()

void v8::Isolate::SetWasmAsyncResolvePromiseCallback ( WasmAsyncResolvePromiseCallback callback)

◆ SetWasmImportedStringsEnabledCallback()

void v8::Isolate::SetWasmImportedStringsEnabledCallback ( WasmImportedStringsEnabledCallback callback)
Here is the caller graph for this function:

◆ SetWasmInstanceCallback()

void v8::Isolate::SetWasmInstanceCallback ( ExtensionCallback callback)
Here is the caller graph for this function:

◆ SetWasmJSPIEnabledCallback()

void v8::Isolate::SetWasmJSPIEnabledCallback ( WasmJSPIEnabledCallback callback)
Here is the caller graph for this function:

◆ SetWasmLoadSourceMapCallback()

void v8::Isolate::SetWasmLoadSourceMapCallback ( WasmLoadSourceMapCallback callback)

◆ SetWasmModuleCallback()

void v8::Isolate::SetWasmModuleCallback ( ExtensionCallback callback)

Embedder over{ride|load} injection points for wasm APIs. The expectation is that the embedder sets them at most once.

Here is the caller graph for this function:

◆ SetWasmStreamingCallback()

void v8::Isolate::SetWasmStreamingCallback ( WasmStreamingCallback callback)

◆ TerminateExecution()

void v8::Isolate::TerminateExecution ( )

Forcefully terminate the current thread of JavaScript execution in the given isolate.

This method can be used by any thread even if that thread has not acquired the V8 lock with a Locker object.

Definition at line 9888 of file api.cc.

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

◆ ThrowError() [1/2]

template<int N>
Local< Value > v8::Isolate::ThrowError ( const char(&) message[N])
inline

Schedules a v8::Exception::Error with the given message. See ThrowException for more details. Templatized to provide compile-time errors in case of too long strings (see v8::String::NewFromUtf8Literal).

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

Here is the caller graph for this function:

◆ ThrowError() [2/2]

v8::Local< Value > v8::Isolate::ThrowError ( Local< String > message)

Definition at line 9789 of file api.cc.

Here is the call graph for this function:

◆ ThrowException()

v8::Local< Value > v8::Isolate::ThrowException ( Local< Value > exception)

Schedules an exception to be thrown when returning to JavaScript. When an exception has been scheduled it is illegal to invoke any JavaScript operation; the caller must return immediately and only after the exception has been handled does it become legal to invoke JavaScript operations.

Definition at line 9793 of file api.cc.

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

◆ TryGetCurrent()

Isolate * v8::Isolate::TryGetCurrent ( )
static

Returns the entered isolate for the current thread or NULL in case there is no current isolate.

No checks are performed by this method.

Definition at line 9954 of file api.cc.

Here is the caller graph for this function:

◆ V8_DEPRECATED()

v8::Isolate::V8_DEPRECATED ( "Will be removed,
use ScriptCompiler::CompileOptions for enabling the " "compile hints magic comments"  )

Register callback to control whether compile hints magic comments are enabled.

Friends And Related Symbol Documentation

◆ ExternalMemoryAccounter

friend class ExternalMemoryAccounter
friend

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

◆ PersistentValueMapBase

template<class K , class V , class Traits >
friend class PersistentValueMapBase
friend

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

Member Data Documentation

◆ kMinCodePagesBufferSize

size_t v8::Isolate::kMinCodePagesBufferSize = 32
staticconstexpr

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


The documentation for this class was generated from the following files: