Changeset 101218 in webkit
- Timestamp:
- Nov 27, 2011, 7:50:23 PM (15 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 4 edited
-
ChangeLog (modified) (1 diff)
-
css/CSSRule.h (modified) (2 diffs)
-
css/CSSStyleRule.cpp (modified) (1 diff)
-
css/CSSStyleRule.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r101215 r101218 1 2011-11-27 Andreas Kling <kling@webkit.org> 2 3 CSSStyleRule: Pack m_sourceLine with CSSRule bits. 4 <http://webkit.org/b/73168> 5 6 Reviewed by Antti Koivisto. 7 8 Make CSSStyleRule::m_sourceLine a 27-bit integer and pack it with the rest 9 of the members in CSSRule. This shrinks CSSStyleRule by one CPU word 10 and reduces memory consumption by 81 kB on the GMail inbox (on 64-bit.) 11 12 * css/CSSRule.h: 13 (WebCore::CSSRule::CSSRule): 14 * css/CSSStyleRule.cpp: 15 (WebCore::CSSStyleRule::CSSStyleRule): 16 * css/CSSStyleRule.h: 17 1 18 2011-11-27 Mark Rowe <mrowe@apple.com> 2 19 -
trunk/Source/WebCore/css/CSSRule.h
r99171 r101218 110 110 protected: 111 111 CSSRule(CSSStyleSheet* parent, Type type) 112 : m_parentIsRule(false) 112 : m_sourceLine(0) 113 , m_parentIsRule(false) 113 114 , m_type(type) 114 115 , m_parentStyleSheet(parent) … … 121 122 ~CSSRule() { } 122 123 124 // Only used by CSSStyleRule but kept here to maximize struct packing. 125 signed m_sourceLine : 27; 126 123 127 private: 124 void destroy();125 126 128 bool m_parentIsRule : 1; 127 unsigned m_type : 31; // Plenty of space for additional flags here.129 unsigned m_type : 4; 128 130 union { 129 131 CSSRule* m_parentRule; 130 132 CSSStyleSheet* m_parentStyleSheet; 131 133 }; 134 135 void destroy(); 132 136 }; 133 137 -
trunk/Source/WebCore/css/CSSStyleRule.cpp
r101172 r101218 36 36 CSSStyleRule::CSSStyleRule(CSSStyleSheet* parent, int sourceLine, CSSRule::Type type) 37 37 : CSSRule(parent, type) 38 , m_sourceLine(sourceLine)39 38 { 39 m_sourceLine = sourceLine; 40 41 // m_sourceLine is a bitfield, so let's catch any overflow early in debug mode. 42 ASSERT(m_sourceLine == sourceLine); 40 43 } 41 44 -
trunk/Source/WebCore/css/CSSStyleRule.h
r99190 r101218 64 64 RefPtr<CSSMutableStyleDeclaration> m_style; 65 65 CSSSelectorList m_selectorList; 66 int m_sourceLine;67 66 }; 68 67
Note:
See TracChangeset
for help on using the changeset viewer.