Bug 135958

Summary: CSS JIT: compile the :empty pseudo class
Product: WebKit Reporter: Benjamin Poulain <benjamin>
Component: New BugsAssignee: Benjamin Poulain <benjamin>
Status: RESOLVED FIXED    
Severity: Normal CC: cmarcelo, commit-queue, esprehn+autocc, kangil.han, kling
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch kling: review+

Description Benjamin Poulain 2014-08-14 15:34:18 PDT
CSS JIT: compile the :empty pseudo class
Comment 1 Benjamin Poulain 2014-08-14 15:36:29 PDT
Created attachment 236629 [details]
Patch
Comment 2 WebKit Commit Bot 2014-08-14 15:38:32 PDT
Attachment 236629 [details] did not pass style-queue:


ERROR: Source/WebCore/cssjit/SelectorCompiler.cpp:2527:  This { should be at the end of the previous line  [whitespace/braces] [4]
ERROR: Source/WebCore/cssjit/SelectorCompiler.cpp:2542:  This { should be at the end of the previous line  [whitespace/braces] [4]
Total errors found: 2 in 16 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 3 Andreas Kling 2014-08-14 21:00:42 PDT
Comment on attachment 236629 [details]
Patch

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

r=me

> Source/WebCore/cssjit/SelectorCompiler.cpp:2465
> +static void jumpIfElementIsNotEmpty(Assembler& assembler, RegisterAllocator &registerAllocator, Assembler::JumpList& notEmptyCases, Assembler::RegisterID element)

RegisterAllocator& (& placement)

> Source/WebCore/cssjit/SelectorCompiler.cpp:2515
> +    if (m_selectorContext == SelectorContext::QuerySelector) {
> +        jumpIfElementIsNotEmpty(m_assembler, m_registerAllocator, failureCases, elementAddressRegister);
> +        return;
> +    }

The querySelector path is so nice and tidy.
Is the affected-by-empty bit optimization really necessary?
Comment 4 Benjamin Poulain 2014-08-14 21:04:50 PDT
(In reply to comment #3)
> > Source/WebCore/cssjit/SelectorCompiler.cpp:2515
> > +    if (m_selectorContext == SelectorContext::QuerySelector) {
> > +        jumpIfElementIsNotEmpty(m_assembler, m_registerAllocator, failureCases, elementAddressRegister);
> > +        return;
> > +    }
> 
> The querySelector path is so nice and tidy.
> Is the affected-by-empty bit optimization really necessary?

Today the flag avoid some style recalc when updating the tree.

I suspect that flag is the cause of the bug, I will look into it in the follow up.
Comment 5 Benjamin Poulain 2014-08-14 21:07:14 PDT
Committed r172619: <http://trac.webkit.org/changeset/172619>