Skip to content
forked from v8/v8

Commit

Permalink
[M114-LTS][codegen] Install BytecodeArray last in SharedFunctionInfo
Browse files Browse the repository at this point in the history
M114 merge issues:
  codegen/compiler.cc:
    set_age() isn't called in 114 - removed it from the change.

Maglev assumes that when a SharedFunctionInfo has a BytecodeArray,
then it should also have FeedbackMetadata. However, this may not
hold with concurrent compilation when the SharedFunctionInfo is
re-compiled after being flushed. Here the BytecodeArray was installed
on the SFI before the FeedbackMetadata and a concurrent thread could
observe the BytecodeArray but not the FeedbackMetadata.

Drive-by: Reset the age field before setting the BytecodeArray as
well. This ensures that the concurrent marker will not observe the
old age for the new BytecodeArray.

(cherry picked from commit 46cb67e)

Bug: chromium:1507412
No-Try: true
No-Presubmit: true
No-Tree-Checks: true
Change-Id: I8855ed7ecc50c4a47d2c89043d62ac053858bc75
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/5125960
Commit-Queue: Dominik Inführ <dinfuehr@chromium.org>
Cr-Original-Commit-Position: refs/heads/main@{#91568}
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/5189926
Reviewed-by: Leszek Swirski <leszeks@chromium.org>
Commit-Queue: Roger Felipe Zanoni da Silva <rzanoni@google.com>
Cr-Commit-Position: refs/branch-heads/11.4@{v8#79}
Cr-Branched-From: 8a8a1e7-refs/heads/11.4.183@{#1}
Cr-Branched-From: 5483d8e-refs/heads/main@{#87241}
  • Loading branch information
Dominik Inführ authored and V8 LUCI CQ committed Jan 25, 2024
1 parent d53ecb5 commit dd1b8f7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/codegen/compiler.cc
Original file line number Diff line number Diff line change
Expand Up @@ -676,11 +676,11 @@ void InstallUnoptimizedCode(UnoptimizedCompilationInfo* compilation_info,
}
#endif // V8_ENABLE_WEBASSEMBLY

shared_info->set_bytecode_array(*compilation_info->bytecode_array());

Handle<FeedbackMetadata> feedback_metadata = FeedbackMetadata::New(
isolate, compilation_info->feedback_vector_spec());
shared_info->set_feedback_metadata(*feedback_metadata, kReleaseStore);

shared_info->set_bytecode_array(*compilation_info->bytecode_array());
} else {
#if V8_ENABLE_WEBASSEMBLY
DCHECK(compilation_info->has_asm_wasm_data());
Expand Down

0 comments on commit dd1b8f7

Please sign in to comment.