Title: [96594] trunk/Source/WebCore
Revision
96594
Author
commit-qu...@webkit.org
Date
2011-10-04 08:13:45 -0700 (Tue, 04 Oct 2011)

Log Message

Shrink StyleRareNonInheritedData.
https://bugs.webkit.org/show_bug.cgi?id=69331

Patch by Andreas Kling <kl...@webkit.org> on 2011-10-04
Reviewed by Antti Koivisto.

Rearrange the members and move all small types into the bitfield.
This shrinks StyleRareNonInheritedData by two CPU words, reducing memory
consumption by 140 kB (on 64-bit) 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 (96593 => 96594)


--- trunk/Source/WebCore/ChangeLog	2011-10-04 15:02:25 UTC (rev 96593)
+++ trunk/Source/WebCore/ChangeLog	2011-10-04 15:13:45 UTC (rev 96594)
@@ -1,3 +1,18 @@
+2011-10-04  Andreas Kling  <kl...@webkit.org>
+
+        Shrink StyleRareNonInheritedData.
+        https://bugs.webkit.org/show_bug.cgi?id=69331
+
+        Reviewed by Antti Koivisto.
+
+        Rearrange the members and move all small types into the bitfield.
+        This shrinks StyleRareNonInheritedData by two CPU words, reducing memory
+        consumption by 140 kB (on 64-bit) when loading the full HTML5 spec.
+
+        * rendering/style/StyleRareNonInheritedData.cpp:
+        (WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData):
+        * rendering/style/StyleRareNonInheritedData.h:
+
 2011-10-04  Vsevolod Vlasov  <vse...@chromium.org>
 
         Web Inspector: Remove http/tests/inspector/network/disabled-cache-crash.html.

Modified: trunk/Source/WebCore/rendering/style/StyleRareNonInheritedData.cpp (96593 => 96594)


--- trunk/Source/WebCore/rendering/style/StyleRareNonInheritedData.cpp	2011-10-04 15:02:25 UTC (rev 96593)
+++ trunk/Source/WebCore/rendering/style/StyleRareNonInheritedData.cpp	2011-10-04 15:13:45 UTC (rev 96594)
@@ -36,35 +36,35 @@
 StyleRareNonInheritedData::StyleRareNonInheritedData()
     : lineClamp(RenderStyle::initialLineClamp())
     , opacity(RenderStyle::initialOpacity())
-    , userDrag(RenderStyle::initialUserDrag())
-    , textOverflow(RenderStyle::initialTextOverflow())
-    , marginBeforeCollapse(MCOLLAPSE)
-    , marginAfterCollapse(MCOLLAPSE)
-    , matchNearestMailBlockquoteColor(RenderStyle::initialMatchNearestMailBlockquoteColor())
-    , m_appearance(RenderStyle::initialAppearance())
-    , m_borderFit(RenderStyle::initialBorderFit())
-    , m_textCombine(RenderStyle::initialTextCombine())
-    , m_counterIncrement(0)
-    , m_counterReset(0)
-#if USE(ACCELERATED_COMPOSITING)
-    , m_runningAcceleratedAnimation(false)
-#endif
     , m_mask(FillLayer(MaskFillLayer))
-    , m_transformStyle3D(RenderStyle::initialTransformStyle3D())
-    , m_backfaceVisibility(RenderStyle::initialBackfaceVisibility())
     , m_perspective(RenderStyle::initialPerspective())
     , m_perspectiveOriginX(RenderStyle::initialPerspectiveOriginX())
     , m_perspectiveOriginY(RenderStyle::initialPerspectiveOriginY())
     , m_pageSize()
-    , m_pageSizeType(PAGE_SIZE_AUTO)
+    , m_wrapShape(RenderStyle::initialWrapShape())
     , m_flowThread(RenderStyle::initialFlowThread())
     , m_regionThread(RenderStyle::initialRegionThread())
     , m_regionIndex(RenderStyle::initialRegionIndex())
     , m_regionOverflow(RenderStyle::initialRegionOverflow())
-    , m_wrapShape(RenderStyle::initialWrapShape())
     , m_regionBreakAfter(RenderStyle::initialPageBreak())
     , m_regionBreakBefore(RenderStyle::initialPageBreak())
     , m_regionBreakInside(RenderStyle::initialPageBreak())
+    , m_pageSizeType(PAGE_SIZE_AUTO)
+    , m_transformStyle3D(RenderStyle::initialTransformStyle3D())
+    , m_backfaceVisibility(RenderStyle::initialBackfaceVisibility())
+    , userDrag(RenderStyle::initialUserDrag())
+    , textOverflow(RenderStyle::initialTextOverflow())
+    , marginBeforeCollapse(MCOLLAPSE)
+    , marginAfterCollapse(MCOLLAPSE)
+    , matchNearestMailBlockquoteColor(RenderStyle::initialMatchNearestMailBlockquoteColor())
+    , m_appearance(RenderStyle::initialAppearance())
+    , m_borderFit(RenderStyle::initialBorderFit())
+    , m_textCombine(RenderStyle::initialTextCombine())
+#if USE(ACCELERATED_COMPOSITING)
+    , m_runningAcceleratedAnimation(false)
+#endif
+    , m_counterIncrement(0)
+    , m_counterReset(0)
 {
     m_maskBoxImage.setMaskDefaults();
 }
@@ -85,40 +85,40 @@
 #endif
     , m_content(o.m_content ? o.m_content->clone() : nullptr)
     , m_counterDirectives(o.m_counterDirectives ? clone(*o.m_counterDirectives) : nullptr)
-    , userDrag(o.userDrag)
-    , textOverflow(o.textOverflow)
-    , marginBeforeCollapse(o.marginBeforeCollapse)
-    , marginAfterCollapse(o.marginAfterCollapse)
-    , matchNearestMailBlockquoteColor(o.matchNearestMailBlockquoteColor)
-    , m_appearance(o.m_appearance)
-    , m_borderFit(o.m_borderFit)
-    , m_textCombine(o.m_textCombine)
-    , m_counterIncrement(o.m_counterIncrement)
-    , m_counterReset(o.m_counterReset)
-#if USE(ACCELERATED_COMPOSITING)
-    , m_runningAcceleratedAnimation(o.m_runningAcceleratedAnimation)
-#endif
     , m_boxShadow(o.m_boxShadow ? adoptPtr(new ShadowData(*o.m_boxShadow)) : nullptr)
     , m_boxReflect(o.m_boxReflect)
     , m_animations(o.m_animations ? adoptPtr(new AnimationList(*o.m_animations)) : nullptr)
     , m_transitions(o.m_transitions ? adoptPtr(new AnimationList(*o.m_transitions)) : nullptr)
     , m_mask(o.m_mask)
     , m_maskBoxImage(o.m_maskBoxImage)
-    , m_transformStyle3D(o.m_transformStyle3D)
-    , m_backfaceVisibility(o.m_backfaceVisibility)
     , m_perspective(o.m_perspective)
     , m_perspectiveOriginX(o.m_perspectiveOriginX)
     , m_perspectiveOriginY(o.m_perspectiveOriginY)
     , m_pageSize(o.m_pageSize)
-    , m_pageSizeType(o.m_pageSizeType)
+    , m_wrapShape(o.m_wrapShape)
     , m_flowThread(o.m_flowThread)
     , m_regionThread(o.m_regionThread)
     , m_regionIndex(o.m_regionIndex)
     , m_regionOverflow(o.m_regionOverflow)
-    , m_wrapShape(o.m_wrapShape)
     , m_regionBreakAfter(o.m_regionBreakAfter)
     , m_regionBreakBefore(o.m_regionBreakBefore)
     , m_regionBreakInside(o.m_regionBreakInside)
+    , m_pageSizeType(o.m_pageSizeType)
+    , m_transformStyle3D(o.m_transformStyle3D)
+    , m_backfaceVisibility(o.m_backfaceVisibility)
+    , userDrag(o.userDrag)
+    , textOverflow(o.textOverflow)
+    , marginBeforeCollapse(o.marginBeforeCollapse)
+    , marginAfterCollapse(o.marginAfterCollapse)
+    , matchNearestMailBlockquoteColor(o.matchNearestMailBlockquoteColor)
+    , m_appearance(o.m_appearance)
+    , m_borderFit(o.m_borderFit)
+    , m_textCombine(o.m_textCombine)
+#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 (96593 => 96594)


--- trunk/Source/WebCore/rendering/style/StyleRareNonInheritedData.h	2011-10-04 15:02:25 UTC (rev 96593)
+++ trunk/Source/WebCore/rendering/style/StyleRareNonInheritedData.h	2011-10-04 15:13:45 UTC (rev 96594)
@@ -108,21 +108,6 @@
     OwnPtr<ContentData> m_content;
     OwnPtr<CounterDirectiveMap> m_counterDirectives;
 
-    unsigned userDrag : 2; // EUserDrag
-    unsigned textOverflow : 1; // Whether or not lines that spill out should be truncated with "..."
-    unsigned marginBeforeCollapse : 2; // EMarginCollapse
-    unsigned marginAfterCollapse : 2; // EMarginCollapse
-    unsigned matchNearestMailBlockquoteColor : 1; // EMatchNearestMailBlockquoteColor, FIXME: This property needs to be eliminated. It should never have been added.
-    unsigned m_appearance : 6; // EAppearance
-    unsigned m_borderFit : 1; // EBorderFit
-    unsigned m_textCombine : 1; // CSS3 text-combine properties
-    
-    short m_counterIncrement;
-    short m_counterReset;
-
-#if USE(ACCELERATED_COMPOSITING)
-    bool m_runningAcceleratedAnimation : 1;
-#endif
     OwnPtr<ShadowData> m_boxShadow;  // For box-shadow decorations.
     
     RefPtr<StyleReflection> m_boxReflect;
@@ -133,26 +118,43 @@
     FillLayer m_mask;
     NinePieceImage m_maskBoxImage;
 
-    ETransformStyle3D m_transformStyle3D;
-    EBackfaceVisibility m_backfaceVisibility;
     float m_perspective;
     Length m_perspectiveOriginX;
     Length m_perspectiveOriginY;
 
     LengthSize m_pageSize;
-    PageSizeType m_pageSizeType;
 
+    RefPtr<CSSWrapShape> m_wrapShape;
+
     AtomicString m_flowThread;
     AtomicString m_regionThread;
     int m_regionIndex;
-    RegionOverflow m_regionOverflow;
+    RegionOverflow m_regionOverflow : 1;
 
-    RefPtr<CSSWrapShape> m_wrapShape;
-
     unsigned m_regionBreakAfter : 2; // EPageBreak
     unsigned m_regionBreakBefore : 2; // EPageBreak
     unsigned m_regionBreakInside : 2; // EPageBreak
 
+    PageSizeType m_pageSizeType : 2;
+    ETransformStyle3D m_transformStyle3D : 1;
+    EBackfaceVisibility m_backfaceVisibility : 1;
+
+    unsigned userDrag : 2; // EUserDrag
+    unsigned textOverflow : 1; // Whether or not lines that spill out should be truncated with "..."
+    unsigned marginBeforeCollapse : 2; // EMarginCollapse
+    unsigned marginAfterCollapse : 2; // EMarginCollapse
+    unsigned matchNearestMailBlockquoteColor : 1; // EMatchNearestMailBlockquoteColor, FIXME: This property needs to be eliminated. It should never have been added.
+    unsigned m_appearance : 6; // EAppearance
+    unsigned m_borderFit : 1; // EBorderFit
+    unsigned m_textCombine : 1; // CSS3 text-combine properties
+
+#if USE(ACCELERATED_COMPOSITING)
+    bool m_runningAcceleratedAnimation : 1;
+#endif
+
+    short m_counterIncrement;
+    short m_counterReset;
+
 private:
     StyleRareNonInheritedData();
     StyleRareNonInheritedData(const StyleRareNonInheritedData&);
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to