Bug 126154 - Add id matching to the Selector Code Generator
Summary: Add id matching to the Selector Code Generator
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: Benjamin Poulain
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-12-23 03:12 PST by Benjamin Poulain
Modified: 2013-12-23 12:18 PST (History)
7 users (show)

See Also:


Attachments
Patch (8.79 KB, patch)
2013-12-23 03:15 PST, Benjamin Poulain
koivisto: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Benjamin Poulain 2013-12-23 03:12:30 PST
Add id matching to the Selector Code Generator
Comment 1 Benjamin Poulain 2013-12-23 03:15:33 PST
Created attachment 219903 [details]
Patch
Comment 2 Antti Koivisto 2013-12-23 10:39:59 PST
Comment on attachment 219903 [details]
Patch

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

> Source/WebCore/cssjit/SelectorCompiler.cpp:91
>          , tagName(0)
> +        , id(0)

nullptr (both)

> Source/WebCore/cssjit/SelectorCompiler.cpp:216
>          case CSSSelector::Id:
> +            {
> +                const AtomicString& id = selector->value();

I think we usually put { after case and indent only one level.

> Source/WebCore/cssjit/SelectorCompiler.cpp:763
> +
> +    //  Generate:
> +    //     elementDataAddress = element->elementData();
> +    //     if (!elementDataAddress)
> +    //         failure!
> +    LocalRegister elementDataAddress(m_registerAllocator);
> +    m_assembler.loadPtr(Assembler::Address(elementAddressRegister, Element::elementDataMemoryOffset()), elementDataAddress);
> +    failureCases.append(m_assembler.branchTestPtr(Assembler::Zero, elementDataAddress));
> +
> +    generateElementHasId(failureCases, elementDataAddress, *fragment.id);
>  }

Would be nice if we could just write the C++ and have tooling do the rest!
Comment 3 Benjamin Poulain 2013-12-23 12:18:13 PST
Committed r161010: <http://trac.webkit.org/changeset/161010>