No subject


Mon Jan 28 08:41:14 PST 2013


8621">r148621</a> by &lt;timloh at chromium.org&gt;:

This appears to improve html5-full-render by 1-2% on my system (gcc 4.6.3=
) by using memcpy
instead of copying members (and branching to copy the union).

* platform/Length.h:
(WebCore::Length::initFromLength):</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href=3D"#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeL=
og</a></li>
<li><a href=3D"#trunkSourceWebCoreplatformLengthh">trunk/Source/WebCore/p=
latform/Length.h</a></li>
</ul>

</div>
<div id=3D"patch">
<h3>Diff</h3>
<a id=3D"trunkSourceWebCoreChangeLog"></a>
<div class=3D"modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (1490=
12 =3D> 149013)</h4>
<pre class=3D"diff"><span>
<span class=3D"info">--- trunk/Source/WebCore/ChangeLog	2013-04-24 01:06:=
01 UTC (rev 149012)
+++ trunk/Source/WebCore/ChangeLog	2013-04-24 01:10:51 UTC (rev 149013)
</span><span class=3D"lines">@@ -1,3 +1,16 @@
</span><ins>+2013-04-23  Andreas Kling  &lt;akling at apple.com&gt;
+
+        Micro-optimize Length::initFromLength().
+        &lt;http://webkit.org/b/115073&gt;
+
+        From Blink r148621 by &lt;timloh at chromium.org&gt;:
+
+        This appears to improve html5-full-render by 1-2% on my system (=
gcc 4.6.3) by using memcpy
+        instead of copying members (and branching to copy the union).
+
+        * platform/Length.h:
+        (WebCore::Length::initFromLength):
+
</ins><span class=3D"cx"> 2013-04-23  Kent Tamura  &lt;tkent at chromium.org=
&gt;
</span><span class=3D"cx">=20
</span><span class=3D"cx">         Add missing copyright header to ColorC=
hooserClient.h
</span></span></pre></div>
<a id=3D"trunkSourceWebCoreplatformLengthh"></a>
<div class=3D"modfile"><h4>Modified: trunk/Source/WebCore/platform/Length=
.h (149012 =3D> 149013)</h4>
<pre class=3D"diff"><span>
<span class=3D"info">--- trunk/Source/WebCore/platform/Length.h	2013-04-2=
4 01:06:01 UTC (rev 149012)
+++ trunk/Source/WebCore/platform/Length.h	2013-04-24 01:10:51 UTC (rev 1=
49013)
</span><span class=3D"lines">@@ -24,6 +24,7 @@
</span><span class=3D"cx"> #define Length_h
</span><span class=3D"cx">=20
</span><span class=3D"cx"> #include &quot;AnimationUtilities.h&quot;
</span><ins>+#include &lt;string.h&gt;
</ins><span class=3D"cx"> #include &lt;wtf/Assertions.h&gt;
</span><span class=3D"cx"> #include &lt;wtf/FastAllocBase.h&gt;
</span><span class=3D"cx"> #include &lt;wtf/Forward.h&gt;
</span><span class=3D"lines">@@ -279,17 +280,9 @@
</span><span class=3D"cx">         ASSERT(!isUndefined());
</span><span class=3D"cx">         return m_isFloat ? static_cast&lt;int&=
gt;(m_floatValue) : m_intValue;
</span><span class=3D"cx">     }
</span><del>-    void initFromLength(const Length &amp;length)=20
</del><ins>+    void initFromLength(const Length&amp; length)
</ins><span class=3D"cx">     {
</span><del>-        m_quirk =3D length.m_quirk;
-        m_type =3D length.m_type;
-        m_isFloat =3D length.m_isFloat;
-       =20
-        if (m_isFloat)
-            m_floatValue =3D length.m_floatValue;
-        else
-            m_intValue =3D length.m_intValue;
-       =20
</del><ins>+        memcpy(this, &amp;length, sizeof(Length));
</ins><span class=3D"cx">         if (isCalculated())
</span><span class=3D"cx">             incrementCalculatedRef();
</span><span class=3D"cx">     }
</span></span></pre>
</div>
</div>

</body>
</html>


More information about the webkit-changes mailing list