Title: [102835] trunk/Source/WebCore
- Revision
- 102835
- Author
- [email protected]
- Date
- 2011-12-14 15:21:35 -0800 (Wed, 14 Dec 2011)
Log Message
COMPILE_ASSERT in CSSStyleSelector.cpp doesn't compile on Windows
https://bugs.webkit.org/show_bug.cgi?id=74327
Reviewed by Darin Adler.
Always use unsigned instead of bool and unsigned in the bitfields of RuleData to shrink
its size under MSVC.
Unlike gcc and clang, MSVC pads each consecutive member variables of the same type
in bitfields. e.g. if you have:
sturct AB {
unsigned m_1 : 31;
bool m_2 : 1;
}
then MSVC pads m_1 and allocates sizeof(unsigned) * 2 for AB whereas gcc and clang
only allocate sizeof(unsigned) * 1 for AB.
* css/CSSStyleSelector.cpp:
(WebCore::RuleData::RuleData):
Modified Paths
Diff
Modified: trunk/Source/WebCore/ChangeLog (102834 => 102835)
--- trunk/Source/WebCore/ChangeLog 2011-12-14 23:18:26 UTC (rev 102834)
+++ trunk/Source/WebCore/ChangeLog 2011-12-14 23:21:35 UTC (rev 102835)
@@ -1,5 +1,27 @@
2011-12-14 Ryosuke Niwa <[email protected]>
+ COMPILE_ASSERT in CSSStyleSelector.cpp doesn't compile on Windows
+ https://bugs.webkit.org/show_bug.cgi?id=74327
+
+ Reviewed by Darin Adler.
+
+ Always use unsigned instead of bool and unsigned in the bitfields of RuleData to shrink
+ its size under MSVC.
+
+ Unlike gcc and clang, MSVC pads each consecutive member variables of the same type
+ in bitfields. e.g. if you have:
+ sturct AB {
+ unsigned m_1 : 31;
+ bool m_2 : 1;
+ }
+ then MSVC pads m_1 and allocates sizeof(unsigned) * 2 for AB whereas gcc and clang
+ only allocate sizeof(unsigned) * 1 for AB.
+
+ * css/CSSStyleSelector.cpp:
+ (WebCore::RuleData::RuleData):
+
+2011-12-14 Ryosuke Niwa <[email protected]>
+
NodeChildList shouldn't be in NodeListNodeData
https://bugs.webkit.org/show_bug.cgi?id=73969
Modified: trunk/Source/WebCore/css/CSSStyleSelector.cpp (102834 => 102835)
--- trunk/Source/WebCore/css/CSSStyleSelector.cpp 2011-12-14 23:18:26 UTC (rev 102834)
+++ trunk/Source/WebCore/css/CSSStyleSelector.cpp 2011-12-14 23:21:35 UTC (rev 102835)
@@ -193,12 +193,12 @@
// This number was picked fairly arbitrarily. We can probably lower it if we need to.
// Some simple testing showed <100,000 RuleData's on large sites.
unsigned m_position : 25;
- bool m_hasFastCheckableSelector : 1;
- bool m_hasMultipartSelector : 1;
- bool m_hasRightmostSelectorMatchingHTMLBasedOnRuleHash : 1;
- bool m_containsUncommonAttributeSelector : 1;
+ unsigned m_hasFastCheckableSelector : 1;
+ unsigned m_hasMultipartSelector : 1;
+ unsigned m_hasRightmostSelectorMatchingHTMLBasedOnRuleHash : 1;
+ unsigned m_containsUncommonAttributeSelector : 1;
unsigned m_linkMatchType : 2; // SelectorChecker::LinkMatchMask
- bool m_regionStyleRule : 1;
+ unsigned m_regionStyleRule : 1;
// Use plain array instead of a Vector to minimize memory overhead.
unsigned m_descendantSelectorIdentifierHashes[maximumIdentifierCount];
};
@@ -211,9 +211,7 @@
unsigned e[4];
};
-#if !OS(WINDOWS)
COMPILE_ASSERT(sizeof(RuleData) == sizeof(SameSizeAsRuleData), RuleData_should_stay_small);
-#endif
class RuleSet {
WTF_MAKE_NONCOPYABLE(RuleSet);
@@ -1894,7 +1892,7 @@
, m_specificity(selector->specificity())
, m_position(position)
, m_hasFastCheckableSelector(SelectorChecker::isFastCheckableSelector(selector))
- , m_hasMultipartSelector(selector->tagHistory())
+ , m_hasMultipartSelector(!!selector->tagHistory())
, m_hasRightmostSelectorMatchingHTMLBasedOnRuleHash(isSelectorMatchingHTMLBasedOnRuleHash(selector))
, m_containsUncommonAttributeSelector(WebCore::containsUncommonAttributeSelector(selector))
, m_linkMatchType(SelectorChecker::determineLinkMatchType(selector))
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes