Title: [96935] trunk/Source/WebCore
Revision
96935
Author
[email protected]
Date
2011-10-07 07:28:40 -0700 (Fri, 07 Oct 2011)

Log Message

Shrink StyleInheritedData.
https://bugs.webkit.org/show_bug.cgi?id=69625

Reviewed by Antti Koivisto.

Rearrange the members of StyleInheritedData to fold as much
as possible into the padding at the end of RefCounted.

This shrinks StyleInheritedData by 8 bytes on 64-bit, reducing
memory consumption by 500 kB when loading the full HTML5 spec.

* rendering/style/StyleInheritedData.cpp:
(WebCore::StyleInheritedData::StyleInheritedData):
* rendering/style/StyleInheritedData.h:

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (96934 => 96935)


--- trunk/Source/WebCore/ChangeLog	2011-10-07 14:18:56 UTC (rev 96934)
+++ trunk/Source/WebCore/ChangeLog	2011-10-07 14:28:40 UTC (rev 96935)
@@ -1,3 +1,20 @@
+2011-10-07  Andreas Kling  <[email protected]>
+
+        Shrink StyleInheritedData.
+        https://bugs.webkit.org/show_bug.cgi?id=69625
+
+        Reviewed by Antti Koivisto.
+
+        Rearrange the members of StyleInheritedData to fold as much
+        as possible into the padding at the end of RefCounted.
+
+        This shrinks StyleInheritedData by 8 bytes on 64-bit, reducing
+        memory consumption by 500 kB when loading the full HTML5 spec.
+
+        * rendering/style/StyleInheritedData.cpp:
+        (WebCore::StyleInheritedData::StyleInheritedData):
+        * rendering/style/StyleInheritedData.h:
+
 2011-10-07  Pavel Feldman  <[email protected]>
 
         Web Inspector: make ScriptsPanel compile

Modified: trunk/Source/WebCore/rendering/style/StyleInheritedData.cpp (96934 => 96935)


--- trunk/Source/WebCore/rendering/style/StyleInheritedData.cpp	2011-10-07 14:18:56 UTC (rev 96934)
+++ trunk/Source/WebCore/rendering/style/StyleInheritedData.cpp	2011-10-07 14:28:40 UTC (rev 96935)
@@ -28,11 +28,11 @@
 namespace WebCore {
 
 StyleInheritedData::StyleInheritedData()
-    : line_height(RenderStyle::initialLineHeight())
+    : horizontal_border_spacing(RenderStyle::initialHorizontalBorderSpacing())
+    , vertical_border_spacing(RenderStyle::initialVerticalBorderSpacing())
+    , line_height(RenderStyle::initialLineHeight())
     , list_style_image(RenderStyle::initialListStyleImage())
     , color(RenderStyle::initialColor())
-    , horizontal_border_spacing(RenderStyle::initialHorizontalBorderSpacing())
-    , vertical_border_spacing(RenderStyle::initialVerticalBorderSpacing())
 {
 }
 
@@ -42,12 +42,12 @@
 
 StyleInheritedData::StyleInheritedData(const StyleInheritedData& o)
     : RefCounted<StyleInheritedData>()
+    , horizontal_border_spacing(o.horizontal_border_spacing)
+    , vertical_border_spacing(o.vertical_border_spacing)
     , line_height(o.line_height)
     , list_style_image(o.list_style_image)
     , font(o.font)
     , color(o.color)
-    , horizontal_border_spacing(o.horizontal_border_spacing)
-    , vertical_border_spacing(o.vertical_border_spacing)
 {
 }
 

Modified: trunk/Source/WebCore/rendering/style/StyleInheritedData.h (96934 => 96935)


--- trunk/Source/WebCore/rendering/style/StyleInheritedData.h	2011-10-07 14:18:56 UTC (rev 96934)
+++ trunk/Source/WebCore/rendering/style/StyleInheritedData.h	2011-10-07 14:28:40 UTC (rev 96935)
@@ -48,6 +48,9 @@
         return !(*this == o);
     }
 
+    short horizontal_border_spacing;
+    short vertical_border_spacing;
+
     // could be packed in a short but doesn't
     // make a difference currently because of padding
     Length line_height;
@@ -57,8 +60,6 @@
     Font font;
     Color color;
 
-    short horizontal_border_spacing;
-    short vertical_border_spacing;
 private:
     StyleInheritedData();
     StyleInheritedData(const StyleInheritedData&);
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to