Title: [217073] trunk/Source/_javascript_Core
Revision
217073
Author
[email protected]
Date
2017-05-18 16:11:30 -0700 (Thu, 18 May 2017)

Log Message

Add FTL whitelist debugging option
https://bugs.webkit.org/show_bug.cgi?id=172321

Reviewed by Saam Barati.

* dfg/DFGTierUpCheckInjectionPhase.cpp:
(JSC::DFG::ensureGlobalFTLWhitelist):
(JSC::DFG::TierUpCheckInjectionPhase::run):
* runtime/Options.h:
* tools/FunctionWhitelist.cpp:
(JSC::FunctionWhitelist::contains):

Modified Paths

Diff

Modified: trunk/Source/_javascript_Core/ChangeLog (217072 => 217073)


--- trunk/Source/_javascript_Core/ChangeLog	2017-05-18 22:33:30 UTC (rev 217072)
+++ trunk/Source/_javascript_Core/ChangeLog	2017-05-18 23:11:30 UTC (rev 217073)
@@ -1,3 +1,17 @@
+2017-05-18  Michael Saboff  <[email protected]>
+
+        Add FTL whitelist debugging option
+        https://bugs.webkit.org/show_bug.cgi?id=172321
+
+        Reviewed by Saam Barati.
+
+        * dfg/DFGTierUpCheckInjectionPhase.cpp:
+        (JSC::DFG::ensureGlobalFTLWhitelist):
+        (JSC::DFG::TierUpCheckInjectionPhase::run):
+        * runtime/Options.h:
+        * tools/FunctionWhitelist.cpp:
+        (JSC::FunctionWhitelist::contains):
+
 2017-05-18  Filip Pizlo  <[email protected]>
 
         Constructor calls set this too early

Modified: trunk/Source/_javascript_Core/dfg/DFGTierUpCheckInjectionPhase.cpp (217072 => 217073)


--- trunk/Source/_javascript_Core/dfg/DFGTierUpCheckInjectionPhase.cpp	2017-05-18 22:33:30 UTC (rev 217072)
+++ trunk/Source/_javascript_Core/dfg/DFGTierUpCheckInjectionPhase.cpp	2017-05-18 23:11:30 UTC (rev 217073)
@@ -33,10 +33,23 @@
 #include "DFGNaturalLoops.h"
 #include "DFGPhase.h"
 #include "FTLCapabilities.h"
+#include "FunctionWhitelist.h"
 #include "JSCInlines.h"
+#include <wtf/NeverDestroyed.h>
 
 namespace JSC { namespace DFG {
 
+static FunctionWhitelist& ensureGlobalFTLWhitelist()
+{
+    static LazyNeverDestroyed<FunctionWhitelist> ftlWhitelist;
+    static std::once_flag initializeWhitelistFlag;
+    std::call_once(initializeWhitelistFlag, [] {
+        const char* functionWhitelistFile = Options::ftlWhitelist();
+        ftlWhitelist.construct(functionWhitelistFile);
+    });
+    return ftlWhitelist;
+}
+
 class TierUpCheckInjectionPhase : public Phase {
 public:
     TierUpCheckInjectionPhase(Graph& graph)
@@ -57,6 +70,9 @@
         if (!Options::bytecodeRangeToFTLCompile().isInRange(m_graph.m_profiledBlock->instructionCount()))
             return false;
 
+        if (!ensureGlobalFTLWhitelist().contains(m_graph.m_profiledBlock))
+            return false;
+
 #if ENABLE(FTL_JIT)
         FTL::CapabilityLevel level = FTL::canCompile(m_graph);
         if (level == FTL::CannotCompile)

Modified: trunk/Source/_javascript_Core/runtime/Options.h (217072 => 217073)


--- trunk/Source/_javascript_Core/runtime/Options.h	2017-05-18 22:33:30 UTC (rev 217072)
+++ trunk/Source/_javascript_Core/runtime/Options.h	2017-05-18 23:11:30 UTC (rev 217073)
@@ -157,6 +157,7 @@
     v(optionRange, bytecodeRangeToFTLCompile, 0, Normal, "bytecode size range to allow FTL compilation on, e.g. 1:100") \
     v(optionString, jitWhitelist, nullptr, Normal, "file with list of function signatures to allow compilation on") \
     v(optionString, dfgWhitelist, nullptr, Normal, "file with list of function signatures to allow DFG compilation on") \
+    v(optionString, ftlWhitelist, nullptr, Normal, "file with list of function signatures to allow FTL compilation on") \
     v(bool, dumpSourceAtDFGTime, false, Normal, "dumps source code of JS function being DFG compiled") \
     v(bool, dumpBytecodeAtDFGTime, false, Normal, "dumps bytecode of JS function being DFG compiled") \
     v(bool, dumpGraphAfterParsing, false, Normal, nullptr) \

Modified: trunk/Source/_javascript_Core/tools/FunctionWhitelist.cpp (217072 => 217073)


--- trunk/Source/_javascript_Core/tools/FunctionWhitelist.cpp	2017-05-18 22:33:30 UTC (rev 217072)
+++ trunk/Source/_javascript_Core/tools/FunctionWhitelist.cpp	2017-05-18 23:11:30 UTC (rev 217073)
@@ -75,7 +75,6 @@
 
 bool FunctionWhitelist::contains(CodeBlock* codeBlock) const
 {
-    ASSERT(!isCompilationThread());
     if (!m_hasActiveWhitelist)
         return true;
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to