V8 API Reference, 7.2.502.16 (for Deno 0.2.4)
|
#include <v8-profiler.h>
Public Types | |
enum | SerializationFormat { kJSON = 0 } |
Public Member Functions | |
const HeapGraphNode * | GetRoot () const |
const HeapGraphNode * | GetNodeById (SnapshotObjectId id) const |
int | GetNodesCount () const |
const HeapGraphNode * | GetNode (int index) const |
SnapshotObjectId | GetMaxSnapshotJSObjectId () const |
void | Delete () |
void | Serialize (OutputStream *stream, SerializationFormat format=kJSON) const |
HeapSnapshots record the state of the JS heap at some moment.
Definition at line 479 of file v8-profiler.h.
void v8::HeapSnapshot::Delete | ( | ) |
Deletes the snapshot and removes it from HeapProfiler's list. All pointers to nodes, edges and paths previously returned become invalid.
SnapshotObjectId v8::HeapSnapshot::GetMaxSnapshotJSObjectId | ( | ) | const |
const HeapGraphNode * v8::HeapSnapshot::GetNode | ( | int | index | ) | const |
const HeapGraphNode * v8::HeapSnapshot::GetNodeById | ( | SnapshotObjectId | id | ) | const |
int v8::HeapSnapshot::GetNodesCount | ( | ) | const |
const HeapGraphNode * v8::HeapSnapshot::GetRoot | ( | ) | const |
void v8::HeapSnapshot::Serialize | ( | OutputStream * | stream, |
HeapSnapshot::SerializationFormat | format = kJSON |
||
) | const |
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.