Title: [96972] trunk/Source/WebCore
Revision
96972
Author
[email protected]
Date
2011-10-07 12:32:32 -0700 (Fri, 07 Oct 2011)

Log Message

Pack StyleRareNonInheritedData even harder on 64-bit.
https://bugs.webkit.org/show_bug.cgi?id=69648

Patch by Andreas Kling <[email protected]> on 2011-10-07
Reviewed by Benjamin Poulain.

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

This shrinks StyleRareNonInheritedData by 16 bytes on 64-bit,
reducing memory consumption by another 140 kB when loading the
full HTML5 spec.

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

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (96971 => 96972)


--- trunk/Source/WebCore/ChangeLog	2011-10-07 19:28:49 UTC (rev 96971)
+++ trunk/Source/WebCore/ChangeLog	2011-10-07 19:32:32 UTC (rev 96972)
@@ -1,3 +1,21 @@
+2011-10-07  Andreas Kling  <[email protected]>
+
+        Pack StyleRareNonInheritedData even harder on 64-bit.
+        https://bugs.webkit.org/show_bug.cgi?id=69648
+
+        Reviewed by Benjamin Poulain.
+
+        Rearrange the members of StyleRareNonInheritedData to fold as much
+        as possible into the padding at the end of RefCounted.
+
+        This shrinks StyleRareNonInheritedData by 16 bytes on 64-bit,
+        reducing memory consumption by another 140 kB when loading the
+        full HTML5 spec.
+
+        * rendering/style/StyleRareNonInheritedData.cpp:
+        (WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData):
+        * rendering/style/StyleRareNonInheritedData.h:
+
 2011-10-07  Cary Clark  <[email protected]>
 
         Enable color profiles, unless profile is grayscale

Modified: trunk/Source/WebCore/rendering/style/StyleRareNonInheritedData.cpp (96971 => 96972)


--- trunk/Source/WebCore/rendering/style/StyleRareNonInheritedData.cpp	2011-10-07 19:28:49 UTC (rev 96971)
+++ trunk/Source/WebCore/rendering/style/StyleRareNonInheritedData.cpp	2011-10-07 19:32:32 UTC (rev 96972)
@@ -34,12 +34,14 @@
 namespace WebCore {
 
 StyleRareNonInheritedData::StyleRareNonInheritedData()
-    : lineClamp(RenderStyle::initialLineClamp())
-    , opacity(RenderStyle::initialOpacity())
-    , m_mask(FillLayer(MaskFillLayer))
+    : opacity(RenderStyle::initialOpacity())
+    , m_counterIncrement(0)
+    , m_counterReset(0)
     , m_perspective(RenderStyle::initialPerspective())
     , m_perspectiveOriginX(RenderStyle::initialPerspectiveOriginX())
     , m_perspectiveOriginY(RenderStyle::initialPerspectiveOriginY())
+    , lineClamp(RenderStyle::initialLineClamp())
+    , m_mask(FillLayer(MaskFillLayer))
     , m_pageSize()
     , m_wrapShape(RenderStyle::initialWrapShape())
     , m_flowThread(RenderStyle::initialFlowThread())
@@ -63,16 +65,19 @@
 #if USE(ACCELERATED_COMPOSITING)
     , m_runningAcceleratedAnimation(false)
 #endif
-    , m_counterIncrement(0)
-    , m_counterReset(0)
 {
     m_maskBoxImage.setMaskDefaults();
 }
 
 StyleRareNonInheritedData::StyleRareNonInheritedData(const StyleRareNonInheritedData& o)
     : RefCounted<StyleRareNonInheritedData>()
+    , opacity(o.opacity)
+    , m_counterIncrement(o.m_counterIncrement)
+    , m_counterReset(o.m_counterReset)
+    , m_perspective(o.m_perspective)
+    , m_perspectiveOriginX(o.m_perspectiveOriginX)
+    , m_perspectiveOriginY(o.m_perspectiveOriginY)
     , lineClamp(o.lineClamp)
-    , opacity(o.opacity)
     , m_deprecatedFlexibleBox(o.m_deprecatedFlexibleBox)
 #if ENABLE(CSS3_FLEXBOX)
     , m_flexibleBox(o.m_flexibleBox)
@@ -91,9 +96,6 @@
     , m_transitions(o.m_transitions ? adoptPtr(new AnimationList(*o.m_transitions)) : nullptr)
     , m_mask(o.m_mask)
     , m_maskBoxImage(o.m_maskBoxImage)
-    , m_perspective(o.m_perspective)
-    , m_perspectiveOriginX(o.m_perspectiveOriginX)
-    , m_perspectiveOriginY(o.m_perspectiveOriginY)
     , m_pageSize(o.m_pageSize)
     , m_wrapShape(o.m_wrapShape)
     , m_flowThread(o.m_flowThread)
@@ -117,8 +119,6 @@
 #if USE(ACCELERATED_COMPOSITING)
     , m_runningAcceleratedAnimation(o.m_runningAcceleratedAnimation)
 #endif
-    , m_counterIncrement(o.m_counterIncrement)
-    , m_counterReset(o.m_counterReset)
 {
 }
 

Modified: trunk/Source/WebCore/rendering/style/StyleRareNonInheritedData.h (96971 => 96972)


--- trunk/Source/WebCore/rendering/style/StyleRareNonInheritedData.h	2011-10-07 19:28:49 UTC (rev 96971)
+++ trunk/Source/WebCore/rendering/style/StyleRareNonInheritedData.h	2011-10-07 19:32:32 UTC (rev 96972)
@@ -87,11 +87,19 @@
     bool animationDataEquivalent(const StyleRareNonInheritedData&) const;
     bool transitionDataEquivalent(const StyleRareNonInheritedData&) const;
 
+    float opacity; // Whether or not we're transparent.
+
+    short m_counterIncrement;
+    short m_counterReset;
+
+    float m_perspective;
+    Length m_perspectiveOriginX;
+    Length m_perspectiveOriginY;
+
     LineClampValue lineClamp; // An Apple extension.
 #if ENABLE(DASHBOARD_SUPPORT)
     Vector<StyleDashboardRegion> m_dashboardRegions;
 #endif
-    float opacity; // Whether or not we're transparent.
 
     DataRef<StyleDeprecatedFlexibleBoxData> m_deprecatedFlexibleBox; // Flexible box properties
 #if ENABLE(CSS3_FLEXBOX)
@@ -118,10 +126,6 @@
     FillLayer m_mask;
     NinePieceImage m_maskBoxImage;
 
-    float m_perspective;
-    Length m_perspectiveOriginX;
-    Length m_perspectiveOriginY;
-
     LengthSize m_pageSize;
 
     RefPtr<CSSWrapShape> m_wrapShape;
@@ -152,9 +156,6 @@
     bool m_runningAcceleratedAnimation : 1;
 #endif
 
-    short m_counterIncrement;
-    short m_counterReset;
-
 private:
     StyleRareNonInheritedData();
     StyleRareNonInheritedData(const StyleRareNonInheritedData&);
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to