2018-09-13 23:04:55 +03:00
|
|
|
/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
2015-05-28 17:37:42 +03:00
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
|
|
|
|
* You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
|
|
|
* A HeapSnapshot represents a snapshot of the heap graph
|
|
|
|
*/
|
2018-10-21 03:02:53 +03:00
|
|
|
[ChromeOnly, Exposed=(Window,Worker)]
|
2015-05-28 17:37:42 +03:00
|
|
|
interface HeapSnapshot {
|
2015-10-20 08:25:49 +03:00
|
|
|
/**
|
|
|
|
* A time stamp of when the heap snapshot was taken, if available. Units are
|
|
|
|
* microseconds since midnight (00:00:00) 1 January 1970 UTC.
|
|
|
|
*/
|
|
|
|
readonly attribute unsigned long long? creationTime;
|
|
|
|
|
2015-08-26 21:38:05 +03:00
|
|
|
/**
|
|
|
|
* Take a census of the heap snapshot.
|
|
|
|
*
|
|
|
|
* This is the same as |Debugger.Memory.prototype.takeCensus|, but operates on
|
|
|
|
* the offline heap snapshot's serialized heap graph rather than the live heap
|
|
|
|
* graph. The same optional configuration options that can be passed to that
|
|
|
|
* function can be passed here.
|
|
|
|
*
|
|
|
|
* The returned value is determined by the `"breakdown"` option used, and is
|
|
|
|
* usually a `Map`, `Object`, or `Array`. For example, the following breakdown
|
|
|
|
*
|
|
|
|
* {
|
|
|
|
* by: "coarseType",
|
|
|
|
* objects: { by: "objectClass" },
|
|
|
|
* other: { by: "internalType" }
|
|
|
|
* }
|
|
|
|
*
|
|
|
|
* produces a result like this:
|
|
|
|
*
|
|
|
|
* {
|
|
|
|
* "objects": {
|
|
|
|
* "Function": { "count": 404, "bytes": 37328 },
|
|
|
|
* "Object": { "count": 11, "bytes": 1264 },
|
|
|
|
* "Debugger": { "count": 1, "bytes": 416 },
|
|
|
|
* "ScriptSource": { "count": 1, "bytes": 64 },
|
|
|
|
* // ... omitted for brevity...
|
|
|
|
* },
|
|
|
|
* "scripts": { "count": 1, "bytes": 0 },
|
|
|
|
* "strings": { "count": 701, "bytes": 49080 },
|
|
|
|
* "other": {
|
|
|
|
* "js::Shape": { "count": 450, "bytes": 0 },
|
|
|
|
* "js::BaseShape": { "count": 21, "bytes": 0 },
|
|
|
|
* "js::ObjectGroup": { "count": 17, "bytes": 0 }
|
|
|
|
* }
|
|
|
|
* }
|
|
|
|
*
|
|
|
|
* See the `takeCensus` section of the `js/src/doc/Debugger/Debugger.Memory.md`
|
|
|
|
* file for detailed documentation.
|
|
|
|
*/
|
|
|
|
[Throws]
|
|
|
|
any takeCensus(object? options);
|
2015-11-19 01:12:23 +03:00
|
|
|
|
2015-12-18 23:05:14 +03:00
|
|
|
/**
|
|
|
|
* Describe `node` with the specified `breakdown`. See the comment above
|
|
|
|
* `takeCensus` or `js/src/doc/Debugger/Debugger.Memory.md` for detailed
|
|
|
|
* documentation on breakdowns.
|
|
|
|
*
|
|
|
|
* Throws an error when `node` is not the id of a node in the heap snapshot,
|
|
|
|
* or if the breakdown is invalid.
|
|
|
|
*/
|
|
|
|
[Throws]
|
|
|
|
any describeNode(object breakdown, NodeId node);
|
|
|
|
|
2015-11-19 01:12:23 +03:00
|
|
|
/**
|
|
|
|
* Compute the dominator tree for this heap snapshot.
|
|
|
|
*
|
|
|
|
* @see DominatorTree.webidl
|
|
|
|
*/
|
|
|
|
[Throws]
|
|
|
|
DominatorTree computeDominatorTree();
|
2016-02-11 16:32:00 +03:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Find the shortest retaining paths from the node associated with the ID
|
|
|
|
* `start` to each node associated with the IDs in `targets`. Find at most
|
|
|
|
* `maxNumPaths` retaining paths for each target node.
|
|
|
|
*
|
|
|
|
* The return value is a Map object mapping from each target node ID to an
|
|
|
|
* array of retaining paths. The array may be empty if we did not find any
|
|
|
|
* retaining paths.
|
|
|
|
*
|
|
|
|
* A path is an array of objects of the form:
|
|
|
|
*
|
|
|
|
* {
|
|
|
|
* predecessor: <node ID>,
|
|
|
|
* edge: <string or null>,
|
|
|
|
* }
|
|
|
|
*
|
|
|
|
* The first `predecessor` will always be `start`. The last edge in the path
|
|
|
|
* leads to the `target` node that is mapped to the path; the `target` does
|
|
|
|
* not appear as a `predecessor` in the path.
|
|
|
|
*
|
|
|
|
* Throws when `start` or any of the elements of `targets` are not an ID of a
|
|
|
|
* node in the snapshot, or if we encounter an out of memory exception.
|
|
|
|
*/
|
|
|
|
[Throws]
|
|
|
|
object computeShortestPaths(NodeId start, sequence<NodeId> targets,
|
|
|
|
unsigned long long maxNumPaths);
|
2015-05-28 17:37:42 +03:00
|
|
|
};
|