From c404473df4c0ecd3eb6e42c58e4ac6169e8a9884 Mon Sep 17 00:00:00 2001 From: Liang Gong Date: Tue, 5 Dec 2023 17:07:12 -0800 Subject: [PATCH] feat(core): more heap API to query with heap object ids Summary: This diff adds more APIs to query the heap based on heap object ids. Reviewed By: tulga1970 Differential Revision: D51866934 fbshipit-source-id: 1568d35838b21a0a2158cf26a66f427d219e29b7 --- packages/core/src/lib/Types.ts | 52 ++++++++++++++ .../core/src/lib/heap-data/HeapSnapshot.ts | 25 +++++++ .../docs/api/interfaces/core_src.IHeapEdge.md | 18 ++--- .../api/interfaces/core_src.IHeapEdges.md | 6 +- .../api/interfaces/core_src.IHeapLocation.md | 12 ++-- .../docs/api/interfaces/core_src.IHeapNode.md | 64 ++++++++--------- .../api/interfaces/core_src.IHeapNodes.md | 6 +- .../api/interfaces/core_src.IHeapSnapshot.md | 72 +++++++++++++++++-- .../interfaces/core_src.IHeapStringNode.md | 66 ++++++++--------- website/docs/api/modules/core_src.md | 2 +- 10 files changed, 232 insertions(+), 91 deletions(-) diff --git a/packages/core/src/lib/Types.ts b/packages/core/src/lib/Types.ts index d012777bb..3b31a1200 100644 --- a/packages/core/src/lib/Types.ts +++ b/packages/core/src/lib/Types.ts @@ -1158,6 +1158,58 @@ export interface IHeapSnapshot { * ``` */ getNodeById(id: number): Nullable; + /** + * Given an array of ids of heap nodes (JS objects in heap), use this API + * to get an array of those heap nodes. + * @param ids id array of the heap nodes (JS objects in heap) you + * would like to query + * @returns an array of those heap nodes. The return array will preserve the + * order of the input array. If an id is not found in the heap, the + * corresponding element in the return array will be `null`. + * + * * **Examples**: + * ```typescript + * import type {IHeapSnapshot} from '@memlab/core'; + * import {dumpNodeHeapSnapshot} from '@memlab/core'; + * import {getFullHeapFromFile} from '@memlab/heap-analysis'; + * + * (async function () { + * const heapFile = dumpNodeHeapSnapshot(); + * const heap: IHeapSnapshot = await getFullHeapFromFile(heapFile); + * + * // suppose 1000 is not a valid id in the heap + * const nodes = heap.getNodesByIds([1, 2, 1000, 3]); + * nodes // should be [node1, node2, null, node3] + * })(); + * ``` + */ + getNodesByIds(ids: number[]): Array>; + /** + * Given a set of ids of heap nodes (JS objects in heap), use this API + * to get a set of those heap nodes. + * @param ids id set of the heap nodes (JS objects in heap) you + * would like to query + * @returns a set of those heap nodes. The set will only include + * nodes that are found in the heap. If none of the input ids are found, + * this API will return an empty set. + * + * * **Examples**: + * ```typescript + * import type {IHeapSnapshot} from '@memlab/core'; + * import {dumpNodeHeapSnapshot} from '@memlab/core'; + * import {getFullHeapFromFile} from '@memlab/heap-analysis'; + * + * (async function () { + * const heapFile = dumpNodeHeapSnapshot(); + * const heap: IHeapSnapshot = await getFullHeapFromFile(heapFile); + * + * // suppose 1000 is not a valid id in the heap + * const set = heap.getNodesByIdSet(new Set([1, 2, 1000, 3])); + * set // should be Set([node1, node2, node3]) + * })(); + * ``` + */ + getNodesByIdSet(ids: Set): Set; /** * Search for the heap and check if there is any JS object instance with * a specified constructor name. diff --git a/packages/core/src/lib/heap-data/HeapSnapshot.ts b/packages/core/src/lib/heap-data/HeapSnapshot.ts index 5aa5e1867..ded83bae7 100644 --- a/packages/core/src/lib/heap-data/HeapSnapshot.ts +++ b/packages/core/src/lib/heap-data/HeapSnapshot.ts @@ -212,6 +212,31 @@ export default class HeapSnapshot implements IHeapSnapshot { return new HeapNode(this, idx); } + getNodesByIds(ids: number[]): Array> { + const ret: Array> = []; + ids.forEach(id => { + if (!(id in this._nodeId2NodeIdx)) { + ret.push(null); + return; + } + const idx = this._nodeId2NodeIdx[id]; + ret.push(new HeapNode(this, idx)); + }); + return ret; + } + + getNodesByIdSet(ids: Set): Set { + const ret = new Set(); + ids.forEach(id => { + if (!(id in this._nodeId2NodeIdx)) { + return; + } + const idx = this._nodeId2NodeIdx[id]; + ret.add(new HeapNode(this, idx)); + }); + return ret; + } + clearShortestPathInfo(): void { this._nodeIdxHasPathEdge = new Uint8Array(this._nodeCount); } diff --git a/website/docs/api/interfaces/core_src.IHeapEdge.md b/website/docs/api/interfaces/core_src.IHeapEdge.md index 0331861ea..bc056ec12 100644 --- a/website/docs/api/interfaces/core_src.IHeapEdge.md +++ b/website/docs/api/interfaces/core_src.IHeapEdge.md @@ -45,7 +45,7 @@ import {getFullHeapFromFile} from '@memlab/heap-analysis'; index of this JS reference inside the `edge.snapshot.edges` pseudo array * **Source**: - * core/src/lib/Types.ts:1411 + * core/src/lib/Types.ts:1463 ___ @@ -55,7 +55,7 @@ returns an [IHeapNode](core_src.IHeapNode.md) instance representing the hosting JS heap object where this reference starts * **Source**: - * core/src/lib/Types.ts:1432 + * core/src/lib/Types.ts:1484 ___ @@ -67,7 +67,7 @@ otherwise this is a reference with a string name (`edge.name_or_index` will return a string) * **Source**: - * core/src/lib/Types.ts:1418 + * core/src/lib/Types.ts:1470 ___ @@ -77,7 +77,7 @@ name of the JS reference. If this is a reference to an array element or internal table element, it is an numeric index * **Source**: - * core/src/lib/Types.ts:1367 + * core/src/lib/Types.ts:1419 ___ @@ -86,7 +86,7 @@ ___ get the [IHeapSnapshot](core_src.IHeapSnapshot.md) containing this JS reference * **Source**: - * core/src/lib/Types.ts:1407 + * core/src/lib/Types.ts:1459 ___ @@ -96,7 +96,7 @@ returns an [IHeapNode](core_src.IHeapNode.md) instance representing the JS heap pointed to by this reference * **Source**: - * core/src/lib/Types.ts:1427 + * core/src/lib/Types.ts:1479 ___ @@ -105,7 +105,7 @@ ___ the index of the JS heap object pointed to by this reference * **Source**: - * core/src/lib/Types.ts:1422 + * core/src/lib/Types.ts:1474 ___ @@ -115,7 +115,7 @@ type of the JS reference, all types: `context`, `element`, `property`, `internal`, `hidden`, `shortcut`, `weak` * **Source**: - * core/src/lib/Types.ts:1372 + * core/src/lib/Types.ts:1424 ## Methods @@ -133,4 +133,4 @@ captured by the hosting object. * `...args`: `any`[] * **Returns**: `string` * **Source**: - * core/src/lib/Types.ts:1442 + * core/src/lib/Types.ts:1494 diff --git a/website/docs/api/interfaces/core_src.IHeapEdges.md b/website/docs/api/interfaces/core_src.IHeapEdges.md index 43c52fc1a..9fba3c6b3 100644 --- a/website/docs/api/interfaces/core_src.IHeapEdges.md +++ b/website/docs/api/interfaces/core_src.IHeapEdges.md @@ -41,7 +41,7 @@ The total number of edges in heap graph (or JS references in heap snapshot). * **Source**: - * core/src/lib/Types.ts:1479 + * core/src/lib/Types.ts:1531 ## Methods @@ -54,7 +54,7 @@ to each element in ascending order of element index. * `callback`: (`edge`: [`IHeapEdge`](core_src.IHeapEdge.md), `index`: `number`) => `boolean` \| `void` | the callback does not need to return any value, if the callback returns `false` when iterating on element at index `i`, then all elements after `i` won't be iterated. * **Returns**: `void` * **Source**: - * core/src/lib/Types.ts:1495 + * core/src/lib/Types.ts:1547 ___ @@ -68,4 +68,4 @@ get an [IHeapEdge](core_src.IHeapEdge.md) element at the specified index at the specified index, otherwise it returns `null`. * **Source**: - * core/src/lib/Types.ts:1487 + * core/src/lib/Types.ts:1539 diff --git a/website/docs/api/interfaces/core_src.IHeapLocation.md b/website/docs/api/interfaces/core_src.IHeapLocation.md index a1717bb05..6173c237f 100644 --- a/website/docs/api/interfaces/core_src.IHeapLocation.md +++ b/website/docs/api/interfaces/core_src.IHeapLocation.md @@ -43,7 +43,7 @@ import {getFullHeapFromFile} from '@memlab/heap-analysis'; get the column number * **Source**: - * core/src/lib/Types.ts:1348 + * core/src/lib/Types.ts:1400 ___ @@ -52,7 +52,7 @@ ___ get the line number * **Source**: - * core/src/lib/Types.ts:1344 + * core/src/lib/Types.ts:1396 ___ @@ -61,7 +61,7 @@ ___ get the heap object this location this location represents * **Source**: - * core/src/lib/Types.ts:1336 + * core/src/lib/Types.ts:1388 ___ @@ -70,7 +70,7 @@ ___ get the script ID of the source file * **Source**: - * core/src/lib/Types.ts:1340 + * core/src/lib/Types.ts:1392 ___ @@ -79,7 +79,7 @@ ___ get the [IHeapSnapshot](core_src.IHeapSnapshot.md) containing this location instance * **Source**: - * core/src/lib/Types.ts:1332 + * core/src/lib/Types.ts:1384 ## Methods @@ -97,4 +97,4 @@ captured by the hosting object. * `...args`: `any`[] * **Returns**: `string` * **Source**: - * core/src/lib/Types.ts:1358 + * core/src/lib/Types.ts:1410 diff --git a/website/docs/api/interfaces/core_src.IHeapNode.md b/website/docs/api/interfaces/core_src.IHeapNode.md index f458515de..e41d194d5 100644 --- a/website/docs/api/interfaces/core_src.IHeapNode.md +++ b/website/docs/api/interfaces/core_src.IHeapNode.md @@ -52,7 +52,7 @@ For more information on what a dominator node is, please check out [this doc](https://developer.chrome.com/docs/devtools/memory-problems/memory-101/#dominators). * **Source**: - * core/src/lib/Types.ts:1636 + * core/src/lib/Types.ts:1688 ___ @@ -62,7 +62,7 @@ The total number of outgoing JS references (including engine-internal, native, and JS references). * **Source**: - * core/src/lib/Types.ts:1590 + * core/src/lib/Types.ts:1642 ___ @@ -72,7 +72,7 @@ returns true if the heap node has been set an incoming edge which leads to the parent node on the shortest path to GC root. * **Source**: - * core/src/lib/Types.ts:1612 + * core/src/lib/Types.ts:1664 ___ @@ -81,7 +81,7 @@ ___ unique id of the heap object * **Source**: - * core/src/lib/Types.ts:1517 + * core/src/lib/Types.ts:1569 ___ @@ -91,7 +91,7 @@ check if this a string node (normal string node, concatenated string node or sliced string node) * **Source**: - * core/src/lib/Types.ts:1648 + * core/src/lib/Types.ts:1700 ___ @@ -104,7 +104,7 @@ from the React Fiber tree, `is_detached` will be `true`; otherwise it will be `false` * **Source**: - * core/src/lib/Types.ts:1572 + * core/src/lib/Types.ts:1624 ___ @@ -114,7 +114,7 @@ source location information of this heap object (if it is recorded by the heap snapshot). * **Source**: - * core/src/lib/Types.ts:1641 + * core/src/lib/Types.ts:1693 ___ @@ -125,7 +125,7 @@ for JS object instances (type `object`), `name` is the constructor's name of the object instance. for `string`, `name` is the string value. * **Source**: - * core/src/lib/Types.ts:1513 + * core/src/lib/Types.ts:1565 ___ @@ -134,7 +134,7 @@ ___ index of this heap object inside the `node.snapshot.nodes` pseudo array * **Source**: - * core/src/lib/Types.ts:1621 + * core/src/lib/Types.ts:1673 ___ @@ -144,7 +144,7 @@ Get the number of all incoming references pointing to this heap object (including engine-internal, native, and JS references). * **Source**: - * core/src/lib/Types.ts:1607 + * core/src/lib/Types.ts:1659 ___ @@ -154,7 +154,7 @@ The incoming edge which leads to the parent node on the shortest path to GC root. * **Source**: - * core/src/lib/Types.ts:1617 + * core/src/lib/Types.ts:1669 ___ @@ -164,7 +164,7 @@ Get a JS array containing all outgoing JS references from this heap object (including engine-internal, native, and JS references). * **Source**: - * core/src/lib/Types.ts:1597 + * core/src/lib/Types.ts:1649 ___ @@ -174,7 +174,7 @@ Get a JS array containing all incoming JS references pointing to this heap object (including engine-internal, native, and JS references). * **Source**: - * core/src/lib/Types.ts:1602 + * core/src/lib/Types.ts:1654 ___ @@ -186,7 +186,7 @@ could be released if this object is released). For difference between [this doc](https://developer.chrome.com/docs/devtools/memory-problems/memory-101/#object_sizes). * **Source**: - * core/src/lib/Types.ts:1628 + * core/src/lib/Types.ts:1680 ___ @@ -198,7 +198,7 @@ by the object itself.). For difference between **shallow size** and [this doc](https://developer.chrome.com/docs/devtools/memory-problems/memory-101/#object_sizes). * **Source**: - * core/src/lib/Types.ts:1585 + * core/src/lib/Types.ts:1637 ___ @@ -207,7 +207,7 @@ ___ get the [IHeapSnapshot](core_src.IHeapSnapshot.md) containing this heap object * **Source**: - * core/src/lib/Types.ts:1564 + * core/src/lib/Types.ts:1616 ___ @@ -220,7 +220,7 @@ This is engine-specific, for example all types in V8: `symbol`, `bigint` * **Source**: - * core/src/lib/Types.ts:1507 + * core/src/lib/Types.ts:1559 ## Methods @@ -244,7 +244,7 @@ const reference = node.findAnyReference((edge: IHeapEdge) => { ``` * **Source**: - * core/src/lib/Types.ts:1717 + * core/src/lib/Types.ts:1769 ___ @@ -268,7 +268,7 @@ const referrer = node.findAnyReferrer((edge: IHeapEdge) => { ``` * **Source**: - * core/src/lib/Types.ts:1734 + * core/src/lib/Types.ts:1786 ___ @@ -293,7 +293,7 @@ const referrer = node.findAnyReferrerNode((node: IHeapNode) => { ``` * **Source**: - * core/src/lib/Types.ts:1752 + * core/src/lib/Types.ts:1804 ___ @@ -318,7 +318,7 @@ const referrerNodes = node.findReferrerNodes((node: IHeapNode) => { ``` * **Source**: - * core/src/lib/Types.ts:1787 + * core/src/lib/Types.ts:1839 ___ @@ -342,7 +342,7 @@ const referrers = node.findReferrers((edge: IHeapEdge) => { ``` * **Source**: - * core/src/lib/Types.ts:1769 + * core/src/lib/Types.ts:1821 ___ @@ -367,7 +367,7 @@ node.forEachReference((edge: IHeapEdge) => { ``` * **Source**: - * core/src/lib/Types.ts:1682 + * core/src/lib/Types.ts:1734 ___ @@ -392,7 +392,7 @@ node.forEachReferrer((edge: IHeapEdge) => { ``` * **Source**: - * core/src/lib/Types.ts:1700 + * core/src/lib/Types.ts:1752 ___ @@ -413,7 +413,7 @@ const reference = node.getAnyReferrer('ref', 'property'); ``` * **Source**: - * core/src/lib/Types.ts:1842 + * core/src/lib/Types.ts:1894 ___ @@ -439,7 +439,7 @@ const n2 = node.getAnyReferrer('ref', 'property')?.fromNode; ``` * **Source**: - * core/src/lib/Types.ts:1865 + * core/src/lib/Types.ts:1917 ___ @@ -460,7 +460,7 @@ const reference = node.getReference('map', 'hidden'); ``` * **Source**: - * core/src/lib/Types.ts:1802 + * core/src/lib/Types.ts:1854 ___ @@ -485,7 +485,7 @@ const hiddenClassNode2 = node.getReference('map', 'hidden')?.toNode; ``` * **Source**: - * core/src/lib/Types.ts:1824 + * core/src/lib/Types.ts:1876 ___ @@ -512,7 +512,7 @@ const nodes2 = node.getReferrers('ref', 'property') ``` * **Source**: - * core/src/lib/Types.ts:1905 + * core/src/lib/Types.ts:1957 ___ @@ -534,7 +534,7 @@ const referrers = node.getReferrers('ref', 'property'); ``` * **Source**: - * core/src/lib/Types.ts:1884 + * core/src/lib/Types.ts:1936 ___ @@ -552,7 +552,7 @@ captured by the hosting object. * `...args`: `any`[] * **Returns**: `string` * **Source**: - * core/src/lib/Types.ts:1664 + * core/src/lib/Types.ts:1716 ___ @@ -564,4 +564,4 @@ inside the string node. * **Returns**: [`Nullable`](../modules/core_src.md#nullable)<[`IHeapStringNode`](core_src.IHeapStringNode.md)\> * **Source**: - * core/src/lib/Types.ts:1654 + * core/src/lib/Types.ts:1706 diff --git a/website/docs/api/interfaces/core_src.IHeapNodes.md b/website/docs/api/interfaces/core_src.IHeapNodes.md index 497994ab4..66ff8d586 100644 --- a/website/docs/api/interfaces/core_src.IHeapNodes.md +++ b/website/docs/api/interfaces/core_src.IHeapNodes.md @@ -41,7 +41,7 @@ The total number of nodes in heap graph (or JS objects in heap snapshot). * **Source**: - * core/src/lib/Types.ts:1983 + * core/src/lib/Types.ts:2035 ## Methods @@ -54,7 +54,7 @@ to each element in ascending order of element index. * `callback`: (`node`: [`IHeapNode`](core_src.IHeapNode.md), `index`: `number`) => `boolean` \| `void` | the callback does not need to return any value, if the callback returns `false` when iterating on element at index `i`, then all elements after `i` won't be iterated. * **Returns**: `void` * **Source**: - * core/src/lib/Types.ts:1999 + * core/src/lib/Types.ts:2051 ___ @@ -68,4 +68,4 @@ get an [IHeapNode](core_src.IHeapNode.md) element at the specified index at the specified index, otherwise it returns `null`. * **Source**: - * core/src/lib/Types.ts:1991 + * core/src/lib/Types.ts:2043 diff --git a/website/docs/api/interfaces/core_src.IHeapSnapshot.md b/website/docs/api/interfaces/core_src.IHeapSnapshot.md index dda7e6662..d300bd0de 100644 --- a/website/docs/api/interfaces/core_src.IHeapSnapshot.md +++ b/website/docs/api/interfaces/core_src.IHeapSnapshot.md @@ -105,7 +105,7 @@ class TestObject { ``` * **Source**: - * core/src/lib/Types.ts:1227 + * core/src/lib/Types.ts:1279 ___ @@ -138,6 +138,70 @@ import {getFullHeapFromFile} from '@memlab/heap-analysis'; ___ +### **getNodesByIdSet**(`ids`) + +Given a set of ids of heap nodes (JS objects in heap), use this API +to get a set of those heap nodes. + + * **Parameters**: + * `ids`: `Set`<`number`\> | id set of the heap nodes (JS objects in heap) you would like to query + * **Returns**: `Set`<[`IHeapNode`](core_src.IHeapNode.md)\> | a set of those heap nodes. The set will only include +nodes that are found in the heap. If none of the input ids are found, +this API will return an empty set. + +* **Examples**: +```typescript +import type {IHeapSnapshot} from '@memlab/core'; +import {dumpNodeHeapSnapshot} from '@memlab/core'; +import {getFullHeapFromFile} from '@memlab/heap-analysis'; + +(async function () { + const heapFile = dumpNodeHeapSnapshot(); + const heap: IHeapSnapshot = await getFullHeapFromFile(heapFile); + + // suppose 1000 is not a valid id in the heap + const set = heap.getNodesByIdSet(new Set([1, 2, 1000, 3])); + set // should be Set([node1, node2, node3]) +})(); +``` + + * **Source**: + * core/src/lib/Types.ts:1212 + +___ + +### **getNodesByIds**(`ids`) + +Given an array of ids of heap nodes (JS objects in heap), use this API +to get an array of those heap nodes. + + * **Parameters**: + * `ids`: `number`[] | id array of the heap nodes (JS objects in heap) you would like to query + * **Returns**: [`Nullable`](../modules/core_src.md#nullable)<[`IHeapNode`](core_src.IHeapNode.md)\>[] | an array of those heap nodes. The return array will preserve the +order of the input array. If an id is not found in the heap, the +corresponding element in the return array will be `null`. + +* **Examples**: +```typescript +import type {IHeapSnapshot} from '@memlab/core'; +import {dumpNodeHeapSnapshot} from '@memlab/core'; +import {getFullHeapFromFile} from '@memlab/heap-analysis'; + +(async function () { + const heapFile = dumpNodeHeapSnapshot(); + const heap: IHeapSnapshot = await getFullHeapFromFile(heapFile); + + // suppose 1000 is not a valid id in the heap + const nodes = heap.getNodesByIds([1, 2, 1000, 3]); + nodes // should be [node1, node2, null, node3] +})(); +``` + + * **Source**: + * core/src/lib/Types.ts:1186 + +___ + ### **hasObjectWithClassName**(`className`) Search for the heap and check if there is any JS object instance with @@ -180,7 +244,7 @@ test('memory test with heap assertion', async () => { ``` * **Source**: - * core/src/lib/Types.ts:1199 + * core/src/lib/Types.ts:1251 ___ @@ -212,7 +276,7 @@ import {getFullHeapFromFile} from '@memlab/heap-analysis'; ``` * **Source**: - * core/src/lib/Types.ts:1253 + * core/src/lib/Types.ts:1305 ___ @@ -256,4 +320,4 @@ test('memory test', async () => { ``` * **Source**: - * core/src/lib/Types.ts:1291 + * core/src/lib/Types.ts:1343 diff --git a/website/docs/api/interfaces/core_src.IHeapStringNode.md b/website/docs/api/interfaces/core_src.IHeapStringNode.md index c73fffede..6da8b4f21 100644 --- a/website/docs/api/interfaces/core_src.IHeapStringNode.md +++ b/website/docs/api/interfaces/core_src.IHeapStringNode.md @@ -51,7 +51,7 @@ For more information on what a dominator node is, please check out [this doc](https://developer.chrome.com/docs/devtools/memory-problems/memory-101/#dominators). * **Source**: - * core/src/lib/Types.ts:1636 + * core/src/lib/Types.ts:1688 ___ @@ -61,7 +61,7 @@ The total number of outgoing JS references (including engine-internal, native, and JS references). * **Source**: - * core/src/lib/Types.ts:1590 + * core/src/lib/Types.ts:1642 ___ @@ -71,7 +71,7 @@ returns true if the heap node has been set an incoming edge which leads to the parent node on the shortest path to GC root. * **Source**: - * core/src/lib/Types.ts:1612 + * core/src/lib/Types.ts:1664 ___ @@ -80,7 +80,7 @@ ___ unique id of the heap object * **Source**: - * core/src/lib/Types.ts:1517 + * core/src/lib/Types.ts:1569 ___ @@ -90,7 +90,7 @@ check if this a string node (normal string node, concatenated string node or sliced string node) * **Source**: - * core/src/lib/Types.ts:1648 + * core/src/lib/Types.ts:1700 ___ @@ -103,7 +103,7 @@ from the React Fiber tree, `is_detached` will be `true`; otherwise it will be `false` * **Source**: - * core/src/lib/Types.ts:1572 + * core/src/lib/Types.ts:1624 ___ @@ -113,7 +113,7 @@ source location information of this heap object (if it is recorded by the heap snapshot). * **Source**: - * core/src/lib/Types.ts:1641 + * core/src/lib/Types.ts:1693 ___ @@ -124,7 +124,7 @@ for JS object instances (type `object`), `name` is the constructor's name of the object instance. for `string`, `name` is the string value. * **Source**: - * core/src/lib/Types.ts:1513 + * core/src/lib/Types.ts:1565 ___ @@ -133,7 +133,7 @@ ___ index of this heap object inside the `node.snapshot.nodes` pseudo array * **Source**: - * core/src/lib/Types.ts:1621 + * core/src/lib/Types.ts:1673 ___ @@ -143,7 +143,7 @@ Get the number of all incoming references pointing to this heap object (including engine-internal, native, and JS references). * **Source**: - * core/src/lib/Types.ts:1607 + * core/src/lib/Types.ts:1659 ___ @@ -153,7 +153,7 @@ The incoming edge which leads to the parent node on the shortest path to GC root. * **Source**: - * core/src/lib/Types.ts:1617 + * core/src/lib/Types.ts:1669 ___ @@ -163,7 +163,7 @@ Get a JS array containing all outgoing JS references from this heap object (including engine-internal, native, and JS references). * **Source**: - * core/src/lib/Types.ts:1597 + * core/src/lib/Types.ts:1649 ___ @@ -173,7 +173,7 @@ Get a JS array containing all incoming JS references pointing to this heap object (including engine-internal, native, and JS references). * **Source**: - * core/src/lib/Types.ts:1602 + * core/src/lib/Types.ts:1654 ___ @@ -185,7 +185,7 @@ could be released if this object is released). For difference between [this doc](https://developer.chrome.com/docs/devtools/memory-problems/memory-101/#object_sizes). * **Source**: - * core/src/lib/Types.ts:1628 + * core/src/lib/Types.ts:1680 ___ @@ -197,7 +197,7 @@ by the object itself.). For difference between **shallow size** and [this doc](https://developer.chrome.com/docs/devtools/memory-problems/memory-101/#object_sizes). * **Source**: - * core/src/lib/Types.ts:1585 + * core/src/lib/Types.ts:1637 ___ @@ -206,7 +206,7 @@ ___ get the [IHeapSnapshot](core_src.IHeapSnapshot.md) containing this heap object * **Source**: - * core/src/lib/Types.ts:1564 + * core/src/lib/Types.ts:1616 ___ @@ -216,7 +216,7 @@ get the string value of the JS string heap object associated with this `IHeapStringNode` instance in heap * **Source**: - * core/src/lib/Types.ts:1946 + * core/src/lib/Types.ts:1998 ___ @@ -229,7 +229,7 @@ This is engine-specific, for example all types in V8: `symbol`, `bigint` * **Source**: - * core/src/lib/Types.ts:1507 + * core/src/lib/Types.ts:1559 ## Methods @@ -253,7 +253,7 @@ const reference = node.findAnyReference((edge: IHeapEdge) => { ``` * **Source**: - * core/src/lib/Types.ts:1717 + * core/src/lib/Types.ts:1769 ___ @@ -277,7 +277,7 @@ const referrer = node.findAnyReferrer((edge: IHeapEdge) => { ``` * **Source**: - * core/src/lib/Types.ts:1734 + * core/src/lib/Types.ts:1786 ___ @@ -302,7 +302,7 @@ const referrer = node.findAnyReferrerNode((node: IHeapNode) => { ``` * **Source**: - * core/src/lib/Types.ts:1752 + * core/src/lib/Types.ts:1804 ___ @@ -327,7 +327,7 @@ const referrerNodes = node.findReferrerNodes((node: IHeapNode) => { ``` * **Source**: - * core/src/lib/Types.ts:1787 + * core/src/lib/Types.ts:1839 ___ @@ -351,7 +351,7 @@ const referrers = node.findReferrers((edge: IHeapEdge) => { ``` * **Source**: - * core/src/lib/Types.ts:1769 + * core/src/lib/Types.ts:1821 ___ @@ -376,7 +376,7 @@ node.forEachReference((edge: IHeapEdge) => { ``` * **Source**: - * core/src/lib/Types.ts:1682 + * core/src/lib/Types.ts:1734 ___ @@ -401,7 +401,7 @@ node.forEachReferrer((edge: IHeapEdge) => { ``` * **Source**: - * core/src/lib/Types.ts:1700 + * core/src/lib/Types.ts:1752 ___ @@ -422,7 +422,7 @@ const reference = node.getAnyReferrer('ref', 'property'); ``` * **Source**: - * core/src/lib/Types.ts:1842 + * core/src/lib/Types.ts:1894 ___ @@ -448,7 +448,7 @@ const n2 = node.getAnyReferrer('ref', 'property')?.fromNode; ``` * **Source**: - * core/src/lib/Types.ts:1865 + * core/src/lib/Types.ts:1917 ___ @@ -469,7 +469,7 @@ const reference = node.getReference('map', 'hidden'); ``` * **Source**: - * core/src/lib/Types.ts:1802 + * core/src/lib/Types.ts:1854 ___ @@ -494,7 +494,7 @@ const hiddenClassNode2 = node.getReference('map', 'hidden')?.toNode; ``` * **Source**: - * core/src/lib/Types.ts:1824 + * core/src/lib/Types.ts:1876 ___ @@ -521,7 +521,7 @@ const nodes2 = node.getReferrers('ref', 'property') ``` * **Source**: - * core/src/lib/Types.ts:1905 + * core/src/lib/Types.ts:1957 ___ @@ -543,7 +543,7 @@ const referrers = node.getReferrers('ref', 'property'); ``` * **Source**: - * core/src/lib/Types.ts:1884 + * core/src/lib/Types.ts:1936 ___ @@ -561,7 +561,7 @@ captured by the hosting object. * `...args`: `any`[] * **Returns**: `string` * **Source**: - * core/src/lib/Types.ts:1664 + * core/src/lib/Types.ts:1716 ___ @@ -573,4 +573,4 @@ inside the string node. * **Returns**: [`Nullable`](../modules/core_src.md#nullable)<[`IHeapStringNode`](core_src.IHeapStringNode.md)\> * **Source**: - * core/src/lib/Types.ts:1654 + * core/src/lib/Types.ts:1706 diff --git a/website/docs/api/modules/core_src.md b/website/docs/api/modules/core_src.md index fceb61f2d..39478da59 100644 --- a/website/docs/api/modules/core_src.md +++ b/website/docs/api/modules/core_src.md @@ -86,7 +86,7 @@ or [forEachReferrer](../interfaces/core_src.IHeapNode.md#foreachreferrer). * **Returns**: [`Optional`](core_src.md#optional)<{ `stop`: `boolean` }\> \| `void` | this API returns void * **Source**: - * core/src/lib/Types.ts:1527 + * core/src/lib/Types.ts:1579 ___