Bug 147898 - Add a tool that dumps class and struct member layout, showing padding
Summary: Add a tool that dumps class and struct member layout, showing padding
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Simon Fraser (smfr)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-08-11 13:58 PDT by Simon Fraser (smfr)
Modified: 2015-08-12 12:32 PDT (History)
7 users (show)

See Also:


Attachments
Patch (10.01 KB, patch)
2015-08-11 14:01 PDT, Simon Fraser (smfr)
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Simon Fraser (smfr) 2015-08-11 13:58:19 PDT
Add a tool that dumps class and struct member layout, showing padding
Comment 1 Simon Fraser (smfr) 2015-08-11 14:01:50 PDT
Created attachment 258753 [details]
Patch
Comment 2 Simon Fraser (smfr) 2015-08-11 14:03:06 PDT
Here's what it says for RenderElement:

 97$ $ ./Tools/Scripts/dump-class-layout WebCore RenderElement
Found 1 types matching "RenderElement" in "/Volumes/Data/Development/OSX/webkit/OpenSource/WebKitBuild/Release/WebCore.framework/WebCore"
  +0 { 72} RenderElement
  +0 { 48}     WebCore::RenderObject
  +0 {  8}         WebCore::CachedImageClient
  +0 {  8}             WebCore::CachedResourceClient
  +0 <  8>                 __vtbl_ptr_type * _vptr;
  +8 <  8>         WebCore::Node & m_node;
 +16 <  8>         WebCore::RenderElement * m_parent;
 +24 <  8>         WebCore::RenderObject * m_previous;
 +32 <  8>         WebCore::RenderObject * m_next;
 +40 <  4>         WebCore::RenderObject::RenderObjectBitfields m_bitfields;
 +40 <  4>             unsigned int:1 m_hasRareData;
 +40 <  4>             unsigned int:1 m_beingDestroyed;
 +40 <  4>             unsigned int:1 m_needsLayout;
 +40 <  4>             unsigned int:1 m_needsPositionedMovementLayout;
 +40 <  4>             unsigned int:1 m_normalChildNeedsLayout;
 +40 <  4>             unsigned int:1 m_posChildNeedsLayout;
 +40 <  4>             unsigned int:1 m_needsSimplifiedNormalFlowLayout;
 +40 <  4>             unsigned int:1 m_preferredLogicalWidthsDirty;
 +41 <  4>             unsigned int:1 m_floating;
 +41 <  4>             unsigned int:1 m_isAnonymous;
 +41 <  4>             unsigned int:1 m_isTextOrRenderView;
 +41 <  4>             unsigned int:1 m_isBox;
 +41 <  4>             unsigned int:1 m_isInline;
 +41 <  4>             unsigned int:1 m_isReplaced;
 +41 <  4>             unsigned int:1 m_isLineBreak;
 +41 <  4>             unsigned int:1 m_horizontalWritingMode;
 +42 <  4>             unsigned int:1 m_hasLayer;
 +42 <  4>             unsigned int:1 m_hasOverflowClip;
 +42 <  4>             unsigned int:1 m_hasTransformRelatedProperty;
 +42 <  4>             unsigned int:1 m_unused;
 +42 <  4>             unsigned int:1 m_everHadLayout;
 +42 <  4>             unsigned int:1 m_childrenInline;
 +42 <  4>             unsigned int:2 m_positionedState;
 +43 <  4>             unsigned int:3 m_selectionState;
 +43 <  4>             unsigned int:2 m_flowThreadState;
 +43 <  4>             unsigned int:2 m_boxDecorationState;
 +47 <  1>         <PADDING>
 +44 <  4>     unsigned int:6 m_baseTypeFlags;
 +44 <  4>     unsigned int:1 m_ancestorLineBoxDirty;
 +44 <  4>     unsigned int:1 m_hasInitializedStyle;
 +45 <  4>     unsigned int:1 m_renderInlineAlwaysCreatesLineBoxes;
 +45 <  4>     unsigned int:1 m_renderBoxNeedsLazyRepaint;
 +45 <  4>     unsigned int:1 m_hasPausedImageAnimations;
 +45 <  4>     unsigned int:1 m_hasCounterNodeMap;
 +45 <  4>     unsigned int:1 m_isCSSAnimating;
 +45 <  4>     unsigned int:1 m_hasContinuation;
 +45 <  4>     unsigned int:1 m_renderBlockHasMarginBeforeQuirk;
 +45 <  4>     unsigned int:1 m_renderBlockHasMarginAfterQuirk;
 +46 <  4>     unsigned int:1 m_renderBlockHasBorderOrPaddingLogicalWidthChanged;
 +46 <  4>     unsigned int:1 m_renderBlockFlowHasMarkupTruncation;
 +46 <  4>     unsigned int:2 m_renderBlockFlowLineLayoutPath;
 +48 <  8>     WebCore::RenderObject * m_firstChild;
 +56 <  8>     WebCore::RenderObject * m_lastChild;
 +64 <  8>     WTF::Ref<WebCore::RenderStyle> m_style;
 +64 <  8>         WebCore::RenderStyle * m_ptr;
Total byte size: 72
Total pad bytes: 1
Padding percentage: 1.39 %
Comment 3 zalan 2015-08-11 14:05:37 PDT
Comment on attachment 258753 [details]
Patch

rs=me!
very nice!

Any documentation on how to use it?
Comment 4 zalan 2015-08-11 14:06:46 PDT
(In reply to comment #3)
> Comment on attachment 258753 [details]
> Patch
> 
> rs=me!
> very nice!
> 
> Any documentation on how to use it?
Never mind!
Comment 5 WebKit Commit Bot 2015-08-12 12:32:00 PDT
Comment on attachment 258753 [details]
Patch

Clearing flags on attachment: 258753

Committed r188350: <http://trac.webkit.org/changeset/188350>
Comment 6 WebKit Commit Bot 2015-08-12 12:32:05 PDT
All reviewed patches have been landed.  Closing bug.