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
// 6. Let isLittleEndian be the value of the [[LittleEndian]] field
438
+
// of the surrounding agent's Agent Record.
430
439
// 7. Let rawBytes be NumericToRawBytes(type, value, isLittleEndian).
431
-
// 8. If IsSharedArrayBuffer(arrayBuffer) is true, then
432
-
// a. Let execution be the [[CandidateExecution]] field of the surrounding agent's Agent Record.
433
-
// b. Let eventsRecord be the Agent Events Record of execution.[[EventsRecords]] whose [[AgentSignifier]] is AgentSignifier().
434
-
// c. Let rawBytesRead be a List of length elementSize whose elements are nondeterministically chosen byte values.
435
-
// d. 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.
436
-
// e. Let rmwEvent be ReadModifyWriteSharedMemory { [[Order]]: SEQ-CST, [[NoTear]]: true, [[Block]]: block, [[ByteIndex]]: byteIndex, [[ElementSize]]: elementSize, [[Payload]]: rawBytes, [[ModifyOp]]: op }.
437
-
// f. Append rmwEvent to eventsRecord.[[EventList]].
438
-
// g. Append Chosen Value Record { [[Event]]: rmwEvent, [[ChosenValue]]: rawBytesRead } to execution.[[ChosenValues]].
439
-
// 9. Else,
440
-
// a. Let rawBytesRead be a List of length elementSize whose elements are the sequence of elementSize bytes starting with block[byteIndex].
441
-
// b. Let rawBytesModified be op(rawBytesRead, rawBytes).
442
-
// c. Store the individual bytes of rawBytesModified into block, starting at block[byteIndex].
440
+
let raw_bytes = Type::from_ne_value(agent, value);
441
+
let raw_bytes_read = match array_buffer {
442
+
AnyArrayBuffer::ArrayBuffer(array_buffer) => {
443
+
let op = get_array_buffer_op::<Type,OP>();
444
+
// 4. Let block be arrayBuffer.[[ArrayBufferData]].
445
+
let block = array_buffer.as_mut_slice(agent);
446
+
// 8. If IsSharedArrayBuffer(arrayBuffer) is true, then
447
+
// 9. Else,
448
+
let slot = &mut block[byte_index..byte_index + element_size];
0 commit comments