Remove NodeListsNodeData when it's no longer needed
[WebKit-https.git] / Source / WebCore / ChangeLog
index 0836ed4..67c1137 100644 (file)
@@ -1,3 +1,30 @@
+2013-01-16  Ryosuke Niwa  <rniwa@webkit.org>
+
+        Remove NodeListsNodeData when it's no longer needed
+        https://bugs.webkit.org/show_bug.cgi?id=107074
+
+        Reviewed by Darin Adler.
+
+        Remove NodeListsNodeData when the last node list is removed from it.
+
+        If we detect that we have only one node list left in the data structure,
+        we'll simply destroy the entire "this" object to free up the memory space.
+
+        This reduced the memory usage of the micro benchmark by roughly 3%.
+
+        Performance Tests: DOM/TraverseChildNodes.html
+
+        * dom/Node.cpp:
+        (WebCore::Node::clearNodeLists): Added.
+        * dom/Node.h:
+        * dom/NodeRareData.h:
+        (WebCore::NodeListsNodeData::removeChildNodeList):
+        (WebCore::NodeListsNodeData::removeCacheWithAtomicName):
+        (WebCore::NodeListsNodeData::removeCacheWithName):
+        (WebCore::NodeListsNodeData::removeCacheWithQualifiedName):
+        (WebCore::NodeListsNodeData::deleteThisAndUpdateNodeRareDataIfAboutToRemoveLastList): Added.
+        Removes "this" NodeListsNodeData if there is only one node list left.
+
 2013-01-17  Abhishek Arya  <inferno@chromium.org>
 
         Heap-use-after-free in WebCore::RenderBlock::checkFloatsInCleanLine