Changeset 157934 in webkit


Ignore:
Timestamp:
Oct 24, 2013 9:35:44 AM (11 years ago)
Author:
commit-queue@webkit.org
Message:

Unreviewed, rolling out r157916.
http://trac.webkit.org/changeset/157916
https://bugs.webkit.org/show_bug.cgi?id=123274

Broke Layout/flexbox-lots-of-data.html on perfbot (Requested
by ap on #webkit).

PerformanceTests:

  • Layout/flexbox-lots-of-data.html: Removed.

Source/WebCore:

  • rendering/RenderFlexibleBox.cpp:

(WebCore::RenderFlexibleBox::OrderHashTraits::emptyValue):
(WebCore::RenderFlexibleBox::OrderHashTraits::constructDeletedValue):
(WebCore::RenderFlexibleBox::OrderHashTraits::isDeletedValue):
(WebCore::RenderFlexibleBox::OrderIterator::setOrderValues):
(WebCore::RenderFlexibleBox::layoutBlock):
(WebCore::RenderFlexibleBox::computeMainAxisPreferredSizes):

  • rendering/RenderFlexibleBox.h:
Location:
trunk
Files:
1 deleted
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/PerformanceTests/ChangeLog

    r157916 r157934  
     12013-10-24  Commit Queue  <commit-queue@webkit.org>
     2
     3        Unreviewed, rolling out r157916.
     4        http://trac.webkit.org/changeset/157916
     5        https://bugs.webkit.org/show_bug.cgi?id=123274
     6
     7        Broke Layout/flexbox-lots-of-data.html on perfbot (Requested
     8        by ap on #webkit).
     9
     10        * Layout/flexbox-lots-of-data.html: Removed.
     11
    1122013-10-14  Sergio Villar Senin  <svillar@igalia.com>
    213
  • trunk/Source/WebCore/ChangeLog

    r157933 r157934  
     12013-10-24  Commit Queue  <commit-queue@webkit.org>
     2
     3        Unreviewed, rolling out r157916.
     4        http://trac.webkit.org/changeset/157916
     5        https://bugs.webkit.org/show_bug.cgi?id=123274
     6
     7        Broke Layout/flexbox-lots-of-data.html on perfbot (Requested
     8        by ap on #webkit).
     9
     10        * rendering/RenderFlexibleBox.cpp:
     11        (WebCore::RenderFlexibleBox::OrderHashTraits::emptyValue):
     12        (WebCore::RenderFlexibleBox::OrderHashTraits::constructDeletedValue):
     13        (WebCore::RenderFlexibleBox::OrderHashTraits::isDeletedValue):
     14        (WebCore::RenderFlexibleBox::OrderIterator::setOrderValues):
     15        (WebCore::RenderFlexibleBox::layoutBlock):
     16        (WebCore::RenderFlexibleBox::computeMainAxisPreferredSizes):
     17        * rendering/RenderFlexibleBox.h:
     18
    1192013-10-24  Zan Dobersek  <zdobersek@igalia.com>
    220
  • trunk/Source/WebCore/rendering/RenderFlexibleBox.cpp

    r157916 r157934  
    4040namespace WebCore {
    4141
     42// Normally, -1 and 0 are not valid in a HashSet, but these are relatively likely order: values. Instead,
     43// we make the two smallest int values invalid order: values (in the css parser code we clamp them to
     44// int min + 2).
     45struct RenderFlexibleBox::OrderHashTraits : WTF::GenericHashTraits<int> {
     46    static const bool emptyValueIsZero = false;
     47    static int emptyValue() { return std::numeric_limits<int>::min(); }
     48    static void constructDeletedValue(int& slot) { slot = std::numeric_limits<int>::min() + 1; }
     49    static bool isDeletedValue(int value) { return value == std::numeric_limits<int>::min() + 1; }
     50};
     51
    4252RenderFlexibleBox::OrderIterator::OrderIterator(const RenderFlexibleBox* flexibleBox)
    4353    : m_flexibleBox(flexibleBox)
     
    4757}
    4858
    49 void RenderFlexibleBox::OrderIterator::setOrderValues(const OrderValues& orderValues)
     59void RenderFlexibleBox::OrderIterator::setOrderValues(const OrderHashSet& orderValues)
    5060{
    5161    reset();
    52     m_orderValues = orderValues;
    53     if (m_orderValues.size() < 2)
    54         return;
    55 
     62    copyToVector(orderValues, m_orderValues);
    5663    std::sort(m_orderValues.begin(), m_orderValues.end());
    57     auto nextElement = std::unique(m_orderValues.begin(), m_orderValues.end());
    58     m_orderValues.shrinkCapacity(nextElement - m_orderValues.begin());
    5964}
    6065
     
    344349
    345350    Vector<LineContext> lineContexts;
    346     OrderIterator::OrderValues orderValues;
     351    OrderHashSet orderValues;
    347352    computeMainAxisPreferredSizes(orderValues);
    348353    m_orderIterator.setOrderValues(orderValues);
     
    904909}
    905910
    906 void RenderFlexibleBox::computeMainAxisPreferredSizes(OrderIterator::OrderValues& orderValues)
    907 {
    908     ASSERT(orderValues.isEmpty());
    909 
     911void RenderFlexibleBox::computeMainAxisPreferredSizes(OrderHashSet& orderValues)
     912{
    910913    for (RenderBox* child = firstChildBox(); child; child = child->nextSiblingBox()) {
    911         // Avoid growing the vector for the common-case default value of 0. This optimizes the most common case which is
    912         // one or a few values with the default order 0
    913         int order = child->style()->order();
    914         if (orderValues.isEmpty() || orderValues.last() != order)
    915             orderValues.append(order);
     914        orderValues.add(child->style()->order());
    916915
    917916        if (child->isOutOfFlowPositioned())
  • trunk/Source/WebCore/rendering/RenderFlexibleBox.h

    r157916 r157934  
    7474    };
    7575
     76    struct OrderHashTraits;
     77    typedef HashSet<int, DefaultHash<int>::Hash, OrderHashTraits> OrderHashSet;
     78
    7679    class OrderIterator {
    7780        WTF_MAKE_NONCOPYABLE(OrderIterator);
    7881    public:
    79         typedef Vector<int, 1> OrderValues;
    80 
    8182        OrderIterator(const RenderFlexibleBox*);
    82         void setOrderValues(const OrderValues&);
     83        void setOrderValues(const OrderHashSet&);
    8384        RenderBox* currentChild() const { return m_currentChild; }
    8485        RenderBox* first();
     
    8990        const RenderFlexibleBox* m_flexibleBox;
    9091        RenderBox* m_currentChild;
    91         OrderValues m_orderValues;
     92        Vector<int> m_orderValues;
    9293        Vector<int>::const_iterator m_orderValuesIterator;
    9394    };
     
    153154
    154155    LayoutUnit computeChildMarginValue(const Length& margin);
    155     void computeMainAxisPreferredSizes(OrderIterator::OrderValues&);
     156    void computeMainAxisPreferredSizes(OrderHashSet&);
    156157    LayoutUnit adjustChildSizeForMinAndMax(RenderBox&, LayoutUnit childSize);
    157158    bool computeNextFlexLine(OrderedFlexItemList& orderedChildren, LayoutUnit& preferredMainAxisExtent, double& totalFlexGrow, double& totalWeightedFlexShrink, LayoutUnit& minMaxAppliedMainAxisExtent, bool& hasInfiniteLineLength);
Note: See TracChangeset for help on using the changeset viewer.