Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 4c82252b8b2face375e7d0552264de6ab7568bb6
https://github.com/WebKit/WebKit/commit/4c82252b8b2face375e7d0552264de6ab7568bb6
Author: Shu-yu Guo <[email protected]>
Date: 2026-04-22 (Wed, 22 Apr 2026)
Changed paths:
A
JSTests/stress/growable-sharedarraybuffer-parallel-grow-during-prototype-methods.js
M Source/JavaScriptCore/runtime/JSGenericTypedArrayViewPrototypeFunctions.h
Log Message:
-----------
[JSC] Snapshot span of TypedArrays in toSorted, toReversed, and with
https://bugs.webkit.org/show_bug.cgi?id=307723
rdar://170264253
Reviewed by Mark Lam.
The TypedArray.prototype.toSorted, toReversed, and with methods all create a
new TA and copies from the original. This copying is currently done with a
typedSpan(), which reads the TA's length. If the TA is backed by a growable
SharedArrayBuffer, this typedSpan may have a different length than the copy as
it may have grown in parallel. This PR fixes this by snapshotting the span
ahead of the time.
Test:
JSTests/stress/growable-sharedarraybuffer-parallel-grow-during-prototype-methods.js
*
JSTests/stress/growable-sharedarraybuffer-parallel-grow-during-prototype-methods.js:
Added.
(round.agent.start.agent.receiveBroadcast):
(round.i.catch):
* Source/JavaScriptCore/runtime/JSGenericTypedArrayViewPrototypeFunctions.h:
(JSC::genericTypedArrayViewProtoFuncToReversed):
(JSC::genericTypedArrayViewProtoFuncToSorted):
(JSC::genericTypedArrayViewProtoFuncWith):
Originally-landed-as: 305413.294@safari-7624-branch (17128d39f814).
rdar://173969072
Canonical link: https://commits.webkit.org/311789@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications