src: name EmbededderGraph edges and use class names for nodes
This patch:
- Refactors the
MemoryRetainer
API so that the impementer no longer callsTrackThis()
that sets the size of node on the top of the stack, which may be hard to understand. Instead they implementsSelfSize()
to provide their self sizes. Also documents the API in the header. - Refactors
MemoryTracker
so it callsMemoryInfoName()
andSelfSize()
ofMemoryRetainer
to retrieve info about them, and separatenode_names
andedge_names
so the edges can be properly named with reference names and the nodes can be named with class names. (Previously the nodes are named with reference names while the edges are all indexed and appear as array elements). - Adds
SET_MEMORY_INFO_NAME()
,SET_SELF_SIZE()
andSET_NO_MEMORY_INFO()
convenience macros - Fixes a few
MemoryInfo
calls in someMemoryRetainers
to track their references properly. - Refactors the heapdump tests to check both node names and edge names,
distinguishing between wrapped JS nodes (without prefixes)
and embedder wrappers (prefixed with
Node /
).
Comparison in Chrome DevTools
Node / Http2Session
Before:
After:
Node / FileHandleReadWrap
Before:
After:
Node / JSBindingConnection
Before:
After:
Checklist
-
make -j4 test
(UNIX), orvcbuild test
(Windows) passes -
tests and/or benchmarks are included -
documentation is changed or added -
commit message follows commit guidelines