Inline NodeListsNodeData helpers more aggressively.
authorakling@apple.com <akling@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 6 Jul 2014 18:03:06 +0000 (18:03 +0000)
committerakling@apple.com <akling@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 6 Jul 2014 18:03:06 +0000 (18:03 +0000)
<https://webkit.org/b/134654>

Get rid of call overhead costs when retrieving NodeLists and
HTMLCollections from Document. These functions have very few clients,
so there's no real reason to keep them out of line.

Reviewed by Antti Koivisto.

* dom/NodeRareData.h:
(WebCore::NodeListsNodeData::addCacheWithAtomicName):
(WebCore::NodeListsNodeData::addCacheWithName):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@170829 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebCore/ChangeLog
Source/WebCore/dom/NodeRareData.h

index f0801b4..82b43a3 100644 (file)
@@ -1,5 +1,20 @@
 2014-07-06  Andreas Kling  <akling@apple.com>
 
+        Inline NodeListsNodeData helpers more aggressively.
+        <https://webkit.org/b/134654>
+
+        Get rid of call overhead costs when retrieving NodeLists and
+        HTMLCollections from Document. These functions have very few clients,
+        so there's no real reason to keep them out of line.
+
+        Reviewed by Antti Koivisto.
+
+        * dom/NodeRareData.h:
+        (WebCore::NodeListsNodeData::addCacheWithAtomicName):
+        (WebCore::NodeListsNodeData::addCacheWithName):
+
+2014-07-06  Andreas Kling  <akling@apple.com>
+
         Inline Node's rare data getters.
         <https://webkit.org/b/134652>
 
index a35ebe0..f53b441 100644 (file)
@@ -118,7 +118,7 @@ public:
     typedef HashMap<QualifiedName, TagNodeList*> TagNodeListCacheNS;
 
     template<typename T, typename ContainerType>
-    PassRef<T> addCacheWithAtomicName(ContainerType& container, const AtomicString& name)
+    ALWAYS_INLINE PassRef<T> addCacheWithAtomicName(ContainerType& container, const AtomicString& name)
     {
         NodeListAtomicNameCacheMap::AddResult result = m_atomicNameCaches.fastAdd(namedNodeListKey<T>(name), nullptr);
         if (!result.isNewEntry)
@@ -130,7 +130,7 @@ public:
     }
 
     template<typename T>
-    PassRef<T> addCacheWithName(ContainerNode& node, const String& name)
+    ALWAYS_INLINE PassRef<T> addCacheWithName(ContainerNode& node, const String& name)
     {
         NodeListNameCacheMap::AddResult result = m_nameCaches.fastAdd(namedNodeListKey<T>(name), nullptr);
         if (!result.isNewEntry)
@@ -141,7 +141,7 @@ public:
         return list;
     }
 
-    PassRef<TagNodeList> addCacheWithQualifiedName(ContainerNode& node, const AtomicString& namespaceURI, const AtomicString& localName)
+    ALWAYS_INLINE PassRef<TagNodeList> addCacheWithQualifiedName(ContainerNode& node, const AtomicString& namespaceURI, const AtomicString& localName)
     {
         QualifiedName name(nullAtom, localName, namespaceURI);
         TagNodeListCacheNS::AddResult result = m_tagNodeListCacheNS.fastAdd(name, nullptr);
@@ -154,7 +154,7 @@ public:
     }
 
     template<typename T, typename ContainerType>
-    PassRef<T> addCachedCollection(ContainerType& container, CollectionType collectionType, const AtomicString& name)
+    ALWAYS_INLINE PassRef<T> addCachedCollection(ContainerType& container, CollectionType collectionType, const AtomicString& name)
     {
         CollectionCacheMap::AddResult result = m_cachedCollections.fastAdd(namedCollectionKey(collectionType, name), nullptr);
         if (!result.isNewEntry)
@@ -166,7 +166,7 @@ public:
     }
 
     template<typename T, typename ContainerType>
-    PassRef<T> addCachedCollection(ContainerType& container, CollectionType collectionType)
+    ALWAYS_INLINE PassRef<T> addCachedCollection(ContainerType& container, CollectionType collectionType)
     {
         CollectionCacheMap::AddResult result = m_cachedCollections.fastAdd(namedCollectionKey(collectionType, starAtom), nullptr);
         if (!result.isNewEntry)