Changeset 99873 in webkit
- Timestamp:
- Nov 10, 2011 9:46:27 AM (12 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r99872 r99873 1 2011-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 1 19 2011-11-10 Balazs Kelemen <kbalazs@webkit.org> 2 20 -
trunk/Source/WebCore/css/CSSMutableStyleDeclaration.cpp
r99749 r99873 44 44 : CSSStyleDeclaration(0, /* isMutable */ true) 45 45 , 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; 51 49 } 52 50 … … 54 52 : CSSStyleDeclaration(parent, /* isMutable */ true) 55 53 , m_node(0) 56 , m_strictParsing(!parent || parent->useStrictParsing())57 #ifndef NDEBUG58 , m_iteratorCount(0)59 #endif60 54 { 61 55 } … … 65 59 , m_properties(properties) 66 60 , m_node(0) 67 , m_strictParsing(!parent || parent->useStrictParsing())68 #ifndef NDEBUG69 , m_iteratorCount(0)70 #endif71 61 { 72 62 m_properties.shrinkToFit(); … … 77 67 : CSSStyleDeclaration(parent, /* isMutable */ true) 78 68 , m_node(0) 79 , m_strictParsing(!parent || parent->useStrictParsing())80 #ifndef NDEBUG81 , m_iteratorCount(0)82 #endif83 69 { 84 70 m_properties.reserveInitialCapacity(numProperties); -
trunk/Source/WebCore/css/CSSMutableStyleDeclaration.h
r99355 r99873 173 173 174 174 Node* m_node; 175 bool m_strictParsing : 1;176 #ifndef NDEBUG177 unsigned m_iteratorCount : 4;178 #endif179 175 180 176 friend class CSSMutableStyleDeclarationConstIterator; -
trunk/Source/WebCore/css/CSSStyleDeclaration.cpp
r99749 r99873 40 40 41 41 CSSStyleDeclaration::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) 43 47 , m_parentIsRule(true) 44 48 , m_parentRule(parent) -
trunk/Source/WebCore/css/CSSStyleDeclaration.h
r99355 r99873 110 110 virtual bool cssPropertyMatches(const CSSProperty*) const; 111 111 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 112 119 private: 113 120 bool m_isMutableStyleDeclaration : 1;
Note: See TracChangeset
for help on using the changeset viewer.