<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[162274] trunk/Source/WebCore</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/162274">162274</a></dd>
<dt>Author</dt> <dd>benjamin@webkit.org</dd>
<dt>Date</dt> <dd>2014-01-18 14:17:09 -0800 (Sat, 18 Jan 2014)</dd>
</dl>

<h3>Log Message</h3>
<pre>Make ElementData JIT friendly
https://bugs.webkit.org/show_bug.cgi?id=127209

Reviewed by Geoffrey Garen.

The offsets of ElementData's flags were not accessible by the JIT. This patch
refactor ElementData to use explicit flags so that they can be used from
the code generators.

* dom/Element.cpp:
(WebCore::Element::synchronizeAllAttributes):
(WebCore::Element::synchronizeAttribute):
(WebCore::Element::attributeChanged):
(WebCore::Element::removeAttribute):
* dom/ElementData.cpp:
(WebCore::ElementData::destroy):
(WebCore::ElementData::ElementData):
(WebCore::ShareableElementData::ShareableElementData):
(WebCore::ShareableElementData::~ShareableElementData):
(WebCore::ElementData::arraySizeAndFlagsFromOther):
* dom/ElementData.h:
(WebCore::ElementData::hasName):
(WebCore::ElementData::isUnique):
(WebCore::ElementData::updateFlag):
(WebCore::ElementData::arraySize):
(WebCore::ElementData::setHasNameAttribute):
(WebCore::ElementData::styleAttributeIsDirty):
(WebCore::ElementData::setStyleAttributeIsDirty):
(WebCore::ElementData::presentationAttributeStyleIsDirty):
(WebCore::ElementData::setPresentationAttributeStyleIsDirty):
(WebCore::ElementData::animatedSVGAttributesAreDirty):
(WebCore::ElementData::setAnimatedSVGAttributesAreDirty):
(WebCore::ElementData::length):
(WebCore::ElementData::attributeBase):
(WebCore::ElementData::presentationAttributeStyle):
* dom/StyledElement.cpp:
(WebCore::StyledElement::synchronizeStyleAttributeInternal):
(WebCore::StyledElement::attributeChanged):
(WebCore::StyledElement::styleAttributeChanged):
(WebCore::StyledElement::inlineStyleChanged):
(WebCore::StyledElement::rebuildPresentationAttributeStyle):
* dom/StyledElement.h:
(WebCore::StyledElement::invalidateStyleAttribute):
(WebCore::StyledElement::presentationAttributeStyle):
* svg/SVGElement.cpp:
(WebCore::SVGElement::synchronizeAnimatedSVGAttribute):
* svg/SVGElement.h:
(WebCore::SVGElement::invalidateSVGAttributes):</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoredomElementcpp">trunk/Source/WebCore/dom/Element.cpp</a></li>
<li><a href="#trunkSourceWebCoredomElementDatacpp">trunk/Source/WebCore/dom/ElementData.cpp</a></li>
<li><a href="#trunkSourceWebCoredomElementDatah">trunk/Source/WebCore/dom/ElementData.h</a></li>
<li><a href="#trunkSourceWebCoredomStyledElementcpp">trunk/Source/WebCore/dom/StyledElement.cpp</a></li>
<li><a href="#trunkSourceWebCoredomStyledElementh">trunk/Source/WebCore/dom/StyledElement.h</a></li>
<li><a href="#trunkSourceWebCoresvgSVGElementcpp">trunk/Source/WebCore/svg/SVGElement.cpp</a></li>
<li><a href="#trunkSourceWebCoresvgSVGElementh">trunk/Source/WebCore/svg/SVGElement.h</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (162273 => 162274)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2014-01-18 21:24:25 UTC (rev 162273)
+++ trunk/Source/WebCore/ChangeLog        2014-01-18 22:17:09 UTC (rev 162274)
</span><span class="lines">@@ -1,3 +1,54 @@
</span><ins>+2014-01-18  Benjamin Poulain  &lt;benjamin@webkit.org&gt;
+
+        Make ElementData JIT friendly
+        https://bugs.webkit.org/show_bug.cgi?id=127209
+
+        Reviewed by Geoffrey Garen.
+
+        The offsets of ElementData's flags were not accessible by the JIT. This patch
+        refactor ElementData to use explicit flags so that they can be used from
+        the code generators.
+
+        * dom/Element.cpp:
+        (WebCore::Element::synchronizeAllAttributes):
+        (WebCore::Element::synchronizeAttribute):
+        (WebCore::Element::attributeChanged):
+        (WebCore::Element::removeAttribute):
+        * dom/ElementData.cpp:
+        (WebCore::ElementData::destroy):
+        (WebCore::ElementData::ElementData):
+        (WebCore::ShareableElementData::ShareableElementData):
+        (WebCore::ShareableElementData::~ShareableElementData):
+        (WebCore::ElementData::arraySizeAndFlagsFromOther):
+        * dom/ElementData.h:
+        (WebCore::ElementData::hasName):
+        (WebCore::ElementData::isUnique):
+        (WebCore::ElementData::updateFlag):
+        (WebCore::ElementData::arraySize):
+        (WebCore::ElementData::setHasNameAttribute):
+        (WebCore::ElementData::styleAttributeIsDirty):
+        (WebCore::ElementData::setStyleAttributeIsDirty):
+        (WebCore::ElementData::presentationAttributeStyleIsDirty):
+        (WebCore::ElementData::setPresentationAttributeStyleIsDirty):
+        (WebCore::ElementData::animatedSVGAttributesAreDirty):
+        (WebCore::ElementData::setAnimatedSVGAttributesAreDirty):
+        (WebCore::ElementData::length):
+        (WebCore::ElementData::attributeBase):
+        (WebCore::ElementData::presentationAttributeStyle):
+        * dom/StyledElement.cpp:
+        (WebCore::StyledElement::synchronizeStyleAttributeInternal):
+        (WebCore::StyledElement::attributeChanged):
+        (WebCore::StyledElement::styleAttributeChanged):
+        (WebCore::StyledElement::inlineStyleChanged):
+        (WebCore::StyledElement::rebuildPresentationAttributeStyle):
+        * dom/StyledElement.h:
+        (WebCore::StyledElement::invalidateStyleAttribute):
+        (WebCore::StyledElement::presentationAttributeStyle):
+        * svg/SVGElement.cpp:
+        (WebCore::SVGElement::synchronizeAnimatedSVGAttribute):
+        * svg/SVGElement.h:
+        (WebCore::SVGElement::invalidateSVGAttributes):
+
</ins><span class="cx"> 2014-01-18  Zalan Bujtas  &lt;zalan@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Subpixel layout: IntRect::infiniteRect() overflows when subpixel layout is enabled.
</span></span></pre></div>
<a id="trunkSourceWebCoredomElementcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/Element.cpp (162273 => 162274)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/Element.cpp        2014-01-18 21:24:25 UTC (rev 162273)
+++ trunk/Source/WebCore/dom/Element.cpp        2014-01-18 22:17:09 UTC (rev 162274)
</span><span class="lines">@@ -4,7 +4,7 @@
</span><span class="cx">  *           (C) 2001 Peter Kelly (pmk@post.com)
</span><span class="cx">  *           (C) 2001 Dirk Mueller (mueller@kde.org)
</span><span class="cx">  *           (C) 2007 David Smith (catfish.man@gmail.com)
</span><del>- * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2012, 2013 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2004-2014 Apple Inc. All rights reserved.
</ins><span class="cx">  *           (C) 2007 Eric Seidel (eric@webkit.org)
</span><span class="cx">  *
</span><span class="cx">  * This library is free software; you can redistribute it and/or
</span><span class="lines">@@ -388,12 +388,12 @@
</span><span class="cx"> {
</span><span class="cx">     if (!elementData())
</span><span class="cx">         return;
</span><del>-    if (elementData()-&gt;m_styleAttributeIsDirty) {
</del><ins>+    if (elementData()-&gt;styleAttributeIsDirty()) {
</ins><span class="cx">         ASSERT(isStyledElement());
</span><span class="cx">         static_cast&lt;const StyledElement*&gt;(this)-&gt;synchronizeStyleAttributeInternal();
</span><span class="cx">     }
</span><span class="cx"> #if ENABLE(SVG)
</span><del>-    if (elementData()-&gt;m_animatedSVGAttributesAreDirty) {
</del><ins>+    if (elementData()-&gt;animatedSVGAttributesAreDirty()) {
</ins><span class="cx">         ASSERT(isSVGElement());
</span><span class="cx">         toSVGElement(this)-&gt;synchronizeAnimatedSVGAttribute(anyQName());
</span><span class="cx">     }
</span><span class="lines">@@ -404,13 +404,13 @@
</span><span class="cx"> {
</span><span class="cx">     if (!elementData())
</span><span class="cx">         return;
</span><del>-    if (UNLIKELY(name == styleAttr &amp;&amp; elementData()-&gt;m_styleAttributeIsDirty)) {
</del><ins>+    if (UNLIKELY(name == styleAttr &amp;&amp; elementData()-&gt;styleAttributeIsDirty())) {
</ins><span class="cx">         ASSERT_WITH_SECURITY_IMPLICATION(isStyledElement());
</span><span class="cx">         static_cast&lt;const StyledElement*&gt;(this)-&gt;synchronizeStyleAttributeInternal();
</span><span class="cx">         return;
</span><span class="cx">     }
</span><span class="cx"> #if ENABLE(SVG)
</span><del>-    if (UNLIKELY(elementData()-&gt;m_animatedSVGAttributesAreDirty)) {
</del><ins>+    if (UNLIKELY(elementData()-&gt;animatedSVGAttributesAreDirty())) {
</ins><span class="cx">         ASSERT(isSVGElement());
</span><span class="cx">         toSVGElement(this)-&gt;synchronizeAnimatedSVGAttribute(name);
</span><span class="cx">     }
</span><span class="lines">@@ -423,13 +423,13 @@
</span><span class="cx">     // e.g when called from DOM API.
</span><span class="cx">     if (!elementData())
</span><span class="cx">         return;
</span><del>-    if (elementData()-&gt;m_styleAttributeIsDirty &amp;&amp; equalPossiblyIgnoringCase(localName, styleAttr.localName(), shouldIgnoreAttributeCase(*this))) {
</del><ins>+    if (elementData()-&gt;styleAttributeIsDirty() &amp;&amp; equalPossiblyIgnoringCase(localName, styleAttr.localName(), shouldIgnoreAttributeCase(*this))) {
</ins><span class="cx">         ASSERT_WITH_SECURITY_IMPLICATION(isStyledElement());
</span><span class="cx">         static_cast&lt;const StyledElement*&gt;(this)-&gt;synchronizeStyleAttributeInternal();
</span><span class="cx">         return;
</span><span class="cx">     }
</span><span class="cx"> #if ENABLE(SVG)
</span><del>-    if (elementData()-&gt;m_animatedSVGAttributesAreDirty) {
</del><ins>+    if (elementData()-&gt;animatedSVGAttributesAreDirty()) {
</ins><span class="cx">         // We're not passing a namespace argument on purpose. SVGNames::*Attr are defined w/o namespaces as well.
</span><span class="cx">         ASSERT_WITH_SECURITY_IMPLICATION(isSVGElement());
</span><span class="cx">         toSVGElement(this)-&gt;synchronizeAnimatedSVGAttribute(QualifiedName(nullAtom, localName, nullAtom));
</span><span class="lines">@@ -1109,7 +1109,7 @@
</span><span class="cx">     } else if (name == classAttr)
</span><span class="cx">         classAttributeChanged(newValue);
</span><span class="cx">     else if (name == HTMLNames::nameAttr)
</span><del>-        elementData()-&gt;m_hasNameAttribute = !newValue.isNull();
</del><ins>+        elementData()-&gt;setHasNameAttribute(!newValue.isNull());
</ins><span class="cx">     else if (name == HTMLNames::pseudoAttr)
</span><span class="cx">         shouldInvalidateStyle |= testShouldInvalidateStyle &amp;&amp; isInShadowTree();
</span><span class="cx"> 
</span><span class="lines">@@ -1873,7 +1873,7 @@
</span><span class="cx">     AtomicString localName = shouldIgnoreAttributeCase(*this) ? name.lower() : name;
</span><span class="cx">     unsigned index = elementData()-&gt;findAttributeIndexByName(localName, false);
</span><span class="cx">     if (index == ElementData::attributeNotFound) {
</span><del>-        if (UNLIKELY(localName == styleAttr) &amp;&amp; elementData()-&gt;m_styleAttributeIsDirty &amp;&amp; isStyledElement())
</del><ins>+        if (UNLIKELY(localName == styleAttr) &amp;&amp; elementData()-&gt;styleAttributeIsDirty() &amp;&amp; isStyledElement())
</ins><span class="cx">             toStyledElement(this)-&gt;removeAllInlineStyleProperties();
</span><span class="cx">         return;
</span><span class="cx">     }
</span></span></pre></div>
<a id="trunkSourceWebCoredomElementDatacpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/ElementData.cpp (162273 => 162274)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/ElementData.cpp        2014-01-18 21:24:25 UTC (rev 162273)
+++ trunk/Source/WebCore/dom/ElementData.cpp        2014-01-18 22:17:09 UTC (rev 162274)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> /*
</span><del>- * Copyright (C) 2013 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2013, 2014 Apple Inc. All rights reserved.
</ins><span class="cx">  *
</span><span class="cx">  * Redistribution and use in source and binary forms, with or without
</span><span class="cx">  * modification, are permitted provided that the following conditions
</span><span class="lines">@@ -33,33 +33,19 @@
</span><span class="cx"> 
</span><span class="cx"> void ElementData::destroy()
</span><span class="cx"> {
</span><del>-    if (m_isUnique)
</del><ins>+    if (isUnique())
</ins><span class="cx">         delete static_cast&lt;UniqueElementData*&gt;(this);
</span><span class="cx">     else
</span><span class="cx">         delete static_cast&lt;ShareableElementData*&gt;(this);
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> ElementData::ElementData()
</span><del>-    : m_isUnique(true)
-    , m_arraySize(0)
-    , m_hasNameAttribute(false)
-    , m_presentationAttributeStyleIsDirty(false)
-    , m_styleAttributeIsDirty(false)
-#if ENABLE(SVG)
-    , m_animatedSVGAttributesAreDirty(false)
-#endif
</del><ins>+    : m_arraySizeAndFlags(s_flagIsUnique)
</ins><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> ElementData::ElementData(unsigned arraySize)
</span><del>-    : m_isUnique(false)
-    , m_arraySize(arraySize)
-    , m_hasNameAttribute(false)
-    , m_presentationAttributeStyleIsDirty(false)
-    , m_styleAttributeIsDirty(false)
-#if ENABLE(SVG)
-    , m_animatedSVGAttributesAreDirty(false)
-#endif
</del><ins>+    : m_arraySizeAndFlags(arraySize &lt;&lt; s_flagCount)
</ins><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -89,13 +75,15 @@
</span><span class="cx"> ShareableElementData::ShareableElementData(const Vector&lt;Attribute&gt;&amp; attributes)
</span><span class="cx">     : ElementData(attributes.size())
</span><span class="cx"> {
</span><del>-    for (unsigned i = 0; i &lt; m_arraySize; ++i)
</del><ins>+    unsigned attributeArraySize = arraySize();
+    for (unsigned i = 0; i &lt; attributeArraySize; ++i)
</ins><span class="cx">         new (NotNull, &amp;m_attributeArray[i]) Attribute(attributes[i]);
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> ShareableElementData::~ShareableElementData()
</span><span class="cx"> {
</span><del>-    for (unsigned i = 0; i &lt; m_arraySize; ++i)
</del><ins>+    unsigned attributeArraySize = arraySize();
+    for (unsigned i = 0; i &lt; attributeArraySize; ++i)
</ins><span class="cx">         m_attributeArray[i].~Attribute();
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -109,19 +97,23 @@
</span><span class="cx">         m_inlineStyle = other.m_inlineStyle-&gt;immutableCopyIfNeeded();
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    for (unsigned i = 0; i &lt; m_arraySize; ++i)
</del><ins>+    unsigned attributeArraySize = arraySize();
+    for (unsigned i = 0; i &lt; attributeArraySize; ++i)
</ins><span class="cx">         new (NotNull, &amp;m_attributeArray[i]) Attribute(other.m_attributeVector.at(i));
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+inline uint32_t ElementData::arraySizeAndFlagsFromOther(const ElementData&amp; other, bool isUnique)
+{
+    if (isUnique) {
+        // Set isUnique and ignore arraySize.
+        return (other.m_arraySizeAndFlags | s_flagIsUnique) &amp; s_flagsMask;
+    }
+    // Clear isUnique and set arraySize.
+    return (other.m_arraySizeAndFlags &amp; (s_flagsMask &amp; ~s_flagIsUnique)) | other.length() &lt;&lt; s_flagCount;
+}
+
</ins><span class="cx"> ElementData::ElementData(const ElementData&amp; other, bool isUnique)
</span><del>-    : m_isUnique(isUnique)
-    , m_arraySize(isUnique ? 0 : other.length())
-    , m_hasNameAttribute(other.m_hasNameAttribute)
-    , m_presentationAttributeStyleIsDirty(other.m_presentationAttributeStyleIsDirty)
-    , m_styleAttributeIsDirty(other.m_styleAttributeIsDirty)
-#if ENABLE(SVG)
-    , m_animatedSVGAttributesAreDirty(other.m_animatedSVGAttributesAreDirty)
-#endif
</del><ins>+    : m_arraySizeAndFlags(ElementData::arraySizeAndFlagsFromOther(other, isUnique))
</ins><span class="cx">     , m_classNames(other.m_classNames)
</span><span class="cx">     , m_idForStyleResolution(other.m_idForStyleResolution)
</span><span class="cx"> {
</span></span></pre></div>
<a id="trunkSourceWebCoredomElementDatah"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/ElementData.h (162273 => 162274)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/ElementData.h        2014-01-18 21:24:25 UTC (rev 162273)
+++ trunk/Source/WebCore/dom/ElementData.h        2014-01-18 22:17:09 UTC (rev 162274)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> /*
</span><del>- * Copyright (C) 2013 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2013, 2014 Apple Inc. All rights reserved.
</ins><span class="cx">  *
</span><span class="cx">  * Redistribution and use in source and binary forms, with or without
</span><span class="cx">  * modification, are permitted provided that the following conditions
</span><span class="lines">@@ -69,26 +69,53 @@
</span><span class="cx"> 
</span><span class="cx">     bool hasID() const { return !m_idForStyleResolution.isNull(); }
</span><span class="cx">     bool hasClass() const { return !m_classNames.isEmpty(); }
</span><del>-    bool hasName() const { return m_hasNameAttribute; }
</del><ins>+    bool hasName() const { return m_arraySizeAndFlags &amp; s_flagHasNameAttribute; }
</ins><span class="cx"> 
</span><span class="cx">     bool isEquivalent(const ElementData* other) const;
</span><span class="cx"> 
</span><del>-    bool isUnique() const { return m_isUnique; }
</del><ins>+    bool isUnique() const { return m_arraySizeAndFlags &amp; s_flagIsUnique; }
</ins><span class="cx"> 
</span><ins>+private:
+    mutable uint32_t m_arraySizeAndFlags;
+
+    static const uint32_t s_arraySize = 27;
+    static const uint32_t s_flagCount = 5;
+    static const uint32_t s_flagIsUnique = 1;
+    static const uint32_t s_flagHasNameAttribute = 1 &lt;&lt; 1;
+    static const uint32_t s_flagPresentationAttributeStyleIsDirty = 1 &lt;&lt; 2;
+    static const uint32_t s_flagStyleAttributeIsDirty = 1 &lt;&lt; 3;
+#if ENABLE(SVG)
+    static const uint32_t s_flagAnimatedSVGAttributesAreDirty = 1 &lt;&lt; 4;
+#endif
+    static const uint32_t s_flagsMask = (1 &lt;&lt; s_flagCount) - 1;
+
+    inline void updateFlag(uint32_t flag, bool set) const
+    {
+        if (set)
+            m_arraySizeAndFlags |= flag;
+        else
+            m_arraySizeAndFlags &amp;= ~flag;
+    }
+    static inline uint32_t arraySizeAndFlagsFromOther(const ElementData&amp; other, bool isUnique);
+
</ins><span class="cx"> protected:
</span><span class="cx">     ElementData();
</span><span class="cx">     explicit ElementData(unsigned arraySize);
</span><span class="cx">     ElementData(const ElementData&amp;, bool isUnique);
</span><span class="cx"> 
</span><del>-    unsigned m_isUnique : 1;
-    unsigned m_arraySize : 27;
-    mutable unsigned m_hasNameAttribute : 1;
-    mutable unsigned m_presentationAttributeStyleIsDirty : 1;
-    mutable unsigned m_styleAttributeIsDirty : 1;
-#if ENABLE(SVG)
-    mutable unsigned m_animatedSVGAttributesAreDirty : 1;
-#endif
</del><ins>+    unsigned arraySize() const { return m_arraySizeAndFlags &gt;&gt; s_flagCount; }
</ins><span class="cx"> 
</span><ins>+    void setHasNameAttribute(bool hasName) const { updateFlag(s_flagHasNameAttribute, hasName); }
+
+    bool styleAttributeIsDirty() const { return m_arraySizeAndFlags &amp; s_flagStyleAttributeIsDirty; }
+    void setStyleAttributeIsDirty(bool isDirty) const { updateFlag(s_flagStyleAttributeIsDirty, isDirty); }
+
+    bool presentationAttributeStyleIsDirty() const { return m_arraySizeAndFlags &amp; s_flagPresentationAttributeStyleIsDirty; }
+    void setPresentationAttributeStyleIsDirty(bool isDirty) const { updateFlag(s_flagPresentationAttributeStyleIsDirty, isDirty); }
+
+    bool animatedSVGAttributesAreDirty() const { return m_arraySizeAndFlags &amp; s_flagAnimatedSVGAttributesAreDirty; }
+    void setAnimatedSVGAttributesAreDirty(bool dirty) const { updateFlag(s_flagAnimatedSVGAttributesAreDirty, dirty); }
+
</ins><span class="cx">     mutable RefPtr&lt;StyleProperties&gt; m_inlineStyle;
</span><span class="cx">     mutable SpaceSplitString m_classNames;
</span><span class="cx">     mutable AtomicString m_idForStyleResolution;
</span><span class="lines">@@ -162,19 +189,19 @@
</span><span class="cx"> {
</span><span class="cx">     if (isUnique())
</span><span class="cx">         return static_cast&lt;const UniqueElementData*&gt;(this)-&gt;m_attributeVector.size();
</span><del>-    return m_arraySize;
</del><ins>+    return arraySize();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> inline const Attribute* ElementData::attributeBase() const
</span><span class="cx"> {
</span><del>-    if (m_isUnique)
</del><ins>+    if (isUnique())
</ins><span class="cx">         return static_cast&lt;const UniqueElementData*&gt;(this)-&gt;m_attributeVector.data();
</span><span class="cx">     return static_cast&lt;const ShareableElementData*&gt;(this)-&gt;m_attributeArray;
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> inline const StyleProperties* ElementData::presentationAttributeStyle() const
</span><span class="cx"> {
</span><del>-    if (!m_isUnique)
</del><ins>+    if (!isUnique())
</ins><span class="cx">         return 0;
</span><span class="cx">     return static_cast&lt;const UniqueElementData*&gt;(this)-&gt;m_presentationAttributeStyle.get();
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCoredomStyledElementcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/StyledElement.cpp (162273 => 162274)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/StyledElement.cpp        2014-01-18 21:24:25 UTC (rev 162273)
+++ trunk/Source/WebCore/dom/StyledElement.cpp        2014-01-18 22:17:09 UTC (rev 162274)
</span><span class="lines">@@ -121,8 +121,8 @@
</span><span class="cx"> void StyledElement::synchronizeStyleAttributeInternal() const
</span><span class="cx"> {
</span><span class="cx">     ASSERT(elementData());
</span><del>-    ASSERT(elementData()-&gt;m_styleAttributeIsDirty);
-    elementData()-&gt;m_styleAttributeIsDirty = false;
</del><ins>+    ASSERT(elementData()-&gt;styleAttributeIsDirty());
+    elementData()-&gt;setStyleAttributeIsDirty(false);
</ins><span class="cx">     if (const StyleProperties* inlineStyle = this-&gt;inlineStyle())
</span><span class="cx">         const_cast&lt;StyledElement*&gt;(this)-&gt;setSynchronizedLazyAttribute(styleAttr, inlineStyle-&gt;asText());
</span><span class="cx"> }
</span><span class="lines">@@ -154,7 +154,7 @@
</span><span class="cx">     if (name == styleAttr)
</span><span class="cx">         styleAttributeChanged(newValue, reason);
</span><span class="cx">     else if (isPresentationAttribute(name)) {
</span><del>-        elementData()-&gt;m_presentationAttributeStyleIsDirty = true;
</del><ins>+        elementData()-&gt;setPresentationAttributeStyleIsDirty(true);
</ins><span class="cx">         setNeedsStyleRecalc(InlineStyleChange);
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="lines">@@ -204,7 +204,7 @@
</span><span class="cx">     } else if (reason == ModifiedByCloning || document().contentSecurityPolicy()-&gt;allowInlineStyle(document().url(), startLineNumber))
</span><span class="cx">         setInlineStyleFromString(newStyleString);
</span><span class="cx"> 
</span><del>-    elementData()-&gt;m_styleAttributeIsDirty = false;
</del><ins>+    elementData()-&gt;setStyleAttributeIsDirty(false);
</ins><span class="cx"> 
</span><span class="cx">     setNeedsStyleRecalc(InlineStyleChange);
</span><span class="cx">     InspectorInstrumentation::didInvalidateStyleAttr(&amp;document(), this);
</span><span class="lines">@@ -214,7 +214,7 @@
</span><span class="cx"> {
</span><span class="cx">     setNeedsStyleRecalc(InlineStyleChange);
</span><span class="cx">     ASSERT(elementData());
</span><del>-    elementData()-&gt;m_styleAttributeIsDirty = true;
</del><ins>+    elementData()-&gt;setStyleAttributeIsDirty(true);
</ins><span class="cx">     InspectorInstrumentation::didInvalidateStyleAttr(&amp;document(), this);
</span><span class="cx"> }
</span><span class="cx">     
</span><span class="lines">@@ -345,7 +345,7 @@
</span><span class="cx">     // ShareableElementData doesn't store presentation attribute style, so make sure we have a UniqueElementData.
</span><span class="cx">     UniqueElementData&amp; elementData = ensureUniqueElementData();
</span><span class="cx"> 
</span><del>-    elementData.m_presentationAttributeStyleIsDirty = false;
</del><ins>+    elementData.setPresentationAttributeStyleIsDirty(false);
</ins><span class="cx">     elementData.m_presentationAttributeStyle = style-&gt;isEmpty() ? 0 : style;
</span><span class="cx"> 
</span><span class="cx">     if (!cacheHash || cacheIterator-&gt;value)
</span></span></pre></div>
<a id="trunkSourceWebCoredomStyledElementh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/StyledElement.h (162273 => 162274)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/StyledElement.h        2014-01-18 21:24:25 UTC (rev 162273)
+++ trunk/Source/WebCore/dom/StyledElement.h        2014-01-18 22:17:09 UTC (rev 162274)
</span><span class="lines">@@ -93,14 +93,14 @@
</span><span class="cx"> inline void StyledElement::invalidateStyleAttribute()
</span><span class="cx"> {
</span><span class="cx">     ASSERT(elementData());
</span><del>-    elementData()-&gt;m_styleAttributeIsDirty = true;
</del><ins>+    elementData()-&gt;setStyleAttributeIsDirty(true);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> inline const StyleProperties* StyledElement::presentationAttributeStyle()
</span><span class="cx"> {
</span><span class="cx">     if (!elementData())
</span><span class="cx">         return 0;
</span><del>-    if (elementData()-&gt;m_presentationAttributeStyleIsDirty)
</del><ins>+    if (elementData()-&gt;presentationAttributeStyleIsDirty())
</ins><span class="cx">         rebuildPresentationAttributeStyle();
</span><span class="cx">     return elementData()-&gt;presentationAttributeStyle();
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCoresvgSVGElementcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/svg/SVGElement.cpp (162273 => 162274)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/svg/SVGElement.cpp        2014-01-18 21:24:25 UTC (rev 162273)
+++ trunk/Source/WebCore/svg/SVGElement.cpp        2014-01-18 22:17:09 UTC (rev 162274)
</span><span class="lines">@@ -733,13 +733,13 @@
</span><span class="cx"> 
</span><span class="cx"> void SVGElement::synchronizeAnimatedSVGAttribute(const QualifiedName&amp; name) const
</span><span class="cx"> {
</span><del>-    if (!elementData() || !elementData()-&gt;m_animatedSVGAttributesAreDirty)
</del><ins>+    if (!elementData() || !elementData()-&gt;animatedSVGAttributesAreDirty())
</ins><span class="cx">         return;
</span><span class="cx"> 
</span><span class="cx">     SVGElement* nonConstThis = const_cast&lt;SVGElement*&gt;(this);
</span><span class="cx">     if (name == anyQName()) {
</span><span class="cx">         nonConstThis-&gt;localAttributeToPropertyMap().synchronizeProperties(nonConstThis);
</span><del>-        elementData()-&gt;m_animatedSVGAttributesAreDirty = false;
</del><ins>+        elementData()-&gt;setAnimatedSVGAttributesAreDirty(false);
</ins><span class="cx">     } else
</span><span class="cx">         nonConstThis-&gt;localAttributeToPropertyMap().synchronizeProperty(nonConstThis, name);
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCoresvgSVGElementh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/svg/SVGElement.h (162273 => 162274)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/svg/SVGElement.h        2014-01-18 21:24:25 UTC (rev 162273)
+++ trunk/Source/WebCore/svg/SVGElement.h        2014-01-18 22:17:09 UTC (rev 162274)
</span><span class="lines">@@ -96,7 +96,7 @@
</span><span class="cx"> 
</span><span class="cx">     virtual AffineTransform* supplementalTransform() { return 0; }
</span><span class="cx"> 
</span><del>-    void invalidateSVGAttributes() { ensureUniqueElementData().m_animatedSVGAttributesAreDirty = true; }
</del><ins>+    void invalidateSVGAttributes() { ensureUniqueElementData().setAnimatedSVGAttributesAreDirty(true); }
</ins><span class="cx"> 
</span><span class="cx">     const HashSet&lt;SVGElementInstance*&gt;&amp; instancesForElement() const;
</span><span class="cx"> 
</span></span></pre>
</div>
</div>

</body>
</html>