Changeset 130560 in webkit


Ignore:
Timestamp:
Oct 5, 2012 3:09:04 PM (11 years ago)
Author:
eric@webkit.org
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:
Location:
trunk/Source/WebCore
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r130556 r130560  
     12012-10-05  Eric Seidel  <eric@webkit.org>
     2
     3        Remove needless virtual calls and inline RenderStyle::logical* to make table layout faster
     4        https://bugs.webkit.org/show_bug.cgi?id=98550
     5
     6        Reviewed by Andreas Kling.
     7
     8        This shaved another 5% (100ms) off of the runtime of resizecol.html microbenchmark:
     9        http://www.robohornet.org/tests/resizecol.html
     10
     11        * rendering/AutoTableLayout.cpp:
     12        (WebCore::AutoTableLayout::recalcColumn):
     13        * rendering/style/RenderStyle.cpp:
     14        * rendering/style/RenderStyle.h:
     15
    1162012-10-04  Eric Carlson  <eric.carlson@apple.com>
    217
  • trunk/Source/WebCore/rendering/AutoTableLayout.cpp

    r129529 r130560  
    5050    RenderTableCell* maxContributor = 0;
    5151
    52     for (RenderObject* child = m_table->firstChild(); child; child = child->nextSibling()) {
     52    for (RenderObject* child = m_table->children()->firstChild(); child; child = child->nextSibling()) {
    5353        if (child->isRenderTableCol())
    5454            toRenderTableCol(child)->computePreferredLogicalWidths();
     
    6363                    continue;
    6464
    65                 bool cellHasContent = cell->firstChild() || cell->style()->hasBorder() || cell->style()->hasPadding();
     65                bool cellHasContent = cell->children()->firstChild() || cell->style()->hasBorder() || cell->style()->hasPadding();
    6666                if (cellHasContent)
    6767                    columnLayout.emptyCellsOnly = false;
  • trunk/Source/WebCore/rendering/style/RenderStyle.cpp

    r130489 r130560  
    14331433}
    14341434
    1435 Length RenderStyle::logicalWidth() const
    1436 {
    1437     if (isHorizontalWritingMode())
    1438         return width();
    1439     return height();
    1440 }
    1441 
    1442 Length RenderStyle::logicalHeight() const
    1443 {
    1444     if (isHorizontalWritingMode())
    1445         return height();
    1446     return width();
    1447 }
    1448 
    1449 Length RenderStyle::logicalMinWidth() const
    1450 {
    1451     if (isHorizontalWritingMode())
    1452         return minWidth();
    1453     return minHeight();
    1454 }
    1455 
    1456 Length RenderStyle::logicalMaxWidth() const
    1457 {
    1458     if (isHorizontalWritingMode())
    1459         return maxWidth();
    1460     return maxHeight();
    1461 }
    1462 
    1463 Length RenderStyle::logicalMinHeight() const
    1464 {
    1465     if (isHorizontalWritingMode())
    1466         return minHeight();
    1467     return minWidth();
    1468 }
    1469 
    1470 Length RenderStyle::logicalMaxHeight() const
    1471 {
    1472     if (isHorizontalWritingMode())
    1473         return maxHeight();
    1474     return maxWidth();
    1475 }
    1476 
    14771435const BorderValue& RenderStyle::borderBefore() const
    14781436{
  • trunk/Source/WebCore/rendering/style/RenderStyle.h

    r130489 r130560  
    524524    Length maxHeight() const { return m_box->maxHeight(); }
    525525   
    526     Length logicalWidth() const;
    527     Length logicalHeight() const;
    528     Length logicalMinWidth() const;
    529     Length logicalMaxWidth() const;
    530     Length logicalMinHeight() const;
    531     Length logicalMaxHeight() const;
     526    Length logicalWidth() const { return isHorizontalWritingMode() ? width() : height(); }
     527    Length logicalHeight() const { return isHorizontalWritingMode() ? height() : width(); }
     528    Length logicalMinWidth() const { return isHorizontalWritingMode() ? minWidth() : minHeight(); }
     529    Length logicalMaxWidth() const { return isHorizontalWritingMode() ? maxWidth() : maxHeight(); }
     530    Length logicalMinHeight() const { return isHorizontalWritingMode() ? minHeight() : minWidth(); }
     531    Length logicalMaxHeight() const { return isHorizontalWritingMode() ? maxHeight() : maxWidth(); }
    532532
    533533    const BorderData& border() const { return surround->border; }
Note: See TracChangeset for help on using the changeset viewer.