Ignore:
Timestamp:
Sep 30, 2012, 2:06:32 PM (13 years ago)
Author:
[email protected]
Message:

444kB below CSSParser::parseDeprecatedGradient() on Membuster3.
<http://webkit.org/b/97981>
<rdar://problem/12403058>

Reviewed by Anders Carlsson.

Slap an inline capacity of 2 on the Vector<CSSGradientColorStop> in CSSGradientValue.
This covers the majority of gradient values, and reduces memory consumption by ~250kB on Membuster3.

  • css/CSSGradientValue.h:

(WebCore::CSSGradientValue::stopCount):

  • css/CSSParser.cpp:

(WebCore::CSSParser::parseLinearGradient):
(WebCore::CSSParser::parseGradientColorStops):

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/css/CSSGradientValue.h

    r124768 r129996  
    6060    void addStop(const CSSGradientColorStop& stop) { m_stops.append(stop); }
    6161
    62     Vector<CSSGradientColorStop>& stops() { return m_stops; }
     62    unsigned stopCount() const { return m_stops.size(); }
    6363
    6464    void sortStopsIfNeeded();
     
    117117
    118118    // Stops
    119     Vector<CSSGradientColorStop> m_stops;
     119    Vector<CSSGradientColorStop, 2> m_stops;
    120120    bool m_stopsSorted;
    121121    bool m_deprecatedType; // -webkit-gradient()
Note: See TracChangeset for help on using the changeset viewer.