Changeset 96422 in webkit


Ignore:
Timestamp:
Sep 30, 2011 1:49:27 PM (13 years ago)
Author:
commit-queue@webkit.org
Message:

REGRESSION(r82611) InlineBox has 33 bits of bitset, causing alignment issues and extra memory use.
https://bugs.webkit.org/show_bug.cgi?id=64914

Patch by Andreas Kling <kling@webkit.org> on 2011-09-30
Reviewed by Antti Koivisto.

Remove InlineBox::prevOnLineExists() and its two accompanying bitfields
since nobody is using them anymore. nextOnLineExists() is still used by
GTK+ accessibility code.

Also added a compile-time assertion to guard against future bloating of
the InlineBox class.

  • rendering/InlineBox.cpp:

(WebCore::SameSizeAsInlineBox::~SameSizeAsInlineBox):

  • rendering/InlineBox.h:

(WebCore::InlineBox::InlineBox):

Location:
trunk/Source/WebCore
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r96421 r96422  
     12011-09-30  Andreas Kling  <kling@webkit.org>
     2
     3        REGRESSION(r82611) InlineBox has 33 bits of bitset, causing alignment issues and extra memory use.
     4        https://bugs.webkit.org/show_bug.cgi?id=64914
     5
     6        Reviewed by Antti Koivisto.
     7
     8        Remove InlineBox::prevOnLineExists() and its two accompanying bitfields
     9        since nobody is using them anymore. nextOnLineExists() is still used by
     10        GTK+ accessibility code.
     11
     12        Also added a compile-time assertion to guard against future bloating of
     13        the InlineBox class.
     14
     15        * rendering/InlineBox.cpp:
     16        (WebCore::SameSizeAsInlineBox::~SameSizeAsInlineBox):
     17        * rendering/InlineBox.h:
     18        (WebCore::InlineBox::InlineBox):
     19
    1202011-09-30  Pierre Rossi  <pierre.rossi@gmail.com>
    221
  • trunk/Source/WebCore/rendering/InlineBox.cpp

    r96187 r96422  
    3535
    3636namespace WebCore {
     37
     38class SameSizeAsInlineBox {
     39    virtual ~SameSizeAsInlineBox() { }
     40    void* a[4];
     41    FloatPoint b;
     42    float c;
     43    uint32_t d;
     44#ifndef NDEBUG
     45    bool e;
     46#endif
     47};
     48
     49COMPILE_ASSERT(sizeof(InlineBox) == sizeof(SameSizeAsInlineBox), InlineBox_size_guard);
    3750   
    3851#ifndef NDEBUG
     
    259272}
    260273
    261 bool InlineBox::prevOnLineExists() const
    262 {
    263     if (!m_determinedIfPrevOnLineExists) {
    264         m_determinedIfPrevOnLineExists = true;
    265        
    266         if (!parent())
    267             m_prevOnLineExists = false;
    268         else if (prevOnLine())
    269             m_prevOnLineExists = true;
    270         else
    271             m_prevOnLineExists = parent()->prevOnLineExists();
    272     }
    273     return m_prevOnLineExists;
    274 }
    275 
    276274InlineBox* InlineBox::nextLeafChild() const
    277275{
  • trunk/Source/WebCore/rendering/InlineBox.h

    r96187 r96422  
    5757        , m_isText(false)
    5858        , m_determinedIfNextOnLineExists(false)
    59         , m_determinedIfPrevOnLineExists(false)
    6059        , m_nextOnLineExists(false)
    61         , m_prevOnLineExists(false)
    6260        , m_expansion(0)
    6361#ifndef NDEBUG
     
    9189        , m_isText(false)
    9290        , m_determinedIfNextOnLineExists(false)
    93         , m_determinedIfPrevOnLineExists(false)
    9491        , m_nextOnLineExists(false)
    95         , m_prevOnLineExists(false)
    9692        , m_expansion(0)
    9793#ifndef NDEBUG
     
    204200    }
    205201    bool nextOnLineExists() const;
    206     bool prevOnLineExists() const;
    207202
    208203    virtual bool isLeaf() const { return true; }
     
    365360protected:
    366361    mutable bool m_determinedIfNextOnLineExists : 1;
    367     mutable bool m_determinedIfPrevOnLineExists : 1;
    368362    mutable bool m_nextOnLineExists : 1;
    369     mutable bool m_prevOnLineExists : 1;
    370363    signed m_expansion : 11; // for justified text
    371364
Note: See TracChangeset for help on using the changeset viewer.