Index: src/optimizing-compiler-thread.cc |
diff --git a/src/optimizing-compiler-thread.cc b/src/optimizing-compiler-thread.cc |
index d21507084c5f9d0de5d3eba72831f0f464665329..fb3eac5d503c1afd47be21cdc587c9f3ec097438 100644 |
--- a/src/optimizing-compiler-thread.cc |
+++ b/src/optimizing-compiler-thread.cc |
@@ -258,9 +258,13 @@ void OptimizingCompilerThread::InstallOptimizedFunctions() { |
uint32_t offset = code->TranslateAstIdToPcOffset(info->osr_ast_id()); |
BackEdgeTable::RemoveStackCheck(code, offset); |
} else { |
- Handle<Code> code = Compiler::GetConcurrentlyOptimizedCode(job); |
- function->ReplaceCode( |
- code.is_null() ? function->shared()->code() : *code); |
+ if (function->IsOptimized()) { |
+ DisposeOptimizedCompileJob(job, false); |
+ } else { |
+ Handle<Code> code = Compiler::GetConcurrentlyOptimizedCode(job); |
+ function->ReplaceCode( |
+ code.is_null() ? function->shared()->code() : *code); |
+ } |
} |
} |
} |