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

Unified Diff: src/compiler.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 | « no previous file | src/optimizing-compiler-thread.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler.cc
diff --git a/src/compiler.cc b/src/compiler.cc
index 47ae439c35301ad04b6bf62a9747498a34ec475a..e51fb42c8f9c484bcf768b440541e5b80e951517 100644
--- a/src/compiler.cc
+++ b/src/compiler.cc
@@ -946,7 +946,6 @@ void Compiler::RecompileParallel(Handle<JSFunction> closure) {
// Do a scavenge to put off the next scavenge as far as possible.
// This may ease the issue that GVN blocks the next scavenge.
isolate->heap()->CollectGarbage(NEW_SPACE, "parallel recompile");
- closure->MarkInRecompileQueue();
shared->code()->set_profiler_ticks(0);
info.Detach();
isolate->optimizing_compiler_thread()->QueueForOptimization(compiler);
@@ -978,12 +977,17 @@ void Compiler::RecompileParallel(Handle<JSFunction> closure) {
void Compiler::InstallOptimizedCode(OptimizingCompiler* optimizing_compiler) {
SmartPointer<CompilationInfo> info(optimizing_compiler->info());
- ASSERT(info->closure()->IsMarkedForInstallingRecompiledCode());
- // While waiting for the optimizer thread, OSR may have already done all
- // the work and disabled optimization of this function for some reason.
+ // The function may have already been optimized by OSR. Simply continue.
+ // Except when OSR already disabled optimization for some reason.
if (info->shared_info()->optimization_disabled()) {
info->SetCode(Handle<Code>(info->shared_info()->code()));
InstallFullCode(*info);
+ if (FLAG_trace_parallel_recompilation) {
+ PrintF(" ** aborting optimization for ");
+ info->closure()->PrintName();
+ PrintF(" as it has been disabled.\n");
+ }
+ ASSERT(!info->closure()->IsMarkedForInstallingRecompiledCode());
return;
}
@@ -1025,6 +1029,7 @@ void Compiler::InstallOptimizedCode(OptimizingCompiler* optimizing_compiler) {
// Optimized code is finally replacing unoptimized code. Reset the latter's
// profiler ticks to prevent too soon re-opt after a deopt.
info->shared_info()->code()->set_profiler_ticks(0);
+ ASSERT(!info->closure()->IsMarkedForInstallingRecompiledCode());
}
« no previous file with comments | « no previous file | src/optimizing-compiler-thread.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698