When a JSContext is created with a non-null globalObjectClass passed to JSGlobalContextCreateInGroup, that root object is created as an instance of CallbackGlobalObject and not GlobalObject. The Object graph view only searches for objects that are instances of GlobalObject in the JSContext case so nothing gets populated in this case.
Created attachment 403723 [details] patch
Comment on attachment 403723 [details] patch View in context: https://bugs.webkit.org/attachment.cgi?id=403723&action=review > Source/WebInspectorUI/UserInterface/Views/HeapSnapshotDataGridTree.js:271 > + this.heapSnapshot.instancesWithClassName("CallbackGlobalObject", (instances) => { While this is fine, it would be nice to show all roots rather than just a specific few, as these roots may change in the future :) I believe we could expose a way to iterate `heapSnapshot._nodeOrdinalIsGCRoot`, calling `HeapSnapshot.prototype.serializeNode` on each.
Comment on attachment 403723 [details] patch View in context: https://bugs.webkit.org/attachment.cgi?id=403723&action=review >> Source/WebInspectorUI/UserInterface/Views/HeapSnapshotDataGridTree.js:271 >> + this.heapSnapshot.instancesWithClassName("CallbackGlobalObject", (instances) => { > > While this is fine, it would be nice to show all roots rather than just a specific few, as these roots may change in the future :) > > I believe we could expose a way to iterate `heapSnapshot._nodeOrdinalIsGCRoot`, calling `HeapSnapshot.prototype.serializeNode` on each. this can be done as a FIXME followup bug, or behind a `WI.Setting` btw :)
(In reply to Devin Rousso from comment #3) > Comment on attachment 403723 [details] > patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=403723&action=review > > >> Source/WebInspectorUI/UserInterface/Views/HeapSnapshotDataGridTree.js:271 > >> + this.heapSnapshot.instancesWithClassName("CallbackGlobalObject", (instances) => { > > > > While this is fine, it would be nice to show all roots rather than just a specific few, as these roots may change in the future :) > > > > I believe we could expose a way to iterate `heapSnapshot._nodeOrdinalIsGCRoot`, calling `HeapSnapshot.prototype.serializeNode` on each. > > this can be done as a FIXME followup bug, or behind a `WI.Setting` btw :) Yeah that would be good to have. I created a followup bug https://webkit.org/b/214092 and will point a FIXME to it when landing.
Created attachment 403798 [details] Patch for landing
Committed r264124: <https://trac.webkit.org/changeset/264124> All reviewed patches have been landed. Closing bug and clearing flags on attachment 403798 [details].
<rdar://problem/65234451>