Commit 660d11a2 authored by klaasb's avatar klaasb Committed by Commit bot

[turbofan] Mark for non-concurrent recompilation on OSR

Re-enable marking functions for optimized compilation on the next call
when using OSR. We would previously do this for all functions. However,
it only benefits functions marked for concurrent recompilation. These
would potentially run unoptimized again and be OSRed again.
In addition any function that already was optimized concurrently had
it's optimized code removed and would have been recompiled. Functions to
be baselined would skip that and possibly deopt.

BUG=chromium:651042

Review-Url: https://codereview.chromium.org/2391533002
Cr-Commit-Position: refs/heads/master@{#39934}
parent c9391d15
......@@ -361,7 +361,20 @@ RUNTIME_FUNCTION(Runtime_CompileForOnStackReplacement) {
// match. Fix heuristics for reenabling optimizations!
function->shared()->increment_deopt_count();
if (!result->is_turbofanned()) {
if (result->is_turbofanned()) {
// When we're waiting for concurrent optimization, set to compile on
// the next call - otherwise we'd run unoptimized once more
// and potentially compile for OSR another time as well.
if (function->IsMarkedForConcurrentOptimization()) {
if (FLAG_trace_osr) {
PrintF("[OSR - Re-marking ");
function->PrintName();
PrintF(" for non-concurrent optimization]\n");
}
function->ReplaceCode(
isolate->builtins()->builtin(Builtins::kCompileOptimized));
}
} else {
// Crankshafted OSR code can be installed into the function.
function->ReplaceCode(*result);
}
......
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