Title: [217843] trunk
Revision
217843
Author
[email protected]
Date
2017-06-06 11:15:31 -0700 (Tue, 06 Jun 2017)

Log Message

Unreviewed rollout r217807. Caused a test to crash.

JSTests:

* heapProfiler/class-names.js: Removed.
* heapProfiler/driver/driver.js:
(CheapHeapSnapshotNode):
(CheapHeapSnapshot):
(createCheapHeapSnapshot):
(HeapSnapshot):
(createHeapSnapshot):
* typeProfiler/inheritance.js:
(wrapper.A):
(wrapper.B):
(wrapper.C):
(wrapper):

Source/_javascript_Core:

* heap/HeapSnapshotBuilder.cpp:
(JSC::HeapSnapshotBuilder::buildSnapshot):
(JSC::HeapSnapshotBuilder::json):
(): Deleted.
* heap/HeapSnapshotBuilder.h:
* runtime/JSObject.cpp:
(JSC::JSObject::calculatedClassName):

Source/WebInspectorUI:

* UserInterface/Proxies/HeapSnapshotNodeProxy.js:
(WebInspector.HeapSnapshotNodeProxy):
(WebInspector.HeapSnapshotNodeProxy.deserialize):
* UserInterface/Views/HeapSnapshotClassDataGridNode.js:
(WebInspector.HeapSnapshotClassDataGridNode.prototype.createCellContent):
* UserInterface/Views/HeapSnapshotClusterContentView.js:
(WebInspector.HeapSnapshotClusterContentView.iconStyleClassNameForClassName):
* UserInterface/Views/HeapSnapshotDataGridTree.js:
(WebInspector.HeapSnapshotInstancesDataGridTree.prototype.populateTopLevel):
* UserInterface/Views/HeapSnapshotInstanceDataGridNode.js:
(WebInspector.HeapSnapshotInstanceDataGridNode.prototype.createCellContent):
(WebInspector.HeapSnapshotInstanceDataGridNode.prototype._mouseoverHandler.appendPathRow):
* UserInterface/Workers/HeapSnapshot/HeapSnapshot.js:
(HeapSnapshot):
(HeapSnapshot.updateCategoriesAndMetadata):
(HeapSnapshot.prototype.serializeNode):
(HeapSnapshot.prototype._gcRootPathes.visitNode):
(HeapSnapshot.prototype._gcRootPathes):

LayoutTests:

* inspector/unit-tests/heap-snapshot-expected.txt:
* inspector/unit-tests/heap-snapshot.html:

Modified Paths

Removed Paths

Diff

Modified: trunk/JSTests/ChangeLog (217842 => 217843)


--- trunk/JSTests/ChangeLog	2017-06-06 18:11:21 UTC (rev 217842)
+++ trunk/JSTests/ChangeLog	2017-06-06 18:15:31 UTC (rev 217843)
@@ -1,3 +1,20 @@
+2017-06-06  Joseph Pecoraro  <[email protected]>
+
+        Unreviewed rollout r217807. Caused a test to crash.
+
+        * heapProfiler/class-names.js: Removed.
+        * heapProfiler/driver/driver.js:
+        (CheapHeapSnapshotNode):
+        (CheapHeapSnapshot):
+        (createCheapHeapSnapshot):
+        (HeapSnapshot):
+        (createHeapSnapshot):
+        * typeProfiler/inheritance.js:
+        (wrapper.A):
+        (wrapper.B):
+        (wrapper.C):
+        (wrapper):
+
 2017-06-06  Filip Pizlo  <[email protected]>
 
         index out of bound in bytecodebasicblock

Deleted: trunk/JSTests/heapProfiler/class-names.js (217842 => 217843)


--- trunk/JSTests/heapProfiler/class-names.js	2017-06-06 18:11:21 UTC (rev 217842)
+++ trunk/JSTests/heapProfiler/class-names.js	2017-06-06 18:15:31 UTC (rev 217843)
@@ -1,44 +0,0 @@
-load("./driver/driver.js");
-
-function MyES5ClassUgly() {};
-MyES5ClassUgly.displayName = "MyES5ClassDisplayName";
-MyES5ClassUgly.prototype = { constructor: MyES5ClassUgly };
-
-class MyES6Class {};
-class MyES6Subclass extends MyES6Class {};
-
-let classInstances = [];
-for (let i = 0; i < 5; ++i)
-    classInstances.push(new MyES5ClassUgly);
-for (let i = 0; i < 10; ++i)
-    classInstances.push(new MyES6Class);
-for (let i = 0; i < 20; ++i)
-    classInstances.push(new MyES6Subclass);
-
-let myFunction = function() {};
-let myMap = new Map;
-
-(function() {
-    let nodes;
-    let snapshot = createCheapHeapSnapshot();
-
-    nodes = snapshot.nodesWithClassName("MyES5ClassDisplayName");
-    assert(nodes.length === 5, "Snapshot should contain 5 'MyES5ClassDisplayName' (MyES5ClassUgly) instances");
-    assert(nodes[0].isObjectType, "MyES5Class instance should have had its ObjectType flag set");
-
-    nodes = snapshot.nodesWithClassName("MyES6Class");
-    assert(nodes.length === 10, "Snapshot should contain 10 'MyES6Class' instances");
-    assert(nodes[0].isObjectType, "MyES6Class instance should have had its ObjectType flag set");
-
-    nodes = snapshot.nodesWithClassName("MyES6Subclass");
-    assert(nodes.length === 20, "Snapshot should contain 20 'MyES6Subclass' instances");
-    assert(nodes[0].isObjectType, "MyES6Subclass instance should have had its ObjectType flag set");
-
-    nodes = snapshot.nodesWithClassName("Function");
-    assert(nodes.length > 0, "Should be at least 1 Function instance");
-    assert(!nodes[0].isObjectType, "Function instance should not have its ObjectType flag set");
-
-    nodes = snapshot.nodesWithClassName("Map");
-    assert(nodes.length > 0, "Should be at least 1 Map instance");
-    assert(!nodes[0].isObjectType, "Map instance should not have its ObjectType flag set");
-})();

Modified: trunk/JSTests/heapProfiler/driver/driver.js (217842 => 217843)


--- trunk/JSTests/heapProfiler/driver/driver.js	2017-06-06 18:11:21 UTC (rev 217842)
+++ trunk/JSTests/heapProfiler/driver/driver.js	2017-06-06 18:15:31 UTC (rev 217843)
@@ -14,14 +14,10 @@
 const nodeIdOffset = 0;
 const nodeSizeOffset = 1;
 const nodeClassNameOffset = 2;
-const nodeFlagsOffset = 3;
+const nodeInternalOffset = 3;
 const nodeFirstEdgeOffset = 4;
 const nodeNoEdgeValue = 0xffffffff; // UINT_MAX
 
-// Node Flags.
-const internalFlagMask = (1 << 0);
-const objectTypeMask = (1 << 1);
-
 // [<0:fromId>, <1:toId>, <2:typeTableIndex>, <3:edgeDataIndexOrEdgeNameIndex>]
 const edgeFieldCount = 4;
 const edgeFromIdOffset = 0;
@@ -39,11 +35,8 @@
         this.id = nodes[nodeIndex + nodeIdOffset];
         this.size = nodes[nodeIndex + nodeSizeOffset];
         this.className = snapshot.classNameFromTableIndex(nodes[nodeIndex + nodeClassNameOffset]);
+        this.internal = nodes[nodeIndex + nodeInternalOffset] ? true : false;
 
-        let flags = nodes[nodeIndex + nodeFlagsOffset];
-        this.internal = flags & internalFlagMask ? true : false;
-        this.isObjectType = flags & objectTypeMask ? true : false;
-
         this.outgoingEdges = [];
         let firstEdgeIndex = nodes[nodeIndex + nodeFirstEdgeOffset];
         if (firstEdgeIndex !== nodeNoEdgeValue) {
@@ -98,7 +91,7 @@
             this._nodes[n++] = nodes[i++]; // id
             this._nodes[n++] = nodes[i++]; // size
             this._nodes[n++] = nodes[i++]; // classNameTableIndex
-            this._nodes[n++] = nodes[i++]; // flags
+            this._nodes[n++] = nodes[i++]; // internal
             this._nodes[n++] = nodeNoEdgeValue;
         }
 
@@ -161,7 +154,7 @@
     let json = generateHeapSnapshot();
 
     let {version, nodes, nodeClassNames, edges, edgeTypes} = json;
-    assert(version === 2, "Heap Snapshot payload should be version 2");
+    assert(version === 1, "Heap Snapshot payload should be version 1");
     assert(nodes.length, "Heap Snapshot should have nodes");
     assert(nodeClassNames.length, "Heap Snapshot should have nodeClassNames");
     assert(edges.length, "Heap Snapshot should have edges");
@@ -217,8 +210,7 @@
             let id = nodes[i++];
             let size = nodes[i++];
             let classNameIndex = nodes[i++];
-            let flags = nodes[i++];
-            let internal = flags & internalFlagMask ? true : false;
+            let internal = nodes[i++];
 
             let node = new HeapSnapshotNode(id, nodeClassNames[classNameIndex], size, internal);
             this.nodeMap.set(id, node);
@@ -264,7 +256,7 @@
     let json = generateHeapSnapshot();
 
     let {version, nodes, nodeClassNames, edges, edgeTypes} = json;
-    assert(version === 2, "Heap Snapshot payload should be version 2");
+    assert(version === 1, "Heap Snapshot payload should be version 1");
     assert(nodes.length, "Heap Snapshot should have nodes");
     assert(nodeClassNames.length, "Heap Snapshot should have nodeClassNames");
     assert(edges.length, "Heap Snapshot should have edges");

Modified: trunk/JSTests/typeProfiler/inheritance.js (217842 => 217843)


--- trunk/JSTests/typeProfiler/inheritance.js	2017-06-06 18:11:21 UTC (rev 217842)
+++ trunk/JSTests/typeProfiler/inheritance.js	2017-06-06 18:15:31 UTC (rev 217843)
@@ -3,10 +3,6 @@
 function wrapper()
 {
 
-function A() { };
-function B() { };
-function C() { };
-
 var theA = new A;
 var theB = new B;
 var theC = new C;
@@ -18,8 +14,9 @@
 
 var secondB = Object.create(theB);
 
-B.prototype.__proto__ = A.prototype;
-C.prototype.__proto__ = A.prototype;
+function A() { };
+function B() { }; B.prototype.__proto__ = A.prototype;
+function C() { }; C.prototype.__proto__ = A.prototype;
 
 }
 wrapper();

Modified: trunk/LayoutTests/ChangeLog (217842 => 217843)


--- trunk/LayoutTests/ChangeLog	2017-06-06 18:11:21 UTC (rev 217842)
+++ trunk/LayoutTests/ChangeLog	2017-06-06 18:15:31 UTC (rev 217843)
@@ -1,3 +1,10 @@
+2017-06-06  Joseph Pecoraro  <[email protected]>
+
+        Unreviewed rollout r217807. Caused a test to crash.
+
+        * inspector/unit-tests/heap-snapshot-expected.txt:
+        * inspector/unit-tests/heap-snapshot.html:
+
 2017-06-06  Antoine Quint  <[email protected]>
 
         Rebaseline and enable media/modern-media-controls/audio

Modified: trunk/LayoutTests/inspector/unit-tests/heap-snapshot-expected.txt (217842 => 217843)


--- trunk/LayoutTests/inspector/unit-tests/heap-snapshot-expected.txt	2017-06-06 18:11:21 UTC (rev 217842)
+++ trunk/LayoutTests/inspector/unit-tests/heap-snapshot-expected.txt	2017-06-06 18:15:31 UTC (rev 217843)
@@ -23,7 +23,6 @@
 PASS: Node identifier should match.
 PASS: Node size should match.
 PASS: Node internal state should match.
-PASS: Node isObjectType state should match.
 PASS: Node gcRoot state should match.
 PASS: Node retainedSize should at least be the size.
 

Modified: trunk/LayoutTests/inspector/unit-tests/heap-snapshot.html (217842 => 217843)


--- trunk/LayoutTests/inspector/unit-tests/heap-snapshot.html	2017-06-06 18:11:21 UTC (rev 217842)
+++ trunk/LayoutTests/inspector/unit-tests/heap-snapshot.html	2017-06-06 18:15:31 UTC (rev 217843)
@@ -9,13 +9,12 @@
 
     WebInspector.TestHeapSnapshotNode = class TestHeapSnapshotNode
     {
-        constructor(identifier, className, size, flags)
+        constructor(identifier, className, size, internal)
         {
             this.id = identifier;
             this.className = className;
             this.size = size; 
-            this.internal = flags & (1 << 0) ? true : false;
-            this.isObjectType = flags & (1 << 1) ? true : false;
+            this.internal = internal;
             this.gcRoot = false;
             this.outgoingEdges = [];
             this.incomingEdges = [];
@@ -60,9 +59,9 @@
                 let id = nodes[i++];
                 let size = nodes[i++];
                 let classNameIndex = nodes[i++];
-                let flags = nodes[i++];
+                let internal = nodes[i++];
 
-                let node = new WebInspector.TestHeapSnapshotNode(id, nodeClassNames[classNameIndex], size, flags);
+                let node = new WebInspector.TestHeapSnapshotNode(id, nodeClassNames[classNameIndex], size, !!internal);
                 nodeMap.set(id, node);
                 processedNodes.push(node);
             }
@@ -128,7 +127,6 @@
             && node1.size === node2.size
             && node1.className === node2.className
             && node1.internal === node2.internal
-            && node1.isObjectType === node2.isObjectType
             && node1.gcRoot === node2.gcRoot;
     }
 
@@ -191,7 +189,6 @@
                 InspectorTest.expectThat(heapSnapshotNode.id === testSnapshotNodeForWindowObject.id, "Node identifier should match.")
                 InspectorTest.expectThat(heapSnapshotNode.size === testSnapshotNodeForWindowObject.size, "Node size should match.");
                 InspectorTest.expectThat(heapSnapshotNode.internal === testSnapshotNodeForWindowObject.internal, "Node internal state should match.");
-                InspectorTest.expectThat(heapSnapshotNode.isObjectType === testSnapshotNodeForWindowObject.isObjectType, "Node isObjectType state should match.");
                 InspectorTest.expectThat(heapSnapshotNode.gcRoot === testSnapshotNodeForWindowObject.gcRoot, "Node gcRoot state should match.");
                 InspectorTest.expectThat(heapSnapshotNode.retainedSize >= heapSnapshotNode.size, "Node retainedSize should at least be the size.");
                 resolve();

Modified: trunk/Source/_javascript_Core/ChangeLog (217842 => 217843)


--- trunk/Source/_javascript_Core/ChangeLog	2017-06-06 18:11:21 UTC (rev 217842)
+++ trunk/Source/_javascript_Core/ChangeLog	2017-06-06 18:15:31 UTC (rev 217843)
@@ -1,3 +1,15 @@
+2017-06-06  Joseph Pecoraro  <[email protected]>
+
+        Unreviewed rollout r217807. Caused a test to crash.
+
+        * heap/HeapSnapshotBuilder.cpp:
+        (JSC::HeapSnapshotBuilder::buildSnapshot):
+        (JSC::HeapSnapshotBuilder::json):
+        (): Deleted.
+        * heap/HeapSnapshotBuilder.h:
+        * runtime/JSObject.cpp:
+        (JSC::JSObject::calculatedClassName):
+
 2017-06-06  Filip Pizlo  <[email protected]>
 
         index out of bound in bytecodebasicblock

Modified: trunk/Source/_javascript_Core/heap/HeapSnapshotBuilder.cpp (217842 => 217843)


--- trunk/Source/_javascript_Core/heap/HeapSnapshotBuilder.cpp	2017-06-06 18:11:21 UTC (rev 217842)
+++ trunk/Source/_javascript_Core/heap/HeapSnapshotBuilder.cpp	2017-06-06 18:15:31 UTC (rev 217843)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2016-2017 Apple Inc. All rights reserved.
+ * Copyright (C) 2016 Apple Inc. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -20,7 +20,7 @@
  * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
  * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
  */
 
 #include "config.h"
@@ -37,7 +37,7 @@
 #include <wtf/text/StringBuilder.h>
 
 namespace JSC {
-
+    
 unsigned HeapSnapshotBuilder::nextAvailableObjectIdentifier = 1;
 unsigned HeapSnapshotBuilder::getNextObjectIdentifier() { return nextAvailableObjectIdentifier++; }
 void HeapSnapshotBuilder::resetNextAvailableObjectIdentifier() { HeapSnapshotBuilder::nextAvailableObjectIdentifier = 1; }
@@ -54,7 +54,7 @@
 void HeapSnapshotBuilder::buildSnapshot()
 {
     PreventCollectionScope preventCollectionScope(m_profiler.vm().heap);
-
+    
     m_snapshot = std::make_unique<HeapSnapshot>(m_profiler.mostRecentSnapshot());
     {
         m_profiler.setActiveSnapshotBuilder(this);
@@ -135,10 +135,10 @@
 // Heap Snapshot JSON Format:
 //
 //   {
-//      "version": 2,
+//      "version": 1.0,
 //      "nodes": [
-//          <nodeId>, <sizeInBytes>, <nodeClassNameIndex>, <flags>,
-//          <nodeId>, <sizeInBytes>, <nodeClassNameIndex>, <flags>,
+//          <nodeId>, <sizeInBytes>, <nodeClassNameIndex>, <internal>,
+//          <nodeId>, <sizeInBytes>, <nodeClassNameIndex>, <internal>,
 //          ...
 //      ],
 //      "nodeClassNames": [
@@ -162,10 +162,8 @@
 //     <nodeClassNameIndex>
 //       - index into the "nodeClassNames" list.
 //
-//     <flags>
-//       - 0b0000 - no flags
-//       - 0b0001 - internal instance
-//       - 0b0010 - Object subclassification
+//     <internal>
+//       - 0 = false, 1 = true.
 //
 //     <edgeTypeIndex>
 //       - index into the "edgeTypes" list.
@@ -175,11 +173,6 @@
 //       - for Index edges this is the index value.
 //       - for Property or Variable edges this is an index into the "edgeNames" list.
 
-typedef enum {
-    Internal      = 1 << 0,
-    ObjectSubtype = 1 << 1,
-} NodeFlags;
-
 static uint8_t edgeTypeToNumber(EdgeType type)
 {
     return static_cast<uint8_t>(type);
@@ -230,38 +223,20 @@
         if (!allowNodeCallback(node))
             return;
 
-        unsigned flags = 0;
-
         allowedNodeIdentifiers.set(node.cell, node.identifier);
 
-        const char* className = node.cell->classInfo(vm)->className;
-        if (node.cell->isObject() && !strcmp(className, JSObject::info()->className)) {
-            flags |= ObjectSubtype;
-
-            // Skip calculating a class name if this object has a `constructor` own property.
-            // These cases are typically F.prototype objects and we want to treat these as
-            // "Object" in snapshots and not get the name of what the prototype's parent.
-            JSObject* object = jsCast<JSObject*>(node.cell);
-            if (JSGlobalObject* globalObject = object->structure(vm)->globalObject()) {
-                ExecState* exec = globalObject->globalExec();
-                PropertySlot slot(object, PropertySlot::InternalMethodType::VMInquiry);
-                if (!object->getOwnPropertySlot(object, exec, vm.propertyNames->constructor, slot))
-                    className = JSObject::calculatedClassName(object).utf8().data();
-            }
-        }
-
-        auto result = classNameIndexes.add(className, nextClassNameIndex);
+        auto result = classNameIndexes.add(node.cell->classInfo(vm)->className, nextClassNameIndex);
         if (result.isNewEntry)
             nextClassNameIndex++;
         unsigned classNameIndex = result.iterator->value;
 
+        bool isInternal = false;
         if (!node.cell->isString()) {
             Structure* structure = node.cell->structure(vm);
-            if (!structure || !structure->globalObject())
-                flags |= Internal;
+            isInternal = !structure || !structure->globalObject();
         }
 
-        // <nodeId>, <sizeInBytes>, <className>, <flags>
+        // <nodeId>, <sizeInBytes>, <className>, <optionalInternalBoolean>
         json.append(',');
         json.appendNumber(node.identifier);
         json.append(',');
@@ -269,7 +244,7 @@
         json.append(',');
         json.appendNumber(classNameIndex);
         json.append(',');
-        json.appendNumber(flags);
+        json.append(isInternal ? '1' : '0');
     };
 
     bool firstEdge = true;
@@ -308,7 +283,7 @@
     json.append('{');
 
     // version
-    json.appendLiteral("\"version\":2");
+    json.appendLiteral("\"version\":1");
 
     // nodes
     json.append(',');

Modified: trunk/Source/_javascript_Core/heap/HeapSnapshotBuilder.h (217842 => 217843)


--- trunk/Source/_javascript_Core/heap/HeapSnapshotBuilder.h	2017-06-06 18:11:21 UTC (rev 217842)
+++ trunk/Source/_javascript_Core/heap/HeapSnapshotBuilder.h	2017-06-06 18:15:31 UTC (rev 217843)
@@ -36,8 +36,6 @@
 class HeapProfiler;
 class HeapSnapshot;
 class JSCell;
-class JSObject;
-class VM;
 
 struct HeapSnapshotNode {
     HeapSnapshotNode(JSCell* cell, unsigned identifier)

Modified: trunk/Source/_javascript_Core/runtime/JSObject.cpp (217842 => 217843)


--- trunk/Source/_javascript_Core/runtime/JSObject.cpp	2017-06-06 18:11:21 UTC (rev 217842)
+++ trunk/Source/_javascript_Core/runtime/JSObject.cpp	2017-06-06 18:15:31 UTC (rev 217843)
@@ -526,23 +526,19 @@
 String JSObject::calculatedClassName(JSObject* object)
 {
     String prototypeFunctionName;
-    auto structure = object->structure();
-    auto globalObject = structure->globalObject();
+    auto globalObject = object->globalObject();
     VM& vm = globalObject->vm();
     auto scope = DECLARE_CATCH_SCOPE(vm);
 
-    // Get the display name of obj.__proto__.constructor.
-    MethodTable::GetPrototypeFunctionPtr defaultGetPrototype = JSObject::getPrototype;
-    if (structure->classInfo()->methodTable.getPrototype == defaultGetPrototype) {
-        JSValue protoValue = object->getPrototypeDirect();
-        if (protoValue.isObject()) {
-            JSObject* protoObject = jsCast<JSObject*>(protoValue);
-            ExecState* exec = globalObject->globalExec();
-            PropertyName constructor(exec->propertyNames().constructor);
-            PropertySlot slot(protoValue, PropertySlot::InternalMethodType::VMInquiry);
-            if (protoObject->getPropertySlot(exec, constructor, slot)) {
-                if (slot.isValue()) {
-                    if (JSObject* ctorObject = jsDynamicCast<JSObject*>(vm, slot.getValue(exec, constructor))) {
+    ExecState* exec = globalObject->globalExec();
+    PropertySlot slot(object->getPrototypeDirect(), PropertySlot::InternalMethodType::VMInquiry);
+    PropertyName constructor(exec->propertyNames().constructor);
+    if (object->getPropertySlot(exec, constructor, slot)) {
+        if (slot.isValue()) {
+            JSValue constructorValue = slot.getValue(exec, constructor);
+            if (constructorValue.isCell()) {
+                if (JSCell* constructorCell = constructorValue.asCell()) {
+                    if (JSObject* ctorObject = constructorCell->getObject()) {
                         if (JSFunction* constructorFunction = jsDynamicCast<JSFunction*>(vm, ctorObject))
                             prototypeFunctionName = constructorFunction->calculatedDisplayName(vm);
                         else if (InternalFunction* constructorFunction = jsDynamicCast<InternalFunction*>(vm, ctorObject))
@@ -552,7 +548,6 @@
             }
         }
     }
-
     ASSERT(!scope.exception() || prototypeFunctionName.isNull());
     if (UNLIKELY(scope.exception()))
         scope.clearException();

Modified: trunk/Source/WebInspectorUI/ChangeLog (217842 => 217843)


--- trunk/Source/WebInspectorUI/ChangeLog	2017-06-06 18:11:21 UTC (rev 217842)
+++ trunk/Source/WebInspectorUI/ChangeLog	2017-06-06 18:15:31 UTC (rev 217843)
@@ -1,3 +1,26 @@
+2017-06-06  Joseph Pecoraro  <[email protected]>
+
+        Unreviewed rollout r217807. Caused a test to crash.
+
+        * UserInterface/Proxies/HeapSnapshotNodeProxy.js:
+        (WebInspector.HeapSnapshotNodeProxy):
+        (WebInspector.HeapSnapshotNodeProxy.deserialize):
+        * UserInterface/Views/HeapSnapshotClassDataGridNode.js:
+        (WebInspector.HeapSnapshotClassDataGridNode.prototype.createCellContent):
+        * UserInterface/Views/HeapSnapshotClusterContentView.js:
+        (WebInspector.HeapSnapshotClusterContentView.iconStyleClassNameForClassName):
+        * UserInterface/Views/HeapSnapshotDataGridTree.js:
+        (WebInspector.HeapSnapshotInstancesDataGridTree.prototype.populateTopLevel):
+        * UserInterface/Views/HeapSnapshotInstanceDataGridNode.js:
+        (WebInspector.HeapSnapshotInstanceDataGridNode.prototype.createCellContent):
+        (WebInspector.HeapSnapshotInstanceDataGridNode.prototype._mouseoverHandler.appendPathRow):
+        * UserInterface/Workers/HeapSnapshot/HeapSnapshot.js:
+        (HeapSnapshot):
+        (HeapSnapshot.updateCategoriesAndMetadata):
+        (HeapSnapshot.prototype.serializeNode):
+        (HeapSnapshot.prototype._gcRootPathes.visitNode):
+        (HeapSnapshot.prototype._gcRootPathes):
+
 2017-06-05  Joseph Pecoraro  <[email protected]>
 
         Web Inspector: Improve ES6 Class instances in Heap Snapshot instances view

Modified: trunk/Source/WebInspectorUI/UserInterface/Proxies/HeapSnapshotNodeProxy.js (217842 => 217843)


--- trunk/Source/WebInspectorUI/UserInterface/Proxies/HeapSnapshotNodeProxy.js	2017-06-06 18:11:21 UTC (rev 217842)
+++ trunk/Source/WebInspectorUI/UserInterface/Proxies/HeapSnapshotNodeProxy.js	2017-06-06 18:15:31 UTC (rev 217843)
@@ -25,7 +25,7 @@
 
 WebInspector.HeapSnapshotNodeProxy = class HeapSnapshotNodeProxy
 {
-    constructor(snapshotObjectId, identifier, className, size, retainedSize, internal, isObjectType, gcRoot, dead, dominatorNodeIdentifier, hasChildren)
+    constructor(snapshotObjectId, identifier, className, size, retainedSize, internal, gcRoot, dead, dominatorNodeIdentifier, hasChildren)
     {
         this._proxyObjectId = snapshotObjectId;
 
@@ -34,7 +34,6 @@
         this.size = size;
         this.retainedSize = retainedSize;
         this.internal = internal;
-        this.isObjectType = isObjectType;
         this.gcRoot = gcRoot;
         this.dead = dead;
         this.dominatorNodeIdentifier = dominatorNodeIdentifier;
@@ -45,8 +44,8 @@
 
     static deserialize(objectId, serializedNode)
     {
-        let {id, className, size, retainedSize, internal, isObjectType, gcRoot, dead, dominatorNodeIdentifier, hasChildren} = serializedNode;
-        return new WebInspector.HeapSnapshotNodeProxy(objectId, id, className, size, retainedSize, internal, isObjectType, gcRoot, dead, dominatorNodeIdentifier, hasChildren);
+        let {id, className, size, retainedSize, internal, gcRoot, dead, dominatorNodeIdentifier, hasChildren} = serializedNode;
+        return new WebInspector.HeapSnapshotNodeProxy(objectId, id, className, size, retainedSize, internal, gcRoot, dead, dominatorNodeIdentifier, hasChildren);
     }
 
     // Proxied

Modified: trunk/Source/WebInspectorUI/UserInterface/Views/HeapSnapshotClassDataGridNode.js (217842 => 217843)


--- trunk/Source/WebInspectorUI/UserInterface/Views/HeapSnapshotClassDataGridNode.js	2017-06-06 18:11:21 UTC (rev 217842)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/HeapSnapshotClassDataGridNode.js	2017-06-06 18:15:31 UTC (rev 217843)
@@ -60,11 +60,10 @@
             return Number.bytesToString(this._data.size);
 
         if (columnIdentifier === "className") {
-            const internal = false;
-            let {className, isObjectSubcategory} = this._data;
+            let {className} = this._data;
             let fragment = document.createDocumentFragment();
             let iconElement = fragment.appendChild(document.createElement("img"));
-            iconElement.classList.add("icon", WebInspector.HeapSnapshotClusterContentView.iconStyleClassNameForClassName(className, internal, isObjectSubcategory));
+            iconElement.classList.add("icon", WebInspector.HeapSnapshotClusterContentView.iconStyleClassNameForClassName(className));
             let nameElement = fragment.appendChild(document.createElement("span"));
             nameElement.classList.add("class-name");
             nameElement.textContent = className;

Modified: trunk/Source/WebInspectorUI/UserInterface/Views/HeapSnapshotClusterContentView.js (217842 => 217843)


--- trunk/Source/WebInspectorUI/UserInterface/Views/HeapSnapshotClusterContentView.js	2017-06-06 18:11:21 UTC (rev 217842)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/HeapSnapshotClusterContentView.js	2017-06-06 18:15:31 UTC (rev 217843)
@@ -58,12 +58,10 @@
 
     // Static
 
-    static iconStyleClassNameForClassName(className, internal, isObjectType)
+    static iconStyleClassNameForClassName(className, internal)
     {
         if (internal)
             return "native";
-        if (isObjectType)
-            return "object";
 
         switch (className) {
         case "Object":

Modified: trunk/Source/WebInspectorUI/UserInterface/Views/HeapSnapshotDataGridTree.js (217842 => 217843)


--- trunk/Source/WebInspectorUI/UserInterface/Views/HeapSnapshotDataGridTree.js	2017-06-06 18:11:21 UTC (rev 217842)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/HeapSnapshotDataGridTree.js	2017-06-06 18:15:31 UTC (rev 217843)
@@ -216,8 +216,7 @@
     populateTopLevel()
     {
         // Populate the first level with the different non-internal classes.
-        for (let [className, {size, retainedSize, count, internalCount, deadCount, objectCount}] of this.heapSnapshot.categories) {
-            console.assert(count > 0);
+        for (let [className, {size, retainedSize, count, internalCount, deadCount}] of this.heapSnapshot.categories) {
             if (count === internalCount)
                 continue;
 
@@ -226,11 +225,7 @@
             if (!liveCount)
                 continue;
 
-            // If over half of the objects with this class name are Object sub-types, treat this as an Object category.
-            // This can happen if the page has a _javascript_ Class with the same name as a native class.
-            let isObjectSubcategory = (objectCount / count) > 0.5;
-
-            this.appendChild(new WebInspector.HeapSnapshotClassDataGridNode({className, size, retainedSize, isObjectSubcategory, count: liveCount}, this));
+            this.appendChild(new WebInspector.HeapSnapshotClassDataGridNode({className, size, retainedSize, count: liveCount}, this));
         }
 
         this.didPopulate();

Modified: trunk/Source/WebInspectorUI/UserInterface/Views/HeapSnapshotInstanceDataGridNode.js (217842 => 217843)


--- trunk/Source/WebInspectorUI/UserInterface/Views/HeapSnapshotInstanceDataGridNode.js	2017-06-06 18:11:21 UTC (rev 217842)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/HeapSnapshotInstanceDataGridNode.js	2017-06-06 18:15:31 UTC (rev 217843)
@@ -146,12 +146,12 @@
             return Number.bytesToString(this._node.size);
 
         if (columnIdentifier === "className") {
-            let {className, id, internal, isObjectType} = this._node;
+            let {className, id, internal} = this._node;
             let containerElement = document.createElement("span");
             containerElement.addEventListener("contextmenu", this._contextMenuHandler.bind(this));
 
             let iconElement = containerElement.appendChild(document.createElement("img"));
-            iconElement.classList.add("icon", WebInspector.HeapSnapshotClusterContentView.iconStyleClassNameForClassName(className, internal, isObjectType));
+            iconElement.classList.add("icon", WebInspector.HeapSnapshotClusterContentView.iconStyleClassNameForClassName(className, internal));
 
             if (this._edge) {
                 let nameElement = containerElement.appendChild(document.createElement("span"));
@@ -410,7 +410,7 @@
             containerElement.classList.add("node");
 
             let iconElement = containerElement.appendChild(document.createElement("img"));
-            iconElement.classList.add("icon", WebInspector.HeapSnapshotClusterContentView.iconStyleClassNameForClassName(node.className, node.internal, node.isObjectType));
+            iconElement.classList.add("icon", WebInspector.HeapSnapshotClusterContentView.iconStyleClassNameForClassName(node.className, node.internal));
 
             let classNameElement = containerElement.appendChild(document.createElement("span"));
             classNameElement.textContent = sanitizeClassName(node.className) + " ";

Modified: trunk/Source/WebInspectorUI/UserInterface/Workers/HeapSnapshot/HeapSnapshot.js (217842 => 217843)


--- trunk/Source/WebInspectorUI/UserInterface/Workers/HeapSnapshot/HeapSnapshot.js	2017-06-06 18:11:21 UTC (rev 217842)
+++ trunk/Source/WebInspectorUI/UserInterface/Workers/HeapSnapshot/HeapSnapshot.js	2017-06-06 18:15:31 UTC (rev 217843)
@@ -30,17 +30,13 @@
  */
 
 // nodes
-// [<0:id>, <1:size>, <2:classNameTableIndex>, <3:flags>]
+// [<0:id>, <1:size>, <2:classNameTableIndex>, <3:internal>]
 const nodeFieldCount = 4;
 const nodeIdOffset = 0;
 const nodeSizeOffset = 1;
 const nodeClassNameOffset = 2;
-const nodeFlagsOffset = 3;
+const nodeInternalOffset = 3;
 
-// node flags
-const internalFlagsMask = (1 << 0);
-const objectTypeMask = (1 << 1);
-
 // edges
 // [<0:fromId>, <1:toId>, <2:typeTableIndex>, <3:edgeDataIndexOrEdgeNameIndex>]
 const edgeFieldCount = 4;
@@ -54,10 +50,6 @@
 const rootNodeOrdinal = 0;
 const rootNodeIdentifier = 0;
 
-// Version Differences:
-//   - In Version 1, node[3] now named <flags> was the value 0 or 1 indicating not-internal or internal.
-//   - In Version 2, this became a bitmask so multiple flags could be included without modifying the size.
-//
 // Terminology:
 //   - `nodeIndex` is an index into the `nodes` list.
 //   - `nodeOrdinal` is the order of the node in the `nodes` list. (nodeIndex / nodeFieldCount).
@@ -91,7 +83,7 @@
         snapshotDataString = null;
 
         let {version, nodes, nodeClassNames, edges, edgeTypes, edgeNames} = json;
-        console.assert(version === 1 || version === 2, "Expect _javascript_Core Heap Snapshot version 1 or 2");
+        console.assert(version === 1, "Expect _javascript_Core Heap Snapshot version 1");
 
         this._nodes = nodes;
         this._nodeCount = nodes.length / nodeFieldCount;
@@ -168,20 +160,18 @@
             let className = nodeClassNamesTable[classNameTableIndex];
             let size = nodes[nodeIndex + nodeSizeOffset];
             let retainedSize = nodeOrdinalToRetainedSizes[nodeOrdinal];
-            let flags = nodes[nodeIndex + nodeFlagsOffset];
+            let internal = nodes[nodeIndex + nodeInternalOffset] ? true : false;
             let dead = nodeOrdinalIsDead[nodeOrdinal] ? true : false;
 
             let category = categories[className];
             if (!category)
-                category = categories[className] = {className, size: 0, retainedSize: 0, count: 0, internalCount: 0, deadCount: 0, objectCount: 0};
+                category = categories[className] = {className, size: 0, retainedSize: 0, count: 0, internalCount: 0, deadCount: 0};
 
             category.size += size;
             category.retainedSize += retainedSize;
             category.count += 1;
-            if (flags & internalFlagsMask)
+            if (internal)
                 category.internalCount += 1;
-            if (flags & objectTypeMask)
-                category.objectCount += 1;
             if (dead)
                 category.deadCount += 1;
             else
@@ -423,7 +413,6 @@
         let nodeOrdinal = nodeIndex / nodeFieldCount;
         let edgeIndex = this._nodeOrdinalToFirstOutgoingEdge[nodeOrdinal];
         let hasChildren = this._edges[edgeIndex + edgeFromIdOffset] === nodeIdentifier;
-        let nodeFlags = this._nodes[nodeIndex + nodeFlagsOffset];
 
         let dominatorNodeOrdinal = this._nodeOrdinalToDominatorNodeOrdinal[nodeOrdinal];
         let dominatorNodeIndex = dominatorNodeOrdinal * nodeFieldCount;
@@ -434,8 +423,7 @@
             className: this._nodeClassNamesTable[this._nodes[nodeIndex + nodeClassNameOffset]],
             size: this._nodes[nodeIndex + nodeSizeOffset],
             retainedSize: this._nodeOrdinalToRetainedSizes[nodeOrdinal],
-            internal: nodeFlags & internalFlagsMask ? true : false,
-            isObjectType: nodeFlags & objectTypeMask ? true : false,
+            internal: this._nodes[nodeIndex + nodeInternalOffset] ? true : false,
             gcRoot: this._nodeOrdinalIsGCRoot[nodeOrdinal] ? true : false,
             dead: this._nodeOrdinalIsDead[nodeOrdinal] ? true : false,
             dominatorNodeIdentifier,
@@ -762,7 +750,7 @@
             for (let incomingEdgeIndex = incomingEdgeIndexEnd - 1; incomingEdgeIndex >= incomingEdgeIndexStart; --incomingEdgeIndex) {
                 let fromNodeOrdinal = this._incomingNodes[incomingEdgeIndex];
                 let fromNodeIndex = fromNodeOrdinal * nodeFieldCount;
-                let fromNodeIsInternal = this._nodes[fromNodeIndex + nodeFlagsOffset] & internalFlagsMask;
+                let fromNodeIsInternal = this._nodes[fromNodeIndex + nodeInternalOffset];
                 if (fromNodeIsInternal)
                     continue;
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to