[test] Fix %PrepareFunctionForOptimization() vs bytecode flushing
Ensure the bytecode array is available, before we put it to the PendingOptimizationTable. Bug: v8:12416 Change-Id: Ie4eb1a8a2ebdcdc0cfbfd7884eb081e156635a59 Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3313108 Auto-Submit: Igor Sheludko <ishell@chromium.org> Reviewed-by: Toon Verwaest <verwaest@chromium.org> Commit-Queue: Toon Verwaest <verwaest@chromium.org> Cr-Commit-Position: refs/heads/main@{#78293}
This commit is contained in:
parent
adc11330e5
commit
96ad5ab39d
@ -30,6 +30,11 @@ void PendingOptimizationTable::PreparedForOptimization(
|
||||
if (allow_heuristic_optimization) {
|
||||
status |= FunctionStatus::kAllowHeuristicOptimization;
|
||||
}
|
||||
Handle<SharedFunctionInfo> shared_info(function->shared(), isolate);
|
||||
|
||||
IsCompiledScope is_compiled_scope;
|
||||
SharedFunctionInfo::EnsureBytecodeArrayAvailable(isolate, shared_info,
|
||||
&is_compiled_scope);
|
||||
|
||||
Handle<ObjectHashTable> 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<Tuple2> 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);
|
||||
|
Loading…
Reference in New Issue
Block a user