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

Unified Diff: src/runtime.cc

Issue 12831003: Parallel recompilation: fix concurrency issues. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 9 months 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
« no previous file with comments | « src/optimizing-compiler-thread.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/runtime.cc
diff --git a/src/runtime.cc b/src/runtime.cc
index 6c2664bde46245ee11737406039127fd0adf90a1..12777e78a6d2278cb8aa3a2a0fe2abaca2218738 100644
--- a/src/runtime.cc
+++ b/src/runtime.cc
@@ -7729,7 +7729,7 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_ParallelRecompile) {
CONVERT_ARG_HANDLE_CHECKED(JSFunction, function, 0);
if (!AllowOptimization(isolate, function)) {
function->ReplaceCode(function->shared()->code());
- return function->code();
+ return isolate->heap()->undefined_value();
}
function->shared()->code()->set_profiler_ticks(0);
ASSERT(FLAG_parallel_recompilation);
@@ -7742,10 +7742,13 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_InstallRecompiledCode) {
HandleScope handle_scope(isolate);
ASSERT(args.length() == 1);
CONVERT_ARG_HANDLE_CHECKED(JSFunction, function, 0);
- if (!V8::UseCrankshaft()) return isolate->heap()->undefined_value();
- ASSERT(FLAG_parallel_recompilation);
+ ASSERT(V8::UseCrankshaft() && FLAG_parallel_recompilation);
OptimizingCompilerThread* opt_thread = isolate->optimizing_compiler_thread();
- opt_thread->InstallOptimizedFunctions();
+ do {
+ // The function could have been marked for installing, but not queued just
+ // yet. In this case, retry until installed.
+ opt_thread->InstallOptimizedFunctions();
+ } while (function->IsMarkedForInstallingRecompiledCode());
return function->code();
}
« no previous file with comments | « src/optimizing-compiler-thread.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698