JIT debugging features that selectively disable the JITs for code blocks need to...
[WebKit-https.git] / Source / JavaScriptCore / dfg / DFGDriver.cpp
index a822079ae880901ead6b06779d93a20c2cd4c994..08982bc6b3fa0a4ec552b90b6cefe96c7f7b25a5 100644 (file)
@@ -30,6 +30,7 @@
 #include "JSString.h"
 
 #include "CodeBlock.h"
+#include "DFGFunctionWhitelist.h"
 #include "DFGJITCode.h"
 #include "DFGPlan.h"
 #include "DFGThunks.h"
@@ -62,6 +63,10 @@ static CompilationResult compileImpl(
 {
     SamplingRegion samplingRegion("DFG Compilation (Driver)");
     
+    if (!Options::bytecodeRangeToDFGCompile().isInRange(codeBlock->instructionCount())
+        || !FunctionWhitelist::ensureGlobalWhitelist().contains(codeBlock))
+        return CompilationFailed;
+    
     numCompilations++;
     
     ASSERT(codeBlock);