<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[181935] trunk</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/181935">181935</a></dd>
<dt>Author</dt> <dd>commit-queue@webkit.org</dd>
<dt>Date</dt> <dd>2015-03-25 00:40:01 -0700 (Wed, 25 Mar 2015)</dd>
</dl>

<h3>Log Message</h3>
<pre>Unreviewed, rolling out <a href="http://trac.webkit.org/projects/webkit/changeset/181932">r181932</a>.
https://bugs.webkit.org/show_bug.cgi?id=143041

The test fails most of the time on bots (Requested by ap on
#webkit).

Reverted changeset:

&quot;[Content Extensions] Add multi-DFA compiling and
interpreting.&quot;
https://bugs.webkit.org/show_bug.cgi?id=143010
http://trac.webkit.org/changeset/181932</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCorecontentextensionsContentExtensionCompilercpp">trunk/Source/WebCore/contentextensions/ContentExtensionCompiler.cpp</a></li>
<li><a href="#trunkSourceWebCorecontentextensionsContentExtensionsBackendcpp">trunk/Source/WebCore/contentextensions/ContentExtensionsBackend.cpp</a></li>
<li><a href="#trunkSourceWebCorecontentextensionsDFABytecodeCompilercpp">trunk/Source/WebCore/contentextensions/DFABytecodeCompiler.cpp</a></li>
<li><a href="#trunkSourceWebCorecontentextensionsDFABytecodeInterpretercpp">trunk/Source/WebCore/contentextensions/DFABytecodeInterpreter.cpp</a></li>
<li><a href="#trunkToolsChangeLog">trunk/Tools/ChangeLog</a></li>
<li><a href="#trunkToolsTestWebKitAPITestsWebCoreContentExtensionscpp">trunk/Tools/TestWebKitAPI/Tests/WebCore/ContentExtensions.cpp</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (181934 => 181935)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2015-03-25 06:06:15 UTC (rev 181934)
+++ trunk/Source/WebCore/ChangeLog        2015-03-25 07:40:01 UTC (rev 181935)
</span><span class="lines">@@ -1,3 +1,18 @@
</span><ins>+2015-03-25  Commit Queue  &lt;commit-queue@webkit.org&gt;
+
+        Unreviewed, rolling out r181932.
+        https://bugs.webkit.org/show_bug.cgi?id=143041
+
+        The test fails most of the time on bots (Requested by ap on
+        #webkit).
+
+        Reverted changeset:
+
+        &quot;[Content Extensions] Add multi-DFA compiling and
+        interpreting.&quot;
+        https://bugs.webkit.org/show_bug.cgi?id=143010
+        http://trac.webkit.org/changeset/181932
+
</ins><span class="cx"> 2015-03-24  Dean Jackson  &lt;dino@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Source/WebCore/rendering/RenderThemeMac.mm:2181:118: error: null passed to a callee that requires a non-null argument [-Werror,-Wnonnull]
</span></span></pre></div>
<a id="trunkSourceWebCorecontentextensionsContentExtensionCompilercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/contentextensions/ContentExtensionCompiler.cpp (181934 => 181935)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/contentextensions/ContentExtensionCompiler.cpp        2015-03-25 06:06:15 UTC (rev 181934)
+++ trunk/Source/WebCore/contentextensions/ContentExtensionCompiler.cpp        2015-03-25 07:40:01 UTC (rev 181935)
</span><span class="lines">@@ -111,23 +111,16 @@
</span><span class="cx">     Vector&lt;unsigned&gt; actionLocations = serializeActions(parsedRuleList, actions);
</span><span class="cx">     Vector&lt;uint64_t&gt; universalActionLocations;
</span><span class="cx"> 
</span><del>-    Vector&lt;NFA&gt; nfas;
-    nfas.append(NFA());
</del><ins>+    NFA nfa;
+    URLFilterParser urlFilterParser(nfa);
</ins><span class="cx">     bool nonUniversalActionSeen = false;
</span><span class="cx">     for (unsigned ruleIndex = 0; ruleIndex &lt; parsedRuleList.size(); ++ruleIndex) {
</span><del>-
-        // FIXME: Tune this better and adjust ContentExtensionTest.MultiDFA accordingly.
-        if (nfas[nfas.size() - 1].graphSize() &gt; 500)
-            nfas.append(NFA());
-
-        NFA&amp; lastNFA = nfas[nfas.size() - 1];
-        URLFilterParser urlFilterParser(lastNFA);
</del><span class="cx">         const ContentExtensionRule&amp; contentExtensionRule = parsedRuleList[ruleIndex];
</span><span class="cx">         const Trigger&amp; trigger = contentExtensionRule.trigger();
</span><span class="cx">         ASSERT(trigger.urlFilter.length());
</span><span class="cx"> 
</span><span class="cx">         // High bits are used for flags. This should match how they are used in DFABytecodeCompiler::compileNode.
</span><del>-        uint64_t actionLocationAndFlags = (static_cast&lt;uint64_t&gt;(trigger.flags) &lt;&lt; 32) | static_cast&lt;uint64_t&gt;(actionLocations[ruleIndex]);
</del><ins>+        uint64_t actionLocationAndFlags =(static_cast&lt;uint64_t&gt;(trigger.flags) &lt;&lt; 32) | static_cast&lt;uint64_t&gt;(actionLocations[ruleIndex]);
</ins><span class="cx">         URLFilterParser::ParseStatus status = urlFilterParser.addPattern(trigger.urlFilter, trigger.urlFilterIsCaseSensitive, actionLocationAndFlags);
</span><span class="cx"> 
</span><span class="cx">         if (status == URLFilterParser::MatchesEverything) {
</span><span class="lines">@@ -156,17 +149,9 @@
</span><span class="cx">     double dfaBuildTimeStart = monotonicallyIncreasingTime();
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><del>-    Vector&lt;DFABytecode&gt; bytecode;
-    for (size_t i = 0; i &lt; nfas.size(); ++i) {
-        DFA dfa = NFAToDFA::convert(nfas[i]);
-        if (!i) {
-            // Put all the universal actions on the first DFA.
-            for (uint64_t actionLocation : universalActionLocations)
-                dfa.nodeAt(dfa.root()).actions.append(actionLocation);
-        }
-        DFABytecodeCompiler compiler(dfa, bytecode);
-        compiler.compile();
-    }
</del><ins>+    DFA dfa = NFAToDFA::convert(nfa);
+    for (uint64_t actionLocation : universalActionLocations)
+        dfa.nodeAt(dfa.root()).actions.append(actionLocation);
</ins><span class="cx"> 
</span><span class="cx"> #if CONTENT_EXTENSIONS_PERFORMANCE_REPORTING
</span><span class="cx">     double dfaBuildTimeEnd = monotonicallyIncreasingTime();
</span><span class="lines">@@ -179,6 +164,10 @@
</span><span class="cx">     dfa.debugPrintDot();
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><ins>+    Vector&lt;DFABytecode&gt; bytecode;
+    DFABytecodeCompiler compiler(dfa, bytecode);
+    compiler.compile();
+
</ins><span class="cx">     return { WTF::move(bytecode), WTF::move(actions) };
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorecontentextensionsContentExtensionsBackendcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/contentextensions/ContentExtensionsBackend.cpp (181934 => 181935)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/contentextensions/ContentExtensionsBackend.cpp        2015-03-25 06:06:15 UTC (rev 181934)
+++ trunk/Source/WebCore/contentextensions/ContentExtensionsBackend.cpp        2015-03-25 07:40:01 UTC (rev 181935)
</span><span class="lines">@@ -80,7 +80,6 @@
</span><span class="cx">         const SerializedActionByte* actions = compiledExtension.actions();
</span><span class="cx">         const unsigned actionsLength = compiledExtension.actionsLength();
</span><span class="cx">         
</span><del>-        bool sawIgnorePreviousRules = false;
</del><span class="cx">         if (!triggeredActions.isEmpty()) {
</span><span class="cx">             Vector&lt;unsigned&gt; actionLocations;
</span><span class="cx">             actionLocations.reserveInitialCapacity(triggeredActions.size());
</span><span class="lines">@@ -88,6 +87,8 @@
</span><span class="cx">                 actionLocations.append(static_cast&lt;unsigned&gt;(actionLocation));
</span><span class="cx">             std::sort(actionLocations.begin(), actionLocations.end());
</span><span class="cx"> 
</span><ins>+            bool sawIgnorePreviousRules = false;
+
</ins><span class="cx">             // Add actions in reverse order to properly deal with IgnorePreviousRules.
</span><span class="cx">             for (unsigned i = actionLocations.size(); i; i--) {
</span><span class="cx">                 Action action = Action::deserialize(actions, actionsLength, actionLocations[i - 1]);
</span><span class="lines">@@ -97,9 +98,10 @@
</span><span class="cx">                 }
</span><span class="cx">                 finalActions.append(action);
</span><span class="cx">             }
</span><ins>+
+            if (!sawIgnorePreviousRules)
+                finalActions.append(Action(ActionType::CSSDisplayNoneStyleSheet, contentExtension-&gt;identifier()));
</ins><span class="cx">         }
</span><del>-        if (!sawIgnorePreviousRules)
-            finalActions.append(Action(ActionType::CSSDisplayNoneStyleSheet, contentExtension-&gt;identifier()));
</del><span class="cx">     }
</span><span class="cx">     return finalActions;
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCorecontentextensionsDFABytecodeCompilercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/contentextensions/DFABytecodeCompiler.cpp (181934 => 181935)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/contentextensions/DFABytecodeCompiler.cpp        2015-03-25 06:06:15 UTC (rev 181934)
+++ trunk/Source/WebCore/contentextensions/DFABytecodeCompiler.cpp        2015-03-25 07:40:01 UTC (rev 181935)
</span><span class="lines">@@ -167,9 +167,7 @@
</span><span class="cx"> 
</span><span class="cx"> void DFABytecodeCompiler::compile()
</span><span class="cx"> {
</span><del>-    // DFA header.
-    unsigned startLocation = m_bytecode.size();
-    append&lt;unsigned&gt;(m_bytecode, 0);
</del><ins>+    ASSERT(!m_bytecode.size());
</ins><span class="cx">     m_nodeStartOffsets.resize(m_dfa.size());
</span><span class="cx">     
</span><span class="cx">     // Make sure the root is always at the beginning of the bytecode.
</span><span class="lines">@@ -182,9 +180,6 @@
</span><span class="cx">     // Link.
</span><span class="cx">     for (const auto&amp; linkRecord : m_linkRecords)
</span><span class="cx">         set32Bits(m_bytecode, linkRecord.first, m_nodeStartOffsets[linkRecord.second]);
</span><del>-    
-    // Set size header.
-    set32Bits(m_bytecode, startLocation, m_bytecode.size() - startLocation);
</del><span class="cx"> }
</span><span class="cx">     
</span><span class="cx"> } // namespace ContentExtensions
</span></span></pre></div>
<a id="trunkSourceWebCorecontentextensionsDFABytecodeInterpretercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/contentextensions/DFABytecodeInterpreter.cpp (181934 => 181935)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/contentextensions/DFABytecodeInterpreter.cpp        2015-03-25 06:06:15 UTC (rev 181934)
+++ trunk/Source/WebCore/contentextensions/DFABytecodeInterpreter.cpp        2015-03-25 07:40:01 UTC (rev 181935)
</span><span class="lines">@@ -43,15 +43,13 @@
</span><span class="cx">     
</span><span class="cx"> DFABytecodeInterpreter::Actions DFABytecodeInterpreter::actionsFromDFARoot()
</span><span class="cx"> {
</span><del>-    DFABytecodeInterpreter::Actions universalActionLocations;
-
-    // Skip first DFA header. All universal actions are in the first DFA root.
-    unsigned programCounter = sizeof(unsigned);
</del><ins>+    unsigned programCounter = 0;
+    DFABytecodeInterpreter::Actions globalActionLocations;
</ins><span class="cx">     while (static_cast&lt;DFABytecodeInstruction&gt;(m_bytecode[programCounter]) == DFABytecodeInstruction::AppendAction) {
</span><del>-        universalActionLocations.add(static_cast&lt;uint64_t&gt;(getBits&lt;unsigned&gt;(m_bytecode, m_bytecodeLength, programCounter + sizeof(DFABytecode))));
</del><ins>+        globalActionLocations.add(static_cast&lt;uint64_t&gt;(getBits&lt;unsigned&gt;(m_bytecode, m_bytecodeLength, programCounter + sizeof(DFABytecode))));
</ins><span class="cx">         programCounter += instructionSizeWithArguments(DFABytecodeInstruction::AppendAction);
</span><span class="cx">     }
</span><del>-    return universalActionLocations;
</del><ins>+    return globalActionLocations;
</ins><span class="cx"> }
</span><span class="cx">     
</span><span class="cx"> DFABytecodeInterpreter::Actions DFABytecodeInterpreter::interpret(const CString&amp; urlCString, uint16_t flags)
</span><span class="lines">@@ -59,92 +57,78 @@
</span><span class="cx">     const char* url = urlCString.data();
</span><span class="cx">     ASSERT(url);
</span><span class="cx">     
</span><ins>+    unsigned programCounter = 0;
+    unsigned urlIndex = 0;
+    bool urlIndexIsAfterEndOfString = false;
</ins><span class="cx">     Actions actions;
</span><span class="cx">     
</span><del>-    unsigned programCounter = 0;
-    while (programCounter &lt; m_bytecodeLength) {
</del><ins>+    while (static_cast&lt;DFABytecodeInstruction&gt;(m_bytecode[programCounter]) == DFABytecodeInstruction::AppendAction)
+        programCounter += instructionSizeWithArguments(DFABytecodeInstruction::AppendAction);
</ins><span class="cx"> 
</span><del>-        // DFA header.
-        unsigned dfaStart = programCounter;
-        unsigned dfaBytecodeLength = getBits&lt;unsigned&gt;(m_bytecode, m_bytecodeLength, programCounter);
-        programCounter += sizeof(unsigned);
</del><ins>+    // This should always terminate if interpreting correctly compiled bytecode.
+    while (true) {
+        ASSERT(programCounter &lt;= m_bytecodeLength);
+        switch (static_cast&lt;DFABytecodeInstruction&gt;(m_bytecode[programCounter])) {
</ins><span class="cx"> 
</span><del>-        // Skip the universal actions.
-        // FIXME: Replace AppendAction with AppendActions to make this just one jump and make sure there aren't universal actions with flags.
-        while (static_cast&lt;DFABytecodeInstruction&gt;(m_bytecode[programCounter]) == DFABytecodeInstruction::AppendAction)
-            programCounter += instructionSizeWithArguments(DFABytecodeInstruction::AppendAction);
-        
-        // Interpret the bytecode from this DFA.
-        // This should always terminate if interpreting correctly compiled bytecode.
-        unsigned urlIndex = 0;
-        bool urlIndexIsAfterEndOfString = false;
-        while (true) {
-            ASSERT(programCounter &lt;= m_bytecodeLength);
-            switch (static_cast&lt;DFABytecodeInstruction&gt;(m_bytecode[programCounter])) {
</del><ins>+        case DFABytecodeInstruction::Terminate:
+            return actions;
</ins><span class="cx"> 
</span><del>-            case DFABytecodeInstruction::Terminate:
-                goto nextDFA;
-                    
-            case DFABytecodeInstruction::CheckValue:
-                if (urlIndexIsAfterEndOfString)
-                    goto nextDFA;
</del><ins>+        case DFABytecodeInstruction::CheckValue:
+            if (urlIndexIsAfterEndOfString)
+                return actions;
</ins><span class="cx"> 
</span><del>-                // Check to see if the next character in the url is the value stored with the bytecode.
-                if (url[urlIndex] == getBits&lt;uint8_t&gt;(m_bytecode, m_bytecodeLength, programCounter + sizeof(DFABytecode))) {
-                    programCounter = getBits&lt;unsigned&gt;(m_bytecode, m_bytecodeLength, programCounter + sizeof(DFABytecode) + sizeof(uint8_t));
-                    if (!url[urlIndex])
-                        urlIndexIsAfterEndOfString = true;
-                    urlIndex++; // This represents an edge in the DFA.
-                } else
-                    programCounter += instructionSizeWithArguments(DFABytecodeInstruction::CheckValue);
-                break;
-                    
-            case DFABytecodeInstruction::CheckValueRange: {
-                if (urlIndexIsAfterEndOfString)
-                    goto nextDFA;
-                
-                char character = url[urlIndex];
-                if (character &gt;= getBits&lt;uint8_t&gt;(m_bytecode, m_bytecodeLength, programCounter + sizeof(DFABytecode))
-                    &amp;&amp; character &lt;= getBits&lt;uint8_t&gt;(m_bytecode, m_bytecodeLength, programCounter + sizeof(DFABytecode) + sizeof(uint8_t))) {
-                    programCounter = getBits&lt;unsigned&gt;(m_bytecode, m_bytecodeLength, programCounter + sizeof(DFABytecode) + sizeof(uint8_t) + sizeof(uint8_t));
-                    if (!character)
-                        urlIndexIsAfterEndOfString = true;
-                    urlIndex++; // This represents an edge in the DFA.
-                } else
-                    programCounter += instructionSizeWithArguments(DFABytecodeInstruction::CheckValueRange);
-                break;
-            }
</del><ins>+            // Check to see if the next character in the url is the value stored with the bytecode.
+            if (url[urlIndex] == getBits&lt;uint8_t&gt;(m_bytecode, m_bytecodeLength, programCounter + sizeof(DFABytecode))) {
+                programCounter = getBits&lt;unsigned&gt;(m_bytecode, m_bytecodeLength, programCounter + sizeof(DFABytecode) + sizeof(uint8_t));
+                if (!url[urlIndex])
+                    urlIndexIsAfterEndOfString = true;
+                urlIndex++; // This represents an edge in the DFA.
+            } else
+                programCounter += instructionSizeWithArguments(DFABytecodeInstruction::CheckValue);
+            break;
</ins><span class="cx"> 
</span><del>-            case DFABytecodeInstruction::Jump:
-                if (!url[urlIndex] || urlIndexIsAfterEndOfString)
-                    goto nextDFA;
-                
-                programCounter = getBits&lt;unsigned&gt;(m_bytecode, m_bytecodeLength, programCounter + sizeof(DFABytecode));
</del><ins>+        case DFABytecodeInstruction::CheckValueRange: {
+            if (urlIndexIsAfterEndOfString)
+                return actions;
+
+            char character = url[urlIndex];
+            if (character &gt;= getBits&lt;uint8_t&gt;(m_bytecode, m_bytecodeLength, programCounter + sizeof(DFABytecode))
+                &amp;&amp; character &lt;= getBits&lt;uint8_t&gt;(m_bytecode, m_bytecodeLength, programCounter + sizeof(DFABytecode) + sizeof(uint8_t))) {
+                programCounter = getBits&lt;unsigned&gt;(m_bytecode, m_bytecodeLength, programCounter + sizeof(DFABytecode) + sizeof(uint8_t) + sizeof(uint8_t));
+                if (!character)
+                    urlIndexIsAfterEndOfString = true;
</ins><span class="cx">                 urlIndex++; // This represents an edge in the DFA.
</span><del>-                break;
-                    
-            case DFABytecodeInstruction::AppendAction:
-                actions.add(static_cast&lt;uint64_t&gt;(getBits&lt;unsigned&gt;(m_bytecode, m_bytecodeLength, programCounter + sizeof(DFABytecode))));
-                programCounter += instructionSizeWithArguments(DFABytecodeInstruction::AppendAction);
-                break;
-                    
-            case DFABytecodeInstruction::TestFlagsAndAppendAction:
-                if (flags &amp; getBits&lt;uint16_t&gt;(m_bytecode, m_bytecodeLength, programCounter + sizeof(DFABytecode)))
-                    actions.add(static_cast&lt;uint64_t&gt;(getBits&lt;unsigned&gt;(m_bytecode, m_bytecodeLength, programCounter + sizeof(DFABytecode) + sizeof(uint16_t))));
-                programCounter += instructionSizeWithArguments(DFABytecodeInstruction::TestFlagsAndAppendAction);
-                break;
-                    
-            default:
-                RELEASE_ASSERT_NOT_REACHED(); // Invalid bytecode.
-            }
-            // We should always terminate before or at a null character at the end of a String.
-            ASSERT(urlIndex &lt;= urlCString.length() || (urlIndexIsAfterEndOfString &amp;&amp; urlIndex &lt;= urlCString.length() + 1));
</del><ins>+            } else
+                programCounter += instructionSizeWithArguments(DFABytecodeInstruction::CheckValueRange);
+            break;
</ins><span class="cx">         }
</span><del>-        nextDFA:
-        ASSERT(dfaBytecodeLength);
-        programCounter = dfaStart + dfaBytecodeLength;
</del><ins>+
+        case DFABytecodeInstruction::Jump:
+            if (!url[urlIndex] || urlIndexIsAfterEndOfString)
+                return actions;
+
+            programCounter = getBits&lt;unsigned&gt;(m_bytecode, m_bytecodeLength, programCounter + sizeof(DFABytecode));
+            urlIndex++; // This represents an edge in the DFA.
+            break;
+
+        case DFABytecodeInstruction::AppendAction:
+            actions.add(static_cast&lt;uint64_t&gt;(getBits&lt;unsigned&gt;(m_bytecode, m_bytecodeLength, programCounter + sizeof(DFABytecode))));
+            programCounter += instructionSizeWithArguments(DFABytecodeInstruction::AppendAction);
+            break;
+
+        case DFABytecodeInstruction::TestFlagsAndAppendAction:
+            if (flags &amp; getBits&lt;uint16_t&gt;(m_bytecode, m_bytecodeLength, programCounter + sizeof(DFABytecode)))
+                actions.add(static_cast&lt;uint64_t&gt;(getBits&lt;unsigned&gt;(m_bytecode, m_bytecodeLength, programCounter + sizeof(DFABytecode) + sizeof(uint16_t))));
+            programCounter += instructionSizeWithArguments(DFABytecodeInstruction::TestFlagsAndAppendAction);
+            break;
+
+        default:
+            RELEASE_ASSERT_NOT_REACHED(); // Invalid bytecode.
+        }
+        // We should always terminate before or at a null character at the end of a String.
+        ASSERT(urlIndex &lt;= urlCString.length() || (urlIndexIsAfterEndOfString &amp;&amp; urlIndex &lt;= urlCString.length() + 1));
</ins><span class="cx">     }
</span><del>-    return actions;
</del><ins>+    RELEASE_ASSERT_NOT_REACHED();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> } // namespace ContentExtensions
</span></span></pre></div>
<a id="trunkToolsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Tools/ChangeLog (181934 => 181935)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/ChangeLog        2015-03-25 06:06:15 UTC (rev 181934)
+++ trunk/Tools/ChangeLog        2015-03-25 07:40:01 UTC (rev 181935)
</span><span class="lines">@@ -1,3 +1,18 @@
</span><ins>+2015-03-25  Commit Queue  &lt;commit-queue@webkit.org&gt;
+
+        Unreviewed, rolling out r181932.
+        https://bugs.webkit.org/show_bug.cgi?id=143041
+
+        The test fails most of the time on bots (Requested by ap on
+        #webkit).
+
+        Reverted changeset:
+
+        &quot;[Content Extensions] Add multi-DFA compiling and
+        interpreting.&quot;
+        https://bugs.webkit.org/show_bug.cgi?id=143010
+        http://trac.webkit.org/changeset/181932
+
</ins><span class="cx"> 2015-03-24  Alex Christensen  &lt;achristensen@webkit.org&gt;
</span><span class="cx"> 
</span><span class="cx">         [Content Extensions] Add multi-DFA compiling and interpreting.
</span></span></pre></div>
<a id="trunkToolsTestWebKitAPITestsWebCoreContentExtensionscpp"></a>
<div class="modfile"><h4>Modified: trunk/Tools/TestWebKitAPI/Tests/WebCore/ContentExtensions.cpp (181934 => 181935)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/TestWebKitAPI/Tests/WebCore/ContentExtensions.cpp        2015-03-25 06:06:15 UTC (rev 181934)
+++ trunk/Tools/TestWebKitAPI/Tests/WebCore/ContentExtensions.cpp        2015-03-25 07:40:01 UTC (rev 181935)
</span><span class="lines">@@ -36,7 +36,6 @@
</span><span class="cx"> #include &lt;wtf/MainThread.h&gt;
</span><span class="cx"> #include &lt;wtf/RunLoop.h&gt;
</span><span class="cx"> #include &lt;wtf/text/CString.h&gt;
</span><del>-#include &lt;wtf/text/StringBuilder.h&gt;
</del><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> namespace ContentExtensions {
</span><span class="lines">@@ -99,22 +98,16 @@
</span><span class="cx">     ContentExtensions::CompiledContentExtensionData m_data;
</span><span class="cx"> };
</span><span class="cx"> 
</span><del>-void static testRequest(ContentExtensions::ContentExtensionsBackend contentExtensionsBackend, const ResourceLoadInfo&amp; resourceLoadInfo, Vector&lt;ContentExtensions::ActionType&gt; expectedActions, bool ignorePreviousRules = false)
</del><ins>+void static testRequest(ContentExtensions::ContentExtensionsBackend contentExtensionsBackend, const ResourceLoadInfo&amp; resourceLoadInfo, Vector&lt;ContentExtensions::ActionType&gt; expectedActions)
</ins><span class="cx"> {
</span><span class="cx">     auto actions = contentExtensionsBackend.actionsForResourceLoad(resourceLoadInfo);
</span><del>-
-    unsigned expectedSize = actions.size();
-    if (actions.size() &amp;&amp; !ignorePreviousRules)
-        expectedSize--; // The last action is applying the compiled stylesheet.
-    
-    EXPECT_EQ(expectedActions.size(), expectedSize);
-    if (expectedActions.size() != expectedSize)
</del><ins>+    // The last action is applying the compiled stylesheet.
+    EXPECT_EQ(expectedActions.size(), actions.size() ? actions.size() - 1 : 0);
+    if (expectedActions.size() != (actions.size() ? actions.size() - 1 : 0))
</ins><span class="cx">         return;
</span><span class="cx"> 
</span><span class="cx">     for (unsigned i = 0; i &lt; expectedActions.size(); ++i)
</span><span class="cx">         EXPECT_EQ(expectedActions[i], actions[i].type());
</span><del>-    if (!ignorePreviousRules)
-        EXPECT_EQ(actions[actions.size() - 1].type(), ContentExtensions::ActionType::CSSDisplayNoneStyleSheet);
</del><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> ResourceLoadInfo mainDocumentRequest(const char* url, ResourceType resourceType = ResourceType::Document)
</span><span class="lines">@@ -517,47 +510,6 @@
</span><span class="cx">     testRequest(backend, mainDocumentRequest(&quot;http://block_only_images.org&quot;, ResourceType::Document), { });
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-TEST_F(ContentExtensionTest, MultiDFA)
-{
-    // Make an NFA with about 2000 nodes.
-    StringBuilder ruleList;
-    ruleList.append('[');
-    for (char c1 = 'A'; c1 &lt;= 'Z'; ++c1) {
-        for (char c2 = 'A'; c2 &lt;= 'Z'; ++c2) {
-            for (char c3 = 'A'; c3 &lt;= 'C'; ++c3) {
-                if (c1 != 'A' || c2 != 'A' || c3 != 'A')
-                    ruleList.append(',');
-                ruleList.append(&quot;{\&quot;action\&quot;:{\&quot;type\&quot;:\&quot;&quot;);
-                
-                // Put an ignore-previous-rules near the middle.
-                if (c1 == 'L' &amp;&amp; c2 == 'L' &amp;&amp; c3 == 'A')
-                    ruleList.append(&quot;ignore-previous-rules&quot;);
-                else
-                    ruleList.append(&quot;block&quot;);
-                
-                ruleList.append(&quot;\&quot;},\&quot;trigger\&quot;:{\&quot;url-filter\&quot;:\&quot;.*&quot;);
-                ruleList.append(c1);
-                ruleList.append(c2);
-                ruleList.append(c3);
-                ruleList.append(&quot;\&quot;, \&quot;url-filter-is-case-sensitive\&quot;:true}}&quot;);
-            }
-        }
-    }
-    ruleList.append(']');
-    
-    auto extensionData = ContentExtensions::compileRuleList(ruleList.toString());
-    auto extension = InMemoryCompiledContentExtension::create(WTF::move(extensionData));
-        
-    ContentExtensions::ContentExtensionsBackend backend;
-    backend.addContentExtension(&quot;ResourceTypeFilter&quot;, extension);
-
-    testRequest(backend, mainDocumentRequest(&quot;http://webkit.org/AAA&quot;), { ContentExtensions::ActionType::BlockLoad });
-    testRequest(backend, mainDocumentRequest(&quot;http://webkit.org/ZZC&quot;), { ContentExtensions::ActionType::BlockLoad });
-    testRequest(backend, mainDocumentRequest(&quot;http://webkit.org/LLA/AAA&quot;), { }, true);
-    testRequest(backend, mainDocumentRequest(&quot;http://webkit.org/LLA/MMC&quot;), { ContentExtensions::ActionType::BlockLoad }, true);
-    testRequest(backend, mainDocumentRequest(&quot;http://webkit.org/&quot;), { });
-}
-
</del><span class="cx"> static void testPatternStatus(String pattern, ContentExtensions::URLFilterParser::ParseStatus status)
</span><span class="cx"> {
</span><span class="cx">     ContentExtensions::NFA nfa;
</span></span></pre>
</div>
</div>

</body>
</html>