Fix state maching debugging after r181964
authorbenjamin@webkit.org <benjamin@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 26 Mar 2015 21:02:29 +0000 (21:02 +0000)
committerbenjamin@webkit.org <benjamin@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 26 Mar 2015 21:02:29 +0000 (21:02 +0000)
https://bugs.webkit.org/show_bug.cgi?id=143082

Patch by Benjamin Poulain <bpoulain@apple.com> on 2015-03-26
Reviewed by Alex Christensen.

* contentextensions/ContentExtensionCompiler.cpp:
(WebCore::ContentExtensions::compileRuleList):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@182024 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebCore/ChangeLog
Source/WebCore/contentextensions/ContentExtensionCompiler.cpp

index c586ae7..5b0fb52 100644 (file)
@@ -1,3 +1,13 @@
+2015-03-26  Benjamin Poulain  <bpoulain@apple.com>
+
+        Fix state maching debugging after r181964
+        https://bugs.webkit.org/show_bug.cgi?id=143082
+
+        Reviewed by Alex Christensen.
+
+        * contentextensions/ContentExtensionCompiler.cpp:
+        (WebCore::ContentExtensions::compileRuleList):
+
 2015-03-25  David Hyatt  <hyatt@apple.com>
 
         Improve the offsetWidth/Height layout optimization
index 85d43fa..6bc09f5 100644 (file)
@@ -153,7 +153,11 @@ std::error_code compileRuleList(ContentExtensionCompilationClient& client, const
 #endif
 
 #if CONTENT_EXTENSIONS_STATE_MACHINE_DEBUGGING
-    nfa.debugPrintDot();
+    for (size_t i = 0; i < nfas.size(); ++i) {
+        WTFLogAlways("NFA %zu", i);
+        const NFA& nfa = nfas[i];
+        nfa.debugPrintDot();
+    }
 #endif
 
 #if CONTENT_EXTENSIONS_PERFORMANCE_REPORTING
@@ -162,6 +166,12 @@ std::error_code compileRuleList(ContentExtensionCompilationClient& client, const
     Vector<DFABytecode> bytecode;
     for (size_t i = 0; i < nfas.size(); ++i) {
         DFA dfa = NFAToDFA::convert(nfas[i]);
+
+#if CONTENT_EXTENSIONS_STATE_MACHINE_DEBUGGING
+        WTFLogAlways("DFA %zu", i);
+        dfa.debugPrintDot();
+#endif
+
         if (!i) {
             // Put all the universal actions on the first DFA.
             for (uint64_t actionLocation : universalActionLocations)
@@ -171,13 +181,6 @@ std::error_code compileRuleList(ContentExtensionCompilationClient& client, const
         compiler.compile();
     }
 
-#if CONTENT_EXTENSIONS_PERFORMANCE_REPORTING
-    double dfaBuildTimeEnd = monotonicallyIncreasingTime();
-    dataLogF("    Time spent building the DFA: %f\n", (dfaBuildTimeEnd - dfaBuildTimeStart));
-#endif
-
-    // FIXME: never add a DFA that only matches the empty set.
-
 #if CONTENT_EXTENSIONS_STATE_MACHINE_DEBUGGING
     dfa.debugPrintDot();
 #endif