haikuwebkit/LayoutTests/inspector/unit-tests/heap-snapshot-expected.txt

46 lines
1.7 KiB
Plaintext
Raw Permalink Normal View History

Web Inspector: HeapSnapshots are slow and use too much memory https://bugs.webkit.org/show_bug.cgi?id=155571 Reviewed by Timothy Hatcher. Source/WebInspectorUI: This is the first inclusion of Workers into Web Inspector. In this case the Main side merely needs to make requests of the Worker and get back objects that it can interact with more. New file heirarchies: UserInterface/Proxies - new Proxy classes in the Main page. - treat like Model classes, but not quite model. UserInterface/Workers/HeapSnapshotWorker - new Worker classes for Workers. No WebInspector namespace. - no minification of these resources, they are simply copied. Remote procedure call interface between the Main/Worker page happens through the WorkerProxy and Worker classes. There are simple ways to perform factory style methods and call methods on objects, and get the result in a callback. Similiar to frontend <-> backend agent communication: HeapSnapshotWorkerProxy: (Main world) - creates the worker - performAction("actionName", arguments, callback) - callMethod(objectId, "methodName", arguments, callback) - handle message => dispatch event or invoke callback HeapSnapshotWorker: (Worker world) - sendEvent("eventName", eventData) - handle message => dispatch action or method on object Proxy object methods are boilerplate calls to performAction/callMethod with deserialization of responses. The rest of the frontend can just treat Proxy objects as Model objects with some data and async methods. Because the Node/Edge data is so small, objects are cheaply created when needed and not cached. This means that there may be duplicate HeapSnapshotNode's for the same node. For example if different Views both request instancesWithClassName("Foo"). This is fine, as none of our Views really care about object uniqueness, they are only interested in the data or querying for more data. * Scripts/combine-resources.pl: * Scripts/copy-user-interface-resources.pl: Copy the Workers directory to the resources directory. Its code is only meant to be loaded by Workers, so it shouldn't be included in the Main page. * UserInterface/Main.html: * UserInterface/Test.html: * UserInterface/Models/HeapSnapshot.js: Removed. * UserInterface/Models/HeapSnapshotDiff.js: Removed. * UserInterface/Models/HeapSnapshotEdge.js: Removed. * UserInterface/Models/HeapSnapshotNode.js: Removed. Replace the old simple Model classes with Proxy classes that interact with the Worker. * UserInterface/Models/HeapAllocationsInstrument.js: (WebInspector.HeapAllocationsInstrument.prototype._takeHeapSnapshot): (WebInspector.HeapAllocationsInstrument): * UserInterface/Models/HeapAllocationsTimelineRecord.js: (WebInspector.HeapAllocationsTimelineRecord): * UserInterface/Models/HeapSnapshotRootPath.js: (WebInspector.HeapSnapshotRootPath): (WebInspector.HeapSnapshotRootPath.prototype.appendEdge): * UserInterface/Protocol/HeapObserver.js: (WebInspector.HeapObserver.prototype.trackingStart): (WebInspector.HeapObserver.prototype.trackingComplete): * UserInterface/Views/ContentView.js: (WebInspector.ContentView.createFromRepresentedObject): (WebInspector.ContentView.isViewable): * UserInterface/Views/HeapAllocationsTimelineView.js: (WebInspector.HeapAllocationsTimelineView.prototype.showHeapSnapshotDiff): (WebInspector.HeapAllocationsTimelineView.prototype._takeHeapSnapshotClicked): (WebInspector.HeapAllocationsTimelineView.prototype._dataGridNodeSelected): (WebInspector.HeapAllocationsTimelineView): * UserInterface/Views/HeapSnapshotClassDataGridNode.js: (WebInspector.HeapSnapshotClassDataGridNode.prototype._populate): * UserInterface/Views/HeapSnapshotClusterContentView.js: * UserInterface/Views/HeapSnapshotInstanceDataGridNode.js: (WebInspector.HeapSnapshotInstanceDataGridNode): (WebInspector.HeapSnapshotInstanceDataGridNode.logHeapSnapshotNode.node.shortestGCRootPath.): (WebInspector.HeapSnapshotInstanceDataGridNode.logHeapSnapshotNode): (WebInspector.HeapSnapshotInstanceDataGridNode.prototype._mouseoverHandler.appendPath): (WebInspector.HeapSnapshotInstanceDataGridNode.prototype._mouseoverHandler.stringifyEdge): (WebInspector.HeapSnapshotInstanceDataGridNode.prototype._mouseoverHandler): * UserInterface/Views/HeapSnapshotInstancesContentView.js: (WebInspector.HeapSnapshotInstancesContentView): * UserInterface/Views/HeapSnapshotInstancesDataGridTree.js: (WebInspector.HeapSnapshotInstancesDataGridTree): * UserInterface/Views/HeapSnapshotSummaryContentView.js: (WebInspector.HeapSnapshotSummaryContentView): Update existing code to expect the new Proxy objects or create the new HeapSnapshot using workers. * UserInterface/Proxies/HeapSnapshotDiffProxy.js: Added. (WebInspector.HeapSnapshotDiffProxy): (WebInspector.HeapSnapshotDiffProxy.deserialize): (WebInspector.HeapSnapshotDiffProxy.prototype.get snapshot1): (WebInspector.HeapSnapshotDiffProxy.prototype.get snapshot2): (WebInspector.HeapSnapshotDiffProxy.prototype.get totalSize): (WebInspector.HeapSnapshotDiffProxy.prototype.get totalObjectCount): (WebInspector.HeapSnapshotDiffProxy.prototype.get categories): (WebInspector.HeapSnapshotDiffProxy.prototype.allocationBucketCounts): (WebInspector.HeapSnapshotDiffProxy.prototype.instancesWithClassName): (WebInspector.HeapSnapshotDiffProxy.prototype.nodeWithIdentifier): A HeapSnapshotDiffProxy looks like a HeapSnapshotProxy and responds to the same methods, but has the extra snapshot1/2 pointers. * UserInterface/Proxies/HeapSnapshotEdgeProxy.js: (WebInspector.HeapSnapshotEdgeProxy): (WebInspector.HeapSnapshotEdgeProxy.deserialize): Edge data. No methods are proxied at this point. * UserInterface/Proxies/HeapSnapshotNodeProxy.js: Added. (WebInspector.HeapSnapshotNodeProxy): (WebInspector.HeapSnapshotNodeProxy.deserialize): (WebInspector.HeapSnapshotNodeProxy.prototype.shortestGCRootPath): (WebInspector.HeapSnapshotNodeProxy.prototype.dominatedNodes): (WebInspector.HeapSnapshotNodeProxy.prototype.retainedNodes): (WebInspector.HeapSnapshotNodeProxy.prototype.retainers): Node data and methods to query for node relationships. * UserInterface/Proxies/HeapSnapshotProxy.js: Added. (WebInspector.HeapSnapshotProxy): (WebInspector.HeapSnapshotProxy.deserialize): (WebInspector.HeapSnapshotProxy.prototype.get proxyObjectId): (WebInspector.HeapSnapshotProxy.prototype.get identifier): (WebInspector.HeapSnapshotProxy.prototype.get totalSize): (WebInspector.HeapSnapshotProxy.prototype.get totalObjectCount): (WebInspector.HeapSnapshotProxy.prototype.get categories): (WebInspector.HeapSnapshotProxy.prototype.allocationBucketCounts): (WebInspector.HeapSnapshotProxy.prototype.instancesWithClassName): (WebInspector.HeapSnapshotProxy.prototype.nodeWithIdentifier): Snapshot data and methods to query for nodes. * UserInterface/Proxies/HeapSnapshotWorkerProxy.js: Added. (WebInspector.HeapSnapshotWorkerProxy): (WebInspector.HeapSnapshotWorkerProxy.singleton): (WebInspector.HeapSnapshotWorkerProxy.prototype.createSnapshot): (WebInspector.HeapSnapshotWorkerProxy.prototype.createSnapshotDiff): (WebInspector.HeapSnapshotWorkerProxy.prototype.performAction): (WebInspector.HeapSnapshotWorkerProxy.prototype.callMethod): (WebInspector.HeapSnapshotWorkerProxy.prototype._postMessage): (WebInspector.HeapSnapshotWorkerProxy.prototype._handleMessage): Singleton factory for the worker and proxied communication with the worker. Provide means for invoking "factory actions" and "object methods". * UserInterface/Workers/HeapSnapshot/HeapSnapshotWorker.js: Added. (HeapSnapshotWorker): (HeapSnapshotWorker.prototype.createSnapshot): (HeapSnapshotWorker.prototype.createSnapshotDiff): (HeapSnapshotWorker.prototype.sendEvent): (HeapSnapshotWorker.prototype._handleMessage): Main worker code. Handle dispatching actions and methods. * UserInterface/Workers/HeapSnapshot/HeapSnapshot.js: Added. (HeapSnapshot): (HeapSnapshot.buildCategories): (HeapSnapshot.allocationBucketCounts): (HeapSnapshot.instancesWithClassName): (HeapSnapshot.prototype.allocationBucketCounts): (HeapSnapshot.prototype.instancesWithClassName): (HeapSnapshot.prototype.nodeWithIdentifier): (HeapSnapshot.prototype.shortestGCRootPath): (HeapSnapshot.prototype.dominatedNodes): (HeapSnapshot.prototype.retainedNodes): (HeapSnapshot.prototype.retainers): (HeapSnapshot.prototype.serialize): (HeapSnapshot.prototype.serializeNode): (HeapSnapshot.prototype.serializeEdge): (HeapSnapshot.prototype._buildOutgoingEdges): (HeapSnapshot.prototype._buildIncomingEdges): (HeapSnapshot.prototype._buildPostOrderIndexes): (HeapSnapshot.prototype._buildDominatorIndexes): (HeapSnapshot.prototype._buildRetainedSizes): (HeapSnapshot.prototype._gcRootPathes.visitNode): (HeapSnapshot.prototype._gcRootPathes): (HeapSnapshotDiff): (HeapSnapshotDiff.prototype.allocationBucketCounts): (HeapSnapshotDiff.prototype.instancesWithClassName): (HeapSnapshotDiff.prototype.nodeWithIdentifier): (HeapSnapshotDiff.prototype.shortestGCRootPath): (HeapSnapshotDiff.prototype.dominatedNodes): (HeapSnapshotDiff.prototype.retainedNodes): (HeapSnapshotDiff.prototype.retainers): (HeapSnapshotDiff.prototype.serialize): New HeapSnapshot data processing implementation. Instead of creating a new object per Node or per Edge create data arrays containing data per-Node. Operate on these lists of data instead of creating many objects. LayoutTests: * inspector/heap/getPreview.html: * inspector/heap/getRemoteObject.html: * inspector/heap/snapshot.html: Update tests to use the new HeapSnapshotWorker frontend code. * inspector/unit-tests/heap-snapshot-expected.txt: Added. * inspector/unit-tests/heap-snapshot.html: Added. Verify the data processing in and worker communication work HeapSnapshotWorker produces expected values when compared with the simple HeapSnapshot/Node/Edge implentation. Canonical link: https://commits.webkit.org/173715@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@198353 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-03-17 21:02:07 +00:00
Testing HeapSnapshot Worker and Proxy objects.
== Running test suite: HeapSnapshot
-- Running test case: HeapSnapshotProxy data
PASS: Should not have an error creating a snapshot.
PASS: Snapshots totalSize should match.
PASS: Snapshots totalObjectCount should match.
-- Running test case: HeapSnapshotProxy.prototype.instancesWithClassName
PASS: Should be at least 1 Window.
PASS: Window object count is expected.
PASS: Every className should be 'Window'.
PASS: Should be at least 1 Function.
PASS: Function object count is expected.
PASS: Every className should be 'Function'.
PASS: Should be at least 1 string.
PASS: string count is expected.
PASS: Every className should be 'string'.
-- Running test case: HeapSnapshotProxy.prototype.nodeWithIdentifier and HeapSnapshotNodeProxy data
PASS: Node className should be 'Window'.
PASS: Node identifier should match.
PASS: Node size should match.
PASS: Node internal state should match.
Web Inspector: Improve ES6 Class instances in Heap Snapshot instances view https://bugs.webkit.org/show_bug.cgi?id=172848 <rdar://problem/25709212> Reviewed by Mark Lam. JSTests: * typeProfiler/inheritance.js: Rewrite the test slightly for clarity. The hoisting was confusing. * heapProfiler/class-names.js: Added. (MyES5Class): (MyES6Class): (MyES6Subclass): Test object types and improved class names. * heapProfiler/driver/driver.js: (CheapHeapSnapshotNode): (CheapHeapSnapshot): (createCheapHeapSnapshot): (HeapSnapshot): (createHeapSnapshot): Update snapshot parsing from version 1 to version 2. Source/JavaScriptCore: * heap/HeapSnapshotBuilder.h: * heap/HeapSnapshotBuilder.cpp: Update the snapshot version. Change the node's 0 | 1 internal value to be a 32bit bit flag. This is nice in that it is both compatible with the previous snapshot version and the same size. We can use more flags in the future. (JSC::HeapSnapshotBuilder::json): In cases where the classInfo gives us "Object" check for a better class name by checking (o).__proto__.constructor.name. We avoid this check in cases where (o).hasOwnProperty("constructor") which is the case for most Foo.prototype objects. Otherwise this would get the name of the Foo superclass for the Foo.prototype object. * runtime/JSObject.cpp: (JSC::JSObject::calculatedClassName): Handle some possible edge cases that were not handled before, such as a JSObject without a GlobalObject or an object which doesn't have a default getPrototype. Try to make the code a little clearer. Source/WebInspectorUI: * UserInterface/Workers/HeapSnapshot/HeapSnapshot.js: (HeapSnapshot): Support the new snapshot version. The only thing that changes are the node flags, and its actually completely compatible with version 1. (HeapSnapshot.updateCategoriesAndMetadata): List the count of object type instances in each class category. (HeapSnapshot.prototype.serializeNode): Include whether or not the node is an object type. * UserInterface/Proxies/HeapSnapshotNodeProxy.js: (WebInspector.HeapSnapshotNodeProxy): (WebInspector.HeapSnapshotNodeProxy.deserialize): Add a new Node isObjectType property based on the new data. * UserInterface/Views/HeapSnapshotClassDataGridNode.js: (WebInspector.HeapSnapshotClassDataGridNode.prototype.createCellContent): * UserInterface/Views/HeapSnapshotClusterContentView.js: (WebInspector.HeapSnapshotClusterContentView.iconStyleClassNameForClassName): If a class contains 50% or more object type instances then treat it as such instead of defaulting to native. * UserInterface/Views/HeapSnapshotDataGridTree.js: (WebInspector.HeapSnapshotInstancesDataGridTree.prototype.populateTopLevel): * UserInterface/Views/HeapSnapshotInstanceDataGridNode.js: (WebInspector.HeapSnapshotInstanceDataGridNode.prototype.createCellContent): We can be more specific than the default if the individual instance is known to be an object type. LayoutTests: * inspector/unit-tests/heap-snapshot-expected.txt: * inspector/unit-tests/heap-snapshot.html: Update for the new node flag. Canonical link: https://commits.webkit.org/209212@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@241787 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2019-02-20 01:35:31 +00:00
PASS: Node isObjectType state should match.
Web Inspector: HeapSnapshots are slow and use too much memory https://bugs.webkit.org/show_bug.cgi?id=155571 Reviewed by Timothy Hatcher. Source/WebInspectorUI: This is the first inclusion of Workers into Web Inspector. In this case the Main side merely needs to make requests of the Worker and get back objects that it can interact with more. New file heirarchies: UserInterface/Proxies - new Proxy classes in the Main page. - treat like Model classes, but not quite model. UserInterface/Workers/HeapSnapshotWorker - new Worker classes for Workers. No WebInspector namespace. - no minification of these resources, they are simply copied. Remote procedure call interface between the Main/Worker page happens through the WorkerProxy and Worker classes. There are simple ways to perform factory style methods and call methods on objects, and get the result in a callback. Similiar to frontend <-> backend agent communication: HeapSnapshotWorkerProxy: (Main world) - creates the worker - performAction("actionName", arguments, callback) - callMethod(objectId, "methodName", arguments, callback) - handle message => dispatch event or invoke callback HeapSnapshotWorker: (Worker world) - sendEvent("eventName", eventData) - handle message => dispatch action or method on object Proxy object methods are boilerplate calls to performAction/callMethod with deserialization of responses. The rest of the frontend can just treat Proxy objects as Model objects with some data and async methods. Because the Node/Edge data is so small, objects are cheaply created when needed and not cached. This means that there may be duplicate HeapSnapshotNode's for the same node. For example if different Views both request instancesWithClassName("Foo"). This is fine, as none of our Views really care about object uniqueness, they are only interested in the data or querying for more data. * Scripts/combine-resources.pl: * Scripts/copy-user-interface-resources.pl: Copy the Workers directory to the resources directory. Its code is only meant to be loaded by Workers, so it shouldn't be included in the Main page. * UserInterface/Main.html: * UserInterface/Test.html: * UserInterface/Models/HeapSnapshot.js: Removed. * UserInterface/Models/HeapSnapshotDiff.js: Removed. * UserInterface/Models/HeapSnapshotEdge.js: Removed. * UserInterface/Models/HeapSnapshotNode.js: Removed. Replace the old simple Model classes with Proxy classes that interact with the Worker. * UserInterface/Models/HeapAllocationsInstrument.js: (WebInspector.HeapAllocationsInstrument.prototype._takeHeapSnapshot): (WebInspector.HeapAllocationsInstrument): * UserInterface/Models/HeapAllocationsTimelineRecord.js: (WebInspector.HeapAllocationsTimelineRecord): * UserInterface/Models/HeapSnapshotRootPath.js: (WebInspector.HeapSnapshotRootPath): (WebInspector.HeapSnapshotRootPath.prototype.appendEdge): * UserInterface/Protocol/HeapObserver.js: (WebInspector.HeapObserver.prototype.trackingStart): (WebInspector.HeapObserver.prototype.trackingComplete): * UserInterface/Views/ContentView.js: (WebInspector.ContentView.createFromRepresentedObject): (WebInspector.ContentView.isViewable): * UserInterface/Views/HeapAllocationsTimelineView.js: (WebInspector.HeapAllocationsTimelineView.prototype.showHeapSnapshotDiff): (WebInspector.HeapAllocationsTimelineView.prototype._takeHeapSnapshotClicked): (WebInspector.HeapAllocationsTimelineView.prototype._dataGridNodeSelected): (WebInspector.HeapAllocationsTimelineView): * UserInterface/Views/HeapSnapshotClassDataGridNode.js: (WebInspector.HeapSnapshotClassDataGridNode.prototype._populate): * UserInterface/Views/HeapSnapshotClusterContentView.js: * UserInterface/Views/HeapSnapshotInstanceDataGridNode.js: (WebInspector.HeapSnapshotInstanceDataGridNode): (WebInspector.HeapSnapshotInstanceDataGridNode.logHeapSnapshotNode.node.shortestGCRootPath.): (WebInspector.HeapSnapshotInstanceDataGridNode.logHeapSnapshotNode): (WebInspector.HeapSnapshotInstanceDataGridNode.prototype._mouseoverHandler.appendPath): (WebInspector.HeapSnapshotInstanceDataGridNode.prototype._mouseoverHandler.stringifyEdge): (WebInspector.HeapSnapshotInstanceDataGridNode.prototype._mouseoverHandler): * UserInterface/Views/HeapSnapshotInstancesContentView.js: (WebInspector.HeapSnapshotInstancesContentView): * UserInterface/Views/HeapSnapshotInstancesDataGridTree.js: (WebInspector.HeapSnapshotInstancesDataGridTree): * UserInterface/Views/HeapSnapshotSummaryContentView.js: (WebInspector.HeapSnapshotSummaryContentView): Update existing code to expect the new Proxy objects or create the new HeapSnapshot using workers. * UserInterface/Proxies/HeapSnapshotDiffProxy.js: Added. (WebInspector.HeapSnapshotDiffProxy): (WebInspector.HeapSnapshotDiffProxy.deserialize): (WebInspector.HeapSnapshotDiffProxy.prototype.get snapshot1): (WebInspector.HeapSnapshotDiffProxy.prototype.get snapshot2): (WebInspector.HeapSnapshotDiffProxy.prototype.get totalSize): (WebInspector.HeapSnapshotDiffProxy.prototype.get totalObjectCount): (WebInspector.HeapSnapshotDiffProxy.prototype.get categories): (WebInspector.HeapSnapshotDiffProxy.prototype.allocationBucketCounts): (WebInspector.HeapSnapshotDiffProxy.prototype.instancesWithClassName): (WebInspector.HeapSnapshotDiffProxy.prototype.nodeWithIdentifier): A HeapSnapshotDiffProxy looks like a HeapSnapshotProxy and responds to the same methods, but has the extra snapshot1/2 pointers. * UserInterface/Proxies/HeapSnapshotEdgeProxy.js: (WebInspector.HeapSnapshotEdgeProxy): (WebInspector.HeapSnapshotEdgeProxy.deserialize): Edge data. No methods are proxied at this point. * UserInterface/Proxies/HeapSnapshotNodeProxy.js: Added. (WebInspector.HeapSnapshotNodeProxy): (WebInspector.HeapSnapshotNodeProxy.deserialize): (WebInspector.HeapSnapshotNodeProxy.prototype.shortestGCRootPath): (WebInspector.HeapSnapshotNodeProxy.prototype.dominatedNodes): (WebInspector.HeapSnapshotNodeProxy.prototype.retainedNodes): (WebInspector.HeapSnapshotNodeProxy.prototype.retainers): Node data and methods to query for node relationships. * UserInterface/Proxies/HeapSnapshotProxy.js: Added. (WebInspector.HeapSnapshotProxy): (WebInspector.HeapSnapshotProxy.deserialize): (WebInspector.HeapSnapshotProxy.prototype.get proxyObjectId): (WebInspector.HeapSnapshotProxy.prototype.get identifier): (WebInspector.HeapSnapshotProxy.prototype.get totalSize): (WebInspector.HeapSnapshotProxy.prototype.get totalObjectCount): (WebInspector.HeapSnapshotProxy.prototype.get categories): (WebInspector.HeapSnapshotProxy.prototype.allocationBucketCounts): (WebInspector.HeapSnapshotProxy.prototype.instancesWithClassName): (WebInspector.HeapSnapshotProxy.prototype.nodeWithIdentifier): Snapshot data and methods to query for nodes. * UserInterface/Proxies/HeapSnapshotWorkerProxy.js: Added. (WebInspector.HeapSnapshotWorkerProxy): (WebInspector.HeapSnapshotWorkerProxy.singleton): (WebInspector.HeapSnapshotWorkerProxy.prototype.createSnapshot): (WebInspector.HeapSnapshotWorkerProxy.prototype.createSnapshotDiff): (WebInspector.HeapSnapshotWorkerProxy.prototype.performAction): (WebInspector.HeapSnapshotWorkerProxy.prototype.callMethod): (WebInspector.HeapSnapshotWorkerProxy.prototype._postMessage): (WebInspector.HeapSnapshotWorkerProxy.prototype._handleMessage): Singleton factory for the worker and proxied communication with the worker. Provide means for invoking "factory actions" and "object methods". * UserInterface/Workers/HeapSnapshot/HeapSnapshotWorker.js: Added. (HeapSnapshotWorker): (HeapSnapshotWorker.prototype.createSnapshot): (HeapSnapshotWorker.prototype.createSnapshotDiff): (HeapSnapshotWorker.prototype.sendEvent): (HeapSnapshotWorker.prototype._handleMessage): Main worker code. Handle dispatching actions and methods. * UserInterface/Workers/HeapSnapshot/HeapSnapshot.js: Added. (HeapSnapshot): (HeapSnapshot.buildCategories): (HeapSnapshot.allocationBucketCounts): (HeapSnapshot.instancesWithClassName): (HeapSnapshot.prototype.allocationBucketCounts): (HeapSnapshot.prototype.instancesWithClassName): (HeapSnapshot.prototype.nodeWithIdentifier): (HeapSnapshot.prototype.shortestGCRootPath): (HeapSnapshot.prototype.dominatedNodes): (HeapSnapshot.prototype.retainedNodes): (HeapSnapshot.prototype.retainers): (HeapSnapshot.prototype.serialize): (HeapSnapshot.prototype.serializeNode): (HeapSnapshot.prototype.serializeEdge): (HeapSnapshot.prototype._buildOutgoingEdges): (HeapSnapshot.prototype._buildIncomingEdges): (HeapSnapshot.prototype._buildPostOrderIndexes): (HeapSnapshot.prototype._buildDominatorIndexes): (HeapSnapshot.prototype._buildRetainedSizes): (HeapSnapshot.prototype._gcRootPathes.visitNode): (HeapSnapshot.prototype._gcRootPathes): (HeapSnapshotDiff): (HeapSnapshotDiff.prototype.allocationBucketCounts): (HeapSnapshotDiff.prototype.instancesWithClassName): (HeapSnapshotDiff.prototype.nodeWithIdentifier): (HeapSnapshotDiff.prototype.shortestGCRootPath): (HeapSnapshotDiff.prototype.dominatedNodes): (HeapSnapshotDiff.prototype.retainedNodes): (HeapSnapshotDiff.prototype.retainers): (HeapSnapshotDiff.prototype.serialize): New HeapSnapshot data processing implementation. Instead of creating a new object per Node or per Edge create data arrays containing data per-Node. Operate on these lists of data instead of creating many objects. LayoutTests: * inspector/heap/getPreview.html: * inspector/heap/getRemoteObject.html: * inspector/heap/snapshot.html: Update tests to use the new HeapSnapshotWorker frontend code. * inspector/unit-tests/heap-snapshot-expected.txt: Added. * inspector/unit-tests/heap-snapshot.html: Added. Verify the data processing in and worker communication work HeapSnapshotWorker produces expected values when compared with the simple HeapSnapshot/Node/Edge implentation. Canonical link: https://commits.webkit.org/173715@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@198353 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-03-17 21:02:07 +00:00
PASS: Node gcRoot state should match.
PASS: Node retainedSize should at least be the size.
-- Running test case: HeapSnapshotProxy.prototype.allocationBucketCounts
PASS: Result should have 3 buckets, for small/medium/large.
PASS: Small count should match.
PASS: Medium count should match.
PASS: Large count should match.
-- Running test case: HeapSnapshotNodeProxy.prototype.retainedNodes
PASS: Number of retained nodes should match.
Web Inspector: Should be able to expand Objects in Heap Allocations View to see exactly what it retains https://bugs.webkit.org/show_bug.cgi?id=156419 <rdar://problem/25633863> Reviewed by Timothy Hatcher. Source/WebInspectorUI: * Localizations/en.lproj/localizedStrings.js: * UserInterface/Main.html: Remove strings, and fix sort. * UserInterface/Models/HeapSnapshotRootPath.js: (WebInspector.HeapSnapshotRootPath.pathComponentForIndividualEdge): (WebInspector.HeapSnapshotRootPath.canPropertyNameBeDotAccess): (WebInspector.HeapSnapshotRootPath.prototype.appendPropertyName): (WebInspector.HeapSnapshotRootPath.prototype._canPropertyNameBeDotAccess): Provide a helper to get an path component string for an individual edge. * UserInterface/Models/PropertyPreview.js: (WebInspector.PropertyPreview): Fix an assert that may have errantly fired for an empty string name. * UserInterface/Proxies/HeapSnapshotNodeProxy.js: (WebInspector.HeapSnapshotNodeProxy): (WebInspector.HeapSnapshotNodeProxy.deserialize): Include "hasChildren" property in the original proxy message. (WebInspector.HeapSnapshotNodeProxy.prototype.retainedNodes): The method now also returns a list of edges for each of the retained nodes. * UserInterface/Views/HeapSnapshotInstanceDataGridNode.js: (WebInspector.HeapSnapshotInstanceDataGridNode): (WebInspector.HeapSnapshotInstanceDataGridNode.prototype.createCellContent): (WebInspector.HeapSnapshotInstanceDataGridNode.prototype.sort): (WebInspector.HeapSnapshotInstanceDataGridNode.prototype._populate): An instance DataGrid node can now show children. It can expand to show its retained node graph. * UserInterface/Workers/HeapSnapshot/HeapSnapshot.js: (HeapSnapshot.instancesWithClassName): (HeapSnapshot.prototype.dominatedNodes): (HeapSnapshot.prototype.retainers): (HeapSnapshot.prototype.serializeNode): Remove unnecessary calls to bind in favor of using the `thisObject` argument. (HeapSnapshot.prototype.retainedNodes): Return a parallel list of edges for each of the nodes. * UserInterface/Views/HeapSnapshotClassDataGridNode.js: (WebInspector.HeapSnapshotClassDataGridNode.prototype.createCellContent): (WebInspector.HeapSnapshotClassDataGridNode.prototype._populate): * UserInterface/Views/HeapSnapshotClusterContentView.js: (WebInspector.HeapSnapshotClusterContentView.prototype.get summaryContentView): (WebInspector.HeapSnapshotClusterContentView.prototype.get instancesContentView): (WebInspector.HeapSnapshotClusterContentView.prototype.shown): (WebInspector.HeapSnapshotClusterContentView): (WebInspector.HeapSnapshotClusterContentView.prototype.get navigationItems): Deleted. (WebInspector.HeapSnapshotClusterContentView.prototype._contentViewExtraArguments): Deleted. (WebInspector.HeapSnapshotClusterContentView.prototype._toggleShowInternalObjectsSetting): Deleted. (WebInspector.HeapSnapshotClusterContentView.prototype._updateViewsForShowInternalObjectsSettingValue): Deleted. (WebInspector.HeapSnapshotClusterContentView.prototype._updateShowInternalObjectsButtonNavigationItem): Deleted. * UserInterface/Views/HeapSnapshotInstancesContentView.js: (WebInspector.HeapSnapshotInstancesContentView): (WebInspector.HeapSnapshotInstancesContentView.prototype.get showInternalObjects): Deleted. (WebInspector.HeapSnapshotInstancesContentView.prototype.set showInternalObjects): Deleted. * UserInterface/Views/HeapSnapshotInstancesDataGridTree.js: (WebInspector.HeapSnapshotInstancesDataGridTree.prototype._populateTopLevel): (WebInspector.HeapSnapshotInstancesDataGridTree): (WebInspector.HeapSnapshotInstancesDataGridTree.prototype.get includeInternalObjects): Deleted. (WebInspector.HeapSnapshotInstancesDataGridTree.prototype.set includeInternalObjects): Deleted. * UserInterface/Views/HeapSnapshotSummaryContentView.js: Remove the show/hide internal objects button. In the Instances view we will only show non-Internal objects at the top level, and show internal objects when those instances are expanded. LayoutTests: * inspector/unit-tests/heap-snapshot-expected.txt: * inspector/unit-tests/heap-snapshot.html: Add a quick test that retainedNodes returns a list of edges. Canonical link: https://commits.webkit.org/174613@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@199379 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-04-12 19:35:12 +00:00
PASS: Number of edges should match the number of nodes.
Web Inspector: HeapSnapshots are slow and use too much memory https://bugs.webkit.org/show_bug.cgi?id=155571 Reviewed by Timothy Hatcher. Source/WebInspectorUI: This is the first inclusion of Workers into Web Inspector. In this case the Main side merely needs to make requests of the Worker and get back objects that it can interact with more. New file heirarchies: UserInterface/Proxies - new Proxy classes in the Main page. - treat like Model classes, but not quite model. UserInterface/Workers/HeapSnapshotWorker - new Worker classes for Workers. No WebInspector namespace. - no minification of these resources, they are simply copied. Remote procedure call interface between the Main/Worker page happens through the WorkerProxy and Worker classes. There are simple ways to perform factory style methods and call methods on objects, and get the result in a callback. Similiar to frontend <-> backend agent communication: HeapSnapshotWorkerProxy: (Main world) - creates the worker - performAction("actionName", arguments, callback) - callMethod(objectId, "methodName", arguments, callback) - handle message => dispatch event or invoke callback HeapSnapshotWorker: (Worker world) - sendEvent("eventName", eventData) - handle message => dispatch action or method on object Proxy object methods are boilerplate calls to performAction/callMethod with deserialization of responses. The rest of the frontend can just treat Proxy objects as Model objects with some data and async methods. Because the Node/Edge data is so small, objects are cheaply created when needed and not cached. This means that there may be duplicate HeapSnapshotNode's for the same node. For example if different Views both request instancesWithClassName("Foo"). This is fine, as none of our Views really care about object uniqueness, they are only interested in the data or querying for more data. * Scripts/combine-resources.pl: * Scripts/copy-user-interface-resources.pl: Copy the Workers directory to the resources directory. Its code is only meant to be loaded by Workers, so it shouldn't be included in the Main page. * UserInterface/Main.html: * UserInterface/Test.html: * UserInterface/Models/HeapSnapshot.js: Removed. * UserInterface/Models/HeapSnapshotDiff.js: Removed. * UserInterface/Models/HeapSnapshotEdge.js: Removed. * UserInterface/Models/HeapSnapshotNode.js: Removed. Replace the old simple Model classes with Proxy classes that interact with the Worker. * UserInterface/Models/HeapAllocationsInstrument.js: (WebInspector.HeapAllocationsInstrument.prototype._takeHeapSnapshot): (WebInspector.HeapAllocationsInstrument): * UserInterface/Models/HeapAllocationsTimelineRecord.js: (WebInspector.HeapAllocationsTimelineRecord): * UserInterface/Models/HeapSnapshotRootPath.js: (WebInspector.HeapSnapshotRootPath): (WebInspector.HeapSnapshotRootPath.prototype.appendEdge): * UserInterface/Protocol/HeapObserver.js: (WebInspector.HeapObserver.prototype.trackingStart): (WebInspector.HeapObserver.prototype.trackingComplete): * UserInterface/Views/ContentView.js: (WebInspector.ContentView.createFromRepresentedObject): (WebInspector.ContentView.isViewable): * UserInterface/Views/HeapAllocationsTimelineView.js: (WebInspector.HeapAllocationsTimelineView.prototype.showHeapSnapshotDiff): (WebInspector.HeapAllocationsTimelineView.prototype._takeHeapSnapshotClicked): (WebInspector.HeapAllocationsTimelineView.prototype._dataGridNodeSelected): (WebInspector.HeapAllocationsTimelineView): * UserInterface/Views/HeapSnapshotClassDataGridNode.js: (WebInspector.HeapSnapshotClassDataGridNode.prototype._populate): * UserInterface/Views/HeapSnapshotClusterContentView.js: * UserInterface/Views/HeapSnapshotInstanceDataGridNode.js: (WebInspector.HeapSnapshotInstanceDataGridNode): (WebInspector.HeapSnapshotInstanceDataGridNode.logHeapSnapshotNode.node.shortestGCRootPath.): (WebInspector.HeapSnapshotInstanceDataGridNode.logHeapSnapshotNode): (WebInspector.HeapSnapshotInstanceDataGridNode.prototype._mouseoverHandler.appendPath): (WebInspector.HeapSnapshotInstanceDataGridNode.prototype._mouseoverHandler.stringifyEdge): (WebInspector.HeapSnapshotInstanceDataGridNode.prototype._mouseoverHandler): * UserInterface/Views/HeapSnapshotInstancesContentView.js: (WebInspector.HeapSnapshotInstancesContentView): * UserInterface/Views/HeapSnapshotInstancesDataGridTree.js: (WebInspector.HeapSnapshotInstancesDataGridTree): * UserInterface/Views/HeapSnapshotSummaryContentView.js: (WebInspector.HeapSnapshotSummaryContentView): Update existing code to expect the new Proxy objects or create the new HeapSnapshot using workers. * UserInterface/Proxies/HeapSnapshotDiffProxy.js: Added. (WebInspector.HeapSnapshotDiffProxy): (WebInspector.HeapSnapshotDiffProxy.deserialize): (WebInspector.HeapSnapshotDiffProxy.prototype.get snapshot1): (WebInspector.HeapSnapshotDiffProxy.prototype.get snapshot2): (WebInspector.HeapSnapshotDiffProxy.prototype.get totalSize): (WebInspector.HeapSnapshotDiffProxy.prototype.get totalObjectCount): (WebInspector.HeapSnapshotDiffProxy.prototype.get categories): (WebInspector.HeapSnapshotDiffProxy.prototype.allocationBucketCounts): (WebInspector.HeapSnapshotDiffProxy.prototype.instancesWithClassName): (WebInspector.HeapSnapshotDiffProxy.prototype.nodeWithIdentifier): A HeapSnapshotDiffProxy looks like a HeapSnapshotProxy and responds to the same methods, but has the extra snapshot1/2 pointers. * UserInterface/Proxies/HeapSnapshotEdgeProxy.js: (WebInspector.HeapSnapshotEdgeProxy): (WebInspector.HeapSnapshotEdgeProxy.deserialize): Edge data. No methods are proxied at this point. * UserInterface/Proxies/HeapSnapshotNodeProxy.js: Added. (WebInspector.HeapSnapshotNodeProxy): (WebInspector.HeapSnapshotNodeProxy.deserialize): (WebInspector.HeapSnapshotNodeProxy.prototype.shortestGCRootPath): (WebInspector.HeapSnapshotNodeProxy.prototype.dominatedNodes): (WebInspector.HeapSnapshotNodeProxy.prototype.retainedNodes): (WebInspector.HeapSnapshotNodeProxy.prototype.retainers): Node data and methods to query for node relationships. * UserInterface/Proxies/HeapSnapshotProxy.js: Added. (WebInspector.HeapSnapshotProxy): (WebInspector.HeapSnapshotProxy.deserialize): (WebInspector.HeapSnapshotProxy.prototype.get proxyObjectId): (WebInspector.HeapSnapshotProxy.prototype.get identifier): (WebInspector.HeapSnapshotProxy.prototype.get totalSize): (WebInspector.HeapSnapshotProxy.prototype.get totalObjectCount): (WebInspector.HeapSnapshotProxy.prototype.get categories): (WebInspector.HeapSnapshotProxy.prototype.allocationBucketCounts): (WebInspector.HeapSnapshotProxy.prototype.instancesWithClassName): (WebInspector.HeapSnapshotProxy.prototype.nodeWithIdentifier): Snapshot data and methods to query for nodes. * UserInterface/Proxies/HeapSnapshotWorkerProxy.js: Added. (WebInspector.HeapSnapshotWorkerProxy): (WebInspector.HeapSnapshotWorkerProxy.singleton): (WebInspector.HeapSnapshotWorkerProxy.prototype.createSnapshot): (WebInspector.HeapSnapshotWorkerProxy.prototype.createSnapshotDiff): (WebInspector.HeapSnapshotWorkerProxy.prototype.performAction): (WebInspector.HeapSnapshotWorkerProxy.prototype.callMethod): (WebInspector.HeapSnapshotWorkerProxy.prototype._postMessage): (WebInspector.HeapSnapshotWorkerProxy.prototype._handleMessage): Singleton factory for the worker and proxied communication with the worker. Provide means for invoking "factory actions" and "object methods". * UserInterface/Workers/HeapSnapshot/HeapSnapshotWorker.js: Added. (HeapSnapshotWorker): (HeapSnapshotWorker.prototype.createSnapshot): (HeapSnapshotWorker.prototype.createSnapshotDiff): (HeapSnapshotWorker.prototype.sendEvent): (HeapSnapshotWorker.prototype._handleMessage): Main worker code. Handle dispatching actions and methods. * UserInterface/Workers/HeapSnapshot/HeapSnapshot.js: Added. (HeapSnapshot): (HeapSnapshot.buildCategories): (HeapSnapshot.allocationBucketCounts): (HeapSnapshot.instancesWithClassName): (HeapSnapshot.prototype.allocationBucketCounts): (HeapSnapshot.prototype.instancesWithClassName): (HeapSnapshot.prototype.nodeWithIdentifier): (HeapSnapshot.prototype.shortestGCRootPath): (HeapSnapshot.prototype.dominatedNodes): (HeapSnapshot.prototype.retainedNodes): (HeapSnapshot.prototype.retainers): (HeapSnapshot.prototype.serialize): (HeapSnapshot.prototype.serializeNode): (HeapSnapshot.prototype.serializeEdge): (HeapSnapshot.prototype._buildOutgoingEdges): (HeapSnapshot.prototype._buildIncomingEdges): (HeapSnapshot.prototype._buildPostOrderIndexes): (HeapSnapshot.prototype._buildDominatorIndexes): (HeapSnapshot.prototype._buildRetainedSizes): (HeapSnapshot.prototype._gcRootPathes.visitNode): (HeapSnapshot.prototype._gcRootPathes): (HeapSnapshotDiff): (HeapSnapshotDiff.prototype.allocationBucketCounts): (HeapSnapshotDiff.prototype.instancesWithClassName): (HeapSnapshotDiff.prototype.nodeWithIdentifier): (HeapSnapshotDiff.prototype.shortestGCRootPath): (HeapSnapshotDiff.prototype.dominatedNodes): (HeapSnapshotDiff.prototype.retainedNodes): (HeapSnapshotDiff.prototype.retainers): (HeapSnapshotDiff.prototype.serialize): New HeapSnapshot data processing implementation. Instead of creating a new object per Node or per Edge create data arrays containing data per-Node. Operate on these lists of data instead of creating many objects. LayoutTests: * inspector/heap/getPreview.html: * inspector/heap/getRemoteObject.html: * inspector/heap/snapshot.html: Update tests to use the new HeapSnapshotWorker frontend code. * inspector/unit-tests/heap-snapshot-expected.txt: Added. * inspector/unit-tests/heap-snapshot.html: Added. Verify the data processing in and worker communication work HeapSnapshotWorker produces expected values when compared with the simple HeapSnapshot/Node/Edge implentation. Canonical link: https://commits.webkit.org/173715@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@198353 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-03-17 21:02:07 +00:00
PASS: Node values should match.
-- Running test case: HeapSnapshotNodeProxy.prototype.retainers
PASS: Number of retainer nodes should match.
PASS: Number of edges should match the number of nodes.
Web Inspector: HeapSnapshots are slow and use too much memory https://bugs.webkit.org/show_bug.cgi?id=155571 Reviewed by Timothy Hatcher. Source/WebInspectorUI: This is the first inclusion of Workers into Web Inspector. In this case the Main side merely needs to make requests of the Worker and get back objects that it can interact with more. New file heirarchies: UserInterface/Proxies - new Proxy classes in the Main page. - treat like Model classes, but not quite model. UserInterface/Workers/HeapSnapshotWorker - new Worker classes for Workers. No WebInspector namespace. - no minification of these resources, they are simply copied. Remote procedure call interface between the Main/Worker page happens through the WorkerProxy and Worker classes. There are simple ways to perform factory style methods and call methods on objects, and get the result in a callback. Similiar to frontend <-> backend agent communication: HeapSnapshotWorkerProxy: (Main world) - creates the worker - performAction("actionName", arguments, callback) - callMethod(objectId, "methodName", arguments, callback) - handle message => dispatch event or invoke callback HeapSnapshotWorker: (Worker world) - sendEvent("eventName", eventData) - handle message => dispatch action or method on object Proxy object methods are boilerplate calls to performAction/callMethod with deserialization of responses. The rest of the frontend can just treat Proxy objects as Model objects with some data and async methods. Because the Node/Edge data is so small, objects are cheaply created when needed and not cached. This means that there may be duplicate HeapSnapshotNode's for the same node. For example if different Views both request instancesWithClassName("Foo"). This is fine, as none of our Views really care about object uniqueness, they are only interested in the data or querying for more data. * Scripts/combine-resources.pl: * Scripts/copy-user-interface-resources.pl: Copy the Workers directory to the resources directory. Its code is only meant to be loaded by Workers, so it shouldn't be included in the Main page. * UserInterface/Main.html: * UserInterface/Test.html: * UserInterface/Models/HeapSnapshot.js: Removed. * UserInterface/Models/HeapSnapshotDiff.js: Removed. * UserInterface/Models/HeapSnapshotEdge.js: Removed. * UserInterface/Models/HeapSnapshotNode.js: Removed. Replace the old simple Model classes with Proxy classes that interact with the Worker. * UserInterface/Models/HeapAllocationsInstrument.js: (WebInspector.HeapAllocationsInstrument.prototype._takeHeapSnapshot): (WebInspector.HeapAllocationsInstrument): * UserInterface/Models/HeapAllocationsTimelineRecord.js: (WebInspector.HeapAllocationsTimelineRecord): * UserInterface/Models/HeapSnapshotRootPath.js: (WebInspector.HeapSnapshotRootPath): (WebInspector.HeapSnapshotRootPath.prototype.appendEdge): * UserInterface/Protocol/HeapObserver.js: (WebInspector.HeapObserver.prototype.trackingStart): (WebInspector.HeapObserver.prototype.trackingComplete): * UserInterface/Views/ContentView.js: (WebInspector.ContentView.createFromRepresentedObject): (WebInspector.ContentView.isViewable): * UserInterface/Views/HeapAllocationsTimelineView.js: (WebInspector.HeapAllocationsTimelineView.prototype.showHeapSnapshotDiff): (WebInspector.HeapAllocationsTimelineView.prototype._takeHeapSnapshotClicked): (WebInspector.HeapAllocationsTimelineView.prototype._dataGridNodeSelected): (WebInspector.HeapAllocationsTimelineView): * UserInterface/Views/HeapSnapshotClassDataGridNode.js: (WebInspector.HeapSnapshotClassDataGridNode.prototype._populate): * UserInterface/Views/HeapSnapshotClusterContentView.js: * UserInterface/Views/HeapSnapshotInstanceDataGridNode.js: (WebInspector.HeapSnapshotInstanceDataGridNode): (WebInspector.HeapSnapshotInstanceDataGridNode.logHeapSnapshotNode.node.shortestGCRootPath.): (WebInspector.HeapSnapshotInstanceDataGridNode.logHeapSnapshotNode): (WebInspector.HeapSnapshotInstanceDataGridNode.prototype._mouseoverHandler.appendPath): (WebInspector.HeapSnapshotInstanceDataGridNode.prototype._mouseoverHandler.stringifyEdge): (WebInspector.HeapSnapshotInstanceDataGridNode.prototype._mouseoverHandler): * UserInterface/Views/HeapSnapshotInstancesContentView.js: (WebInspector.HeapSnapshotInstancesContentView): * UserInterface/Views/HeapSnapshotInstancesDataGridTree.js: (WebInspector.HeapSnapshotInstancesDataGridTree): * UserInterface/Views/HeapSnapshotSummaryContentView.js: (WebInspector.HeapSnapshotSummaryContentView): Update existing code to expect the new Proxy objects or create the new HeapSnapshot using workers. * UserInterface/Proxies/HeapSnapshotDiffProxy.js: Added. (WebInspector.HeapSnapshotDiffProxy): (WebInspector.HeapSnapshotDiffProxy.deserialize): (WebInspector.HeapSnapshotDiffProxy.prototype.get snapshot1): (WebInspector.HeapSnapshotDiffProxy.prototype.get snapshot2): (WebInspector.HeapSnapshotDiffProxy.prototype.get totalSize): (WebInspector.HeapSnapshotDiffProxy.prototype.get totalObjectCount): (WebInspector.HeapSnapshotDiffProxy.prototype.get categories): (WebInspector.HeapSnapshotDiffProxy.prototype.allocationBucketCounts): (WebInspector.HeapSnapshotDiffProxy.prototype.instancesWithClassName): (WebInspector.HeapSnapshotDiffProxy.prototype.nodeWithIdentifier): A HeapSnapshotDiffProxy looks like a HeapSnapshotProxy and responds to the same methods, but has the extra snapshot1/2 pointers. * UserInterface/Proxies/HeapSnapshotEdgeProxy.js: (WebInspector.HeapSnapshotEdgeProxy): (WebInspector.HeapSnapshotEdgeProxy.deserialize): Edge data. No methods are proxied at this point. * UserInterface/Proxies/HeapSnapshotNodeProxy.js: Added. (WebInspector.HeapSnapshotNodeProxy): (WebInspector.HeapSnapshotNodeProxy.deserialize): (WebInspector.HeapSnapshotNodeProxy.prototype.shortestGCRootPath): (WebInspector.HeapSnapshotNodeProxy.prototype.dominatedNodes): (WebInspector.HeapSnapshotNodeProxy.prototype.retainedNodes): (WebInspector.HeapSnapshotNodeProxy.prototype.retainers): Node data and methods to query for node relationships. * UserInterface/Proxies/HeapSnapshotProxy.js: Added. (WebInspector.HeapSnapshotProxy): (WebInspector.HeapSnapshotProxy.deserialize): (WebInspector.HeapSnapshotProxy.prototype.get proxyObjectId): (WebInspector.HeapSnapshotProxy.prototype.get identifier): (WebInspector.HeapSnapshotProxy.prototype.get totalSize): (WebInspector.HeapSnapshotProxy.prototype.get totalObjectCount): (WebInspector.HeapSnapshotProxy.prototype.get categories): (WebInspector.HeapSnapshotProxy.prototype.allocationBucketCounts): (WebInspector.HeapSnapshotProxy.prototype.instancesWithClassName): (WebInspector.HeapSnapshotProxy.prototype.nodeWithIdentifier): Snapshot data and methods to query for nodes. * UserInterface/Proxies/HeapSnapshotWorkerProxy.js: Added. (WebInspector.HeapSnapshotWorkerProxy): (WebInspector.HeapSnapshotWorkerProxy.singleton): (WebInspector.HeapSnapshotWorkerProxy.prototype.createSnapshot): (WebInspector.HeapSnapshotWorkerProxy.prototype.createSnapshotDiff): (WebInspector.HeapSnapshotWorkerProxy.prototype.performAction): (WebInspector.HeapSnapshotWorkerProxy.prototype.callMethod): (WebInspector.HeapSnapshotWorkerProxy.prototype._postMessage): (WebInspector.HeapSnapshotWorkerProxy.prototype._handleMessage): Singleton factory for the worker and proxied communication with the worker. Provide means for invoking "factory actions" and "object methods". * UserInterface/Workers/HeapSnapshot/HeapSnapshotWorker.js: Added. (HeapSnapshotWorker): (HeapSnapshotWorker.prototype.createSnapshot): (HeapSnapshotWorker.prototype.createSnapshotDiff): (HeapSnapshotWorker.prototype.sendEvent): (HeapSnapshotWorker.prototype._handleMessage): Main worker code. Handle dispatching actions and methods. * UserInterface/Workers/HeapSnapshot/HeapSnapshot.js: Added. (HeapSnapshot): (HeapSnapshot.buildCategories): (HeapSnapshot.allocationBucketCounts): (HeapSnapshot.instancesWithClassName): (HeapSnapshot.prototype.allocationBucketCounts): (HeapSnapshot.prototype.instancesWithClassName): (HeapSnapshot.prototype.nodeWithIdentifier): (HeapSnapshot.prototype.shortestGCRootPath): (HeapSnapshot.prototype.dominatedNodes): (HeapSnapshot.prototype.retainedNodes): (HeapSnapshot.prototype.retainers): (HeapSnapshot.prototype.serialize): (HeapSnapshot.prototype.serializeNode): (HeapSnapshot.prototype.serializeEdge): (HeapSnapshot.prototype._buildOutgoingEdges): (HeapSnapshot.prototype._buildIncomingEdges): (HeapSnapshot.prototype._buildPostOrderIndexes): (HeapSnapshot.prototype._buildDominatorIndexes): (HeapSnapshot.prototype._buildRetainedSizes): (HeapSnapshot.prototype._gcRootPathes.visitNode): (HeapSnapshot.prototype._gcRootPathes): (HeapSnapshotDiff): (HeapSnapshotDiff.prototype.allocationBucketCounts): (HeapSnapshotDiff.prototype.instancesWithClassName): (HeapSnapshotDiff.prototype.nodeWithIdentifier): (HeapSnapshotDiff.prototype.shortestGCRootPath): (HeapSnapshotDiff.prototype.dominatedNodes): (HeapSnapshotDiff.prototype.retainedNodes): (HeapSnapshotDiff.prototype.retainers): (HeapSnapshotDiff.prototype.serialize): New HeapSnapshot data processing implementation. Instead of creating a new object per Node or per Edge create data arrays containing data per-Node. Operate on these lists of data instead of creating many objects. LayoutTests: * inspector/heap/getPreview.html: * inspector/heap/getRemoteObject.html: * inspector/heap/snapshot.html: Update tests to use the new HeapSnapshotWorker frontend code. * inspector/unit-tests/heap-snapshot-expected.txt: Added. * inspector/unit-tests/heap-snapshot.html: Added. Verify the data processing in and worker communication work HeapSnapshotWorker produces expected values when compared with the simple HeapSnapshot/Node/Edge implentation. Canonical link: https://commits.webkit.org/173715@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@198353 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-03-17 21:02:07 +00:00
PASS: Node values should match.