Title: [118127] trunk/Source/WebCore
Revision
118127
Author
[email protected]
Date
2012-05-22 23:17:33 -0700 (Tue, 22 May 2012)

Log Message

Short-circuit Element::attrIfExists() when the Element has no Attr list.
<http://webkit.org/b/87214>

Patch by Hayato Ito <[email protected]> on 2012-05-22
Reviewed by Ryosuke Niwa.

This function was lukewarm on Dromaeo/dom-attr (0.4% of samples.)
Added an early return if !hasAttrList() to avoid the function call overhead of
ElementAttributeData::attrIfExists().

* dom/Element.cpp:
(WebCore::Element::attrIfExists):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (118126 => 118127)


--- trunk/Source/WebCore/ChangeLog	2012-05-23 06:07:53 UTC (rev 118126)
+++ trunk/Source/WebCore/ChangeLog	2012-05-23 06:17:33 UTC (rev 118127)
@@ -1,5 +1,19 @@
 2012-05-22  Hayato Ito  <[email protected]>
 
+        Short-circuit Element::attrIfExists() when the Element has no Attr list.
+        <http://webkit.org/b/87214>
+
+        Reviewed by Ryosuke Niwa.
+
+        This function was lukewarm on Dromaeo/dom-attr (0.4% of samples.)
+        Added an early return if !hasAttrList() to avoid the function call overhead of
+        ElementAttributeData::attrIfExists().
+
+        * dom/Element.cpp:
+        (WebCore::Element::attrIfExists):
+
+2012-05-22  Andreas Kling  <[email protected]>
+
         Remove an assertion since an event's target might be a shadow root if a text node is clicked.
         https://bugs.webkit.org/show_bug.cgi?id=87072
 

Modified: trunk/Source/WebCore/dom/Element.cpp (118126 => 118127)


--- trunk/Source/WebCore/dom/Element.cpp	2012-05-23 06:07:53 UTC (rev 118126)
+++ trunk/Source/WebCore/dom/Element.cpp	2012-05-23 06:17:33 UTC (rev 118127)
@@ -2081,8 +2081,9 @@
 
 PassRefPtr<Attr> Element::attrIfExists(const QualifiedName& name)
 {
-    if (!attributeData())
+    if (!hasAttrList())
         return 0;
+    ASSERT(attributeData());
     return attributeData()->attrIfExists(this, name);
 }
 
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to