Title: [130560] trunk/Source/WebCore
Revision
130560
Author
[email protected]
Date
2012-10-05 15:09:04 -0700 (Fri, 05 Oct 2012)

Log Message

Remove needless virtual calls and inline RenderStyle::logical* to make table layout faster
https://bugs.webkit.org/show_bug.cgi?id=98550

Reviewed by Andreas Kling.

This shaved another 5% (100ms) off of the runtime of resizecol.html microbenchmark:
http://www.robohornet.org/tests/resizecol.html

* rendering/AutoTableLayout.cpp:
(WebCore::AutoTableLayout::recalcColumn):
* rendering/style/RenderStyle.cpp:
* rendering/style/RenderStyle.h:

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (130559 => 130560)


--- trunk/Source/WebCore/ChangeLog	2012-10-05 22:08:29 UTC (rev 130559)
+++ trunk/Source/WebCore/ChangeLog	2012-10-05 22:09:04 UTC (rev 130560)
@@ -1,3 +1,18 @@
+2012-10-05  Eric Seidel  <[email protected]>
+
+        Remove needless virtual calls and inline RenderStyle::logical* to make table layout faster
+        https://bugs.webkit.org/show_bug.cgi?id=98550
+
+        Reviewed by Andreas Kling.
+
+        This shaved another 5% (100ms) off of the runtime of resizecol.html microbenchmark:
+        http://www.robohornet.org/tests/resizecol.html
+
+        * rendering/AutoTableLayout.cpp:
+        (WebCore::AutoTableLayout::recalcColumn):
+        * rendering/style/RenderStyle.cpp:
+        * rendering/style/RenderStyle.h:
+
 2012-10-04  Eric Carlson  <[email protected]>
 
         Allow ports to override text track rendering style

Modified: trunk/Source/WebCore/rendering/AutoTableLayout.cpp (130559 => 130560)


--- trunk/Source/WebCore/rendering/AutoTableLayout.cpp	2012-10-05 22:08:29 UTC (rev 130559)
+++ trunk/Source/WebCore/rendering/AutoTableLayout.cpp	2012-10-05 22:09:04 UTC (rev 130560)
@@ -49,7 +49,7 @@
     RenderTableCell* fixedContributor = 0;
     RenderTableCell* maxContributor = 0;
 
-    for (RenderObject* child = m_table->firstChild(); child; child = child->nextSibling()) {
+    for (RenderObject* child = m_table->children()->firstChild(); child; child = child->nextSibling()) {
         if (child->isRenderTableCol())
             toRenderTableCol(child)->computePreferredLogicalWidths();
         else if (child->isTableSection()) {
@@ -62,7 +62,7 @@
                 if (current.inColSpan || !cell)
                     continue;
 
-                bool cellHasContent = cell->firstChild() || cell->style()->hasBorder() || cell->style()->hasPadding();
+                bool cellHasContent = cell->children()->firstChild() || cell->style()->hasBorder() || cell->style()->hasPadding();
                 if (cellHasContent)
                     columnLayout.emptyCellsOnly = false;
 

Modified: trunk/Source/WebCore/rendering/style/RenderStyle.cpp (130559 => 130560)


--- trunk/Source/WebCore/rendering/style/RenderStyle.cpp	2012-10-05 22:08:29 UTC (rev 130559)
+++ trunk/Source/WebCore/rendering/style/RenderStyle.cpp	2012-10-05 22:09:04 UTC (rev 130560)
@@ -1432,48 +1432,6 @@
     return Color(visitedColor.red(), visitedColor.green(), visitedColor.blue(), unvisitedColor.alpha());
 }
 
-Length RenderStyle::logicalWidth() const
-{
-    if (isHorizontalWritingMode())
-        return width();
-    return height();
-}
-
-Length RenderStyle::logicalHeight() const
-{
-    if (isHorizontalWritingMode())
-        return height();
-    return width();
-}
-
-Length RenderStyle::logicalMinWidth() const
-{
-    if (isHorizontalWritingMode())
-        return minWidth();
-    return minHeight();
-}
-
-Length RenderStyle::logicalMaxWidth() const
-{
-    if (isHorizontalWritingMode())
-        return maxWidth();
-    return maxHeight();
-}
-
-Length RenderStyle::logicalMinHeight() const
-{
-    if (isHorizontalWritingMode())
-        return minHeight();
-    return minWidth();
-}
-
-Length RenderStyle::logicalMaxHeight() const
-{
-    if (isHorizontalWritingMode())
-        return maxHeight();
-    return maxWidth();
-}
-
 const BorderValue& RenderStyle::borderBefore() const
 {
     switch (writingMode()) {

Modified: trunk/Source/WebCore/rendering/style/RenderStyle.h (130559 => 130560)


--- trunk/Source/WebCore/rendering/style/RenderStyle.h	2012-10-05 22:08:29 UTC (rev 130559)
+++ trunk/Source/WebCore/rendering/style/RenderStyle.h	2012-10-05 22:09:04 UTC (rev 130560)
@@ -523,12 +523,12 @@
     Length minHeight() const { return m_box->minHeight(); }
     Length maxHeight() const { return m_box->maxHeight(); }
     
-    Length logicalWidth() const;
-    Length logicalHeight() const;
-    Length logicalMinWidth() const;
-    Length logicalMaxWidth() const;
-    Length logicalMinHeight() const;
-    Length logicalMaxHeight() const;
+    Length logicalWidth() const { return isHorizontalWritingMode() ? width() : height(); }
+    Length logicalHeight() const { return isHorizontalWritingMode() ? height() : width(); }
+    Length logicalMinWidth() const { return isHorizontalWritingMode() ? minWidth() : minHeight(); }
+    Length logicalMaxWidth() const { return isHorizontalWritingMode() ? maxWidth() : maxHeight(); }
+    Length logicalMinHeight() const { return isHorizontalWritingMode() ? minHeight() : minWidth(); }
+    Length logicalMaxHeight() const { return isHorizontalWritingMode() ? maxHeight() : maxWidth(); }
 
     const BorderData& border() const { return surround->border; }
     const BorderValue& borderLeft() const { return surround->border.left(); }
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to