Commit f38932c7 authored by mstarzinger's avatar mstarzinger Committed by Commit bot

[compiler] Prevent unnecessary regeneration of baseline code.

This avoids regenerating baseline code for a closure when such code
already exists for the shared function info. This is also important
because the baseline code might contain deoptimization support.

R=rmcilroy@chromium.org
BUG=chromium:606376
LOG=n

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

Cr-Commit-Position: refs/heads/master@{#35785}
parent a0f88693
......@@ -898,6 +898,11 @@ MaybeHandle<Code> GetBaselineCode(Handle<JSFunction> function) {
function->shared()->set_profiler_ticks(0);
}
// Nothing left to do if the function already has baseline code.
if (function->shared()->code()->kind() == Code::FUNCTION) {
return Handle<Code>(function->shared()->code());
}
// We do not switch to baseline code when the debugger might have created a
// copy of the bytecode with break slots to be able to set break points.
if (function->shared()->HasDebugInfo()) {
......
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