diff --git a/src/codegen/pending-optimization-table.cc b/src/codegen/pending-optimization-table.cc index 6f51cc43af..5e88b1e456 100644 --- a/src/codegen/pending-optimization-table.cc +++ b/src/codegen/pending-optimization-table.cc @@ -30,6 +30,11 @@ void PendingOptimizationTable::PreparedForOptimization( if (allow_heuristic_optimization) { status |= FunctionStatus::kAllowHeuristicOptimization; } + Handle shared_info(function->shared(), isolate); + + IsCompiledScope is_compiled_scope; + SharedFunctionInfo::EnsureBytecodeArrayAvailable(isolate, shared_info, + &is_compiled_scope); Handle table = isolate->heap()->pending_optimize_for_test_bytecode().IsUndefined() @@ -38,7 +43,7 @@ void PendingOptimizationTable::PreparedForOptimization( isolate->heap()->pending_optimize_for_test_bytecode()), isolate); Handle tuple = isolate->factory()->NewTuple2( - handle(function->shared().GetBytecodeArray(isolate), isolate), + handle(shared_info->GetBytecodeArray(isolate), isolate), handle(Smi::FromInt(status), isolate), AllocationType::kYoung); table = ObjectHashTable::Put(table, handle(function->shared(), isolate), tuple);