Commit c865b135 authored by yangguo@chromium.org's avatar yangguo@chromium.org

Do not overwrite already optimized code.

BUG=
R=ulan@chromium.org

Review URL: https://codereview.chromium.org/189603006

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@19791 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 9819cfd2
......@@ -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);
}
}
}
}
......
......@@ -8735,7 +8735,9 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_CompileForOnStackReplacement) {
PrintF(" at AST id %d]\n", ast_id.ToInt());
}
function->ReplaceCode(function->shared()->code());
if (!function->IsOptimized()) {
function->ReplaceCode(function->shared()->code());
}
return NULL;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment