Bug 140465 - When building the NFA of the global disjunction, share the prefix subgraph of existing subpatterns
Summary: When building the NFA of the global disjunction, share the prefix subgraph of...
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: 2015-01-14 14:37 PST by Benjamin Poulain
Modified: 2015-01-15 14:19 PST (History)
1 user (show)

See Also:


Attachments
Patch (30.30 KB, patch)
2015-01-14 14:48 PST, Benjamin Poulain
kling: 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 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>