Title: [156227] trunk/Source/WebCore
- Revision
- 156227
- Author
- [email protected]
- Date
- 2013-09-21 06:05:56 -0700 (Sat, 21 Sep 2013)
Log Message
Re-inline some hot ElementData functions.
<https://webkit.org/b/121743>
Reviewed by Antti Koivisto.
Make the following functions inline again:
- deref()
- addAttribute()
- removeAttribute()
- attributeAt()
They were out-of-lined in r154249 and perf.webkit.org reports a 1.4%
regression on the html5 spec for that revision. This'll hopefully steer
the graph back in the right direction.
Modified Paths
Diff
Modified: trunk/Source/WebCore/ChangeLog (156226 => 156227)
--- trunk/Source/WebCore/ChangeLog 2013-09-21 10:52:25 UTC (rev 156226)
+++ trunk/Source/WebCore/ChangeLog 2013-09-21 13:05:56 UTC (rev 156227)
@@ -1,3 +1,21 @@
+2013-09-21 Andreas Kling <[email protected]>
+
+ Re-inline some hot ElementData functions.
+ <https://webkit.org/b/121743>
+
+ Reviewed by Antti Koivisto.
+
+ Make the following functions inline again:
+
+ - deref()
+ - addAttribute()
+ - removeAttribute()
+ - attributeAt()
+
+ They were out-of-lined in r154249 and perf.webkit.org reports a 1.4%
+ regression on the html5 spec for that revision. This'll hopefully steer
+ the graph back in the right direction.
+
2013-09-21 Tim Horton <[email protected]>
GeneratorGeneratedImage should be called GradientImage
Modified: trunk/Source/WebCore/dom/ElementData.cpp (156226 => 156227)
--- trunk/Source/WebCore/dom/ElementData.cpp 2013-09-21 10:52:25 UTC (rev 156226)
+++ trunk/Source/WebCore/dom/ElementData.cpp 2013-09-21 13:05:56 UTC (rev 156227)
@@ -31,11 +31,8 @@
namespace WebCore {
-void ElementData::deref()
+void ElementData::destroy()
{
- if (!derefBase())
- return;
-
if (m_isUnique)
delete static_cast<UniqueElementData*>(this);
else
@@ -168,17 +165,6 @@
return adoptRef(new (NotNull, slot) ShareableElementData(*this));
}
-void UniqueElementData::addAttribute(const QualifiedName& attributeName, const AtomicString& value)
-{
- m_attributeVector.append(Attribute(attributeName, value));
-}
-
-void UniqueElementData::removeAttribute(unsigned index)
-{
- ASSERT_WITH_SECURITY_IMPLICATION(index < length());
- m_attributeVector.remove(index);
-}
-
bool ElementData::isEquivalent(const ElementData* other) const
{
if (!other)
@@ -231,19 +217,12 @@
Attribute* UniqueElementData::findAttributeByName(const QualifiedName& name)
{
- unsigned count = length();
- for (unsigned i = 0; i < count; ++i) {
+ for (unsigned i = 0, count = m_attributeVector.size(); i < count; ++i) {
if (m_attributeVector.at(i).name().matches(name))
return &m_attributeVector.at(i);
}
- return 0;
+ return nullptr;
}
-Attribute& UniqueElementData::attributeAt(unsigned index)
-{
- ASSERT_WITH_SECURITY_IMPLICATION(index < length());
- return m_attributeVector.at(index);
}
-}
-
Modified: trunk/Source/WebCore/dom/ElementData.h (156226 => 156227)
--- trunk/Source/WebCore/dom/ElementData.h 2013-09-21 10:52:25 UTC (rev 156226)
+++ trunk/Source/WebCore/dom/ElementData.h 2013-09-21 13:05:56 UTC (rev 156227)
@@ -100,6 +100,8 @@
friend class SVGElement;
#endif
+ void destroy();
+
const Attribute* attributeBase() const;
const Attribute* findAttributeByName(const AtomicString& name, bool shouldIgnoreAttributeCase) const;
unsigned findAttributeIndexByNameSlowCase(const AtomicString& name, bool shouldIgnoreAttributeCase) const;
@@ -147,6 +149,13 @@
Vector<Attribute, 4> m_attributeVector;
};
+inline void ElementData::deref()
+{
+ if (!derefBase())
+ return;
+ destroy();
+}
+
inline unsigned ElementData::length() const
{
if (isUnique())
@@ -224,7 +233,22 @@
return attributeBase()[index];
}
+inline void UniqueElementData::addAttribute(const QualifiedName& attributeName, const AtomicString& value)
+{
+ m_attributeVector.append(Attribute(attributeName, value));
}
+inline void UniqueElementData::removeAttribute(unsigned index)
+{
+ m_attributeVector.remove(index);
+}
+
+inline Attribute& UniqueElementData::attributeAt(unsigned index)
+{
+ return m_attributeVector.at(index);
+}
+
+}
+
#endif
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes