Bug 134662 - CSS JIT: Ensure resolvingMode size is 1 byte
Summary: CSS JIT: Ensure resolvingMode size is 1 byte
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: CSS (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Yusuke Suzuki
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-07-06 05:17 PDT by Yusuke Suzuki
Modified: 2014-07-06 18:19 PDT (History)
9 users (show)

See Also:


Attachments
Patch (22.74 KB, patch)
2014-07-06 06:56 PDT, Yusuke Suzuki
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Yusuke Suzuki 2014-07-06 05:17:04 PDT
We use branch8 in jumpIfNotResolvingStyle. However, sizeof(SelectorChecker::Mode) is 4. So it works only in little endianess environment.
Comment 1 Yusuke Suzuki 2014-07-06 06:56:27 PDT
Created attachment 234457 [details]
Patch
Comment 2 Yusuke Suzuki 2014-07-06 07:02:59 PDT
Comment on attachment 234457 [details]
Patch

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

Added comments.

> Source/WebCore/css/SelectorChecker.h:52
> +    };

Using C++11 enum class to guarantee sizeof(Mode) is 1 byte.

> Source/WebCore/cssjit/SelectorCompiler.cpp:1475
> +    static_assert(sizeof(SelectorChecker::Mode) == 1, "We generate a byte load/test for the SelectorChecker::Mode.");

Guaranteed sizeof(SelectorChecker::Mode) == 1 by using static_assert.
Comment 3 Benjamin Poulain 2014-07-06 14:35:42 PDT
Comment on attachment 234457 [details]
Patch

Good catch!
Comment 4 Yusuke Suzuki 2014-07-06 18:18:56 PDT
Comment on attachment 234457 [details]
Patch

Clearing flags on attachment: 234457

Committed r170832: <http://trac.webkit.org/changeset/170832>
Comment 5 Yusuke Suzuki 2014-07-06 18:19:03 PDT
All reviewed patches have been landed.  Closing bug.