Index: src/runtime/runtime-compiler.cc |
diff --git a/src/runtime/runtime-compiler.cc b/src/runtime/runtime-compiler.cc |
index 3f9457e560f6cfe5deb0044922a0d42265e9e21a..7d5289e2e8622a28bfa3da4282fe78bb8a25883f 100644 |
--- a/src/runtime/runtime-compiler.cc |
+++ b/src/runtime/runtime-compiler.cc |
@@ -6,6 +6,7 @@ |
#include "src/arguments.h" |
#include "src/asmjs/asm-js.h" |
+#include "src/compiler-dispatcher/compiler-dispatcher.h" |
#include "src/compiler-dispatcher/optimizing-compile-dispatcher.h" |
#include "src/compiler.h" |
#include "src/deoptimizer.h" |
@@ -34,7 +35,13 @@ RUNTIME_FUNCTION(Runtime_CompileLazy) { |
StackLimitCheck check(isolate); |
if (check.JsHasOverflowed(1 * KB)) return isolate->StackOverflow(); |
- if (!Compiler::Compile(function, Compiler::KEEP_EXCEPTION)) { |
+ CompilerDispatcher* dispatcher = isolate->compiler_dispatcher(); |
+ Handle<SharedFunctionInfo> shared(function->shared(), isolate); |
+ if (dispatcher->IsEnqueued(shared)) { |
+ if (!dispatcher->FinishNow(shared)) { |
+ return isolate->heap()->exception(); |
+ } |
+ } else if (!Compiler::Compile(function, Compiler::KEEP_EXCEPTION)) { |
return isolate->heap()->exception(); |
} |
DCHECK(function->is_compiled()); |