You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: spec.html
+33-17Lines changed: 33 additions & 17 deletions
Original file line number
Diff line number
Diff line change
@@ -4743,7 +4743,8 @@ <h1>
4743
4743
</dl>
4744
4744
<emu-alg>
4745
4745
1. Let _db_ be a new Shared Data Block value consisting of _size_ bytes. If it is impossible to create such a Shared Data Block, throw a *RangeError* exception.
4746
-
1. Let _execution_ be the [[CandidateExecution]] field of the surrounding agent's Agent Record.
4746
+
1. Let _AR_ be the Agent Record of the surrounding agent.
4747
+
1. Let _execution_ be _AR_.[[CandidateExecution]].
4747
4748
1. Let _eventsRecord_ be the Agent Events Record of _execution_.[[EventsRecords]] whose [[AgentSignifier]] is AgentSignifier().
4748
4749
1. Let _zero_ be « 0 ».
4749
4750
1. For each index _i_ of _db_, do
@@ -4772,7 +4773,8 @@ <h1>
4772
4773
1. Assert: _toIndex_ + _count_ ≤ _toSize_.
4773
4774
1. Repeat, while _count_ > 0,
4774
4775
1. If _fromBlock_ is a Shared Data Block, then
4775
-
1. Let _execution_ be the [[CandidateExecution]] field of the surrounding agent's Agent Record.
4776
+
1. Let _AR_ be the Agent Record of the surrounding agent.
4777
+
1. Let _execution_ be _AR_.[[CandidateExecution]].
4776
4778
1. Let _eventsRecord_ be the Agent Events Record of _execution_.[[EventsRecords]] whose [[AgentSignifier]] is AgentSignifier().
4777
4779
1. Let _bytes_ be a List whose sole element is a nondeterministically chosen byte value.
4778
4780
1. NOTE: In implementations, _bytes_ is the result of a non-atomic read instruction on the underlying hardware. The nondeterminism is a semantic prescription of the memory model to describe observable behaviour of hardware with weak consistency.
@@ -44669,7 +44671,8 @@ <h1>
44669
44671
1. If IsGrowableSharedArrayBuffer(_arrayBuffer_) is *true*, then
44670
44672
1. Let _bufferByteLengthBlock_ be _arrayBuffer_.[[ArrayBufferByteLengthData]].
44671
44673
1. Let _rawLength_ be GetRawBytesFromSharedBlock(_bufferByteLengthBlock_, 0, ~biguint64~, *true*, _order_).
44672
-
1. Let _isLittleEndian_ be the value of the [[LittleEndian]] field of the surrounding agent's Agent Record.
44674
+
1. Let _AR_ be the Agent Record of the surrounding agent.
1. Let _elementSize_ be the Element Size value specified in <emu-xref href="#table-the-typedarray-constructors"></emu-xref> for Element Type _type_.
44936
-
1. Let _execution_ be the [[CandidateExecution]] field of the surrounding agent's Agent Record.
44939
+
1. Let _AR_ be the Agent Record of the surrounding agent.
44940
+
1. Let _execution_ be _AR_.[[CandidateExecution]].
44937
44941
1. Let _eventsRecord_ be the Agent Events Record of _execution_.[[EventsRecords]] whose [[AgentSignifier]] is AgentSignifier().
44938
44942
1. If _isTypedArray_ is *true* and IsNoTearConfiguration(_type_, _order_) is *true*, let _noTear_ be *true*; otherwise let _noTear_ be *false*.
44939
44943
1. Let _rawValue_ be a List of length _elementSize_ whose elements are nondeterministically chosen byte values.
@@ -44969,7 +44973,9 @@ <h1>
44969
44973
1. Else,
44970
44974
1. Let _rawValue_ be a List whose elements are bytes from _block_ at indices in the interval from _byteIndex_ (inclusive) to _byteIndex_ + _elementSize_ (exclusive).
44971
44975
1. Assert: The number of elements in _rawValue_ is _elementSize_.
44972
-
1. If _isLittleEndian_ is not present, set _isLittleEndian_ to the value of the [[LittleEndian]] field of the surrounding agent's Agent Record.
44976
+
1. If _isLittleEndian_ is not present, then
44977
+
1. Let _AR_ be the Agent Record of the surrounding agent.
1. Assert: _value_ is a BigInt if IsBigIntElementType(_type_) is *true*; otherwise, _value_ is a Number.
45056
45064
1. Let _block_ be _arrayBuffer_.[[ArrayBufferData]].
45057
45065
1. Let _elementSize_ be the Element Size value specified in <emu-xref href="#table-the-typedarray-constructors"></emu-xref> for Element Type _type_.
45058
-
1. Let _isLittleEndian_ be the value of the [[LittleEndian]] field of the surrounding agent's Agent Record.
45066
+
1. Let _AR_ be the Agent Record of the surrounding agent.
45067
+
1. Let _isLittleEndian_ be _AR_.[[LittleEndian]].
45059
45068
1. Let _rawBytes_ be NumericToRawBytes(_type_, _value_, _isLittleEndian_).
45060
45069
1. If IsSharedArrayBuffer(_arrayBuffer_) is *true*, then
45061
-
1. Let _execution_ be the [[CandidateExecution]] field of the surrounding agent's Agent Record.
45070
+
1. Let _execution_ be _AR_.[[CandidateExecution]].
45062
45071
1. Let _eventsRecord_ be the Agent Events Record of _execution_.[[EventsRecords]] whose [[AgentSignifier]] is AgentSignifier().
45063
45072
1. Let _rawBytesRead_ be a List of length _elementSize_ whose elements are nondeterministically chosen byte values.
45064
45073
1. NOTE: In implementations, _rawBytesRead_ is the result of a load-link, of a load-exclusive, or of an operand of a read-modify-write instruction on the underlying hardware. The nondeterminism is a semantic prescription of the memory model to describe observable behaviour of hardware with weak consistency.
@@ -45405,7 +45414,7 @@ <h1>
45405
45414
<p>The implementation of HostGrowSharedArrayBuffer must conform to the following requirements:</p>
45406
45415
<ul>
45407
45416
<li>If the abstract operation does not complete normally with ~unhandled~, and _newByteLength_ < the current byte length of the _buffer_ or _newByteLength_ > _buffer_.[[ArrayBufferMaxByteLength]], throw a *RangeError* exception.</li>
45408
-
<li>Let _isLittleEndian_ be the value of the [[LittleEndian]] field of the surrounding agent's Agent Record. If the abstract operation completes normally with ~handled~, a WriteSharedMemory or ReadModifyWriteSharedMemory event whose [[Order]] is ~seq-cst~, [[Payload]] is NumericToRawBytes(~biguint64~, _newByteLength_, _isLittleEndian_), [[Block]] is _buffer_.[[ArrayBufferByteLengthData]], [[ByteIndex]] is 0, and [[ElementSize]] is 8 is added to the surrounding agent's candidate execution such that racing calls to <emu-xref href="#sec-sharedarraybuffer.prototype.grow" title></emu-xref> are not "lost", i.e. silently do nothing.</li>
45417
+
<li>Let _AR_ be the Agent Record of the surrounding agent. Let _isLittleEndian_ be _AR_.[[LittleEndian]]. If the abstract operation completes normally with ~handled~, a WriteSharedMemory or ReadModifyWriteSharedMemory event whose [[Order]] is ~seq-cst~, [[Payload]] is NumericToRawBytes(~biguint64~, _newByteLength_, _isLittleEndian_), [[Block]] is _buffer_.[[ArrayBufferByteLengthData]], [[ByteIndex]] is 0, and [[ElementSize]] is 8 is added to the surrounding agent's candidate execution such that racing calls to <emu-xref href="#sec-sharedarraybuffer.prototype.grow" title></emu-xref> are not "lost", i.e. silently do nothing.</li>
1. Let _hostHandled_ be ? HostGrowSharedArrayBuffer(_O_, _newByteLength_).
45509
45518
1. If _hostHandled_ is ~handled~, return *undefined*.
45510
-
1. Let _isLittleEndian_ be the value of the [[LittleEndian]] field of the surrounding agent's Agent Record.
45519
+
1. Let _AR_ be the Agent Record of the surrounding agent.
45520
+
1. Let _isLittleEndian_ be _AR_.[[LittleEndian]].
45511
45521
1. Let _byteLengthBlock_ be _O_.[[ArrayBufferByteLengthData]].
45512
45522
1. Let _currentByteLengthRawBytes_ be GetRawBytesFromSharedBlock(_byteLengthBlock_, 0, ~biguint64~, *true*, ~seq-cst~).
45513
45523
1. Let _newByteLengthRawBytes_ be NumericToRawBytes(~biguint64~, ℤ(_newByteLength_), _isLittleEndian_).
@@ -46385,7 +46395,8 @@ <h1>
46385
46395
1. Wait until no agent is in the critical section for _WL_, then enter the critical section for _WL_ (without allowing any other agent to enter).
46386
46396
1. If _WL_.[[MostRecentLeaveEvent]] is not ~empty~, then
46387
46397
1. NOTE: A _WL_ whose critical section has been entered at least once has a Synchronize event set by LeaveCriticalSection.
46388
-
1. Let _execution_ be the [[CandidateExecution]] field of the surrounding agent's Agent Record.
46398
+
1. Let _AR_ be the Agent Record of the surrounding agent.
46399
+
1. Let _execution_ be _AR_.[[CandidateExecution]].
46389
46400
1. Let _eventsRecord_ be the Agent Events Record of _execution_.[[EventsRecords]] whose [[AgentSignifier]] is AgentSignifier().
46390
46401
1. Let _enterEvent_ be a new Synchronize event.
46391
46402
1. Append _enterEvent_ to _eventsRecord_.[[EventList]].
@@ -46405,7 +46416,8 @@ <h1>
46405
46416
</dl>
46406
46417
<emu-alg>
46407
46418
1. Assert: The surrounding agent is in the critical section for _WL_.
46408
-
1. Let _execution_ be the [[CandidateExecution]] field of the surrounding agent's Agent Record.
46419
+
1. Let _AR_ be the Agent Record of the surrounding agent.
46420
+
1. Let _execution_ be _AR_.[[CandidateExecution]].
46409
46421
1. Let _eventsRecord_ be the Agent Events Record of _execution_.[[EventsRecords]] whose [[AgentSignifier]] is AgentSignifier().
46410
46422
1. Let _leaveEvent_ be a new Synchronize event.
46411
46423
1. Append _leaveEvent_ to _eventsRecord_.[[EventList]].
@@ -46648,7 +46660,8 @@ <h1>
46648
46660
<dl class="header">
46649
46661
</dl>
46650
46662
<emu-alg>
46651
-
1. Let _execution_ be the [[CandidateExecution]] field of the surrounding agent's Agent Record.
46663
+
1. Let _AR_ be the Agent Record of the surrounding agent.
46664
+
1. Let _execution_ be _AR_.[[CandidateExecution]].
46652
46665
1. Let _eventsRecord_ be the Agent Events Record of _execution_.[[EventsRecords]] whose [[AgentSignifier]] is AgentSignifier().
46653
46666
1. Let _rawBytesRead_ be a List of length _elementSize_ whose elements are nondeterministically chosen byte values.
46654
46667
1. NOTE: In implementations, _rawBytesRead_ is the result of a load-link, of a load-exclusive, or of an operand of a read-modify-write instruction on the underlying hardware. The nondeterminism is a semantic prescription of the memory model to describe observable behaviour of hardware with weak consistency.
1. Let _add_ be a new read-modify-write modification function with parameters (_xBytes_, _yBytes_) that captures _typedArray_ and performs the following steps atomically when called:
46749
46762
1. Let _type_ be TypedArrayElementType(_typedArray_).
46750
-
1. Let _isLittleEndian_ be the value of the [[LittleEndian]] field of the surrounding agent's Agent Record.
46763
+
1. Let _AR_ be the Agent Record of the surrounding agent.
46764
+
1. Let _isLittleEndian_ be _AR_.[[LittleEndian]].
46751
46765
1. Let _x_ be RawBytesToNumeric(_type_, _xBytes_, _isLittleEndian_).
46752
46766
1. Let _y_ be RawBytesToNumeric(_type_, _yBytes_, _isLittleEndian_).
1. Let _subtract_ be a new read-modify-write modification function with parameters (_xBytes_, _yBytes_) that captures _typedArray_ and performs the following steps atomically when called:
46875
46890
1. Let _type_ be TypedArrayElementType(_typedArray_).
46876
-
1. Let _isLittleEndian_ be the value of the [[LittleEndian]] field of the surrounding agent's Agent Record.
46891
+
1. Let _AR_ be the Agent Record of the surrounding agent.
46892
+
1. Let _isLittleEndian_ be _AR_.[[LittleEndian]].
46877
46893
1. Let _x_ be RawBytesToNumeric(_type_, _xBytes_, _isLittleEndian_).
46878
46894
1. Let _y_ be RawBytesToNumeric(_type_, _yBytes_, _isLittleEndian_).
0 commit comments