Skip to content

Commit

Permalink
[vm] Clone forwarder function object with relaxed atomics.
Browse files Browse the repository at this point in the history
TEST=ci
BUG=dartbug.com/59594

Change-Id: I8f6b7ee0bb477d1f05cc8baed2b03650888fba5b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/396569
Reviewed-by: Ryan Macnak <[email protected]>
Commit-Queue: Alexander Aprelev <[email protected]>
  • Loading branch information
aam authored and Commit Queue committed Nov 25, 2024
1 parent ed520f5 commit 59f290e
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion runtime/vm/object.cc
Original file line number Diff line number Diff line change
Expand Up @@ -4346,7 +4346,10 @@ FunctionPtr Function::CreateDynamicInvocationForwarder(
Zone* zone = thread->zone();

Function& forwarder = Function::Handle(zone);
forwarder ^= Object::Clone(*this, Heap::kOld);
// Load with relaxed atomics to prevent data race with updating original's
// properties that are overridden below for the copy anyway.
forwarder ^= Object::Clone(*this, Heap::kOld,
/*load_with_relaxed_atomics=*/true);

forwarder.reset_unboxed_parameters_and_return();

Expand Down

0 comments on commit 59f290e

Please sign in to comment.