Shrink the size of NodeRareData by moving pointers into separate objects
authorrniwa@webkit.org <rniwa@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 8 Dec 2012 01:17:36 +0000 (01:17 +0000)
committerrniwa@webkit.org <rniwa@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 8 Dec 2012 01:17:36 +0000 (01:17 +0000)
commit6c0d4234cbaf6af2081980382753174934c18db4
tree6ceca2d3a9e9fd60316f66e26b4d9888a7125cee
parentaa330e9b937da1b23f69d756142a6f0a983de1f8
Shrink the size of NodeRareData by moving pointers into separate objects
https://bugs.webkit.org/show_bug.cgi?id=104312

Reviewed by Andreas Kling.

This patch does three things:
1. Move ChildNodeList back into NodeListsNodeData.
2. Move m_mutationObserverRegistry & m_transientMutationObserverRegistry into a separate object owned by NodeRareData.
3. Move m_itemProp, m_itemRef, m_itemType & into a separate object owned by NodeRareData.

Moving m_childNodeList from NodeRareData to NodeListsNodeData also has a nice side-effect of making ChildNodeList
behave more like other LiveNodeLists.

This patch also fixes Mac build when microdata is enabled.

There should be no user-visible behavior change.

* dom/ChildNodeList.cpp:
(WebCore::ChildNodeList::~ChildNodeList):
* dom/Node.cpp:
(WebCore::Node::childNodes): Moved the code to create ChildNodeList into NodeListsNodeData to match other node lists.
(WebCore::Node::invalidateNodeListCachesInAncestors):
(WebCore): Removed removeCachedChildNodeList.
* dom/Node.h:
(Node):
* dom/NodeRareData.cpp:
(WebCore): Assert the size of NodeRareData at compilation time.
(WebCore::NodeListsNodeData::reportMemoryUsage):
(WebCore::NodeRareData::reportMemoryUsage):
* dom/NodeRareData.h:
(WebCore::NodeListsNodeData::clearChildNodeListCache): Moved from NodeRareData.
(WebCore::NodeListsNodeData::ensureChildNodeList): Extracted from Node::childNodes.
(WebCore::NodeListsNodeData::removeChildNodeList): Added.
(WebCore::NodeListsNodeData::NodeListsNodeData): Initialize m_childNodeList.
(WebCore::NodeRareData::NodeMutationObserverData): Extracted from NodeRareData.
(WebCore::NodeRareData::NodeMutationObserverData::create):
(WebCore::NodeRareData::NodeMicroDataTokenLists): Ditto.
(WebCore::NodeRareData::NodeMicroDataTokenLists::create):
(WebCore::NodeRareData::NodeRareData):
(WebCore::NodeRareData::ensureNodeLists): Merged setNodeLists since it's not called elsewhere.
(WebCore::NodeRareData::mutationObserverRegistry):
(WebCore::NodeRareData::ensureMutationObserverRegistry): Added.
(WebCore::NodeRareData::transientMutationObserverRegistry):
(WebCore::NodeRareData::ensureTransientMutationObserverRegistry):
(WebCore::NodeRareData::ensureMicroDataTokenLists):
(NodeRareData):
(WebCore::NodeRareData::itemProp):
(WebCore::NodeRareData::setItemProp):
(WebCore::NodeRareData::itemRef):
(WebCore::NodeRareData::setItemRef):
(WebCore::NodeRareData::itemType):
(WebCore::NodeRareData::setItemType):
* html/HTMLPropertiesCollection.cpp:
(WebCore::HTMLPropertiesCollection::propertyNodeList): Renamed from namedItem since its return type, PropertyNodeList,
is different from that, Node, of LiveNodeList::namedItem. It was shadowing the function name instead of overriding.
* html/HTMLPropertiesCollection.h:
(HTMLPropertiesCollection):
* html/HTMLPropertiesCollection.idl:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@137003 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore/ChangeLog
Source/WebCore/dom/ChildNodeList.cpp
Source/WebCore/dom/Node.cpp
Source/WebCore/dom/Node.h
Source/WebCore/dom/NodeRareData.cpp
Source/WebCore/dom/NodeRareData.h
Source/WebCore/html/HTMLPropertiesCollection.cpp
Source/WebCore/html/HTMLPropertiesCollection.h
Source/WebCore/html/HTMLPropertiesCollection.idl