Skip to content

Commit e936549

Browse files
sajdakabirljharb
authored andcommitted
Editorial: use typical phrasing for Agent Record field access (#3704)
1 parent 5501329 commit e936549

File tree

1 file changed

+33
-17
lines changed

1 file changed

+33
-17
lines changed

spec.html

Lines changed: 33 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -4743,7 +4743,8 @@ <h1>
47434743
</dl>
47444744
<emu-alg>
47454745
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]].
47474748
1. Let _eventsRecord_ be the Agent Events Record of _execution_.[[EventsRecords]] whose [[AgentSignifier]] is AgentSignifier().
47484749
1. Let _zero_ be « 0 ».
47494750
1. For each index _i_ of _db_, do
@@ -4772,7 +4773,8 @@ <h1>
47724773
1. Assert: _toIndex_ + _count_ ≤ _toSize_.
47734774
1. Repeat, while _count_ > 0,
47744775
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]].
47764778
1. Let _eventsRecord_ be the Agent Events Record of _execution_.[[EventsRecords]] whose [[AgentSignifier]] is AgentSignifier().
47774779
1. Let _bytes_ be a List whose sole element is a nondeterministically chosen byte value.
47784780
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>
4466944671
1. If IsGrowableSharedArrayBuffer(_arrayBuffer_) is *true*, then
4467044672
1. Let _bufferByteLengthBlock_ be _arrayBuffer_.[[ArrayBufferByteLengthData]].
4467144673
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.
44675+
1. Let _isLittleEndian_ be _AR_.[[LittleEndian]].
4467344676
1. Return ℝ(RawBytesToNumeric(~biguint64~, _rawLength_, _isLittleEndian_)).
4467444677
1. Assert: IsDetachedBuffer(_arrayBuffer_) is *false*.
4467544678
1. Return _arrayBuffer_.[[ArrayBufferByteLength]].
@@ -44933,7 +44936,8 @@ <h1>
4493344936
</dl>
4493444937
<emu-alg>
4493544938
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]].
4493744941
1. Let _eventsRecord_ be the Agent Events Record of _execution_.[[EventsRecords]] whose [[AgentSignifier]] is AgentSignifier().
4493844942
1. If _isTypedArray_ is *true* and IsNoTearConfiguration(_type_, _order_) is *true*, let _noTear_ be *true*; otherwise let _noTear_ be *false*.
4493944943
1. Let _rawValue_ be a List of length _elementSize_ whose elements are nondeterministically chosen byte values.
@@ -44969,7 +44973,9 @@ <h1>
4496944973
1. Else,
4497044974
1. Let _rawValue_ be a List whose elements are bytes from _block_ at indices in the interval from _byteIndex_ (inclusive) to _byteIndex_ + _elementSize_ (exclusive).
4497144975
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.
44978+
1. Set _isLittleEndian_ to _AR_.[[LittleEndian]].
4497344979
1. Return RawBytesToNumeric(_type_, _rawValue_, _isLittleEndian_).
4497444980
</emu-alg>
4497544981
</emu-clause>
@@ -45024,10 +45030,12 @@ <h1>
4502445030
1. Assert: _value_ is a BigInt if IsBigIntElementType(_type_) is *true*; otherwise, _value_ is a Number.
4502545031
1. Let _block_ be _arrayBuffer_.[[ArrayBufferData]].
4502645032
1. Let _elementSize_ be the Element Size value specified in <emu-xref href="#table-the-typedarray-constructors"></emu-xref> for Element Type _type_.
45027-
1. If _isLittleEndian_ is not present, set _isLittleEndian_ to the value of the [[LittleEndian]] field of the surrounding agent's Agent Record.
45033+
1. Let _AR_ be the Agent Record of the surrounding agent.
45034+
1. If _isLittleEndian_ is not present, then
45035+
1. Set _isLittleEndian_ to _AR_.[[LittleEndian]].
4502845036
1. Let _rawBytes_ be NumericToRawBytes(_type_, _value_, _isLittleEndian_).
4502945037
1. If IsSharedArrayBuffer(_arrayBuffer_) is *true*, then
45030-
1. Let _execution_ be the [[CandidateExecution]] field of the surrounding agent's Agent Record.
45038+
1. Let _execution_ be _AR_.[[CandidateExecution]].
4503145039
1. Let _eventsRecord_ be the Agent Events Record of _execution_.[[EventsRecords]] whose [[AgentSignifier]] is AgentSignifier().
4503245040
1. If _isTypedArray_ is *true* and IsNoTearConfiguration(_type_, _order_) is *true*, let _noTear_ be *true*; otherwise let _noTear_ be *false*.
4503345041
1. Append WriteSharedMemory { [[Order]]: _order_, [[NoTear]]: _noTear_, [[Block]]: _block_, [[ByteIndex]]: _byteIndex_, [[ElementSize]]: _elementSize_, [[Payload]]: _rawBytes_ } to _eventsRecord_.[[EventList]].
@@ -45055,10 +45063,11 @@ <h1>
4505545063
1. Assert: _value_ is a BigInt if IsBigIntElementType(_type_) is *true*; otherwise, _value_ is a Number.
4505645064
1. Let _block_ be _arrayBuffer_.[[ArrayBufferData]].
4505745065
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]].
4505945068
1. Let _rawBytes_ be NumericToRawBytes(_type_, _value_, _isLittleEndian_).
4506045069
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]].
4506245071
1. Let _eventsRecord_ be the Agent Events Record of _execution_.[[EventsRecords]] whose [[AgentSignifier]] is AgentSignifier().
4506345072
1. Let _rawBytesRead_ be a List of length _elementSize_ whose elements are nondeterministically chosen byte values.
4506445073
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>
4540545414
<p>The implementation of HostGrowSharedArrayBuffer must conform to the following requirements:</p>
4540645415
<ul>
4540745416
<li>If the abstract operation does not complete normally with ~unhandled~, and _newByteLength_ &lt; 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>
4540945418
</ul>
4541045419

4541145420
<emu-note>
@@ -45507,7 +45516,8 @@ <h1>SharedArrayBuffer.prototype.grow ( _newLength_ )</h1>
4550745516
1. Let _newByteLength_ be ? ToIndex(_newLength_).
4550845517
1. Let _hostHandled_ be ? HostGrowSharedArrayBuffer(_O_, _newByteLength_).
4550945518
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]].
4551145521
1. Let _byteLengthBlock_ be _O_.[[ArrayBufferByteLengthData]].
4551245522
1. Let _currentByteLengthRawBytes_ be GetRawBytesFromSharedBlock(_byteLengthBlock_, 0, ~biguint64~, *true*, ~seq-cst~).
4551345523
1. Let _newByteLengthRawBytes_ be NumericToRawBytes(~biguint64~, ℤ(_newByteLength_), _isLittleEndian_).
@@ -46385,7 +46395,8 @@ <h1>
4638546395
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).
4638646396
1. If _WL_.[[MostRecentLeaveEvent]] is not ~empty~, then
4638746397
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]].
4638946400
1. Let _eventsRecord_ be the Agent Events Record of _execution_.[[EventsRecords]] whose [[AgentSignifier]] is AgentSignifier().
4639046401
1. Let _enterEvent_ be a new Synchronize event.
4639146402
1. Append _enterEvent_ to _eventsRecord_.[[EventList]].
@@ -46405,7 +46416,8 @@ <h1>
4640546416
</dl>
4640646417
<emu-alg>
4640746418
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]].
4640946421
1. Let _eventsRecord_ be the Agent Events Record of _execution_.[[EventsRecords]] whose [[AgentSignifier]] is AgentSignifier().
4641046422
1. Let _leaveEvent_ be a new Synchronize event.
4641146423
1. Append _leaveEvent_ to _eventsRecord_.[[EventList]].
@@ -46648,7 +46660,8 @@ <h1>
4664846660
<dl class="header">
4664946661
</dl>
4665046662
<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]].
4665246665
1. Let _eventsRecord_ be the Agent Events Record of _execution_.[[EventsRecords]] whose [[AgentSignifier]] is AgentSignifier().
4665346666
1. Let _rawBytesRead_ be a List of length _elementSize_ whose elements are nondeterministically chosen byte values.
4665446667
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.
@@ -46747,7 +46760,8 @@ <h1>Atomics.add ( _typedArray_, _index_, _value_ )</h1>
4674746760
<emu-alg>
4674846761
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:
4674946762
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]].
4675146765
1. Let _x_ be RawBytesToNumeric(_type_, _xBytes_, _isLittleEndian_).
4675246766
1. Let _y_ be RawBytesToNumeric(_type_, _yBytes_, _isLittleEndian_).
4675346767
1. If _x_ is a Number, then
@@ -46788,7 +46802,8 @@ <h1>Atomics.compareExchange ( _typedArray_, _index_, _expectedValue_, _replaceme
4678846802
1. Perform ? RevalidateAtomicAccess(_typedArray_, _byteIndexInBuffer_).
4678946803
1. Let _elementType_ be TypedArrayElementType(_typedArray_).
4679046804
1. Let _elementSize_ be TypedArrayElementSize(_typedArray_).
46791-
1. Let _isLittleEndian_ be the value of the [[LittleEndian]] field of the surrounding agent's Agent Record.
46805+
1. Let _AR_ be the Agent Record of the surrounding agent.
46806+
1. Let _isLittleEndian_ be _AR_.[[LittleEndian]].
4679246807
1. Let _expectedBytes_ be NumericToRawBytes(_elementType_, _expected_, _isLittleEndian_).
4679346808
1. Let _replacementBytes_ be NumericToRawBytes(_elementType_, _replacement_, _isLittleEndian_).
4679446809
1. If IsSharedArrayBuffer(_buffer_) is *true*, then
@@ -46873,7 +46888,8 @@ <h1>Atomics.sub ( _typedArray_, _index_, _value_ )</h1>
4687346888
<emu-alg>
4687446889
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:
4687546890
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]].
4687746893
1. Let _x_ be RawBytesToNumeric(_type_, _xBytes_, _isLittleEndian_).
4687846894
1. Let _y_ be RawBytesToNumeric(_type_, _yBytes_, _isLittleEndian_).
4687946895
1. If _x_ is a Number, then

0 commit comments

Comments
 (0)