Bug 69331 - Shrink StyleRareNonInheritedData.
Summary: Shrink StyleRareNonInheritedData.
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Layout and Rendering (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Andreas Kling
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-10-04 04:22 PDT by Andreas Kling
Modified: 2011-10-05 04:18 PDT (History)
6 users (show)

See Also:


Attachments
Proposed patch (9.16 KB, patch)
2011-10-04 04:37 PDT, Andreas Kling
koivisto: review+
webkit-ews: commit-queue-
Details | Formatted Diff | Diff
Patch for landing (r=anttik) (9.07 KB, patch)
2011-10-04 07:16 PDT, Andreas Kling
no flags Details | Formatted Diff | Diff
Follow-up patch to make enum bitfields explicitly unsigned. (1.72 KB, patch)
2011-10-04 10:54 PDT, Andreas Kling
darin: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Andreas Kling 2011-10-04 04:22:44 PDT
We can shrink StyleRareNonInheritedData by two CPU words if we rearrange its members.

This would cut memory usage by 140 kB (on 64-bit) when loading the full HTML5 spec.
Comment 1 Andreas Kling 2011-10-04 04:37:36 PDT
Created attachment 109606 [details]
Proposed patch
Comment 2 Early Warning System Bot 2011-10-04 04:47:44 PDT
Comment on attachment 109606 [details]
Proposed patch

Attachment 109606 [details] did not pass qt-ews (qt):
Output: http://queues.webkit.org/results/9944281
Comment 3 Antti Koivisto 2011-10-04 06:12:00 PDT
Comment on attachment 109606 [details]
Proposed patch

r=me if you fix whatever Qt bot is whining about.
Comment 4 WebKit Review Bot 2011-10-04 06:20:50 PDT
Comment on attachment 109606 [details]
Proposed patch

Attachment 109606 [details] did not pass chromium-ews (chromium-xvfb):
Output: http://queues.webkit.org/results/9936528

New failing tests:
plugins/fullscreen-plugins-dont-reload.html
Comment 5 Andreas Kling 2011-10-04 07:15:09 PDT
Comment on attachment 109606 [details]
Proposed patch

View in context: https://bugs.webkit.org/attachment.cgi?id=109606&action=review

> Source/WebCore/rendering/style/StyleRareNonInheritedData.cpp:69
> +    printf("sizeof(StyleRareNonInheritedData) = %lu\n", sizeof(StyleRareNonInheritedData));

Looks like I pulled an Antti here. :)
Comment 6 Andreas Kling 2011-10-04 07:16:43 PDT
Created attachment 109619 [details]
Patch for landing (r=anttik)
Comment 7 WebKit Review Bot 2011-10-04 08:12:52 PDT
Comment on attachment 109619 [details]
Patch for landing (r=anttik)

Clearing flags on attachment: 109619

Committed r96594: <http://trac.webkit.org/changeset/96594>
Comment 8 WebKit Review Bot 2011-10-04 08:12:56 PDT
All reviewed patches have been landed.  Closing bug.
Comment 9 Darin Adler 2011-10-04 10:30:30 PDT
Comment on attachment 109606 [details]
Proposed patch

View in context: https://bugs.webkit.org/attachment.cgi?id=109606&action=review

> Source/WebCore/rendering/style/StyleRareNonInheritedData.h:132
> +    RegionOverflow m_regionOverflow : 1;

Won’t we run into signed/unsigned problems with this with the Windows compiler?

> Source/WebCore/rendering/style/StyleRareNonInheritedData.h:140
> +    PageSizeType m_pageSizeType : 2;
> +    ETransformStyle3D m_transformStyle3D : 1;
> +    EBackfaceVisibility m_backfaceVisibility : 1;

Won’t we run into signed/unsigned problems with these with the Windows compiler?
Comment 10 Andreas Kling 2011-10-04 10:39:50 PDT
(In reply to comment #9)
> (From update of attachment 109606 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=109606&action=review
> 
> > Source/WebCore/rendering/style/StyleRareNonInheritedData.h:132
> > +    RegionOverflow m_regionOverflow : 1;
> 
> Won’t we run into signed/unsigned problems with this with the Windows compiler?
> 
> > Source/WebCore/rendering/style/StyleRareNonInheritedData.h:140
> > +    PageSizeType m_pageSizeType : 2;
> > +    ETransformStyle3D m_transformStyle3D : 1;
> > +    EBackfaceVisibility m_backfaceVisibility : 1;
> 
> Won’t we run into signed/unsigned problems with these with the Windows compiler?

Will we? I was not aware of this issue. CC'ing Adam who might know more.
Comment 11 Antti Koivisto 2011-10-04 10:41:18 PDT
(In reply to comment #9)
> Won’t we run into signed/unsigned problems with these with the Windows compiler?

Oh is that the reason why we have so many enum fields specified as "unsigned"? I didn't know.
Comment 12 Darin Adler 2011-10-04 10:44:02 PDT
(In reply to comment #11)
> (In reply to comment #9)
> > Won’t we run into signed/unsigned problems with these with the Windows compiler?
> 
> Oh is that the reason why we have so many enum fields specified as "unsigned"?

Yes.
Comment 13 Adam Roben (:aroben) 2011-10-04 10:47:00 PDT
http://trac.webkit.org/changeset/25329 has a little more info.
Comment 14 Andreas Kling 2011-10-04 10:54:14 PDT
Created attachment 109648 [details]
Follow-up patch to make enum bitfields explicitly unsigned.

Here we go. Thanks a bunch for pointing this out!
Comment 15 Vangelis Kokkevis 2011-10-04 22:41:10 PDT
(In reply to comment #10)
> (In reply to comment #9)
> > (From update of attachment 109606 [details] [details])
> > View in context: https://bugs.webkit.org/attachment.cgi?id=109606&action=review
> > 
> > > Source/WebCore/rendering/style/StyleRareNonInheritedData.h:132
> > > +    RegionOverflow m_regionOverflow : 1;
> > 
> > Won’t we run into signed/unsigned problems with this with the Windows compiler?
> > 
> > > Source/WebCore/rendering/style/StyleRareNonInheritedData.h:140
> > > +    PageSizeType m_pageSizeType : 2;
> > > +    ETransformStyle3D m_transformStyle3D : 1;
> > > +    EBackfaceVisibility m_backfaceVisibility : 1;
> > 
> > Won’t we run into signed/unsigned problems with these with the Windows compiler?
> 
> Will we? I was not aware of this issue. CC'ing Adam who might know more.

Definitely an issue with the windows compiler.  It did break Chrome on windows where the preserves3d property stopped working due to a (-1 != 1 comparison).  Thanks for checking in a fix.
Comment 16 Andreas Kling 2011-10-05 04:18:49 PDT
Committed r96691: <http://trac.webkit.org/changeset/96691>