Commit 35395d98 authored by mstarzinger's avatar mstarzinger Committed by Commit bot

[compiler] Fix optimized code lookup in GetLazyCode.

This makes sure that when cached optimized code is found while doing
lazy compilation via Compiler::Compile installs any existing literals
array as well.

R=mvstanton@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#35477}
parent 8e4fbb05
......@@ -895,11 +895,16 @@ MaybeHandle<Code> GetLazyCode(Handle<JSFunction> function) {
AggregatedHistogramTimerScope timer(isolate->counters()->compile_lazy());
if (FLAG_turbo_cache_shared_code) {
CodeAndLiterals result;
result = function->shared()->SearchOptimizedCodeMap(
*isolate->native_context(), BailoutId::None());
if (result.code != nullptr) {
return Handle<Code>(result.code);
Handle<Code> cached_code;
if (GetCodeFromOptimizedCodeMap(function, BailoutId::None())
.ToHandle(&cached_code)) {
if (FLAG_trace_opt) {
PrintF("[found optimized code for ");
function->ShortPrint();
PrintF(" during unoptimized compile]\n");
}
DCHECK(function->shared()->is_compiled());
return cached_code;
}
}
......
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