HeapSnapshot.js can be split into a generic heap graph representation which can be reused for native heap and a JavaScript-specific part.
Created attachment 180747 [details] Patch
Comment on attachment 180747 [details] Patch lgtm with nits
Comment on attachment 180747 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=180747&action=review > Source/WebCore/inspector/front-end/HeapSnapshot.js:746 > + var node = this.createNode(0); please remove 0 > Source/WebCore/inspector/front-end/HeapSnapshot.js:892 > + var node = this.createNode(rootNodeIndex); rootNode() > LayoutTests/inspector/profiler/heap-snapshot.html:14 > + var nodeRoot = snapshot.createNode(snapshot._rootNodeIndex); rootNode > LayoutTests/inspector/profiler/heap-snapshot.html:28 > + var nodeRoot = snapshot.createNode(snapshot._rootNodeIndex); ditto
(In reply to comment #3) > (From update of attachment 180747 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=180747&action=review > > > Source/WebCore/inspector/front-end/HeapSnapshot.js:746 > > + var node = this.createNode(0); > > please remove 0 > Done. > > Source/WebCore/inspector/front-end/HeapSnapshot.js:892 > > + var node = this.createNode(rootNodeIndex); > > rootNode() > I'd leave in the current state as we put rootNodeIndex into the array in the next line. > > LayoutTests/inspector/profiler/heap-snapshot.html:14 > > + var nodeRoot = snapshot.createNode(snapshot._rootNodeIndex); > > rootNode > There is no such method on the mock. > > LayoutTests/inspector/profiler/heap-snapshot.html:28 > > + var nodeRoot = snapshot.createNode(snapshot._rootNodeIndex); > > ditto There is no such method on the mock.
Committed r138477: <http://trac.webkit.org/changeset/138477>