Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions spec.html
Original file line number Diff line number Diff line change
Expand Up @@ -47213,7 +47213,9 @@ <h1>
1. NOTE: Bounds checking is not a synchronizing operation when _ta_'s backing buffer is a growable SharedArrayBuffer.
1. Let _taRecord_ be ? ValidateTypedArrayBounds(_ta_, ~unordered~).
1. Assert: _byteIndexInBuffer_ ≥ _ta_.[[ByteOffset]].
1. If _byteIndexInBuffer_ ≥ _taRecord_.[[CachedBufferByteLength]], throw a *RangeError* exception.
1. Let _elementSize_ be TypedArrayElementSize(_ta_).
1. Let _elementLastByteIndex_ be _byteIndexInBuffer_ + _elementSize_ - 1.
1. If _elementLastByteIndex_ ≥ _taRecord_.[[CachedBufferByteLength]], throw a *RangeError* exception.
1. Return ~unused~.
</emu-alg>
</emu-clause>
Expand Down Expand Up @@ -47720,8 +47722,8 @@ <h1>Atomics.notify ( _ta_, _index_, _count_ )</h1>
1. Let _intCount_ be ? ToIntegerOrInfinity(_count_).
1. Set _count_ to max(_intCount_, 0).
1. Let _buffer_ be _ta_.[[ViewedArrayBuffer]].
1. Let _block_ be _buffer_.[[ArrayBufferData]].
1. If IsSharedArrayBuffer(_buffer_) is *false*, return *+0*<sub>𝔽</sub>.
1. Let _block_ be _buffer_.[[ArrayBufferData]].

@gibson042 gibson042 Jul 24, 2026

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Atomics.notify notably does not use RevalidateAtomicAccess, so shrinking a length-tracking TypedArray in e.g. index.valueOf and then returning an index made out-of-bounds by the resize does not throw an exception (Atomics.notify(ta, { valueOf() { assert(ta.length > 0); ta.buffer.resize(0); assert(ta.length === 0); return 0; } }) === 0, except that V8 does seem to revalidate). But the primary use for Atomics.notify is with TypedArrays backed by shared ArrayBuffers, which cannot shrink and thus cannot encounter such a scenario. This PR preserves the behavior; I just thought it'd be worth highlighting.

1. Let _waiterList_ be GetWaiterList(_block_, _byteIndexInBuffer_).
1. Perform EnterCriticalSection(_waiterList_).
1. Let _waiters_ be RemoveWaiters(_waiterList_, _count_).
Expand Down
Loading