|
@@ -0,0 +1,46 @@
|
|
|
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
|
+From: =?UTF-8?q?Dominik=20Inf=C3=BChr?= <[email protected]>
|
|
|
+Date: Mon, 18 Dec 2023 09:15:00 +0100
|
|
|
+Subject: Install BytecodeArray last in SharedFunctionInfo
|
|
|
+MIME-Version: 1.0
|
|
|
+Content-Type: text/plain; charset=UTF-8
|
|
|
+Content-Transfer-Encoding: 8bit
|
|
|
+
|
|
|
+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.
|
|
|
+
|
|
|
+Bug: chromium:1507412
|
|
|
+Change-Id: I8855ed7ecc50c4a47d2c89043d62ac053858bc75
|
|
|
+Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/5125960
|
|
|
+Reviewed-by: Leszek Swirski <[email protected]>
|
|
|
+Commit-Queue: Dominik Inführ <[email protected]>
|
|
|
+Cr-Commit-Position: refs/heads/main@{#91568}
|
|
|
+
|
|
|
+diff --git a/src/codegen/compiler.cc b/src/codegen/compiler.cc
|
|
|
+index 19dd1cb14137a6681d771eccf36d0c6f80654696..4ccde99354235d926bb89807b57107509ebd34c7 100644
|
|
|
+--- a/src/codegen/compiler.cc
|
|
|
++++ b/src/codegen/compiler.cc
|
|
|
+@@ -688,12 +688,12 @@ void InstallUnoptimizedCode(UnoptimizedCompilationInfo* compilation_info,
|
|
|
+ }
|
|
|
+ #endif // V8_ENABLE_WEBASSEMBLY
|
|
|
+
|
|
|
+- shared_info->set_bytecode_array(*compilation_info->bytecode_array());
|
|
|
+- shared_info->set_age(0);
|
|
|
+-
|
|
|
+ Handle<FeedbackMetadata> feedback_metadata = FeedbackMetadata::New(
|
|
|
+ isolate, compilation_info->feedback_vector_spec());
|
|
|
+ shared_info->set_feedback_metadata(*feedback_metadata, kReleaseStore);
|
|
|
++
|
|
|
++ shared_info->set_age(0);
|
|
|
++ shared_info->set_bytecode_array(*compilation_info->bytecode_array());
|
|
|
+ } else {
|
|
|
+ #if V8_ENABLE_WEBASSEMBLY
|
|
|
+ DCHECK(compilation_info->has_asm_wasm_data());
|