[vm] Access Function::code_ with acquire-release ordering.

TEST=tsan
Bug: https://github.com/dart-lang/sdk/issues/55597
Change-Id: I915dfc6e3ec9e547f50e649b9dd430a5c7c52752
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/364969
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
This commit is contained in:
Ryan Macnak
2024-04-30 17:48:19 +00:00
committed by Commit Queue
parent d42a4b7219
commit dced438e75
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -7976,7 +7976,7 @@ void Function::SetInstructions(const Code& value) const {
}
void Function::SetInstructionsSafe(const Code& value) const {
untag()->set_code(value.ptr());
untag()->set_code<std::memory_order_release>(value.ptr());
StoreNonPointer(&untag()->entry_point_, value.EntryPoint());
StoreNonPointer(&untag()->unchecked_entry_point_,
value.UncheckedEntryPoint());
+1 -1
View File
@@ -3159,7 +3159,7 @@ class Function : public Object {
bool SafeToClosurize() const;
static CodePtr CurrentCodeOf(const FunctionPtr function) {
return function->untag()->code();
return function->untag()->code<std::memory_order_acquire>();
}
CodePtr unoptimized_code() const {