Changeset 116343 in webkit


Ignore:
Timestamp:
May 7, 2012 1:16:54 PM (12 years ago)
Author:
rwlbuis@webkit.org
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):

Location:
trunk/Source/WebCore
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r116342 r116343  
     12012-05-07  Rob Buis  <rbuis@rim.com>
     2
     3        Shrink SVGInlineTextBox object size
     4        https://bugs.webkit.org/show_bug.cgi?id=85805
     5
     6        Reviewed by Darin Adler.
     7
     8        Reduce the object size of SVGInlineTextBox by using bitfields. This
     9        should be 4 bytes on 32-bits and 8 bytes on 64-bits systems.
     10
     11        * rendering/svg/RenderSVGResource.h:
     12        * rendering/svg/SVGInlineTextBox.cpp:
     13        (ExpectedSVGInlineTextBoxSize):
     14        (WebCore):
     15        * rendering/svg/SVGInlineTextBox.h:
     16        (SVGInlineTextBox):
     17
    1182012-05-07  Sheriff Bot  <webkit.review.bot@gmail.com>
    219
  • trunk/Source/WebCore/rendering/svg/RenderSVGResource.h

    r107067 r116343  
    3939};
    4040
     41// If this enum changes change the unsigned bitfields using it.
    4142enum RenderSVGResourceMode {
    4243    ApplyToDefaultMode = 1 << 0, // used for all resources except gradient/pattern
  • trunk/Source/WebCore/rendering/svg/SVGInlineTextBox.cpp

    r115201 r116343  
    4545namespace WebCore {
    4646
     47class ExpectedSVGInlineTextBoxSize : public InlineTextBox {
     48    float float1;
     49    uint32_t bitfields : 5;
     50    void* pointer;
     51    Vector<SVGTextFragment> vector;
     52};
     53
     54COMPILE_ASSERT(sizeof(SVGInlineTextBox) == sizeof(ExpectedSVGInlineTextBoxSize), SVGInlineTextBox_is_not_of_expected_size);
     55
    4756SVGInlineTextBox::SVGInlineTextBox(RenderObject* object)
    4857    : InlineTextBox(object)
  • trunk/Source/WebCore/rendering/svg/SVGInlineTextBox.h

    r112166 r116343  
    8484private:
    8585    float m_logicalHeight;
    86     int m_paintingResourceMode;
    87     bool m_startsNewTextChunk : 1;
     86    unsigned m_paintingResourceMode : 4;
     87    unsigned m_startsNewTextChunk : 1;
    8888    RenderSVGResource* m_paintingResource;
    8989    Vector<SVGTextFragment> m_textFragments;
Note: See TracChangeset for help on using the changeset viewer.