Title: [116343] trunk/Source/WebCore
- Revision
- 116343
- Author
- [email protected]
- Date
- 2012-05-07 13:16:54 -0700 (Mon, 07 May 2012)
Log Message
Shrink SVGInlineTextBox object size
https://bugs.webkit.org/show_bug.cgi?id=85805
Reviewed by Darin Adler.
Reduce the object size of SVGInlineTextBox by using bitfields. This
should be 4 bytes on 32-bits and 8 bytes on 64-bits systems.
* rendering/svg/RenderSVGResource.h:
* rendering/svg/SVGInlineTextBox.cpp:
(ExpectedSVGInlineTextBoxSize):
(WebCore):
* rendering/svg/SVGInlineTextBox.h:
(SVGInlineTextBox):
Modified Paths
Diff
Modified: trunk/Source/WebCore/ChangeLog (116342 => 116343)
--- trunk/Source/WebCore/ChangeLog 2012-05-07 20:14:12 UTC (rev 116342)
+++ trunk/Source/WebCore/ChangeLog 2012-05-07 20:16:54 UTC (rev 116343)
@@ -1,3 +1,20 @@
+2012-05-07 Rob Buis <[email protected]>
+
+ Shrink SVGInlineTextBox object size
+ https://bugs.webkit.org/show_bug.cgi?id=85805
+
+ Reviewed by Darin Adler.
+
+ Reduce the object size of SVGInlineTextBox by using bitfields. This
+ should be 4 bytes on 32-bits and 8 bytes on 64-bits systems.
+
+ * rendering/svg/RenderSVGResource.h:
+ * rendering/svg/SVGInlineTextBox.cpp:
+ (ExpectedSVGInlineTextBoxSize):
+ (WebCore):
+ * rendering/svg/SVGInlineTextBox.h:
+ (SVGInlineTextBox):
+
2012-05-07 Sheriff Bot <[email protected]>
Unreviewed, rolling out r116334.
Modified: trunk/Source/WebCore/rendering/svg/RenderSVGResource.h (116342 => 116343)
--- trunk/Source/WebCore/rendering/svg/RenderSVGResource.h 2012-05-07 20:14:12 UTC (rev 116342)
+++ trunk/Source/WebCore/rendering/svg/RenderSVGResource.h 2012-05-07 20:16:54 UTC (rev 116343)
@@ -38,6 +38,7 @@
ClipperResourceType
};
+// If this enum changes change the unsigned bitfields using it.
enum RenderSVGResourceMode {
ApplyToDefaultMode = 1 << 0, // used for all resources except gradient/pattern
ApplyToFillMode = 1 << 1,
Modified: trunk/Source/WebCore/rendering/svg/SVGInlineTextBox.cpp (116342 => 116343)
--- trunk/Source/WebCore/rendering/svg/SVGInlineTextBox.cpp 2012-05-07 20:14:12 UTC (rev 116342)
+++ trunk/Source/WebCore/rendering/svg/SVGInlineTextBox.cpp 2012-05-07 20:16:54 UTC (rev 116343)
@@ -44,6 +44,15 @@
namespace WebCore {
+class ExpectedSVGInlineTextBoxSize : public InlineTextBox {
+ float float1;
+ uint32_t bitfields : 5;
+ void* pointer;
+ Vector<SVGTextFragment> vector;
+};
+
+COMPILE_ASSERT(sizeof(SVGInlineTextBox) == sizeof(ExpectedSVGInlineTextBoxSize), SVGInlineTextBox_is_not_of_expected_size);
+
SVGInlineTextBox::SVGInlineTextBox(RenderObject* object)
: InlineTextBox(object)
, m_logicalHeight(0)
Modified: trunk/Source/WebCore/rendering/svg/SVGInlineTextBox.h (116342 => 116343)
--- trunk/Source/WebCore/rendering/svg/SVGInlineTextBox.h 2012-05-07 20:14:12 UTC (rev 116342)
+++ trunk/Source/WebCore/rendering/svg/SVGInlineTextBox.h 2012-05-07 20:16:54 UTC (rev 116343)
@@ -83,8 +83,8 @@
private:
float m_logicalHeight;
- int m_paintingResourceMode;
- bool m_startsNewTextChunk : 1;
+ unsigned m_paintingResourceMode : 4;
+ unsigned m_startsNewTextChunk : 1;
RenderSVGResource* m_paintingResource;
Vector<SVGTextFragment> m_textFragments;
};
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes