Changeset 102835 in webkit
- Timestamp:
- Dec 14, 2011 3:21:35 PM (12 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r102834 r102835 1 2011-12-14 Ryosuke Niwa <rniwa@webkit.org> 2 3 COMPILE_ASSERT in CSSStyleSelector.cpp doesn't compile on Windows 4 https://bugs.webkit.org/show_bug.cgi?id=74327 5 6 Reviewed by Darin Adler. 7 8 Always use unsigned instead of bool and unsigned in the bitfields of RuleData to shrink 9 its size under MSVC. 10 11 Unlike gcc and clang, MSVC pads each consecutive member variables of the same type 12 in bitfields. e.g. if you have: 13 sturct AB { 14 unsigned m_1 : 31; 15 bool m_2 : 1; 16 } 17 then MSVC pads m_1 and allocates sizeof(unsigned) * 2 for AB whereas gcc and clang 18 only allocate sizeof(unsigned) * 1 for AB. 19 20 * css/CSSStyleSelector.cpp: 21 (WebCore::RuleData::RuleData): 22 1 23 2011-12-14 Ryosuke Niwa <rniwa@webkit.org> 2 24 -
trunk/Source/WebCore/css/CSSStyleSelector.cpp
r102832 r102835 194 194 // Some simple testing showed <100,000 RuleData's on large sites. 195 195 unsigned m_position : 25; 196 boolm_hasFastCheckableSelector : 1;197 boolm_hasMultipartSelector : 1;198 boolm_hasRightmostSelectorMatchingHTMLBasedOnRuleHash : 1;199 boolm_containsUncommonAttributeSelector : 1;196 unsigned m_hasFastCheckableSelector : 1; 197 unsigned m_hasMultipartSelector : 1; 198 unsigned m_hasRightmostSelectorMatchingHTMLBasedOnRuleHash : 1; 199 unsigned m_containsUncommonAttributeSelector : 1; 200 200 unsigned m_linkMatchType : 2; // SelectorChecker::LinkMatchMask 201 boolm_regionStyleRule : 1;201 unsigned m_regionStyleRule : 1; 202 202 // Use plain array instead of a Vector to minimize memory overhead. 203 203 unsigned m_descendantSelectorIdentifierHashes[maximumIdentifierCount]; … … 212 212 }; 213 213 214 #if !OS(WINDOWS)215 214 COMPILE_ASSERT(sizeof(RuleData) == sizeof(SameSizeAsRuleData), RuleData_should_stay_small); 216 #endif217 215 218 216 class RuleSet { … … 1895 1893 , m_position(position) 1896 1894 , m_hasFastCheckableSelector(SelectorChecker::isFastCheckableSelector(selector)) 1897 , m_hasMultipartSelector( selector->tagHistory())1895 , m_hasMultipartSelector(!!selector->tagHistory()) 1898 1896 , m_hasRightmostSelectorMatchingHTMLBasedOnRuleHash(isSelectorMatchingHTMLBasedOnRuleHash(selector)) 1899 1897 , m_containsUncommonAttributeSelector(WebCore::containsUncommonAttributeSelector(selector))
Note: See TracChangeset
for help on using the changeset viewer.