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

[compiler] Fix uncommon CompileOptimized fallback.

This fixes the uncommon fallback when Compiler::CompileOptimized fails
creating optimized code and also the underlying SharedFunctionInfo is
not compiled. We make sure not to uselessly regenerate the bytecode.

R=rmcilroy@chromium.org
BUG=chromium:639753

Review-Url: https://codereview.chromium.org/2261123002
Cr-Commit-Position: refs/heads/master@{#38776}
parent d181e6e1
......@@ -1277,6 +1277,9 @@ bool Compiler::CompileOptimized(Handle<JSFunction> function,
DCHECK(!isolate->has_pending_exception());
if (function->shared()->is_compiled()) {
code = handle(function->shared()->code(), isolate);
} else if (function->shared()->HasBytecodeArray()) {
code = isolate->builtins()->InterpreterEntryTrampoline();
function->shared()->ReplaceCode(*code);
} else {
Zone zone(isolate->allocator());
ParseInfo parse_info(&zone, function);
......
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