Title: [125333] trunk/Source/WebCore
Revision
125333
Author
[email protected]
Date
2012-08-10 15:41:51 -0700 (Fri, 10 Aug 2012)

Log Message

Improved RuleData packing on some 32-bit platforms
https://bugs.webkit.org/show_bug.cgi?id=93737

Reviewed by Andreas Kling.

Certain 32-bit plarforms use an 8-byte alignment for uint64_t. We can save 4 bytes per
object on these platforms by using two naturally-aligning unsigned ints instead.

* css/StyleResolver.cpp:
(RuleData):
(SameSizeAsRuleData):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (125332 => 125333)


--- trunk/Source/WebCore/ChangeLog	2012-08-10 22:17:57 UTC (rev 125332)
+++ trunk/Source/WebCore/ChangeLog	2012-08-10 22:41:51 UTC (rev 125333)
@@ -1,3 +1,17 @@
+2012-08-10  Florin Malita  <[email protected]>
+
+        Improved RuleData packing on some 32-bit platforms
+        https://bugs.webkit.org/show_bug.cgi?id=93737
+
+        Reviewed by Andreas Kling.
+
+        Certain 32-bit plarforms use an 8-byte alignment for uint64_t. We can save 4 bytes per
+        object on these platforms by using two naturally-aligning unsigned ints instead.
+
+        * css/StyleResolver.cpp:
+        (RuleData):
+        (SameSizeAsRuleData):
+
 2012-08-10  Max Vujovic  <[email protected]>
 
         [CSS Shaders] Add blend mode and composite op to compiled program cache key

Modified: trunk/Source/WebCore/css/StyleResolver.cpp (125332 => 125333)


--- trunk/Source/WebCore/css/StyleResolver.cpp	2012-08-10 22:17:57 UTC (rev 125332)
+++ trunk/Source/WebCore/css/StyleResolver.cpp	2012-08-10 22:41:51 UTC (rev 125333)
@@ -223,26 +223,27 @@
 
 private:
     StyleRule* m_rule;
-    uint64_t m_selectorIndex : 12;
+    unsigned m_selectorIndex : 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.
-    uint64_t m_position : 20;
-    uint64_t m_specificity : 24;
-    uint64_t m_hasFastCheckableSelector : 1;
-    uint64_t m_hasMultipartSelector : 1;
-    uint64_t m_hasRightmostSelectorMatchingHTMLBasedOnRuleHash : 1;
-    uint64_t m_containsUncommonAttributeSelector : 1;
-    uint64_t m_linkMatchType : 2; //  SelectorChecker::LinkMatchMask
-    uint64_t m_hasDocumentSecurityOrigin : 1;
-    uint64_t m_isInRegionRule : 1;
+    unsigned m_position : 20;
+    unsigned m_specificity : 24;
+    unsigned m_hasFastCheckableSelector : 1;
+    unsigned m_hasMultipartSelector : 1;
+    unsigned m_hasRightmostSelectorMatchingHTMLBasedOnRuleHash : 1;
+    unsigned m_containsUncommonAttributeSelector : 1;
+    unsigned m_linkMatchType : 2; //  SelectorChecker::LinkMatchMask
+    unsigned m_hasDocumentSecurityOrigin : 1;
+    unsigned m_isInRegionRule : 1;
     // Use plain array instead of a Vector to minimize memory overhead.
     unsigned m_descendantSelectorIdentifierHashes[maximumIdentifierCount];
 };
     
 struct SameSizeAsRuleData {
     void* a;
-    uint64_t b;
-    unsigned c[4];
+    unsigned b;
+    unsigned c;
+    unsigned d[4];
 };
 
 COMPILE_ASSERT(sizeof(RuleData) == sizeof(SameSizeAsRuleData), RuleData_should_stay_small);
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to