WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
71221
CSSRule: Devirtualize type() and isFooRule()
https://bugs.webkit.org/show_bug.cgi?id=71221
Summary
CSSRule: Devirtualize type() and isFooRule()
Andreas Kling
Reported
2011-10-31 08:01:24 PDT
SSIA
Attachments
Patch
(18.39 KB, patch)
2011-10-31 08:37 PDT
,
Andreas Kling
koivisto
: review+
Details
Formatted Diff
Diff
View All
Add attachment
proposed patch, testcase, etc.
Andreas Kling
Comment 1
2011-10-31 08:37:40 PDT
Created
attachment 113053
[details]
Patch
WebKit Review Bot
Comment 2
2011-10-31 08:39:39 PDT
Attachment 113053
[details]
did not pass style-queue: Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'Source/WebCore/ChangeLog', u'Source/WebCor..." exit_code: 1 Source/WebCore/css/CSSStyleRule.h:64: The parameter name "type" adds no information, so it should be removed. [readability/parameter_name] [5] Source/WebCore/css/CSSStyleSelector.cpp:233: The parameter name "rule" adds no information, so it should be removed. [readability/parameter_name] [5] Total errors found: 2 in 15 files If any of these errors are false positives, please file a bug against check-webkit-style.
Antti Koivisto
Comment 3
2011-10-31 08:41:08 PDT
Comment on
attachment 113053
[details]
Patch r=me
Andreas Kling
Comment 4
2011-10-31 08:53:33 PDT
Committed
r98859
: <
http://trac.webkit.org/changeset/98859
>
Luke Macpherson
Comment 5
2011-10-31 09:53:08 PDT
Comment on
attachment 113053
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=113053&action=review
> Source/WebCore/css/CSSRule.h:118 > + unsigned m_type : 31; // Plenty of space for additional flags here.
I would set this to just the number of bits required (4), delete the comment, and add a COMPILE_ASSERT on the overall size of the of CSSRule. Reason for that is that I would not be surprised if this change causes visual c++ builds to increase the size of CSSRule, even though it will be ok on gcc.
Andreas Kling
Comment 6
2011-10-31 10:05:03 PDT
(In reply to
comment #5
)
> (From update of
attachment 113053
[details]
) > View in context:
https://bugs.webkit.org/attachment.cgi?id=113053&action=review
> > > Source/WebCore/css/CSSRule.h:118 > > + unsigned m_type : 31; // Plenty of space for additional flags here. > > I would set this to just the number of bits required (4), delete the comment, and add a COMPILE_ASSERT on the overall size of the of CSSRule. > Reason for that is that I would not be surprised if this change causes visual c++ builds to increase the size of CSSRule, even though it will be ok on gcc.
Hm, do you know the specifics about this? I had problems with MSVC and bit fields when trying to make a size guard for InlineBox (see InlineBox.cpp), but since I never use that compiler, I didn't learn much from it :/
Luke Macpherson
Comment 7
2011-10-31 10:42:27 PDT
Comment on
attachment 113053
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=113053&action=review
>>> Source/WebCore/css/CSSRule.h:118 >>> + unsigned m_type : 31; // Plenty of space for additional flags here. >> >> I would set this to just the number of bits required (4), delete the comment, and add a COMPILE_ASSERT on the overall size of the of CSSRule. >> Reason for that is that I would not be surprised if this change causes visual c++ builds to increase the size of CSSRule, even though it will be ok on gcc. > > Hm, do you know the specifics about this? I had problems with MSVC and bit fields when trying to make a size guard for InlineBox (see InlineBox.cpp), but since I never use that compiler, I didn't learn much from it :/
I don't use MSVC either, but borrowed a colleague's box to run some experiments a few weeks ago. I didn't figure out exactly what the compiler was doing, but I did find that reordering fields reduced the size of RenderStyle. I think the size of the type that it is reading into impacts the way it tries to align the field. Presumably they are trying to allow the compiler to mask the data out without shifting? The easiest way to get things to pack as expected was to use unsigned char (instead of unsigned) for bitfields that were less than 8 bits in size.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug