summaryrefslogtreecommitdiff
path: root/deps/v8/src/builtins/typed-array-set.tq
diff options
context:
space:
mode:
Diffstat (limited to 'deps/v8/src/builtins/typed-array-set.tq')
-rw-r--r--deps/v8/src/builtins/typed-array-set.tq7
1 files changed, 6 insertions, 1 deletions
diff --git a/deps/v8/src/builtins/typed-array-set.tq b/deps/v8/src/builtins/typed-array-set.tq
index b5c9dcb261..f4d2a40f41 100644
--- a/deps/v8/src/builtins/typed-array-set.tq
+++ b/deps/v8/src/builtins/typed-array-set.tq
@@ -281,7 +281,12 @@ TypedArrayPrototypeSetTypedArray(implicit context: Context, receiver: JSAny)(
// value, true, Unordered).
// iii. Set srcByteIndex to srcByteIndex + 1.
// iv. Set targetByteIndex to targetByteIndex + 1.
- CallCMemmove(dstPtr, typedArray.data_ptr, countBytes);
+ if (IsSharedArrayBuffer(target.buffer)) {
+ // SABs need a relaxed memmove to preserve atomicity.
+ CallCRelaxedMemmove(dstPtr, typedArray.data_ptr, countBytes);
+ } else {
+ CallCMemmove(dstPtr, typedArray.data_ptr, countBytes);
+ }
} label IfSlow deferred {
// 22. If target.[[ContentType]] is not equal to
// typedArray.[[ContentType]], throw a TypeError exception.