]> git.saurik.com Git - apple/javascriptcore.git/blobdiff - dfg/DFGDriver.h
JavaScriptCore-7601.1.46.3.tar.gz
[apple/javascriptcore.git] / dfg / DFGDriver.h
index 2b504848d7e356743ef16b04f8e32ff4a545ca04..a456dc66e22fbd968f77571c2a28f1c97a3b45d4 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2011 Apple Inc. All rights reserved.
+ * Copyright (C) 2011, 2013, 2014 Apple Inc. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
 #define DFGDriver_h
 
 #include "CallFrame.h"
-#include <wtf/Platform.h>
+#include "DFGCompilationMode.h"
+#include "DFGPlan.h"
 
 namespace JSC {
 
 class CodeBlock;
 class JITCode;
-class VM;
 class MacroAssemblerCodePtr;
+class VM;
 
 namespace DFG {
 
 JS_EXPORT_PRIVATE unsigned getNumCompilations();
 
-#if ENABLE(DFG_JIT)
-bool tryCompile(ExecState*, CodeBlock*, JITCode&, unsigned bytecodeIndex);
-bool tryCompileFunction(ExecState*, CodeBlock*, JITCode&, MacroAssemblerCodePtr& jitCodeWithArityCheck, unsigned bytecodeIndex);
-#else
-inline bool tryCompile(ExecState*, CodeBlock*, JITCode&, unsigned) { return false; }
-inline bool tryCompileFunction(ExecState*, CodeBlock*, JITCode&, MacroAssemblerCodePtr&, unsigned) { return false; }
-#endif
+// If the worklist is non-null, we do a concurrent compile. Otherwise we do a synchronous
+// compile. Even if we do a synchronous compile, we call the callback with the result.
+CompilationResult compile(
+    VM&, CodeBlock*, CodeBlock* profiledDFGCodeBlock, CompilationMode,
+    unsigned osrEntryBytecodeIndex, const Operands<JSValue>& mustHandleValues,
+    PassRefPtr<DeferredCompilationCallback>);
 
 } } // namespace JSC::DFG