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
This commit is contained in:
yangguo@chromium.org 2014-03-11 11:37:02 +00:00
parent 9819cfd29c
commit c865b1351a
2 changed files with 10 additions and 4 deletions

View File

@ -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);
}
}
}
}

View File

@ -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;
}