Title: [164833] trunk/Source/WebCore
Revision
164833
Author
[email protected]
Date
2014-02-27 15:18:26 -0800 (Thu, 27 Feb 2014)

Log Message

Micro-optimize elementAffectsDirectionality().
<https://webkit.org/b/129444>

Tweak this function to skip an unnecessary bit check and use
fastHasAttribute() instead of hasAttribute() for looking up dirAttr.

~1% speedup on DYEB/AngularJS.

Reviewed by Ryosuke Niwa.

* html/HTMLElement.cpp:
(WebCore::elementAffectsDirectionality):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (164832 => 164833)


--- trunk/Source/WebCore/ChangeLog	2014-02-27 23:16:41 UTC (rev 164832)
+++ trunk/Source/WebCore/ChangeLog	2014-02-27 23:18:26 UTC (rev 164833)
@@ -1,3 +1,18 @@
+2014-02-27  Andreas Kling  <[email protected]>
+
+        Micro-optimize elementAffectsDirectionality().
+        <https://webkit.org/b/129444>
+
+        Tweak this function to skip an unnecessary bit check and use
+        fastHasAttribute() instead of hasAttribute() for looking up dirAttr.
+
+        ~1% speedup on DYEB/AngularJS.
+
+        Reviewed by Ryosuke Niwa.
+
+        * html/HTMLElement.cpp:
+        (WebCore::elementAffectsDirectionality):
+
 2014-02-27  Brian Burg  <[email protected]>
 
         Web Inspector: model tests should use a special Test.html inspector page

Modified: trunk/Source/WebCore/html/HTMLElement.cpp (164832 => 164833)


--- trunk/Source/WebCore/html/HTMLElement.cpp	2014-02-27 23:16:41 UTC (rev 164832)
+++ trunk/Source/WebCore/html/HTMLElement.cpp	2014-02-27 23:18:26 UTC (rev 164833)
@@ -817,7 +817,7 @@
 
 static inline bool elementAffectsDirectionality(const Node& node)
 {
-    return node.isHTMLElement() && (node.hasTagName(bdiTag) || toHTMLElement(node).hasAttribute(dirAttr));
+    return node.isHTMLElement() && (toHTMLElement(node).hasTagName(bdiTag) || toHTMLElement(node).fastHasAttribute(dirAttr));
 }
 
 static void setHasDirAutoFlagRecursively(Node* firstNode, bool flag, Node* lastNode = nullptr)
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to