Commit 1c81ad3f authored by mstarzinger's avatar mstarzinger Committed by Commit bot

[compiler] Hoist bailouts out of OptimizedCompileJob.

This hoists all bailouts out of OptimizedCompileJob::CreateGraph into
the compiler pipeline. The reason is that this moves them to a point
where we can still influence the decision which compiler to pick and
hence gives us more freedom with modeling various pipelines.

R=neis@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#35532}
parent 19f1391e
......@@ -308,20 +308,9 @@ void CompilationInfo::PrintAstForTesting() {
// Implementation of OptimizedCompileJob
OptimizedCompileJob::Status OptimizedCompileJob::CreateGraph() {
DisallowJavascriptExecution no_js(isolate());
DCHECK(info()->IsOptimizing());
// Do not use Crankshaft/TurboFan if we need to be able to set break points.
if (info()->shared_info()->HasDebugInfo()) {
return AbortOptimization(kFunctionBeingDebugged);
}
// Limit the number of times we try to optimize functions.
const int kMaxOptCount =
FLAG_deopt_every_n_times == 0 ? FLAG_max_opt_count : 1000;
if (info()->shared_info()->opt_count() > kMaxOptCount) {
return AbortOptimization(kOptimizedTooManyTimes);
}
if (FLAG_trace_opt) {
OFStream os(stdout);
os << "[compiling method " << Brief(*info()->closure()) << " using "
......@@ -833,6 +822,20 @@ MaybeHandle<Code> GetOptimizedCode(Handle<JSFunction> function,
info->SetOptimizingForOsr(osr_ast_id);
// Do not use Crankshaft/TurboFan if we need to be able to set break points.
if (info->shared_info()->HasDebugInfo()) {
info->AbortOptimization(kFunctionBeingDebugged);
return MaybeHandle<Code>();
}
// Limit the number of times we try to optimize functions.
const int kMaxOptCount =
FLAG_deopt_every_n_times == 0 ? FLAG_max_opt_count : 1000;
if (info->shared_info()->opt_count() > kMaxOptCount) {
info->AbortOptimization(kOptimizedTooManyTimes);
return MaybeHandle<Code>();
}
if (mode == Compiler::CONCURRENT) {
if (GetOptimizedCodeLater(info.get())) {
info.Detach(); // The background recompile job owns this now.
......
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