Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1712)

Unified Diff: src/runtime/runtime-compiler.cc

Issue 2558293004: Add a basic compiler dispatcher (Closed)
Patch Set: play it safe Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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());

Powered by Google App Engine
This is Rietveld 408576698