Changeset 99873 in webkit


Ignore:
Timestamp:
Nov 10, 2011 9:46:27 AM (12 years ago)
Author:
andreas.kling@nokia.com
Message:

Shrink CSSMutableStyleDeclaration.
<http://webkit.org/b/72032>

Reviewed by Antti Koivisto.

Move m_strictParsing and m_iteratorCount (debug only) up into
CSSStyleDeclaration, effectively shaving one CPU word (4/8 bytes)
off of every CSSMutableStyleDeclaration.

  • css/CSSMutableStyleDeclaration.cpp:

(WebCore::CSSMutableStyleDeclaration::CSSMutableStyleDeclaration):

  • css/CSSMutableStyleDeclaration.h:
  • css/CSSStyleDeclaration.cpp:

(WebCore::CSSStyleDeclaration::CSSStyleDeclaration):

  • css/CSSStyleDeclaration.h:
Location:
trunk/Source/WebCore
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r99872 r99873  
     12011-11-10  Andreas Kling  <kling@webkit.org>
     2
     3        Shrink CSSMutableStyleDeclaration.
     4        <http://webkit.org/b/72032>
     5
     6        Reviewed by Antti Koivisto.
     7
     8        Move m_strictParsing and m_iteratorCount (debug only) up into
     9        CSSStyleDeclaration, effectively shaving one CPU word (4/8 bytes)
     10        off of every CSSMutableStyleDeclaration.
     11
     12        * css/CSSMutableStyleDeclaration.cpp:
     13        (WebCore::CSSMutableStyleDeclaration::CSSMutableStyleDeclaration):
     14        * css/CSSMutableStyleDeclaration.h:
     15        * css/CSSStyleDeclaration.cpp:
     16        (WebCore::CSSStyleDeclaration::CSSStyleDeclaration):
     17        * css/CSSStyleDeclaration.h:
     18
    1192011-11-10  Balazs Kelemen  <kbalazs@webkit.org>
    220
  • trunk/Source/WebCore/css/CSSMutableStyleDeclaration.cpp

    r99749 r99873  
    4444    : CSSStyleDeclaration(0, /* isMutable */ true)
    4545    , m_node(0)
    46     , m_strictParsing(false)
    47 #ifndef NDEBUG
    48     , m_iteratorCount(0)
    49 #endif
    50 {
     46{
     47    // This constructor is used for various inline style declarations, so disable strict parsing.
     48    m_strictParsing = false;
    5149}
    5250
     
    5452    : CSSStyleDeclaration(parent, /* isMutable */ true)
    5553    , m_node(0)
    56     , m_strictParsing(!parent || parent->useStrictParsing())
    57 #ifndef NDEBUG
    58     , m_iteratorCount(0)
    59 #endif
    6054{
    6155}
     
    6559    , m_properties(properties)
    6660    , m_node(0)
    67     , m_strictParsing(!parent || parent->useStrictParsing())
    68 #ifndef NDEBUG
    69     , m_iteratorCount(0)
    70 #endif
    7161{
    7262    m_properties.shrinkToFit();
     
    7767    : CSSStyleDeclaration(parent, /* isMutable */ true)
    7868    , m_node(0)
    79     , m_strictParsing(!parent || parent->useStrictParsing())
    80 #ifndef NDEBUG
    81     , m_iteratorCount(0)
    82 #endif
    8369{
    8470    m_properties.reserveInitialCapacity(numProperties);
  • trunk/Source/WebCore/css/CSSMutableStyleDeclaration.h

    r99355 r99873  
    173173
    174174    Node* m_node;
    175     bool m_strictParsing : 1;
    176 #ifndef NDEBUG
    177     unsigned m_iteratorCount : 4;
    178 #endif
    179175
    180176    friend class CSSMutableStyleDeclarationConstIterator;
  • trunk/Source/WebCore/css/CSSStyleDeclaration.cpp

    r99749 r99873  
    4040
    4141CSSStyleDeclaration::CSSStyleDeclaration(CSSRule* parent, bool isMutable)
    42     : m_isMutableStyleDeclaration(isMutable)
     42    : m_strictParsing(!parent || parent->useStrictParsing())
     43#ifndef NDEBUG
     44    , m_iteratorCount(0)
     45#endif
     46    , m_isMutableStyleDeclaration(isMutable)
    4347    , m_parentIsRule(true)
    4448    , m_parentRule(parent)
  • trunk/Source/WebCore/css/CSSStyleDeclaration.h

    r99355 r99873  
    110110    virtual bool cssPropertyMatches(const CSSProperty*) const;
    111111
     112    // These bits are only used by CSSMutableStyleDeclaration but kept here
     113    // to maximize struct packing.
     114    bool m_strictParsing : 1;
     115#ifndef NDEBUG
     116    unsigned m_iteratorCount : 4;
     117#endif
     118
    112119private:
    113120    bool m_isMutableStyleDeclaration : 1;
Note: See TracChangeset for help on using the changeset viewer.