Bug 140465

Summary: When building the NFA of the global disjunction, share the prefix subgraph of existing subpatterns
Product: WebKit Reporter: Benjamin Poulain <benjamin>
Component: New BugsAssignee: Benjamin Poulain <benjamin>
Status: RESOLVED FIXED    
Severity: Normal CC: kling
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch kling: review+

Description Benjamin Poulain 2015-01-14 14:37:07 PST
When building the NFA of the global disjunction, share the prefix subgraph of existing subpatterns
Comment 1 Benjamin Poulain 2015-01-14 14:48:02 PST
Created attachment 244642 [details]
Patch
Comment 2 Andreas Kling 2015-01-15 11:53:02 PST
Comment on attachment 244642 [details]
Patch

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

r=me

> Source/WebCore/contentextensions/DFANode.h:47
> -    Vector<unsigned> correspondingDFANodes;
> +    Vector<unsigned> correspondingNFANodes;

Oops :)

> Source/WebCore/contentextensions/URLFilterParser.cpp:42
> +static TrivialAtom trivialAtomFromAsciiCharacter(char character)

I think we typically capitalize "ASCII" even in this kind of context.

> Source/WebCore/contentextensions/URLFilterParser.cpp:55
> +static void quantifyTrivialAtom(TrivialAtom& trivialTom, TrivialAtomQuantifier quantifier)

trivialTom -> trivialAtom

> Source/WebCore/contentextensions/URLFilterParser.cpp:317
> +            auto addResult = m_LastPrefixTreeEntry->nextPattern.set(m_pendingTrivialAtom, WTF::move(nextPrefixTreeEntry));

I guess you wanted add() here, not set()?

> Source/WebCore/contentextensions/URLFilterParser.cpp:337
> +    PrefixTreeEntry* m_LastPrefixTreeEntry;

Camel casing error, should be m_lastPrefixTreeEntry.

> Source/WebCore/contentextensions/URLFilterParser.h:50
> +    URLFilterParser(NFA&);

explicit
Comment 3 Benjamin Poulain 2015-01-15 14:19:35 PST
Committed r178529: <http://trac.webkit.org/changeset/178529>