Title: [233136] trunk/Source/WebCore
Revision
233136
Author
[email protected]
Date
2018-06-24 21:40:21 -0700 (Sun, 24 Jun 2018)

Log Message

Fix the DUMP_NODE_STATISTICS code so that it compiles
https://bugs.webkit.org/show_bug.cgi?id=186982

Reviewed by Anders Carlsson.

The DUMP_NODE_STATISTICS code had bitrotted. ENTITY_NODE no longer exists.
liveNodeSet needs to be a static function with a NeverDestroyed<>.

* dom/Node.cpp:
(WebCore::Node::dumpStatistics):
(WebCore::Node::trackForDebugging):
(WebCore::Node::~Node):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (233135 => 233136)


--- trunk/Source/WebCore/ChangeLog	2018-06-25 01:52:59 UTC (rev 233135)
+++ trunk/Source/WebCore/ChangeLog	2018-06-25 04:40:21 UTC (rev 233136)
@@ -1,5 +1,20 @@
 2018-06-24  Simon Fraser  <[email protected]>
 
+        Fix the DUMP_NODE_STATISTICS code so that it compiles
+        https://bugs.webkit.org/show_bug.cgi?id=186982
+
+        Reviewed by Anders Carlsson.
+
+        The DUMP_NODE_STATISTICS code had bitrotted. ENTITY_NODE no longer exists.
+        liveNodeSet needs to be a static function with a NeverDestroyed<>.
+
+        * dom/Node.cpp:
+        (WebCore::Node::dumpStatistics):
+        (WebCore::Node::trackForDebugging):
+        (WebCore::Node::~Node):
+
+2018-06-24  Simon Fraser  <[email protected]>
+
         Fix the composition underline to be transformed by -apple-color-filter
         https://bugs.webkit.org/show_bug.cgi?id=186983
         rdar://problem/40515558

Modified: trunk/Source/WebCore/dom/Node.cpp (233135 => 233136)


--- trunk/Source/WebCore/dom/Node.cpp	2018-06-25 01:52:59 UTC (rev 233135)
+++ trunk/Source/WebCore/dom/Node.cpp	2018-06-25 04:40:21 UTC (rev 233136)
@@ -86,7 +86,11 @@
 using namespace HTMLNames;
 
 #if DUMP_NODE_STATISTICS
-static HashSet<Node*> liveNodeSet;
+static HashSet<Node*>& liveNodeSet()
+{
+    static NeverDestroyed<HashSet<Node*>> liveNodes;
+    return liveNodes;
+}
 #endif
 
 void Node::dumpStatistics()
@@ -99,7 +103,6 @@
     size_t textNodes = 0;
     size_t cdataNodes = 0;
     size_t commentNodes = 0;
-    size_t entityNodes = 0;
     size_t piNodes = 0;
     size_t documentNodes = 0;
     size_t docTypeNodes = 0;
@@ -114,7 +117,7 @@
     size_t elementsWithRareData = 0;
     size_t elementsWithNamedNodeMap = 0;
 
-    for (auto* node : liveNodeSet) {
+    for (auto* node : liveNodeSet()) {
         if (node->hasRareData()) {
             ++nodesWithRareData;
             if (is<Element>(*node)) {
@@ -158,18 +161,14 @@
                 ++cdataNodes;
                 break;
             }
+            case PROCESSING_INSTRUCTION_NODE: {
+                ++piNodes;
+                break;
+            }
             case COMMENT_NODE: {
                 ++commentNodes;
                 break;
             }
-            case ENTITY_NODE: {
-                ++entityNodes;
-                break;
-            }
-            case PROCESSING_INSTRUCTION_NODE: {
-                ++piNodes;
-                break;
-            }
             case DOCUMENT_NODE: {
                 ++documentNodes;
                 break;
@@ -188,7 +187,7 @@
         }
     }
 
-    printf("Number of Nodes: %d\n\n", liveNodeSet.size());
+    printf("Number of Nodes: %d\n\n", liveNodeSet().size());
     printf("Number of Nodes with RareData: %zu\n\n", nodesWithRareData);
 
     printf("NodeType distribution:\n");
@@ -197,7 +196,6 @@
     printf("  Number of Text nodes: %zu\n", textNodes);
     printf("  Number of CDATASection nodes: %zu\n", cdataNodes);
     printf("  Number of Comment nodes: %zu\n", commentNodes);
-    printf("  Number of Entity nodes: %zu\n", entityNodes);
     printf("  Number of ProcessingInstruction nodes: %zu\n", piNodes);
     printf("  Number of Document nodes: %zu\n", documentNodes);
     printf("  Number of DocumentType nodes: %zu\n", docTypeNodes);
@@ -255,7 +253,7 @@
 #endif
 
 #if DUMP_NODE_STATISTICS
-    liveNodeSet.add(this);
+    liveNodeSet().add(this);
 #endif
 }
 
@@ -286,7 +284,7 @@
 #endif
 
 #if DUMP_NODE_STATISTICS
-    liveNodeSet.remove(this);
+    liveNodeSet().remove(this);
 #endif
 
     RELEASE_ASSERT(!renderer());
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to