Skip to Content
V8-wasm
API Reference

V8 Inspector, Profiler & Metrics

V8 Chrome DevTools Protocol Inspector, CpuProfiler, HeapProfiler, HeapSnapshot, AllocationProfile, Metrics, and HeapStatistics

Generated TypeScript bindings for V8's built-in Chrome DevTools Protocol inspector (v8_inspector), CPU and heap profilers, heap snapshots, recorder metrics, and heap/code statistics.

Contains 71 classes and 242 bound methods. Inherited WasmHandle base methods (ptr, isNull(), as()) are documented on Core Runtime & Realms.

ActivityControl

class ActivityControl extends WasmHandle

An interface for reporting progress and controlling long-running activities.

Upstream C++: v8::ActivityControl (v8-profiler.h)

Methods

  • reportProgressValue(done: number, total: number): ActivityControlControlOption

    Notify about current progress. The activity can be stopped by returning kAbort as the callback result.

    Upstream C++: v8::ActivityControl::ReportProgressValue

AllocationProfile

class AllocationProfile extends WasmHandle

AllocationProfile is a sampled profile of allocations done by the program. This is structured as a call-graph.

Upstream C++: v8::AllocationProfile (v8-profiler.h)

Methods

  • getRootNode(): AllocationProfileNode | null

    Returns the root node of the call-graph. The root node corresponds to an empty JS call-stack. The lifetime of the returned Node* is scoped to the containing AllocationProfile.

    Upstream C++: v8::AllocationProfile::GetRootNode

AllocationProfileAllocation

class AllocationProfileAllocation extends WasmHandle

Upstream V8 C++ struct v8::AllocationProfile::Allocation (v8-profiler.h).

AllocationProfileNode

class AllocationProfileNode extends WasmHandle

Represents a node in the call-graph.

Upstream C++: v8::AllocationProfile::Node (v8-profiler.h)

AllocationProfileSample

class AllocationProfileSample extends WasmHandle

Represent a single sample recorded for an allocation.

Upstream C++: v8::AllocationProfile::Sample (v8-profiler.h)

CodeEvent

class CodeEvent extends WasmHandle

Representation of a code creation event

Upstream C++: v8::CodeEvent (v8-profiler.h)

Static Methods

  • static getCodeEventTypeName(code_event_type: CodeEventType): string | null

    Binds upstream V8 C++ v8::CodeEvent::GetCodeEventTypeName.

Methods

  • getCodeSize(): number

    Binds upstream V8 C++ v8::CodeEvent::GetCodeSize.

  • getCodeStartAddress(): number

    Binds upstream V8 C++ v8::CodeEvent::GetCodeStartAddress.

  • getCodeType(): CodeEventType

    NOTE (mmarchini): We can't allocate objects in the heap when we collect existing code, and both the code type and the comment are not stored in the heap, so we return those as const char*.

    Upstream C++: v8::CodeEvent::GetCodeType

  • getComment(): string | null

    Binds upstream V8 C++ v8::CodeEvent::GetComment.

  • getFunctionName(): V8String

    Binds upstream V8 C++ v8::CodeEvent::GetFunctionName.

  • getPreviousCodeStartAddress(): number

    Binds upstream V8 C++ v8::CodeEvent::GetPreviousCodeStartAddress.

  • getScriptColumn(): number

    Binds upstream V8 C++ v8::CodeEvent::GetScriptColumn.

  • getScriptLine(): number

    Binds upstream V8 C++ v8::CodeEvent::GetScriptLine.

  • getScriptName(): V8String

    Binds upstream V8 C++ v8::CodeEvent::GetScriptName.

CodeEventHandler

class CodeEventHandler extends WasmHandle

Interface to listen to code creation and code relocation events.

Upstream C++: v8::CodeEventHandler (v8-profiler.h)

Methods

  • disable(): void

    Call Disable() to stop listening to code creation and code relocation events.

    Upstream C++: v8::CodeEventHandler::Disable

  • enable(): void

    Call Enable() to starts listening to code creation and code relocation events. These events will be handled by Handle().

    Upstream C++: v8::CodeEventHandler::Enable

  • handle(code_event: CodeEvent): void

    Handle is called every time a code object is created or moved. Information about each code event will be available through the code_event parameter.

    When the CodeEventType is kRelocationType, the code for this CodeEvent has moved from GetPreviousCodeStartAddress() to GetCodeStartAddress().

    Upstream C++: v8::CodeEventHandler::Handle

CpuProfile

class CpuProfile extends WasmHandle

CpuProfile contains a CPU profile in a form of top-down call tree (from main() down to functions that do all the work).

Upstream C++: v8::CpuProfile (v8-profiler.h)

Methods

  • delete(): void

    Deletes the profile and removes it from CpuProfiler's list. All pointers to nodes previously returned become invalid.

    Upstream C++: v8::CpuProfile::Delete

  • getEndTime(): bigint

    Returns time when the profile recording was stopped (in microseconds) since some unspecified starting point. The point is equal to the starting point used by GetStartTime.

    Upstream C++: v8::CpuProfile::GetEndTime

  • getSample(index: number): CpuProfileNode | null

    Returns profile node corresponding to the top frame the sample at the given index.

    Upstream C++: v8::CpuProfile::GetSample

  • getSampleEmbedderState(index: number): EmbedderStateTag

    Returns state of the embedder when sample was captured.

    Upstream C++: v8::CpuProfile::GetSampleEmbedderState

  • getSamplesCount(): number

    Returns number of samples recorded. The samples are not recorded unless record_samples parameter of CpuProfiler.StartCpuProfiling is true.

    Upstream C++: v8::CpuProfile::GetSamplesCount

  • getSampleState(index: number): StateTag

    Returns state of the vm when sample was captured.

    Upstream C++: v8::CpuProfile::GetSampleState

  • getSampleTimestamp(index: number): bigint

    Returns the timestamp of the sample. The timestamp is the number of microseconds since some unspecified starting point. The point is equal to the starting point used by GetStartTime.

    Upstream C++: v8::CpuProfile::GetSampleTimestamp

  • getStartTime(): bigint

    Returns time when the profile recording was started (in microseconds) since some unspecified starting point.

    Upstream C++: v8::CpuProfile::GetStartTime

  • getTitle(): V8String

    Returns CPU profile title.

    Upstream C++: v8::CpuProfile::GetTitle

  • getTopDownRoot(): CpuProfileNode | null

    Returns the root node of the top down call tree.

    Upstream C++: v8::CpuProfile::GetTopDownRoot

  • serialize(stream: OutputStream, format: CpuProfileSerializationFormat): void

    Prepare a serialized representation of the profile. The result is written into the stream provided in chunks of specified size.

    For the JSON format, heap contents are represented as an object with the following structure:

    { nodes: [nodes array], startTime: number, endTime: number samples: [strings array] timeDeltas: [numbers array] }

    Upstream C++: v8::CpuProfile::Serialize

CpuProfileDeoptFrame

class CpuProfileDeoptFrame extends WasmHandle

Upstream V8 C++ struct v8::CpuProfileDeoptFrame (v8-profiler.h).

CpuProfileDeoptInfo

class CpuProfileDeoptInfo extends WasmHandle

Upstream V8 C++ struct v8::CpuProfileDeoptInfo (v8-profiler.h).

CpuProfileNode

class CpuProfileNode extends WasmHandle

CpuProfileNode represents a node in a call graph.

Upstream C++: v8::CpuProfileNode (v8-profiler.h)

Methods

  • getBailoutReason(): string | null

    Returns bailout reason for the function if the optimization was disabled for it.

    Upstream C++: v8::CpuProfileNode::GetBailoutReason

  • getChild(index: number): CpuProfileNode | null

    Retrieves a child node by index.

    Upstream C++: v8::CpuProfileNode::GetChild

  • getChildrenCount(): number

    Returns child nodes count of the node.

    Upstream C++: v8::CpuProfileNode::GetChildrenCount

  • getColumnNumber(): number

    Returns 1-based number of the column where the function originates. kNoColumnNumberInfo if no column number information is available.

    Upstream C++: v8::CpuProfileNode::GetColumnNumber

  • getFunctionName(): V8String

    Returns function name (empty string for anonymous functions.)

    Upstream C++: v8::CpuProfileNode::GetFunctionName

  • getFunctionNameStr(): string | null

    Returns function name (empty string for anonymous functions.) The string ownership is not passed to the caller. It stays valid until profile is deleted. The function is thread safe.

    Upstream C++: v8::CpuProfileNode::GetFunctionNameStr

  • getHitCount(): number

    Returns the count of samples where the function was currently executing.

    Upstream C++: v8::CpuProfileNode::GetHitCount

  • getHitLineCount(): number

    Returns the number of the function's source lines that collect the samples.

    Upstream C++: v8::CpuProfileNode::GetHitLineCount

  • getLineNumber(): number

    Returns the number, 1-based, of the line where the function originates. kNoLineNumberInfo if no line number information is available.

    Upstream C++: v8::CpuProfileNode::GetLineNumber

  • getLineTicks(entries: CpuProfileNodeLineTick, length: number): boolean

    Returns the set of source lines that collect the samples. The caller allocates buffer and responsible for releasing it. True if all available entries are copied, otherwise false. The function copies nothing if buffer is not large enough.

    Upstream C++: v8::CpuProfileNode::GetLineTicks

  • getNodeId(): number

    Returns id of the node. The id is unique within the tree

    Upstream C++: v8::CpuProfileNode::GetNodeId

  • getParent(): CpuProfileNode | null

    Retrieves the ancestor node, or null if the root.

    Upstream C++: v8::CpuProfileNode::GetParent

  • getScriptId(): number

    Returns id of the script where function is located.

    Upstream C++: v8::CpuProfileNode::GetScriptId

  • getScriptResourceName(): V8String

    Returns resource name for script from where the function originates.

    Upstream C++: v8::CpuProfileNode::GetScriptResourceName

  • getScriptResourceNameStr(): string | null

    Returns resource name for script from where the function originates. The string ownership is not passed to the caller. It stays valid until profile is deleted. The function is thread safe.

    Upstream C++: v8::CpuProfileNode::GetScriptResourceNameStr

  • getSourceType(): CpuProfileNodeSourceType

    Gets the type of the source which the node was captured from.

    Upstream C++: v8::CpuProfileNode::GetSourceType

  • isScriptSharedCrossOrigin(): boolean

    Return true if the script from where the function originates is flagged as being shared cross-origin.

    Upstream C++: v8::CpuProfileNode::IsScriptSharedCrossOrigin

CpuProfileNodeLineTick

class CpuProfileNodeLineTick extends WasmHandle

Upstream V8 C++ struct v8::CpuProfileNode::LineTick (v8-profiler.h).

CpuProfiler

class CpuProfiler extends WasmHandle

Interface for controlling CPU profiling. Instance of the profiler can be created using CpuProfiler.New method.

Upstream C++: v8::CpuProfiler (v8-profiler.h)

Static Methods

  • static new(isolate: Isolate, arg1: CpuProfilingNamingMode, arg2: CpuProfilingLoggingMode): CpuProfiler | null

    Creates a new CPU profiler for the isolate. The isolate must be initialized. The profiler object must be disposed after use by calling Dispose method.

    Upstream C++: v8::CpuProfiler::New

  • static useDetailedSourcePositionsForProfiling(isolate: Isolate): void

    Generate more detailed source positions to code objects. This results in better results when mapping profiling samples to script source.

    Upstream C++: v8::CpuProfiler::UseDetailedSourcePositionsForProfiling

Methods

  • dispose(): void

    Disposes the CPU profiler object.

    Upstream C++: v8::CpuProfiler::Dispose

  • setSamplingInterval(us: number): void

    Changes default CPU profiler sampling interval to the specified number of microseconds. Default interval is 1000us. This method must be called when there are no profiles being recorded.

    Upstream C++: v8::CpuProfiler::SetSamplingInterval

  • setUsePreciseSampling(arg0: boolean): void

    Sets whether or not the profiler should prioritize consistency of sample periodicity on Windows. Disabling this can greatly reduce CPU usage, but may result in greater variance in sample timings from the platform's scheduler. Defaults to enabled. This method must be called when there are no profiles being recorded.

    Upstream C++: v8::CpuProfiler::SetUsePreciseSampling

  • startProfiling(title: V8String, mode: CpuProfilingMode, record_samples: boolean, max_samples: number): CpuProfilingStatus

    Starts profiling with the same semantics as above, except with expanded parameters.

    record_samples parameter controls whether individual samples should be recorded in addition to the aggregated tree.

    max_samples controls the maximum number of samples that should be recorded by the profiler. Samples obtained after this limit will be discarded.

    Upstream C++: v8::CpuProfiler::StartProfiling

  • startProfiling2(title: V8String, record_samples: boolean): CpuProfilingStatus

    The same as StartProfiling above, but the CpuProfilingMode defaults to kLeafNodeLineNumbers mode, which was the previous default behavior of the profiler.

    Upstream C++: v8::CpuProfiler::StartProfiling

  • stop(id: number): CpuProfile | null

    Stops collecting CPU profile with a given id and returns it.

    Upstream C++: v8::CpuProfiler::Stop

  • stopProfiling(title: V8String): CpuProfile | null

    Stops collecting CPU profile with a given title and returns it. If the title given is empty, finishes the last profile started.

    Upstream C++: v8::CpuProfiler::StopProfiling

CpuProfilingOptions

class CpuProfilingOptions extends WasmHandle

Optional profiling attributes.

Upstream C++: v8::CpuProfilingOptions (v8-profiler.h)

Methods

  • max_samples(): number

    Binds upstream V8 C++ v8::CpuProfilingOptions::max_samples.

  • mode(): CpuProfilingMode

    Binds upstream V8 C++ v8::CpuProfilingOptions::mode.

  • profile_source(): CpuProfileSource

    Binds upstream V8 C++ v8::CpuProfilingOptions::profile_source.

  • sampling_interval_us(): number

    Binds upstream V8 C++ v8::CpuProfilingOptions::sampling_interval_us.

CpuProfilingResult

class CpuProfilingResult extends WasmHandle

Result from StartProfiling returning the Profiling Status, and id of the started profiler, or 0 if profiler is not started

Upstream C++: v8::CpuProfilingResult (v8-profiler.h)

DeepSerializationResult

class DeepSerializationResult extends WasmHandle

Upstream V8 C++ struct v8_inspector::DeepSerializationResult (v8-inspector.h).

DeepSerializedValue

class DeepSerializedValue extends WasmHandle

Upstream V8 C++ struct v8_inspector::DeepSerializedValue (v8-inspector.h).

DiscardedSamplesDelegate

class DiscardedSamplesDelegate extends WasmHandle

Delegate for when max samples reached and samples are discarded.

Upstream C++: v8::DiscardedSamplesDelegate (v8-profiler.h)

Methods

  • notify(): void

    Binds upstream V8 C++ v8::DiscardedSamplesDelegate::Notify.

EmbedderGraph

class EmbedderGraph extends WasmHandle

An object graph consisting of embedder objects and V8 objects. Edges of the graph are strong references between the objects. The embedder can build this graph during heap snapshot generation to include the embedder objects in the heap snapshot. Usage:

  1. Define derived class of EmbedderGraph.Node for embedder objects.
  2. Set the build embedder graph callback on the heap profiler using HeapProfiler.AddBuildEmbedderGraphCallback.
  3. In the callback use graph->AddEdge(node1, node2) to add an edge from node1 to node2.
  4. To represent references from/to V8 object, construct V8 nodes using graph->V8Node(value).

Upstream C++: v8::EmbedderGraph (v8-profiler.h)

Methods

  • addEdge(from_: EmbedderGraphNode, to: EmbedderGraphNode, name?: string | null): void

    Adds an edge that represents a strong reference from the given node from to the given node to. The nodes must be added to the graph before calling this function.

    If name is null, the edge will have auto-increment indexes, otherwise it will be named accordingly.

    Upstream C++: v8::EmbedderGraph::AddEdge

  • addNativeSize(size: number): void

    Adds a count of bytes that are not associated with any particular Node. An embedder may use this to represent the size of nodes which were omitted from this EmbedderGraph despite being retained by the graph, or other overhead costs. This number will contribute to the total size in a heap snapshot, without being represented in the object graph.

    Upstream C++: v8::EmbedderGraph::AddNativeSize

  • addWeakEdge(from_: EmbedderGraphNode, to: EmbedderGraphNode, name?: string | null): void

    Adds an edge that represents a weak reference from the given node from to the given node to. The nodes must be added to the graph before calling this function.

    If name is null, the edge will have auto-increment indexes, otherwise it will be named accordingly.

    Upstream C++: v8::EmbedderGraph::AddWeakEdge

  • v8Node(value: Value): EmbedderGraphNode | null

    Returns a node corresponding to the given V8 value. Ownership is not transferred. The result pointer is valid while the graph is alive.

    For now the variant that takes Data is not marked as abstract for compatibility, but embedders who subclass EmbedderGraph are expected to implement it. Then in the implementation of the variant that takes Value, they can simply forward the call to the one that takes Data.

    Upstream C++: v8::EmbedderGraph::V8Node

  • v8Node2(value: Data): EmbedderGraphNode | null

    Returns a node corresponding to the given V8 value. Ownership is not transferred. The result pointer is valid while the graph is alive.

    For API compatibility, this default implementation just checks that the data is a Value and forward it to the variant that takes Value, which is currently required to be implemented. In the future we'll remove the Value variant, and make this variant that takes Data abstract instead. If the embedder subclasses EmbedderGraph and also use TracedReference<Data>, they must override this variant.

    Upstream C++: v8::EmbedderGraph::V8Node

EmbedderGraphNode

class EmbedderGraphNode extends WasmHandle

Upstream V8 C++ class v8::EmbedderGraph::Node (v8-profiler.h).

Methods

  • getAddress(): number

    Returns the address of the object in the embedder heap, or null to not specify the address. If this address is provided, then V8 can generate consistent IDs for objects across subsequent heap snapshots, which allows devtools to determine which objects were retained from one snapshot to the next. This value is used only if GetNativeObject returns null.

    Upstream C++: v8::EmbedderGraph::Node::GetAddress

  • getDetachedness(): EmbedderGraphNodeDetachedness

    Detachedness state of a given object. While unkown in general, there may be objects that specifically know their state. V8 passes this information along in the snapshot. Users of the snapshot may use it to annotate the object graph.

    Upstream C++: v8::EmbedderGraph::Node::GetDetachedness

  • isEmbedderNode(): boolean

    Must return true for non-V8 nodes.

    Upstream C++: v8::EmbedderGraph::Node::IsEmbedderNode

  • isRootNode(): boolean

    Binds upstream V8 C++ v8::EmbedderGraph::Node::IsRootNode.

  • name(): string | null

    Binds upstream V8 C++ v8::EmbedderGraph::Node::Name.

  • namePrefix(): string | null

    Optional name prefix. It is used in Chrome for tagging detached nodes.

    Upstream C++: v8::EmbedderGraph::Node::NamePrefix

  • sizeInBytes(): number

    Binds upstream V8 C++ v8::EmbedderGraph::Node::SizeInBytes.

  • wrapperNode(): EmbedderGraphNode | null

    The corresponding V8 wrapper node if not null. During heap snapshot generation the embedder node and the V8 wrapper node will be merged into one node to simplify retaining paths.

    Upstream C++: v8::EmbedderGraph::Node::WrapperNode

HeapCodeStatistics

class HeapCodeStatistics extends WasmHandle

Upstream V8 C++ class v8::HeapCodeStatistics (v8-statistics.h).

Methods

  • bytecode_and_metadata_size(): number

    Binds upstream V8 C++ v8::HeapCodeStatistics::bytecode_and_metadata_size.

  • code_and_metadata_size(): number

    Binds upstream V8 C++ v8::HeapCodeStatistics::code_and_metadata_size.

  • cpu_profiler_metadata_size(): number

    Binds upstream V8 C++ v8::HeapCodeStatistics::cpu_profiler_metadata_size.

  • external_script_source_size(): number

    Binds upstream V8 C++ v8::HeapCodeStatistics::external_script_source_size.

HeapGraphEdge

class HeapGraphEdge extends WasmHandle

HeapSnapshotEdge represents a directed connection between heap graph nodes: from retainers to retained nodes.

Upstream C++: v8::HeapGraphEdge (v8-profiler.h)

Methods

  • getFromNode(): HeapGraphNode | null

    Returns origin node.

    Upstream C++: v8::HeapGraphEdge::GetFromNode

  • getName(): Value

    Returns edge name. This can be a variable name, an element index, or a property name.

    Upstream C++: v8::HeapGraphEdge::GetName

  • getToNode(): HeapGraphNode | null

    Returns destination node.

    Upstream C++: v8::HeapGraphEdge::GetToNode

  • getType(): HeapGraphEdgeType

    Returns edge type (see HeapGraphEdge.Type).

    Upstream C++: v8::HeapGraphEdge::GetType

HeapGraphNode

class HeapGraphNode extends WasmHandle

HeapGraphNode represents a node in a heap graph.

Upstream C++: v8::HeapGraphNode (v8-profiler.h)

Methods

  • getChild(index: number): HeapGraphEdge | null

    Retrieves a child by index.

    Upstream C++: v8::HeapGraphNode::GetChild

  • getChildrenCount(): number

    Returns child nodes count of the node.

    Upstream C++: v8::HeapGraphNode::GetChildrenCount

  • getName(): V8String

    Returns node name. Depending on node's type this can be the name of the constructor (for objects), the name of the function (for closures), string value, or an empty string (for compiled code).

    Upstream C++: v8::HeapGraphNode::GetName

  • getShallowSize(): number

    Returns node's own size, in bytes.

    Upstream C++: v8::HeapGraphNode::GetShallowSize

  • getType(): HeapGraphNodeType

    Returns node type (see HeapGraphNode.Type).

    Upstream C++: v8::HeapGraphNode::GetType

HeapObjectStatistics

class HeapObjectStatistics extends WasmHandle

Upstream V8 C++ class v8::HeapObjectStatistics (v8-statistics.h).

Methods

  • object_count(): number

    Binds upstream V8 C++ v8::HeapObjectStatistics::object_count.

  • object_size(): number

    Binds upstream V8 C++ v8::HeapObjectStatistics::object_size.

  • object_sub_type(): string | null

    Binds upstream V8 C++ v8::HeapObjectStatistics::object_sub_type.

  • object_type(): string | null

    Binds upstream V8 C++ v8::HeapObjectStatistics::object_type.

HeapProfiler

class HeapProfiler extends WasmHandle

Interface for controlling heap profiling. Instance of the profiler can be retrieved using Isolate.GetHeapProfiler.

Upstream C++: v8::HeapProfiler (v8-profiler.h)

Methods

  • clearObjectIds(): void

    Clears internal map from SnapshotObjectId to heap object. The new objects will not be added into it unless a heap snapshot is taken or heap object tracking is kicked off.

    Upstream C++: v8::HeapProfiler::ClearObjectIds

  • copyNameForHeapSnapshot(name: string | null): string | null

    Allocates a copy of the provided string within the heap snapshot generator and returns a pointer to the copy. May only be called during heap snapshot generation.

    Upstream C++: v8::HeapProfiler::CopyNameForHeapSnapshot

  • deleteAllHeapSnapshots(): void

    Deletes all snapshots taken. All previously returned pointers to snapshots and their contents become invalid after this call.

    Upstream C++: v8::HeapProfiler::DeleteAllHeapSnapshots

  • findObjectById(id: number): Value

    Returns heap object with given SnapshotObjectId if the object is alive, otherwise empty handle is returned.

    Upstream C++: v8::HeapProfiler::FindObjectById

  • getAllocationProfile(): AllocationProfile | null

    Returns the sampled profile of allocations allocated (and still live) since StartSamplingHeapProfiler was called. The ownership of the pointer is transferred to the caller. Returns null if sampling heap profiler is not active.

    Upstream C++: v8::HeapProfiler::GetAllocationProfile

  • getHeapSnapshot(index: number): HeapSnapshot | null

    Returns a snapshot by index.

    Upstream C++: v8::HeapProfiler::GetHeapSnapshot

  • getSnapshotCount(): number

    Returns the number of snapshots taken.

    Upstream C++: v8::HeapProfiler::GetSnapshotCount

  • isTakingSnapshot(): boolean

    Returns whether the heap profiler is currently taking a snapshot.

    Upstream C++: v8::HeapProfiler::IsTakingSnapshot

  • startSamplingHeapProfiler(sample_interval: bigint, stack_depth: number, flags: HeapProfilerSamplingFlags): boolean

    Starts gathering a sampling heap profile. A sampling heap profile is similar to tcmalloc's heap profiler and Go's mprof. It samples object allocations and builds an online 'sampling' heap profile. At any point in time, this profile is expected to be a representative sample of objects currently live in the system. Each sampled allocation includes the stack trace at the time of allocation, which makes this really useful for memory leak detection.

    This mechanism is intended to be cheap enough that it can be used in production with minimal performance overhead.

    Allocations are sampled using a randomized Poisson process. On average, one allocation will be sampled every sample_interval bytes allocated. The stack_depth parameter controls the maximum number of stack frames to be captured on each allocation.

    NOTE: Support for native allocations doesn't exist yet, but is anticipated in the future.

    Objects allocated before the sampling is started will not be included in the profile.

    Returns false if a sampling heap profiler is already running.

    Upstream C++: v8::HeapProfiler::StartSamplingHeapProfiler

  • startTrackingHeapObjects(track_allocations: boolean): void

    Starts tracking of heap objects population statistics. After calling this method, all heap objects relocations done by the garbage collector are being registered.

    track_allocations parameter controls whether stack trace of each allocation in the heap will be recorded and reported as part of HeapSnapshot.

    Upstream C++: v8::HeapProfiler::StartTrackingHeapObjects

  • stopSamplingHeapProfiler(): void

    Stops the sampling heap profile and discards the current profile.

    Upstream C++: v8::HeapProfiler::StopSamplingHeapProfiler

  • stopTrackingHeapObjects(): void

    Stops tracking of heap objects population statistics, cleans up all collected data. StartHeapObjectsTracking must be called again prior to calling GetHeapStats next time.

    Upstream C++: v8::HeapProfiler::StopTrackingHeapObjects

  • takeHeapSnapshot(options: HeapProfilerHeapSnapshotOptions): HeapSnapshot | null

    Takes a heap snapshot.

    Returns: the snapshot.

    Upstream C++: v8::HeapProfiler::TakeHeapSnapshot

  • takeHeapSnapshot2(control: ActivityControl, resolver: HeapProfilerContextNameResolver, hide_internals: boolean, capture_numeric_value: boolean): HeapSnapshot | null

    Takes a heap snapshot. See HeapSnapshotOptions for details on the parameters.

    Returns: the snapshot.

    Upstream C++: v8::HeapProfiler::TakeHeapSnapshot

HeapProfilerContextNameResolver

class HeapProfilerContextNameResolver extends WasmHandle

Callback interface for retrieving user friendly names of a V8.Context objects.

Upstream C++: v8::HeapProfiler::ContextNameResolver (v8-profiler.h)

Methods

  • getName(context: Context): string | null

    Returns name to be used in the heap snapshot for given node. Returned string must stay alive until snapshot collection is completed. If no user friendly name is available return null.

    Upstream C++: v8::HeapProfiler::ContextNameResolver::GetName

HeapProfilerHeapSnapshotOptions

class HeapProfilerHeapSnapshotOptions extends WasmHandle

Upstream V8 C++ struct v8::HeapProfiler::HeapSnapshotOptions (v8-profiler.h).

HeapProfilerObjectNameResolver

class HeapProfilerObjectNameResolver extends WasmHandle

Callback interface for retrieving user friendly names of global objects.

This interface will soon be deprecated in favour of ContextNameResolver.

Upstream C++: v8::HeapProfiler::ObjectNameResolver (v8-profiler.h)

Methods

  • getName(object: V8Object): string | null

    Returns name to be used in the heap snapshot for given node. Returned string must stay alive until snapshot collection is completed.

    Upstream C++: v8::HeapProfiler::ObjectNameResolver::GetName

HeapSnapshot

class HeapSnapshot extends WasmHandle

HeapSnapshots record the state of the JS heap at some moment.

Upstream C++: v8::HeapSnapshot (v8-profiler.h)

Methods

  • delete(): void

    Deletes the snapshot and removes it from HeapProfiler's list. All pointers to nodes, edges and paths previously returned become invalid.

    Upstream C++: v8::HeapSnapshot::Delete

  • getNode(index: number): HeapGraphNode | null

    Returns a node by index.

    Upstream C++: v8::HeapSnapshot::GetNode

  • getNodeById(id: number): HeapGraphNode | null

    Returns a node by its id.

    Upstream C++: v8::HeapSnapshot::GetNodeById

  • getNodesCount(): number

    Returns total nodes count in the snapshot.

    Upstream C++: v8::HeapSnapshot::GetNodesCount

  • getRoot(): HeapGraphNode | null

    Returns the root node of the heap graph.

    Upstream C++: v8::HeapSnapshot::GetRoot

  • serialize(stream: OutputStream, format: HeapSnapshotSerializationFormat): void

    Prepare a serialized representation of the snapshot. The result is written into the stream provided in chunks of specified size. The total length of the serialized snapshot is unknown in advance, it can be roughly equal to JS heap size (that means, it can be really big - tens of megabytes).

    For the JSON format, heap contents are represented as an object with the following structure:

    { snapshot: { title: "...", uid: nnn, meta: { meta-info }, node_count: nnn, edge_count: nnn }, nodes: [nodes array], edges: [edges array], strings: [strings array] }

    Nodes reference strings, other nodes, and edges by their indexes in corresponding arrays.

    Upstream C++: v8::HeapSnapshot::Serialize

HeapSpaceStatistics

class HeapSpaceStatistics extends WasmHandle

Upstream V8 C++ class v8::HeapSpaceStatistics (v8-statistics.h).

Methods

  • physical_space_size(): number

    Binds upstream V8 C++ v8::HeapSpaceStatistics::physical_space_size.

  • space_available_size(): number

    Binds upstream V8 C++ v8::HeapSpaceStatistics::space_available_size.

  • space_name(): string | null

    Binds upstream V8 C++ v8::HeapSpaceStatistics::space_name.

  • space_size(): number

    Binds upstream V8 C++ v8::HeapSpaceStatistics::space_size.

  • space_used_size(): number

    Binds upstream V8 C++ v8::HeapSpaceStatistics::space_used_size.

HeapStatistics

class HeapStatistics extends WasmHandle

Collection of V8 heap information.

Instances of this class can be passed to Isolate.GetHeapStatistics to get heap statistics from V8.

Upstream C++: v8::HeapStatistics (v8-statistics.h)

Methods

  • does_zap_garbage(): number

    Returns a 0/1 boolean, which signifies whether the V8 overwrite heap garbage with a bit pattern.

    Upstream C++: v8::HeapStatistics::does_zap_garbage

  • external_memory(): number

    Binds upstream V8 C++ v8::HeapStatistics::external_memory.

  • heap_size_limit(): number

    Binds upstream V8 C++ v8::HeapStatistics::heap_size_limit.

  • malloced_memory(): number

    Binds upstream V8 C++ v8::HeapStatistics::malloced_memory.

  • number_of_detached_contexts(): number

    Binds upstream V8 C++ v8::HeapStatistics::number_of_detached_contexts.

  • number_of_native_contexts(): number

    Binds upstream V8 C++ v8::HeapStatistics::number_of_native_contexts.

  • peak_malloced_memory(): number

    Binds upstream V8 C++ v8::HeapStatistics::peak_malloced_memory.

  • total_allocated_bytes(): bigint

    Returns the total number of bytes allocated since the Isolate was created. This includes all heap objects allocated in any space (new, old, code, etc.).

    Upstream C++: v8::HeapStatistics::total_allocated_bytes

  • total_available_size(): number

    Binds upstream V8 C++ v8::HeapStatistics::total_available_size.

  • total_global_handles_size(): number

    Binds upstream V8 C++ v8::HeapStatistics::total_global_handles_size.

  • total_heap_size(): number

    Binds upstream V8 C++ v8::HeapStatistics::total_heap_size.

  • total_heap_size_executable(): number

    Binds upstream V8 C++ v8::HeapStatistics::total_heap_size_executable.

  • total_physical_size(): number

    Binds upstream V8 C++ v8::HeapStatistics::total_physical_size.

  • used_global_handles_size(): number

    Binds upstream V8 C++ v8::HeapStatistics::used_global_handles_size.

  • used_heap_size(): number

    Binds upstream V8 C++ v8::HeapStatistics::used_heap_size.

HeapStatsUpdate

class HeapStatsUpdate extends WasmHandle

A struct for exporting HeapStats data from V8, using "push" model. See HeapProfiler.GetHeapStats.

Upstream C++: v8::HeapStatsUpdate (v8-profiler.h)

MeasureMemoryDelegate

class MeasureMemoryDelegate extends WasmHandle

The delegate is used in Isolate.MeasureMemory API.

It specifies the contexts that need to be measured and gets called when the measurement is completed to report the results.

Both MeasurementComplete() callbacks will be invoked on completion. Each implementation of this class should hence implement only one of them, and leave the other empty.

Upstream C++: v8::MeasureMemoryDelegate (v8-statistics.h)

Static Methods

  • static default(isolate: Isolate, context: Context, promise_resolver: PromiseResolver, mode: MeasureMemoryMode): MeasureMemoryDelegate

    Returns a default delegate that resolves the given promise when the memory measurement completes.

    • isolate: the current isolate
    • context: the current context
    • promise_resolver: the promise resolver that is given the result of the memory measurement.
    • mode: the detail level of the result.

    Upstream C++: v8::MeasureMemoryDelegate::Default

Methods

  • shouldMeasure(context: Context): boolean

    Returns true if the size of the given context needs to be measured.

    Upstream C++: v8::MeasureMemoryDelegate::ShouldMeasure

MeasureMemoryDelegateResult

class MeasureMemoryDelegateResult extends WasmHandle

Holds the result of a memory measurement request.

Upstream C++: v8::MeasureMemoryDelegate::Result (v8-statistics.h)

MetricsGarbageCollectionFullCycle

class MetricsGarbageCollectionFullCycle extends WasmHandle

Upstream V8 C++ struct v8::metrics::GarbageCollectionFullCycle (v8-metrics.h).

MetricsGarbageCollectionFullMainThreadIncrementalMark

class MetricsGarbageCollectionFullMainThreadIncrementalMark extends WasmHandle

Upstream V8 C++ struct v8::metrics::GarbageCollectionFullMainThreadIncrementalMark (v8-metrics.h).

MetricsGarbageCollectionFullMainThreadIncrementalSweep

class MetricsGarbageCollectionFullMainThreadIncrementalSweep extends WasmHandle

Upstream V8 C++ struct v8::metrics::GarbageCollectionFullMainThreadIncrementalSweep (v8-metrics.h).

MetricsGarbageCollectionLimits

class MetricsGarbageCollectionLimits extends WasmHandle

Upstream V8 C++ struct v8::metrics::GarbageCollectionLimits (v8-metrics.h).

MetricsGarbageCollectionPhases

class MetricsGarbageCollectionPhases extends WasmHandle

Upstream V8 C++ struct v8::metrics::GarbageCollectionPhases (v8-metrics.h).

MetricsGarbageCollectionSizes

class MetricsGarbageCollectionSizes extends WasmHandle

Upstream V8 C++ struct v8::metrics::GarbageCollectionSizes (v8-metrics.h).

MetricsGarbageCollectionYoungCycle

class MetricsGarbageCollectionYoungCycle extends WasmHandle

Upstream V8 C++ struct v8::metrics::GarbageCollectionYoungCycle (v8-metrics.h).

MetricsLongTaskStats

class MetricsLongTaskStats extends WasmHandle

Experimental API intended for the LongTasks UKM (crbug.com/1173527). The Reset() method should be called at the start of a potential long task. The Get() method returns durations of V8 work that happened during the task.

This API is experimental and may be removed/changed in the future.

Upstream C++: v8::metrics::LongTaskStats (v8-metrics.h)

Static Methods

  • static reset(isolate: Isolate): void

    Resets durations of V8 work for the new task.

    Upstream C++: v8::metrics::LongTaskStats::Reset

MetricsRecorder

class MetricsRecorder extends WasmHandle

This class serves as a base class for recording event-based metrics in V8. There a two kinds of metrics, those which are expected to be thread-safe and whose implementation is required to fulfill this requirement and those whose implementation does not have that requirement and only needs to be executable on the main thread. If such an event is triggered from a background thread, it will be delayed and executed by the foreground task runner.

The embedder is expected to call Isolate.SetMetricsRecorder() providing its implementation and have the virtual methods overwritten for the events it cares about.

Upstream C++: v8::metrics::Recorder (v8-metrics.h)

Methods

  • addThreadSafeEvent(arg0: MetricsWasmModulesPerIsolate): void

    Binds upstream V8 C++ v8::metrics::Recorder::AddThreadSafeEvent.

  • notifyIsolateDisposal(): void

    Binds upstream V8 C++ v8::metrics::Recorder::NotifyIsolateDisposal.

MetricsRecorderContextId

class MetricsRecorderContextId extends WasmHandle

A unique identifier for a context in this Isolate. It is guaranteed to not be reused throughout the lifetime of the Isolate.

Upstream C++: v8::metrics::Recorder::ContextId (v8-metrics.h)

Methods

  • isEmpty(): boolean

    Binds upstream V8 C++ v8::metrics::Recorder::ContextId::IsEmpty.

MetricsWasmModuleCompiled

class MetricsWasmModuleCompiled extends WasmHandle

Upstream V8 C++ struct v8::metrics::WasmModuleCompiled (v8-metrics.h).

MetricsWasmModuleDecoded

class MetricsWasmModuleDecoded extends WasmHandle

Note: These structs do not define any constructor, and declare most fields as const, to force initializing them when using aggregate (designated) initialization. Those structs are meant to be created in V8 and read by embedders.

Upstream C++: v8::metrics::WasmModuleDecoded (v8-metrics.h)

MetricsWasmModuleInstantiated

class MetricsWasmModuleInstantiated extends WasmHandle

Upstream V8 C++ struct v8::metrics::WasmModuleInstantiated (v8-metrics.h).

MetricsWasmModulesPerIsolate

class MetricsWasmModulesPerIsolate extends WasmHandle

Upstream V8 C++ struct v8::metrics::WasmModulesPerIsolate (v8-metrics.h).

OutputStream

class OutputStream extends WasmHandle

An interface for exporting data from V8, using "push" model.

Upstream C++: v8::OutputStream (v8-profiler.h)

Methods

  • endOfStream(): void

    Notify about the end of stream.

    Upstream C++: v8::OutputStream::EndOfStream

  • getChunkSize(): number

    Get preferred output chunk size. Called only once.

    Upstream C++: v8::OutputStream::GetChunkSize

  • writeAsciiChunk(data: number, size: number): OutputStreamWriteResult

    Writes the next chunk of snapshot data into the stream. Writing can be stopped by returning kAbort as function result. EndOfStream will not be called in case writing was aborted.

    Upstream C++: v8::OutputStream::WriteAsciiChunk

  • writeHeapStatsChunk(data: HeapStatsUpdate, count: number): OutputStreamWriteResult

    Writes the next chunk of heap stats data into the stream. Writing can be stopped by returning kAbort as function result. EndOfStream will not be called in case writing was aborted.

    Upstream C++: v8::OutputStream::WriteHeapStatsChunk

QueryObjectPredicate

class QueryObjectPredicate extends WasmHandle

Upstream V8 C++ class v8::QueryObjectPredicate (v8-profiler.h).

Methods

  • filter(object: V8Object): boolean

    Binds upstream V8 C++ v8::QueryObjectPredicate::Filter.

SharedMemoryStatistics

class SharedMemoryStatistics extends WasmHandle

Collection of shared per-process V8 memory information.

Instances of this class can be passed to V8.GetSharedMemoryStatistics to get shared memory statistics from V8.

Upstream C++: v8::SharedMemoryStatistics (v8-statistics.h)

Methods

  • read_only_space_physical_size(): number

    Binds upstream V8 C++ v8::SharedMemoryStatistics::read_only_space_physical_size.

  • read_only_space_size(): number

    Binds upstream V8 C++ v8::SharedMemoryStatistics::read_only_space_size.

  • read_only_space_used_size(): number

    Binds upstream V8 C++ v8::SharedMemoryStatistics::read_only_space_used_size.

StackFrame

class StackFrame extends WasmHandle

A single JavaScript stack frame.

Upstream C++: v8::StackFrame (v8-debug.h)

Static Methods

  • static fromPtr(ptr: number): StackFrame

    Wraps a raw V8-wasm handle pointer as a StackFrame.

Methods

  • getColumn(): number

    Returns the 1-based column offset on the line for the associated function call. This method will return Message.kNoColumnInfo if it is unable to retrieve the column number, or if kColumnOffset was not passed as an option when capturing the StackTrace.

    Upstream C++: v8::StackFrame::GetColumn

  • getFunctionName(): V8String

    Returns the name of the function associated with this stack frame.

    Upstream C++: v8::StackFrame::GetFunctionName

  • getLineNumber(): number

    Returns the number, 1-based, of the line for the associate function call. This method will return Message.kNoLineNumberInfo if it is unable to retrieve the line number, or if kLineNumber was not passed as an option when capturing the StackTrace.

    Upstream C++: v8::StackFrame::GetLineNumber

  • getScriptId(): number

    Returns the id of the script for the function for this StackFrame. This method will return Message.kNoScriptIdInfo if it is unable to retrieve the script id, or if kScriptId was not passed as an option when capturing the StackTrace.

    Upstream C++: v8::StackFrame::GetScriptId

  • getScriptName(): V8String

    Returns the name of the resource that contains the script for the function for this StackFrame.

    Upstream C++: v8::StackFrame::GetScriptName

  • getScriptNameOrSourceURL(): V8String

    Returns the name of the resource that contains the script for the function for this StackFrame or sourceURL value if the script name is undefined and its source ends with //# sourceURL=... string or deprecated //@ sourceURL=... string.

    Upstream C++: v8::StackFrame::GetScriptNameOrSourceURL

  • getScriptSource(): V8String

    Returns the source of the script for the function for this StackFrame.

    Upstream C++: v8::StackFrame::GetScriptSource

  • getScriptSourceMappingURL(): V8String

    Returns the source mapping URL (if one is present) of the script for the function for this StackFrame.

    Upstream C++: v8::StackFrame::GetScriptSourceMappingURL

  • getSourcePosition(): number

    Returns zero based source position (character offset) for the associated function.

    Upstream C++: v8::StackFrame::GetSourcePosition

  • isConstructor(): boolean

    Returns whether or not the associated function is called as a constructor via "new".

    Upstream C++: v8::StackFrame::IsConstructor

  • isEval(): boolean

    Returns whether or not the associated function is compiled via a call to eval().

    Upstream C++: v8::StackFrame::IsEval

  • isUserJavaScript(): boolean

    Returns whether or not the associated function is defined by the user.

    Upstream C++: v8::StackFrame::IsUserJavaScript

  • isWasm(): boolean

    Returns whether or not the associated functions is defined in wasm.

    Upstream C++: v8::StackFrame::IsWasm

StackTrace

class StackTrace extends WasmHandle

Representation of a JavaScript stack trace. The information collected is a snapshot of the execution stack and the information remains valid after execution continues.

Upstream C++: v8::StackTrace (v8-debug.h)

Static Methods

  • static currentScriptId(isolate: Isolate): number

    Returns the first valid script id at the top of the JS stack. The returned value is Message.kNoScriptIdInfo if no id was found.

    This method is equivalent to calling StackTrace.CurrentStackTrace and walking the resulting frames from the beginning until a non-empty id is found. The difference is that this method won't allocate a stack trace.

    Upstream C++: v8::StackTrace::CurrentScriptId

  • static currentScriptNameOrSourceURL(isolate: Isolate): V8String

    Returns the first valid script name or source URL starting at the top of the JS stack. The returned string is either an empty handle if no script name/url was found or a non-zero-length string.

    This method is equivalent to calling StackTrace.CurrentStackTrace and walking the resulting frames from the beginning until a non-empty script name/url is found. The difference is that this method won't allocate a stack trace.

    Upstream C++: v8::StackTrace::CurrentScriptNameOrSourceURL

  • static currentStackTrace(isolate: Isolate, frame_limit: number, options: StackTraceStackTraceOptions): StackTrace

    Grab a snapshot of the current JavaScript execution stack.

    • frame_limit: The maximum number of stack frames we want to capture.
    • options: Enumerates the set of things we will capture for each StackFrame.

    Upstream C++: v8::StackTrace::CurrentStackTrace

  • static fromPtr(ptr: number): StackTrace

    Wraps a raw V8-wasm handle pointer as a StackTrace.

Methods

  • getFrame(isolate: Isolate, index: number): StackFrame

    Returns a StackFrame at a particular index.

    Upstream C++: v8::StackTrace::GetFrame

  • getFrameCount(): number

    Returns the number of StackFrames.

    Upstream C++: v8::StackTrace::GetFrameCount

  • getID(): number

    Returns the (unique) ID of this stack trace.

    Upstream C++: v8::StackTrace::GetID

StackTraceScriptData

class StackTraceScriptData extends WasmHandle

Upstream V8 C++ struct v8::StackTrace::ScriptData (v8-debug.h).

StackTraceScriptIdAndContext

class StackTraceScriptIdAndContext extends WasmHandle

Upstream V8 C++ struct v8::StackTrace::ScriptIdAndContext (v8-debug.h).

StringBuffer

class StringBuffer extends WasmHandle

Upstream V8 C++ class v8_inspector::StringBuffer (v8-inspector.h).

Static Methods

  • static create(arg0: string): StringBuffer

    This method copies contents.

    Upstream C++: v8_inspector::StringBuffer::create

StringView

class StringView extends WasmHandle

Upstream V8 C++ class v8_inspector::StringView (v8-inspector.h).

Methods

  • characters16(): number

    Binds upstream V8 C++ v8_inspector::StringView::characters16.

  • characters8(): number

    TODO(dgozman): add DCHECK(m_is8Bit) to accessors once platform can be used here.

    Upstream C++: v8_inspector::StringView::characters8

  • is8Bit(): boolean

    Binds upstream V8 C++ v8_inspector::StringView::is8Bit.

  • length(): number

    Binds upstream V8 C++ v8_inspector::StringView::length.

V8ContextInfo

class V8ContextInfo extends WasmHandle

Upstream V8 C++ class v8_inspector::V8ContextInfo (v8-inspector.h).

Static Methods

  • static executionContextId(context: Context): number

    Binds upstream V8 C++ v8_inspector::V8ContextInfo::executionContextId.

V8DebuggerId

class V8DebuggerId extends WasmHandle

This debugger id tries to be unique by generating two random numbers, which should most likely avoid collisions. Debugger id has a 1:1 mapping to context group. It is used to attribute stack traces to a particular debugging, when doing any cross-debugger operations (e.g. async step in). See also Runtime.UniqueDebuggerId in the protocol.

Upstream C++: v8_inspector::V8DebuggerId (v8-inspector.h)

Methods

  • isValid(): boolean

    Binds upstream V8 C++ v8_inspector::V8DebuggerId::isValid.

  • toString(): StringBuffer

    Binds upstream V8 C++ v8_inspector::V8DebuggerId::toString.

V8EmbedderState

class V8EmbedderState extends WasmHandle

Upstream V8 C++ struct v8_inspector::V8EmbedderState (v8-inspector.h).

V8Inspector

class V8Inspector extends WasmHandle

Upstream V8 C++ class v8_inspector::V8Inspector (v8-inspector.h).

Static Methods

  • static create(arg0: Isolate, arg1: V8InspectorClient): V8Inspector

    Binds upstream V8 C++ v8_inspector::V8Inspector::create.

Methods

  • allAsyncTasksCanceled(): void

    Binds upstream V8 C++ v8_inspector::V8Inspector::allAsyncTasksCanceled.

  • associateExceptionData(arg0: Context, exception: Value, key: Name, value: Value): boolean

    Binds upstream V8 C++ v8_inspector::V8Inspector::associateExceptionData.

  • asyncTaskCanceled(task: number): void

    Binds upstream V8 C++ v8_inspector::V8Inspector::asyncTaskCanceled.

  • asyncTaskFinished(task: number): void

    Binds upstream V8 C++ v8_inspector::V8Inspector::asyncTaskFinished.

  • asyncTaskScheduled(taskName: string, task: number, recurring: boolean): void

    Async stack traces instrumentation.

    Upstream C++: v8_inspector::V8Inspector::asyncTaskScheduled

  • asyncTaskStarted(task: number): void

    Binds upstream V8 C++ v8_inspector::V8Inspector::asyncTaskStarted.

  • captureStackTrace(fullStack: boolean): V8StackTrace

    Binds upstream V8 C++ v8_inspector::V8Inspector::captureStackTrace.

  • connect(contextGroupId: number, arg1: V8InspectorChannel, state: string, client_trust_level: V8InspectorClientTrustLevel, arg4: V8InspectorSessionPauseState): V8InspectorSession

    TODO(chromium:1352175): remove default value once downstream change lands. Deprecated: Use connectShared instead. Channel is owned by the embedder. Ensure to keep it alive as long as the returned session is alive.

    Upstream C++: v8_inspector::V8Inspector::connect

  • contextById(contextId: number): MaybeLocal<Context>

    Binds upstream V8 C++ v8_inspector::V8Inspector::contextById.

  • contextCreated(arg0: V8ContextInfo): void

    Contexts instrumentation.

    Upstream C++: v8_inspector::V8Inspector::contextCreated

  • contextDestroyed(arg0: Context): void

    Binds upstream V8 C++ v8_inspector::V8Inspector::contextDestroyed.

  • createStackTrace(arg0: StackTrace): V8StackTrace

    API methods.

    Upstream C++: v8_inspector::V8Inspector::createStackTrace

  • exceptionRevoked(arg0: Context, exceptionId: number, message: string): void

    Binds upstream V8 C++ v8_inspector::V8Inspector::exceptionRevoked.

  • externalAsyncTaskFinished(parent: V8StackTraceId): void

    Binds upstream V8 C++ v8_inspector::V8Inspector::externalAsyncTaskFinished.

  • externalAsyncTaskStarted(parent: V8StackTraceId): void

    Binds upstream V8 C++ v8_inspector::V8Inspector::externalAsyncTaskStarted.

  • idleFinished(): void

    Binds upstream V8 C++ v8_inspector::V8Inspector::idleFinished.

  • idleStarted(): void

    Various instrumentation.

    Upstream C++: v8_inspector::V8Inspector::idleStarted

  • isolateId(): bigint

    Binds upstream V8 C++ v8_inspector::V8Inspector::isolateId.

  • resetContextGroup(contextGroupId: number): void

    Binds upstream V8 C++ v8_inspector::V8Inspector::resetContextGroup.

V8InspectorChannel

class V8InspectorChannel extends WasmHandle

Connection.

Upstream C++: v8_inspector::V8Inspector::Channel (v8-inspector.h)

Methods

  • flushProtocolNotifications(): void

    Binds upstream V8 C++ v8_inspector::V8Inspector::Channel::flushProtocolNotifications.

V8InspectorClient

class V8InspectorClient extends WasmHandle

Upstream V8 C++ class v8_inspector::V8InspectorClient (v8-inspector.h).

Methods

  • beginEnsureAllContextsInGroup(contextGroupId: number): void

    Binds upstream V8 C++ v8_inspector::V8InspectorClient::beginEnsureAllContextsInGroup.

  • beginUserGesture(): void

    Binds upstream V8 C++ v8_inspector::V8InspectorClient::beginUserGesture.

  • cancelTimer(data: number): void

    Binds upstream V8 C++ v8_inspector::V8InspectorClient::cancelTimer.

  • canExecuteScripts(contextGroupId: number): boolean

    TODO(dgozman): this was added to support service worker shadow page. We should not connect at all.

    Upstream C++: v8_inspector::V8InspectorClient::canExecuteScripts

  • consoleAPIMessage(contextGroupId: number, level: IsolateMessageErrorLevel, message: StringView, url: StringView, lineNumber: number, columnNumber: number, arg6: V8StackTrace): void

    Deprecated. Use version with contextId.

    Upstream C++: v8_inspector::V8InspectorClient::consoleAPIMessage

  • consoleAPIMessage2(contextGroupId: number, contextId: number, level: IsolateMessageErrorLevel, message: StringView, url: StringView, lineNumber: number, columnNumber: number, stackTrace: V8StackTrace): void

    Deprecated. Use version with contextId.

    Upstream C++: v8_inspector::V8InspectorClient::consoleAPIMessage

  • consoleClear(contextGroupId: number): void

    Binds upstream V8 C++ v8_inspector::V8InspectorClient::consoleClear.

  • consoleTime(isolate: Isolate, label: V8String): void

    Binds upstream V8 C++ v8_inspector::V8InspectorClient::consoleTime.

  • consoleTimeEnd(isolate: Isolate, label: V8String): void

    Binds upstream V8 C++ v8_inspector::V8InspectorClient::consoleTimeEnd.

  • consoleTimeStamp(isolate: Isolate, label: V8String): void

    Binds upstream V8 C++ v8_inspector::V8InspectorClient::consoleTimeStamp.

  • currentTimeMS(): number

    Binds upstream V8 C++ v8_inspector::V8InspectorClient::currentTimeMS.

  • deepSerialize(v8Value: Value, maxDepth: number, additionalParameters: V8Object): DeepSerializationResult

    Binds upstream V8 C++ v8_inspector::V8InspectorClient::deepSerialize.

  • descriptionForValueSubtype(arg0: Context, arg1: Value): StringBuffer

    Binds upstream V8 C++ v8_inspector::V8InspectorClient::descriptionForValueSubtype.

  • dispatchError(arg0: Context, arg1: Message, arg2: Value): void

    Binds upstream V8 C++ v8_inspector::V8InspectorClient::dispatchError.

  • endEnsureAllContextsInGroup(contextGroupId: number): void

    Binds upstream V8 C++ v8_inspector::V8InspectorClient::endEnsureAllContextsInGroup.

  • endUserGesture(): void

    Binds upstream V8 C++ v8_inspector::V8InspectorClient::endUserGesture.

  • ensureDefaultContextInGroup(contextGroupId: number): Context

    Binds upstream V8 C++ v8_inspector::V8InspectorClient::ensureDefaultContextInGroup.

  • generateUniqueId(): bigint

    The caller would defer to generating a random 64 bit integer if this method returns 0.

    Upstream C++: v8_inspector::V8InspectorClient::generateUniqueId

  • installAdditionalCommandLineAPI(arg0: Context, arg1: V8Object): void

    Binds upstream V8 C++ v8_inspector::V8InspectorClient::installAdditionalCommandLineAPI.

  • isInspectableHeapObject(arg0: V8Object): boolean

    Binds upstream V8 C++ v8_inspector::V8InspectorClient::isInspectableHeapObject.

  • maxAsyncCallStackDepthChanged(depth: number): void

    Binds upstream V8 C++ v8_inspector::V8InspectorClient::maxAsyncCallStackDepthChanged.

  • memoryInfo(arg0: Isolate, arg1: Context): MaybeLocal<Value>

    Binds upstream V8 C++ v8_inspector::V8InspectorClient::memoryInfo.

  • muteMetrics(contextGroupId: number): void

    Binds upstream V8 C++ v8_inspector::V8InspectorClient::muteMetrics.

  • quitMessageLoopOnPause(): void

    Binds upstream V8 C++ v8_inspector::V8InspectorClient::quitMessageLoopOnPause.

  • resourceNameToUrl(resourceName: StringView): StringBuffer

    Binds upstream V8 C++ v8_inspector::V8InspectorClient::resourceNameToUrl.

  • runIfWaitingForDebugger(contextGroupId: number): void

    Binds upstream V8 C++ v8_inspector::V8InspectorClient::runIfWaitingForDebugger.

  • runMessageLoopOnInstrumentationPause(contextGroupId: number): void

    Binds upstream V8 C++ v8_inspector::V8InspectorClient::runMessageLoopOnInstrumentationPause.

  • runMessageLoopOnPause(contextGroupId: number): void

    Binds upstream V8 C++ v8_inspector::V8InspectorClient::runMessageLoopOnPause.

  • unmuteMetrics(contextGroupId: number): void

    Binds upstream V8 C++ v8_inspector::V8InspectorClient::unmuteMetrics.

  • valueSubtype(arg0: Value): StringBuffer

    Binds upstream V8 C++ v8_inspector::V8InspectorClient::valueSubtype.

V8InspectorManagedChannel

class V8InspectorManagedChannel extends WasmHandle

Upstream V8 C++ class v8_inspector::V8Inspector::ManagedChannel (v8-inspector.h).

Methods

  • flushProtocolNotifications(): void

    Binds upstream V8 C++ v8_inspector::V8Inspector::ManagedChannel::flushProtocolNotifications.

V8InspectorSession

class V8InspectorSession extends WasmHandle

Upstream V8 C++ class v8_inspector::V8InspectorSession (v8-inspector.h).

Static Methods

  • static canDispatchMethod(method: string): boolean

    Dispatching protocol messages.

    Upstream C++: v8_inspector::V8InspectorSession::canDispatchMethod

Methods

  • breakProgram(breakReason: string, breakDetails: string): void

    Binds upstream V8 C++ v8_inspector::V8InspectorSession::breakProgram.

  • cancelPauseOnNextStatement(): void

    Binds upstream V8 C++ v8_inspector::V8InspectorSession::cancelPauseOnNextStatement.

  • dispatchProtocolMessage(message: string, associated_data: string): void

    Binds upstream V8 C++ v8_inspector::V8InspectorSession::dispatchProtocolMessage.

  • releaseObjectGroup(arg0: string): void

    Binds upstream V8 C++ v8_inspector::V8InspectorSession::releaseObjectGroup.

  • resume(setTerminateOnResume: boolean): void

    Binds upstream V8 C++ v8_inspector::V8InspectorSession::resume.

  • schedulePauseOnNextStatement(breakReason: string, breakDetails: string): void

    Debugger actions.

    Upstream C++: v8_inspector::V8InspectorSession::schedulePauseOnNextStatement

  • setSkipAllPauses(arg0: boolean): void

    Binds upstream V8 C++ v8_inspector::V8InspectorSession::setSkipAllPauses.

  • stepOver(): void

    Binds upstream V8 C++ v8_inspector::V8InspectorSession::stepOver.

  • stop(): void

    Prepare for shutdown (disables debugger pausing, etc.).

    Upstream C++: v8_inspector::V8InspectorSession::stop

  • triggerPreciseCoverageDeltaUpdate(occasion: string): void

    Binds upstream V8 C++ v8_inspector::V8InspectorSession::triggerPreciseCoverageDeltaUpdate.

V8InspectorSessionEvaluateResult

class V8InspectorSessionEvaluateResult extends WasmHandle

Upstream V8 C++ struct v8_inspector::V8InspectorSession::EvaluateResult (v8-inspector.h).

V8InspectorSessionInspectable

class V8InspectorSessionInspectable extends WasmHandle

Cross-context inspectable values (DOM nodes in different worlds, etc.).

Upstream C++: v8_inspector::V8InspectorSession::Inspectable (v8-inspector.h)

Methods

  • get(arg0: Context): Value

    Binds upstream V8 C++ v8_inspector::V8InspectorSession::Inspectable::get.

V8StackFrame

class V8StackFrame extends WasmHandle

Upstream V8 C++ struct v8_inspector::V8StackFrame (v8-inspector.h).

V8StackTrace

class V8StackTrace extends WasmHandle

Upstream V8 C++ class v8_inspector::V8StackTrace (v8-inspector.h).

Methods

  • clone(): V8StackTrace

    Safe to pass between threads, drops async chain.

    Upstream C++: v8_inspector::V8StackTrace::clone

  • isEmpty(): boolean

    Binds upstream V8 C++ v8_inspector::V8StackTrace::isEmpty.

  • topColumnNumber(): number

    Binds upstream V8 C++ v8_inspector::V8StackTrace::topColumnNumber.

  • topLineNumber(): number

    Binds upstream V8 C++ v8_inspector::V8StackTrace::topLineNumber.

  • topScriptId(): number

    Binds upstream V8 C++ v8_inspector::V8StackTrace::topScriptId.

  • toString(): StringBuffer

    Binds upstream V8 C++ v8_inspector::V8StackTrace::toString.

V8StackTraceId

class V8StackTraceId extends WasmHandle

These stack trace ids are intended to be passed between debuggers and be resolved later. This allows to track cross-debugger calls and step between them if a single client connects to multiple debuggers.

Upstream C++: v8_inspector::V8StackTraceId (v8-inspector.h)

Methods

  • isInvalid(): boolean

    Binds upstream V8 C++ v8_inspector::V8StackTraceId::IsInvalid.

  • toString(): StringBuffer

    Binds upstream V8 C++ v8_inspector::V8StackTraceId::ToString.

V8URLBreakpoint

class V8URLBreakpoint extends WasmHandle

Upstream V8 C++ struct v8_inspector::V8URLBreakpoint (v8-inspector.h).

On this page