DynamicNodeList: Simplify internal Caches object.
authorkling@webkit.org <kling@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 19 Jan 2012 13:53:47 +0000 (13:53 +0000)
committerkling@webkit.org <kling@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 19 Jan 2012 13:53:47 +0000 (13:53 +0000)
commitca0ae5dae3e7680b92cb2e989e34d53c0466f169
tree1cffd210f33fbbf4c55d38a50985b01eb0ea7e75
parentadffdd6024089cf74a1fbbc521d6f2323c15b79c
DynamicNodeList: Simplify internal Caches object.
<http://webkit.org/b/76600>

Reviewed by Ryosuke Niwa.

Move m_caches from DynamicSubtreeNodeList and ChildNodeList up into DynamicNodeList.
Remove the inheritance from RefCounted and store it simply as "Caches m_caches"
This avoids one heap allocation per DynamicNodeList. Also reordered the Caches members
to pack slightly better on 64-bit.

* dom/ChildNodeList.cpp:
(WebCore::ChildNodeList::ChildNodeList):
(WebCore::ChildNodeList::length):
(WebCore::ChildNodeList::item):
* dom/ChildNodeList.h:
* dom/DynamicNodeList.cpp:
(WebCore::DynamicSubtreeNodeList::DynamicSubtreeNodeList):
(WebCore::DynamicSubtreeNodeList::length):
(WebCore::DynamicSubtreeNodeList::itemForwardsFromCurrent):
(WebCore::DynamicSubtreeNodeList::itemBackwardsFromCurrent):
(WebCore::DynamicSubtreeNodeList::item):
* dom/DynamicNodeList.h:
(WebCore::DynamicNodeList::invalidateCache):
* dom/Node.cpp:
(WebCore::NodeRareData::clearChildNodeListCache):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@105408 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore/ChangeLog
Source/WebCore/dom/ChildNodeList.cpp
Source/WebCore/dom/ChildNodeList.h
Source/WebCore/dom/DynamicNodeList.cpp
Source/WebCore/dom/DynamicNodeList.h
Source/WebCore/dom/Node.cpp