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): ActivityControlControlOptionNotify 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 | nullReturns 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 | nullBinds upstream V8 C++
v8::CodeEvent::GetCodeEventTypeName.
Methods
-
getCodeSize(): numberBinds upstream V8 C++
v8::CodeEvent::GetCodeSize. -
getCodeStartAddress(): numberBinds upstream V8 C++
v8::CodeEvent::GetCodeStartAddress. -
getCodeType(): CodeEventTypeNOTE (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 | nullBinds upstream V8 C++
v8::CodeEvent::GetComment. -
getFunctionName(): V8StringBinds upstream V8 C++
v8::CodeEvent::GetFunctionName. -
getPreviousCodeStartAddress(): numberBinds upstream V8 C++
v8::CodeEvent::GetPreviousCodeStartAddress. -
getScriptColumn(): numberBinds upstream V8 C++
v8::CodeEvent::GetScriptColumn. -
getScriptLine(): numberBinds upstream V8 C++
v8::CodeEvent::GetScriptLine. -
getScriptName(): V8StringBinds 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(): voidCall
Disable()to stop listening to code creation and code relocation events.Upstream C++:
v8::CodeEventHandler::Disable -
enable(): voidCall
Enable()to starts listening to code creation and code relocation events. These events will be handled byHandle().Upstream C++:
v8::CodeEventHandler::Enable -
handle(code_event: CodeEvent): voidHandle is called every time a code object is created or moved. Information about each code event will be available through the
code_eventparameter.When the CodeEventType is kRelocationType, the code for this CodeEvent has moved from
GetPreviousCodeStartAddress()toGetCodeStartAddress().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(): voidDeletes the profile and removes it from CpuProfiler's list. All pointers to nodes previously returned become invalid.
Upstream C++:
v8::CpuProfile::Delete -
getEndTime(): bigintReturns 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 | nullReturns profile node corresponding to the top frame the sample at the given index.
Upstream C++:
v8::CpuProfile::GetSample -
getSampleEmbedderState(index: number): EmbedderStateTagReturns state of the embedder when sample was captured.
Upstream C++:
v8::CpuProfile::GetSampleEmbedderState -
getSamplesCount(): numberReturns number of samples recorded. The samples are not recorded unless
record_samplesparameter ofCpuProfiler.StartCpuProfilingis true.Upstream C++:
v8::CpuProfile::GetSamplesCount -
getSampleState(index: number): StateTagReturns state of the vm when sample was captured.
Upstream C++:
v8::CpuProfile::GetSampleState -
getSampleTimestamp(index: number): bigintReturns 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(): bigintReturns time when the profile recording was started (in microseconds) since some unspecified starting point.
Upstream C++:
v8::CpuProfile::GetStartTime -
getTitle(): V8StringReturns CPU profile title.
Upstream C++:
v8::CpuProfile::GetTitle -
getTopDownRoot(): CpuProfileNode | nullReturns the root node of the top down call tree.
Upstream C++:
v8::CpuProfile::GetTopDownRoot -
serialize(stream: OutputStream, format: CpuProfileSerializationFormat): voidPrepare 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 | nullReturns bailout reason for the function if the optimization was disabled for it.
Upstream C++:
v8::CpuProfileNode::GetBailoutReason -
getChild(index: number): CpuProfileNode | nullRetrieves a child node by index.
Upstream C++:
v8::CpuProfileNode::GetChild -
getChildrenCount(): numberReturns child nodes count of the node.
Upstream C++:
v8::CpuProfileNode::GetChildrenCount -
getColumnNumber(): numberReturns 1-based number of the column where the function originates. kNoColumnNumberInfo if no column number information is available.
Upstream C++:
v8::CpuProfileNode::GetColumnNumber -
getFunctionName(): V8StringReturns function name (empty string for anonymous functions.)
Upstream C++:
v8::CpuProfileNode::GetFunctionName -
getFunctionNameStr(): string | nullReturns 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(): numberReturns the count of samples where the function was currently executing.
Upstream C++:
v8::CpuProfileNode::GetHitCount -
getHitLineCount(): numberReturns the number of the function's source lines that collect the samples.
Upstream C++:
v8::CpuProfileNode::GetHitLineCount -
getLineNumber(): numberReturns 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): booleanReturns 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(): numberReturns id of the node. The id is unique within the tree
Upstream C++:
v8::CpuProfileNode::GetNodeId -
getParent(): CpuProfileNode | nullRetrieves the ancestor node, or null if the root.
Upstream C++:
v8::CpuProfileNode::GetParent -
getScriptId(): numberReturns id of the script where function is located.
Upstream C++:
v8::CpuProfileNode::GetScriptId -
getScriptResourceName(): V8StringReturns resource name for script from where the function originates.
Upstream C++:
v8::CpuProfileNode::GetScriptResourceName -
getScriptResourceNameStr(): string | nullReturns 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(): CpuProfileNodeSourceTypeGets the type of the source which the node was captured from.
Upstream C++:
v8::CpuProfileNode::GetSourceType -
isScriptSharedCrossOrigin(): booleanReturn 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 | nullCreates a new CPU profiler for the
isolate. The isolate must be initialized. The profiler object must be disposed after use by callingDisposemethod.Upstream C++:
v8::CpuProfiler::New -
static useDetailedSourcePositionsForProfiling(isolate: Isolate): voidGenerate 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(): voidDisposes the CPU profiler object.
Upstream C++:
v8::CpuProfiler::Dispose -
setSamplingInterval(us: number): voidChanges 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): voidSets 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): CpuProfilingStatusStarts profiling with the same semantics as above, except with expanded parameters.
record_samplesparameter controls whether individual samples should be recorded in addition to the aggregated tree.max_samplescontrols 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): CpuProfilingStatusThe 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 | nullStops collecting CPU profile with a given id and returns it.
Upstream C++:
v8::CpuProfiler::Stop -
stopProfiling(title: V8String): CpuProfile | nullStops 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(): numberBinds upstream V8 C++
v8::CpuProfilingOptions::max_samples. -
mode(): CpuProfilingModeBinds upstream V8 C++
v8::CpuProfilingOptions::mode. -
profile_source(): CpuProfileSourceBinds upstream V8 C++
v8::CpuProfilingOptions::profile_source. -
sampling_interval_us(): numberBinds 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(): voidBinds 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:
- Define derived class of
EmbedderGraph.Nodefor embedder objects. - Set the build embedder graph callback on the heap profiler using
HeapProfiler.AddBuildEmbedderGraphCallback. - In the callback use graph->AddEdge(node1, node2) to add an edge from node1 to node2.
- 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): voidAdds an edge that represents a strong reference from the given node
fromto the given nodeto. 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): voidAdds 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): voidAdds an edge that represents a weak reference from the given node
fromto the given nodeto. 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 | nullReturns 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
Datais not marked as abstract for compatibility, but embedders who subclass EmbedderGraph are expected to implement it. Then in the implementation of the variant that takesValue, they can simply forward the call to the one that takesData.Upstream C++:
v8::EmbedderGraph::V8Node -
v8Node2(value: Data): EmbedderGraphNode | nullReturns 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
Valueand forward it to the variant that takesValue, which is currently required to be implemented. In the future we'll remove theValuevariant, and make this variant that takesDataabstract instead. If the embedder subclassesEmbedderGraphand also useTracedReference<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(): numberReturns the address of the object in the embedder heap, or
nullto 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 returnsnull.Upstream C++:
v8::EmbedderGraph::Node::GetAddress -
getDetachedness(): EmbedderGraphNodeDetachednessDetachedness 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(): booleanMust return true for non-V8 nodes.
Upstream C++:
v8::EmbedderGraph::Node::IsEmbedderNode -
isRootNode(): booleanBinds upstream V8 C++
v8::EmbedderGraph::Node::IsRootNode. -
name(): string | nullBinds upstream V8 C++
v8::EmbedderGraph::Node::Name. -
namePrefix(): string | nullOptional name prefix. It is used in Chrome for tagging detached nodes.
Upstream C++:
v8::EmbedderGraph::Node::NamePrefix -
sizeInBytes(): numberBinds upstream V8 C++
v8::EmbedderGraph::Node::SizeInBytes. -
wrapperNode(): EmbedderGraphNode | nullThe 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(): numberBinds upstream V8 C++
v8::HeapCodeStatistics::bytecode_and_metadata_size. -
code_and_metadata_size(): numberBinds upstream V8 C++
v8::HeapCodeStatistics::code_and_metadata_size. -
cpu_profiler_metadata_size(): numberBinds upstream V8 C++
v8::HeapCodeStatistics::cpu_profiler_metadata_size. -
external_script_source_size(): numberBinds 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 | nullReturns origin node.
Upstream C++:
v8::HeapGraphEdge::GetFromNode -
getName(): ValueReturns edge name. This can be a variable name, an element index, or a property name.
Upstream C++:
v8::HeapGraphEdge::GetName -
getToNode(): HeapGraphNode | nullReturns destination node.
Upstream C++:
v8::HeapGraphEdge::GetToNode -
getType(): HeapGraphEdgeTypeReturns 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 | nullRetrieves a child by index.
Upstream C++:
v8::HeapGraphNode::GetChild -
getChildrenCount(): numberReturns child nodes count of the node.
Upstream C++:
v8::HeapGraphNode::GetChildrenCount -
getName(): V8StringReturns 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(): numberReturns node's own size, in bytes.
Upstream C++:
v8::HeapGraphNode::GetShallowSize -
getType(): HeapGraphNodeTypeReturns 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(): numberBinds upstream V8 C++
v8::HeapObjectStatistics::object_count. -
object_size(): numberBinds upstream V8 C++
v8::HeapObjectStatistics::object_size. -
object_sub_type(): string | nullBinds upstream V8 C++
v8::HeapObjectStatistics::object_sub_type. -
object_type(): string | nullBinds 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(): voidClears 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 | nullAllocates 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(): voidDeletes 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): ValueReturns heap object with given SnapshotObjectId if the object is alive, otherwise empty handle is returned.
Upstream C++:
v8::HeapProfiler::FindObjectById -
getAllocationProfile(): AllocationProfile | nullReturns the sampled profile of allocations allocated (and still live) since StartSamplingHeapProfiler was called. The ownership of the pointer is transferred to the caller. Returns
nullif sampling heap profiler is not active.Upstream C++:
v8::HeapProfiler::GetAllocationProfile -
getHeapSnapshot(index: number): HeapSnapshot | nullReturns a snapshot by index.
Upstream C++:
v8::HeapProfiler::GetHeapSnapshot -
getSnapshotCount(): numberReturns the number of snapshots taken.
Upstream C++:
v8::HeapProfiler::GetSnapshotCount -
isTakingSnapshot(): booleanReturns whether the heap profiler is currently taking a snapshot.
Upstream C++:
v8::HeapProfiler::IsTakingSnapshot -
startSamplingHeapProfiler(sample_interval: bigint, stack_depth: number, flags: HeapProfilerSamplingFlags): booleanStarts 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_intervalbytes allocated. Thestack_depthparameter 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): voidStarts tracking of heap objects population statistics. After calling this method, all heap objects relocations done by the garbage collector are being registered.
track_allocationsparameter 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(): voidStops the sampling heap profile and discards the current profile.
Upstream C++:
v8::HeapProfiler::StopSamplingHeapProfiler -
stopTrackingHeapObjects(): voidStops 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 | nullTakes a heap snapshot.
Returns: the snapshot.
Upstream C++:
v8::HeapProfiler::TakeHeapSnapshot -
takeHeapSnapshot2(control: ActivityControl, resolver: HeapProfilerContextNameResolver, hide_internals: boolean, capture_numeric_value: boolean): HeapSnapshot | nullTakes a heap snapshot. See
HeapSnapshotOptionsfor 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 | nullReturns 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 | nullReturns 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(): voidDeletes 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 | nullReturns a node by index.
Upstream C++:
v8::HeapSnapshot::GetNode -
getNodeById(id: number): HeapGraphNode | nullReturns a node by its id.
Upstream C++:
v8::HeapSnapshot::GetNodeById -
getNodesCount(): numberReturns total nodes count in the snapshot.
Upstream C++:
v8::HeapSnapshot::GetNodesCount -
getRoot(): HeapGraphNode | nullReturns the root node of the heap graph.
Upstream C++:
v8::HeapSnapshot::GetRoot -
serialize(stream: OutputStream, format: HeapSnapshotSerializationFormat): voidPrepare 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(): numberBinds upstream V8 C++
v8::HeapSpaceStatistics::physical_space_size. -
space_available_size(): numberBinds upstream V8 C++
v8::HeapSpaceStatistics::space_available_size. -
space_name(): string | nullBinds upstream V8 C++
v8::HeapSpaceStatistics::space_name. -
space_size(): numberBinds upstream V8 C++
v8::HeapSpaceStatistics::space_size. -
space_used_size(): numberBinds 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(): numberReturns 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(): numberBinds upstream V8 C++
v8::HeapStatistics::external_memory. -
heap_size_limit(): numberBinds upstream V8 C++
v8::HeapStatistics::heap_size_limit. -
malloced_memory(): numberBinds upstream V8 C++
v8::HeapStatistics::malloced_memory. -
number_of_detached_contexts(): numberBinds upstream V8 C++
v8::HeapStatistics::number_of_detached_contexts. -
number_of_native_contexts(): numberBinds upstream V8 C++
v8::HeapStatistics::number_of_native_contexts. -
peak_malloced_memory(): numberBinds upstream V8 C++
v8::HeapStatistics::peak_malloced_memory. -
total_allocated_bytes(): bigintReturns 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(): numberBinds upstream V8 C++
v8::HeapStatistics::total_available_size. -
total_global_handles_size(): numberBinds upstream V8 C++
v8::HeapStatistics::total_global_handles_size. -
total_heap_size(): numberBinds upstream V8 C++
v8::HeapStatistics::total_heap_size. -
total_heap_size_executable(): numberBinds upstream V8 C++
v8::HeapStatistics::total_heap_size_executable. -
total_physical_size(): numberBinds upstream V8 C++
v8::HeapStatistics::total_physical_size. -
used_global_handles_size(): numberBinds upstream V8 C++
v8::HeapStatistics::used_global_handles_size. -
used_heap_size(): numberBinds 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): MeasureMemoryDelegateReturns a default delegate that resolves the given promise when the memory measurement completes.
isolate: the current isolatecontext: the current contextpromise_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): booleanReturns 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): voidResets 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): voidBinds upstream V8 C++
v8::metrics::Recorder::AddThreadSafeEvent. -
notifyIsolateDisposal(): voidBinds 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(): booleanBinds 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(): voidNotify about the end of stream.
Upstream C++:
v8::OutputStream::EndOfStream -
getChunkSize(): numberGet preferred output chunk size. Called only once.
Upstream C++:
v8::OutputStream::GetChunkSize -
writeAsciiChunk(data: number, size: number): OutputStreamWriteResultWrites 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): OutputStreamWriteResultWrites 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): booleanBinds 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(): numberBinds upstream V8 C++
v8::SharedMemoryStatistics::read_only_space_physical_size. -
read_only_space_size(): numberBinds upstream V8 C++
v8::SharedMemoryStatistics::read_only_space_size. -
read_only_space_used_size(): numberBinds 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): StackFrameWraps a raw V8-wasm handle pointer as a
StackFrame.
Methods
-
getColumn(): numberReturns the 1-based column offset on the line for the associated function call. This method will return
Message.kNoColumnInfoif 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(): V8StringReturns the name of the function associated with this stack frame.
Upstream C++:
v8::StackFrame::GetFunctionName -
getLineNumber(): numberReturns the number, 1-based, of the line for the associate function call. This method will return
Message.kNoLineNumberInfoif 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(): numberReturns the id of the script for the function for this StackFrame. This method will return
Message.kNoScriptIdInfoif 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(): V8StringReturns the name of the resource that contains the script for the function for this StackFrame.
Upstream C++:
v8::StackFrame::GetScriptName -
getScriptNameOrSourceURL(): V8StringReturns 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(): V8StringReturns the source of the script for the function for this StackFrame.
Upstream C++:
v8::StackFrame::GetScriptSource -
getScriptSourceMappingURL(): V8StringReturns the source mapping URL (if one is present) of the script for the function for this StackFrame.
Upstream C++:
v8::StackFrame::GetScriptSourceMappingURL -
getSourcePosition(): numberReturns zero based source position (character offset) for the associated function.
Upstream C++:
v8::StackFrame::GetSourcePosition -
isConstructor(): booleanReturns whether or not the associated function is called as a constructor via "new".
Upstream C++:
v8::StackFrame::IsConstructor -
isEval(): booleanReturns whether or not the associated function is compiled via a call to eval().
Upstream C++:
v8::StackFrame::IsEval -
isUserJavaScript(): booleanReturns whether or not the associated function is defined by the user.
Upstream C++:
v8::StackFrame::IsUserJavaScript -
isWasm(): booleanReturns 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): numberReturns the first valid script id at the top of the JS stack. The returned value is
Message.kNoScriptIdInfoif no id was found.This method is equivalent to calling
StackTrace.CurrentStackTraceand 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): V8StringReturns 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.CurrentStackTraceand 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): StackTraceGrab 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): StackTraceWraps a raw V8-wasm handle pointer as a
StackTrace.
Methods
-
getFrame(isolate: Isolate, index: number): StackFrameReturns a StackFrame at a particular index.
Upstream C++:
v8::StackTrace::GetFrame -
getFrameCount(): numberReturns the number of StackFrames.
Upstream C++:
v8::StackTrace::GetFrameCount -
getID(): numberReturns 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): StringBufferThis 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(): numberBinds upstream V8 C++
v8_inspector::StringView::characters16. -
characters8(): numberTODO(dgozman): add DCHECK(m_is8Bit) to accessors once platform can be used here.
Upstream C++:
v8_inspector::StringView::characters8 -
is8Bit(): booleanBinds upstream V8 C++
v8_inspector::StringView::is8Bit. -
length(): numberBinds 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): numberBinds 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(): booleanBinds upstream V8 C++
v8_inspector::V8DebuggerId::isValid. -
toString(): StringBufferBinds 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): V8InspectorBinds upstream V8 C++
v8_inspector::V8Inspector::create.
Methods
-
allAsyncTasksCanceled(): voidBinds upstream V8 C++
v8_inspector::V8Inspector::allAsyncTasksCanceled. -
associateExceptionData(arg0: Context, exception: Value, key: Name, value: Value): booleanBinds upstream V8 C++
v8_inspector::V8Inspector::associateExceptionData. -
asyncTaskCanceled(task: number): voidBinds upstream V8 C++
v8_inspector::V8Inspector::asyncTaskCanceled. -
asyncTaskFinished(task: number): voidBinds upstream V8 C++
v8_inspector::V8Inspector::asyncTaskFinished. -
asyncTaskScheduled(taskName: string, task: number, recurring: boolean): voidAsync stack traces instrumentation.
Upstream C++:
v8_inspector::V8Inspector::asyncTaskScheduled -
asyncTaskStarted(task: number): voidBinds upstream V8 C++
v8_inspector::V8Inspector::asyncTaskStarted. -
captureStackTrace(fullStack: boolean): V8StackTraceBinds upstream V8 C++
v8_inspector::V8Inspector::captureStackTrace. -
connect(contextGroupId: number, arg1: V8InspectorChannel, state: string, client_trust_level: V8InspectorClientTrustLevel, arg4: V8InspectorSessionPauseState): V8InspectorSessionTODO(chromium:1352175): remove default value once downstream change lands. Deprecated: Use
connectSharedinstead. 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): voidContexts instrumentation.
Upstream C++:
v8_inspector::V8Inspector::contextCreated -
contextDestroyed(arg0: Context): voidBinds upstream V8 C++
v8_inspector::V8Inspector::contextDestroyed. -
createStackTrace(arg0: StackTrace): V8StackTraceAPI methods.
Upstream C++:
v8_inspector::V8Inspector::createStackTrace -
exceptionRevoked(arg0: Context, exceptionId: number, message: string): voidBinds upstream V8 C++
v8_inspector::V8Inspector::exceptionRevoked. -
externalAsyncTaskFinished(parent: V8StackTraceId): voidBinds upstream V8 C++
v8_inspector::V8Inspector::externalAsyncTaskFinished. -
externalAsyncTaskStarted(parent: V8StackTraceId): voidBinds upstream V8 C++
v8_inspector::V8Inspector::externalAsyncTaskStarted. -
idleFinished(): voidBinds upstream V8 C++
v8_inspector::V8Inspector::idleFinished. -
idleStarted(): voidVarious instrumentation.
Upstream C++:
v8_inspector::V8Inspector::idleStarted -
isolateId(): bigintBinds upstream V8 C++
v8_inspector::V8Inspector::isolateId. -
resetContextGroup(contextGroupId: number): voidBinds upstream V8 C++
v8_inspector::V8Inspector::resetContextGroup.
V8InspectorChannel
class V8InspectorChannel extends WasmHandle
Connection.
Upstream C++: v8_inspector::V8Inspector::Channel (v8-inspector.h)
Methods
-
flushProtocolNotifications(): voidBinds 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): voidBinds upstream V8 C++
v8_inspector::V8InspectorClient::beginEnsureAllContextsInGroup. -
beginUserGesture(): voidBinds upstream V8 C++
v8_inspector::V8InspectorClient::beginUserGesture. -
cancelTimer(data: number): voidBinds upstream V8 C++
v8_inspector::V8InspectorClient::cancelTimer. -
canExecuteScripts(contextGroupId: number): booleanTODO(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): voidDeprecated. 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): voidDeprecated. Use version with contextId.
Upstream C++:
v8_inspector::V8InspectorClient::consoleAPIMessage -
consoleClear(contextGroupId: number): voidBinds upstream V8 C++
v8_inspector::V8InspectorClient::consoleClear. -
consoleTime(isolate: Isolate, label: V8String): voidBinds upstream V8 C++
v8_inspector::V8InspectorClient::consoleTime. -
consoleTimeEnd(isolate: Isolate, label: V8String): voidBinds upstream V8 C++
v8_inspector::V8InspectorClient::consoleTimeEnd. -
consoleTimeStamp(isolate: Isolate, label: V8String): voidBinds upstream V8 C++
v8_inspector::V8InspectorClient::consoleTimeStamp. -
currentTimeMS(): numberBinds upstream V8 C++
v8_inspector::V8InspectorClient::currentTimeMS. -
deepSerialize(v8Value: Value, maxDepth: number, additionalParameters: V8Object): DeepSerializationResultBinds upstream V8 C++
v8_inspector::V8InspectorClient::deepSerialize. -
descriptionForValueSubtype(arg0: Context, arg1: Value): StringBufferBinds upstream V8 C++
v8_inspector::V8InspectorClient::descriptionForValueSubtype. -
dispatchError(arg0: Context, arg1: Message, arg2: Value): voidBinds upstream V8 C++
v8_inspector::V8InspectorClient::dispatchError. -
endEnsureAllContextsInGroup(contextGroupId: number): voidBinds upstream V8 C++
v8_inspector::V8InspectorClient::endEnsureAllContextsInGroup. -
endUserGesture(): voidBinds upstream V8 C++
v8_inspector::V8InspectorClient::endUserGesture. -
ensureDefaultContextInGroup(contextGroupId: number): ContextBinds upstream V8 C++
v8_inspector::V8InspectorClient::ensureDefaultContextInGroup. -
generateUniqueId(): bigintThe 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): voidBinds upstream V8 C++
v8_inspector::V8InspectorClient::installAdditionalCommandLineAPI. -
isInspectableHeapObject(arg0: V8Object): booleanBinds upstream V8 C++
v8_inspector::V8InspectorClient::isInspectableHeapObject. -
maxAsyncCallStackDepthChanged(depth: number): voidBinds 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): voidBinds upstream V8 C++
v8_inspector::V8InspectorClient::muteMetrics. -
quitMessageLoopOnPause(): voidBinds upstream V8 C++
v8_inspector::V8InspectorClient::quitMessageLoopOnPause. -
resourceNameToUrl(resourceName: StringView): StringBufferBinds upstream V8 C++
v8_inspector::V8InspectorClient::resourceNameToUrl. -
runIfWaitingForDebugger(contextGroupId: number): voidBinds upstream V8 C++
v8_inspector::V8InspectorClient::runIfWaitingForDebugger. -
runMessageLoopOnInstrumentationPause(contextGroupId: number): voidBinds upstream V8 C++
v8_inspector::V8InspectorClient::runMessageLoopOnInstrumentationPause. -
runMessageLoopOnPause(contextGroupId: number): voidBinds upstream V8 C++
v8_inspector::V8InspectorClient::runMessageLoopOnPause. -
unmuteMetrics(contextGroupId: number): voidBinds upstream V8 C++
v8_inspector::V8InspectorClient::unmuteMetrics. -
valueSubtype(arg0: Value): StringBufferBinds 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(): voidBinds 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): booleanDispatching protocol messages.
Upstream C++:
v8_inspector::V8InspectorSession::canDispatchMethod
Methods
-
breakProgram(breakReason: string, breakDetails: string): voidBinds upstream V8 C++
v8_inspector::V8InspectorSession::breakProgram. -
cancelPauseOnNextStatement(): voidBinds upstream V8 C++
v8_inspector::V8InspectorSession::cancelPauseOnNextStatement. -
dispatchProtocolMessage(message: string, associated_data: string): voidBinds upstream V8 C++
v8_inspector::V8InspectorSession::dispatchProtocolMessage. -
releaseObjectGroup(arg0: string): voidBinds upstream V8 C++
v8_inspector::V8InspectorSession::releaseObjectGroup. -
resume(setTerminateOnResume: boolean): voidBinds upstream V8 C++
v8_inspector::V8InspectorSession::resume. -
schedulePauseOnNextStatement(breakReason: string, breakDetails: string): voidDebugger actions.
Upstream C++:
v8_inspector::V8InspectorSession::schedulePauseOnNextStatement -
setSkipAllPauses(arg0: boolean): voidBinds upstream V8 C++
v8_inspector::V8InspectorSession::setSkipAllPauses. -
stepOver(): voidBinds upstream V8 C++
v8_inspector::V8InspectorSession::stepOver. -
stop(): voidPrepare for shutdown (disables debugger pausing, etc.).
Upstream C++:
v8_inspector::V8InspectorSession::stop -
triggerPreciseCoverageDeltaUpdate(occasion: string): voidBinds 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): ValueBinds 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(): V8StackTraceSafe to pass between threads, drops async chain.
Upstream C++:
v8_inspector::V8StackTrace::clone -
isEmpty(): booleanBinds upstream V8 C++
v8_inspector::V8StackTrace::isEmpty. -
topColumnNumber(): numberBinds upstream V8 C++
v8_inspector::V8StackTrace::topColumnNumber. -
topLineNumber(): numberBinds upstream V8 C++
v8_inspector::V8StackTrace::topLineNumber. -
topScriptId(): numberBinds upstream V8 C++
v8_inspector::V8StackTrace::topScriptId. -
toString(): StringBufferBinds 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(): booleanBinds upstream V8 C++
v8_inspector::V8StackTraceId::IsInvalid. -
toString(): StringBufferBinds upstream V8 C++
v8_inspector::V8StackTraceId::ToString.
V8URLBreakpoint
class V8URLBreakpoint extends WasmHandle
Upstream V8 C++ struct v8_inspector::V8URLBreakpoint (v8-inspector.h).