Atomics: ensure all SharedArrayBuffer sizes are uniform

This commit is contained in:
Rick Waldron 2018-06-25 15:17:45 -04:00
parent 7ec0cdba6c
commit fc4a6f12cb
85 changed files with 140 additions and 132 deletions

View File

@ -27,7 +27,7 @@ info: |
features: [Atomics, SharedArrayBuffer, TypedArray]
---*/
var buffer = new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT);
var buffer = new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT * 4);
var i32a = new Int32Array(buffer);
var newValue = 0b00000001000000001000000010000001;

View File

@ -27,7 +27,7 @@ info: |
features: [Atomics, SharedArrayBuffer, TypedArray]
---*/
var buffer = new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT);
var buffer = new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT * 4);
var i32a = new Int32Array(buffer);
var initial = 0b00000001000000001000000010000001;
var other = 0b00000001111111111000000011111111;

View File

@ -26,7 +26,7 @@ info: |
features: [Atomics, SharedArrayBuffer, TypedArray]
---*/
var buffer = new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT);
var buffer = new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT * 4);
var i32a = new Int32Array(buffer);
var update = 0b00000001000000001000000010000001;

View File

@ -27,7 +27,7 @@ info: |
features: [Atomics, SharedArrayBuffer, TypedArray]
---*/
var buffer = new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT);
var buffer = new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT * 4);
var i32a = new Int32Array(buffer);
var update = 0b00000001000000001000000010000001;

View File

@ -28,7 +28,7 @@ info: |
features: [Atomics, SharedArrayBuffer, TypedArray]
---*/
var buffer = new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT);
var buffer = new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT * 4);
var i32a = new Int32Array(buffer);
var update = 0b00000001000000001000000010000001;

View File

@ -27,7 +27,7 @@ info: |
features: [Atomics, SharedArrayBuffer, TypedArray]
---*/
var buffer = new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT);
var buffer = new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT * 4);
var i32a = new Int32Array(buffer);
var update = 0b00000001000000001000000010000001;

View File

@ -18,7 +18,7 @@ info: |
features: [Atomics, SharedArrayBuffer, TypedArray]
---*/
var buffer = new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT);
var buffer = new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT * 4);
var i32a = new Int32Array(buffer);
var update = 0b00000001000000001000000010000001;

View File

@ -27,7 +27,7 @@ info: |
features: [Atomics, SharedArrayBuffer, TypedArray]
---*/
var buffer = new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT);
var buffer = new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT * 4);
var i32a = new Int32Array(buffer);
var update = 0b00000001000000001000000010000001;

View File

@ -16,7 +16,7 @@ features: [ArrayBuffer, arrow-function, Atomics, DataView, for-of, let, SharedAr
---*/
const i32a = new Int32Array(
new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT)
new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT * 8)
);
testWithAtomicsOutOfBoundsIndices(function(IdxGen) {

View File

@ -16,7 +16,7 @@ features: [ArrayBuffer, arrow-function, Atomics, BigInt, DataView, for-of, let,
---*/
const i64a = new BigInt64Array(
new SharedArrayBuffer(BigInt64Array.BYTES_PER_ELEMENT)
new SharedArrayBuffer(BigInt64Array.BYTES_PER_ELEMENT * 8)
);
testWithAtomicsOutOfBoundsIndices(function(IdxGen) {

View File

@ -19,7 +19,7 @@ flags: [CanBlockIsFalse]
---*/
const i64a = new BigInt64Array(
new SharedArrayBuffer(BigInt64Array.BYTES_PER_ELEMENT)
new SharedArrayBuffer(BigInt64Array.BYTES_PER_ELEMENT * 8)
);
assert.throws(TypeError, function() {

View File

@ -41,7 +41,7 @@ $262.agent.start(`
`);
const i64a = new BigInt64Array(
new SharedArrayBuffer(BigInt64Array.BYTES_PER_ELEMENT)
new SharedArrayBuffer(BigInt64Array.BYTES_PER_ELEMENT * 8)
);
$262.agent.broadcast(i64a.buffer);

View File

@ -17,7 +17,7 @@ flags: [CanBlockIsFalse]
---*/
const i64a = new BigInt64Array(
new SharedArrayBuffer(BigInt64Array.BYTES_PER_ELEMENT)
new SharedArrayBuffer(BigInt64Array.BYTES_PER_ELEMENT * 8)
);
const valueOf = {

View File

@ -26,7 +26,7 @@ $262.agent.start(`
`);
const i64a = new BigInt64Array(
new SharedArrayBuffer(BigInt64Array.BYTES_PER_ELEMENT)
new SharedArrayBuffer(BigInt64Array.BYTES_PER_ELEMENT * 8)
);
$262.agent.broadcast(i64a.buffer);

View File

@ -17,7 +17,7 @@ features: [Atomics, BigInt, SharedArrayBuffer, TypedArray]
---*/
const i64a = new BigInt64Array(
new SharedArrayBuffer(BigInt64Array.BYTES_PER_ELEMENT)
new SharedArrayBuffer(BigInt64Array.BYTES_PER_ELEMENT * 8)
);
const poisoned = {
valueOf: function() {

View File

@ -18,7 +18,7 @@ $262.agent.start(`
`);
const i64a = new BigInt64Array(
new SharedArrayBuffer(BigInt64Array.BYTES_PER_ELEMENT)
new SharedArrayBuffer(BigInt64Array.BYTES_PER_ELEMENT * 8)
);
$262.agent.broadcast(i64a.buffer);

View File

@ -10,7 +10,7 @@ flags: [CanBlockIsFalse]
---*/
const i64a = new BigInt64Array(
new SharedArrayBuffer(BigInt64Array.BYTES_PER_ELEMENT)
new SharedArrayBuffer(BigInt64Array.BYTES_PER_ELEMENT * 8)
);
assert.sameValue(Atomics.wait(i64a, 0, 0, -1), "timed-out");

View File

@ -29,11 +29,11 @@ $262.agent.start(`
`);
const i64a = new BigInt64Array(
new SharedArrayBuffer(BigInt64Array.BYTES_PER_ELEMENT)
new SharedArrayBuffer(BigInt64Array.BYTES_PER_ELEMENT * 8)
);
$262.agent.broadcast(i64a.buffer);
$262.agent.sleep(100);
$262.agent.sleep(10);
// NO OPERATION OCCURS HERE!

View File

@ -9,9 +9,9 @@ includes: [atomicsHelper.js]
features: [ArrayBuffer, DataView, let, arrow-function, for-of, Atomics, BigInt, SharedArrayBuffer, TypedArray]
---*/
const TIMEOUT = 2000;
const TIMEOUT = 200;
const i64a = new BigInt64Array(
new SharedArrayBuffer(BigInt64Array.BYTES_PER_ELEMENT)
new SharedArrayBuffer(BigInt64Array.BYTES_PER_ELEMENT * 8)
);
$262.agent.start(`
@ -26,7 +26,7 @@ $262.agent.start(`
`);
$262.agent.broadcast(i64a.buffer);
$262.agent.sleep(100);
$262.agent.sleep(10);
Atomics.add(i64a, 0, 1);

View File

@ -8,9 +8,9 @@ description: >
includes: [testAtomics.js]
features: [ArrayBuffer, DataView, let, arrow-function, for-of, Atomics, BigInt, SharedArrayBuffer, TypedArray]
---*/
const TIMEOUT = 2000;
const TIMEOUT = 200;
const i64a = new BigInt64Array(
new SharedArrayBuffer(BigInt64Array.BYTES_PER_ELEMENT)
new SharedArrayBuffer(BigInt64Array.BYTES_PER_ELEMENT * 8)
);
$262.agent.start(`
@ -25,7 +25,7 @@ $262.agent.start(`
`);
$262.agent.broadcast(i64a.buffer);
$262.agent.sleep(100);
$262.agent.sleep(10);
Atomics.and(i64a, 0, 1);

View File

@ -8,9 +8,9 @@ description: >
includes: [testAtomics.js]
features: [Atomics, BigInt, SharedArrayBuffer, TypedArray, ArrayBuffer, DataView, let, arrow-function, for-of]
---*/
const TIMEOUT = 2000;
const TIMEOUT = 200;
const i64a = new BigInt64Array(
new SharedArrayBuffer(BigInt64Array.BYTES_PER_ELEMENT)
new SharedArrayBuffer(BigInt64Array.BYTES_PER_ELEMENT * 8)
);
$262.agent.start(`
@ -25,7 +25,7 @@ $262.agent.start(`
`);
$262.agent.broadcast(i64a.buffer);
$262.agent.sleep(100);
$262.agent.sleep(10);
Atomics.compareExchange(i64a, 0, 0, 1);

View File

@ -8,9 +8,9 @@ description: >
includes: [testAtomics.js]
features: [Atomics, BigInt, SharedArrayBuffer, TypedArray, ArrayBuffer, DataView, let, arrow-function, for-of]
---*/
const TIMEOUT = 2000;
const TIMEOUT = 200;
const i64a = new BigInt64Array(
new SharedArrayBuffer(BigInt64Array.BYTES_PER_ELEMENT)
new SharedArrayBuffer(BigInt64Array.BYTES_PER_ELEMENT * 8)
);
$262.agent.start(`
@ -25,7 +25,7 @@ $262.agent.start(`
`);
$262.agent.broadcast(i64a.buffer);
$262.agent.sleep(100);
$262.agent.sleep(10);
Atomics.exchange(i64a, 0, 1);

View File

@ -8,9 +8,9 @@ description: >
includes: [testAtomics.js]
features: [Atomics, BigInt, SharedArrayBuffer, TypedArray, ArrayBuffer, DataView, let, arrow-function, for-of, Atomics, BigInt, SharedArrayBuffer, TypedArray]
---*/
const TIMEOUT = 2000;
const TIMEOUT = 200;
const i64a = new BigInt64Array(
new SharedArrayBuffer(BigInt64Array.BYTES_PER_ELEMENT)
new SharedArrayBuffer(BigInt64Array.BYTES_PER_ELEMENT * 8)
);
$262.agent.start(`
@ -25,7 +25,7 @@ $262.agent.start(`
`);
$262.agent.broadcast(i64a.buffer);
$262.agent.sleep(100);
$262.agent.sleep(10);
Atomics.or(i64a, 0, 1);

View File

@ -8,9 +8,9 @@ description: >
includes: [testAtomics.js]
features: [Atomics, BigInt, SharedArrayBuffer, TypedArray, ArrayBuffer, DataView, let, arrow-function, for-of, Atomics, BigInt, SharedArrayBuffer, TypedArray]
---*/
const TIMEOUT = 2000;
const TIMEOUT = 200;
const i64a = new BigInt64Array(
new SharedArrayBuffer(BigInt64Array.BYTES_PER_ELEMENT)
new SharedArrayBuffer(BigInt64Array.BYTES_PER_ELEMENT * 8)
);
$262.agent.start(`
@ -25,7 +25,7 @@ $262.agent.start(`
`);
$262.agent.broadcast(i64a.buffer);
$262.agent.sleep(100);
$262.agent.sleep(10);
Atomics.store(i64a, 0, 0x111111);

View File

@ -8,9 +8,9 @@ description: >
includes: [testAtomics.js]
features: [Atomics, BigInt, SharedArrayBuffer, TypedArray, ArrayBuffer, DataView, let, arrow-function, for-of, Atomics, BigInt, SharedArrayBuffer, TypedArray]
---*/
const TIMEOUT = 2000;
const TIMEOUT = 200;
const i64a = new BigInt64Array(
new SharedArrayBuffer(BigInt64Array.BYTES_PER_ELEMENT)
new SharedArrayBuffer(BigInt64Array.BYTES_PER_ELEMENT * 8)
);
$262.agent.start(`
@ -25,7 +25,7 @@ $262.agent.start(`
`);
$262.agent.broadcast(i64a.buffer);
$262.agent.sleep(100);
$262.agent.sleep(10);
Atomics.sub(i64a, 0, 1);

View File

@ -8,9 +8,9 @@ description: >
includes: [testAtomics.js]
features: [Atomics, BigInt, SharedArrayBuffer, TypedArray, ArrayBuffer, DataView, let, arrow-function, for-of, Atomics, BigInt, SharedArrayBuffer, TypedArray]
---*/
const TIMEOUT = 2000;
const TIMEOUT = 200;
const i64a = new BigInt64Array(
new SharedArrayBuffer(BigInt64Array.BYTES_PER_ELEMENT)
new SharedArrayBuffer(BigInt64Array.BYTES_PER_ELEMENT * 8)
);
$262.agent.start(`
@ -25,7 +25,7 @@ $262.agent.start(`
`);
$262.agent.broadcast(i64a.buffer);
$262.agent.sleep(100);
$262.agent.sleep(10);
Atomics.xor(i64a, 0, 1);

View File

@ -26,7 +26,7 @@ features: [ArrayBuffer, Atomics, BigInt, TypedArray]
---*/
const i64a = new BigInt64Array(
new SharedArrayBuffer(BigInt64Array.BYTES_PER_ELEMENT)
new SharedArrayBuffer(BigInt64Array.BYTES_PER_ELEMENT * 8)
);
const poisoned = {
valueOf: function() {

View File

@ -17,7 +17,7 @@ features: [Atomics, BigInt, SharedArrayBuffer, TypedArray]
---*/
const i64a = new BigInt64Array(
new SharedArrayBuffer(BigInt64Array.BYTES_PER_ELEMENT)
new SharedArrayBuffer(BigInt64Array.BYTES_PER_ELEMENT * 8)
);
const poisoned = {

View File

@ -31,7 +31,7 @@ $262.agent.start(`
`);
const i64a = new BigInt64Array(
new SharedArrayBuffer(BigInt64Array.BYTES_PER_ELEMENT)
new SharedArrayBuffer(BigInt64Array.BYTES_PER_ELEMENT * 8)
);
$262.agent.broadcast(i64a.buffer);

View File

@ -27,8 +27,7 @@ $262.agent.start(`
const i64a = new BigInt64Array(sab);
// Wait on index 0
Atomics.wait(i64a, 0, 0, 200);
$262.agent.report(0);
$262.agent.report(Atomics.wait(i64a, 0, 0, Infinity));
$262.agent.leaving();
});
`);
@ -37,25 +36,32 @@ $262.agent.start(`
$262.agent.receiveBroadcast(function(sab) {
const i64a = new BigInt64Array(sab);
// Wait on index 2
Atomics.wait(i64a, 2, 0, 200);
$262.agent.report(2);
// Wait on index 7
$262.agent.report(Atomics.wait(i64a, 7, 0, Infinity));
$262.agent.leaving();
});
`);
const i64a = new BigInt64Array(
new SharedArrayBuffer(4 * BigInt64Array.BYTES_PER_ELEMENT)
new SharedArrayBuffer(BigInt64Array.BYTES_PER_ELEMENT * 8)
);
$262.agent.broadcast(i64a.buffer);
$262.agent.sleep(10);
// Wake index 2
Atomics.wake(i64a, 2, 1);
assert.sameValue(getReport(), '2');
// Wake index 1, wakes nothing
assert.sameValue(Atomics.wake(i64a, 1), 0, 'Atomics.wake(i64a, 1) returns 0');
// Wake index 3, wakes nothing
assert.sameValue(Atomics.wake(i64a, 3), 0, 'Atomics.wake(i64a, 3) returns 0');
// Wake index 4, wakes nothing
assert.sameValue(Atomics.wake(i64a, 4), 0, 'Atomics.wake(i64a, 4) returns 0');
// Wake index 5, wakes nothing
assert.sameValue(Atomics.wake(i64a, 5), 0, 'Atomics.wake(i64a, 5) returns 0');
// Wake index 0
Atomics.wake(i64a, 0, 1);
assert.sameValue(getReport(), '0');
// Wake index 7, wakes 1
assert.sameValue(Atomics.wake(i64a, 7), 1, 'Atomics.wake(i64a, 7) returns 1');
assert.sameValue(getReport(), 'ok', 'getReport() returns "ok"');
// Wake index 0, wakes 1
assert.sameValue(Atomics.wake(i64a, 0), 1, 'Atomics.wake(i64a, 0) returns 1');
assert.sameValue(getReport(), 'ok', 'getReport() returns "ok"');

View File

@ -54,7 +54,7 @@ $262.agent.start(`
const i64a = new BigInt64Array(
new SharedArrayBuffer(4 * BigInt64Array.BYTES_PER_ELEMENT)
new SharedArrayBuffer(BigInt64Array.BYTES_PER_ELEMENT * 8)
);
$262.agent.broadcast(i64a.buffer);

View File

@ -37,7 +37,7 @@ $262.agent.start(`
`);
const i64a = new BigInt64Array(
new SharedArrayBuffer(BigInt64Array.BYTES_PER_ELEMENT)
new SharedArrayBuffer(BigInt64Array.BYTES_PER_ELEMENT * 8)
);
$262.agent.broadcast(i64a.buffer);

View File

@ -19,7 +19,7 @@ flags: [CanBlockIsFalse]
---*/
const i32a = new Int32Array(
new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT)
new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT * 4)
);
assert.throws(TypeError, function() {

View File

@ -41,7 +41,7 @@ $262.agent.start(`
`);
const i32a = new Int32Array(
new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT)
new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT * 4)
);
$262.agent.broadcast(i32a.buffer);

View File

@ -17,7 +17,7 @@ flags: [CanBlockIsFalse]
---*/
const i32a = new Int32Array(
new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT)
new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT * 4)
);
const valueOf = {

View File

@ -26,7 +26,7 @@ $262.agent.start(`
`);
const i32a = new Int32Array(
new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT)
new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT * 4)
);
$262.agent.broadcast(i32a.buffer);

View File

@ -19,7 +19,7 @@ features: [Atomics, SharedArrayBuffer, TypedArray]
---*/
const i32a = new Int32Array(
new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT)
new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT * 4)
);
const poisoned = {

View File

@ -18,7 +18,7 @@ $262.agent.start(`
`);
const i32a = new Int32Array(
new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT)
new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT * 4)
);
$262.agent.broadcast(i32a.buffer);

View File

@ -10,7 +10,7 @@ flags: [CanBlockIsFalse]
---*/
const i32a = new Int32Array(
new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT)
new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT * 4)
);
assert.sameValue(Atomics.wait(i32a, 0, 0, -1), "timed-out");

View File

@ -9,9 +9,9 @@ includes: [atomicsHelper.js]
features: [ArrayBuffer, DataView, let, arrow-function, for-of, Atomics, BigInt, SharedArrayBuffer, TypedArray]
---*/
const TIMEOUT = 2000;
const TIMEOUT = 200;
const i32a = new Int32Array(
new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT)
new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT * 4)
);
$262.agent.start(`
@ -26,7 +26,7 @@ $262.agent.start(`
`);
$262.agent.broadcast(i32a.buffer);
$262.agent.sleep(100);
$262.agent.sleep(10);
Atomics.add(i32a, 0, 1);

View File

@ -9,9 +9,9 @@ includes: [atomicsHelper.js]
features: [Atomics, SharedArrayBuffer, TypedArray]
---*/
const TIMEOUT = 2000;
const TIMEOUT = 200;
const i32a = new Int32Array(
new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT)
new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT * 4)
);
$262.agent.start(`
@ -26,7 +26,7 @@ $262.agent.start(`
`);
$262.agent.broadcast(i32a.buffer);
$262.agent.sleep(100);
$262.agent.sleep(10);
Atomics.and(i32a, 0, 1);

View File

@ -9,9 +9,9 @@ includes: [atomicsHelper.js]
features: [Atomics, SharedArrayBuffer, TypedArray]
---*/
const TIMEOUT = 2000;
const TIMEOUT = 200;
const i32a = new Int32Array(
new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT)
new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT * 4)
);
$262.agent.start(`
@ -26,7 +26,7 @@ $262.agent.start(`
`);
$262.agent.broadcast(i32a.buffer);
$262.agent.sleep(100);
$262.agent.sleep(10);
Atomics.compareExchange(i32a, 0, 0, 1);

View File

@ -9,9 +9,9 @@ includes: [atomicsHelper.js]
features: [Atomics, SharedArrayBuffer, TypedArray]
---*/
const TIMEOUT = 2000;
const TIMEOUT = 200;
const i32a = new Int32Array(
new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT)
new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT * 4)
);
$262.agent.start(`
@ -26,7 +26,7 @@ $262.agent.start(`
`);
$262.agent.broadcast(i32a.buffer);
$262.agent.sleep(100);
$262.agent.sleep(10);
Atomics.exchange(i32a, 0, 1);

View File

@ -9,9 +9,9 @@ includes: [atomicsHelper.js]
features: [Atomics, SharedArrayBuffer, TypedArray]
---*/
const TIMEOUT = 2000;
const TIMEOUT = 200;
const i32a = new Int32Array(
new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT)
new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT * 4)
);
$262.agent.start(`
@ -26,7 +26,7 @@ $262.agent.start(`
`);
$262.agent.broadcast(i32a.buffer);
$262.agent.sleep(100);
$262.agent.sleep(10);
Atomics.or(i32a, 0, 1);

View File

@ -9,9 +9,9 @@ includes: [atomicsHelper.js]
features: [Atomics, SharedArrayBuffer, TypedArray]
---*/
const TIMEOUT = 2000;
const TIMEOUT = 200;
const i32a = new Int32Array(
new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT)
new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT * 4)
);
$262.agent.start(`
@ -26,7 +26,7 @@ $262.agent.start(`
`);
$262.agent.broadcast(i32a.buffer);
$262.agent.sleep(100);
$262.agent.sleep(10);
Atomics.store(i32a, 0, 0x111111);

View File

@ -9,9 +9,9 @@ includes: [atomicsHelper.js]
features: [Atomics, SharedArrayBuffer, TypedArray]
---*/
const TIMEOUT = 2000;
const TIMEOUT = 200;
const i32a = new Int32Array(
new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT)
new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT * 4)
);
$262.agent.start(`
@ -26,7 +26,7 @@ $262.agent.start(`
`);
$262.agent.broadcast(i32a.buffer);
$262.agent.sleep(100);
$262.agent.sleep(10);
Atomics.sub(i32a, 0, 1);

View File

@ -9,9 +9,9 @@ includes: [atomicsHelper.js]
features: [Atomics, SharedArrayBuffer, TypedArray]
---*/
const TIMEOUT = 2000;
const TIMEOUT = 200;
const i32a = new Int32Array(
new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT)
new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT * 4)
);
$262.agent.start(`
@ -26,7 +26,7 @@ $262.agent.start(`
`);
$262.agent.broadcast(i32a.buffer);
$262.agent.sleep(100);
$262.agent.sleep(10);
Atomics.xor(i32a, 0, 1);

View File

@ -17,7 +17,7 @@ features: [ArrayBuffer, Atomics, TypedArray]
---*/
const i32a = new Int32Array(
new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT)
new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT * 4)
);
const poisoned = {

View File

@ -41,7 +41,7 @@ $262.agent.start(`
`);
const i32a = new Int32Array(
new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT)
new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT * 4)
);
$262.agent.broadcast(i32a.buffer);

View File

@ -17,7 +17,7 @@ flags: [CanBlockIsFalse]
---*/
const i32a = new Int32Array(
new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT)
new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT * 4)
);
const valueOf = {

View File

@ -46,7 +46,7 @@ $262.agent.start(`
`);
const i32a = new Int32Array(
new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT)
new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT * 4)
);
$262.agent.broadcast(i32a.buffer);

View File

@ -21,7 +21,7 @@ flags: [CanBlockIsFalse]
---*/
const i32a = new Int32Array(
new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT)
new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT * 4)
);
const valueOf = {

View File

@ -17,7 +17,7 @@ features: [Atomics, SharedArrayBuffer, TypedArray]
---*/
const i32a = new Int32Array(
new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT)
new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT * 4)
);
const poisoned = {
@ -30,7 +30,10 @@ assert.throws(RangeError, function() {
Atomics.wait(i32a, Infinity, poisoned, poisoned);
});
assert.throws(RangeError, function() {
Atomics.wait(i32a, 2, poisoned, poisoned);
Atomics.wait(i32a, -1, poisoned, poisoned);
});
assert.throws(RangeError, function() {
Atomics.wait(i32a, 4, poisoned, poisoned);
});
assert.throws(RangeError, function() {
Atomics.wait(i32a, 200, poisoned, poisoned);

View File

@ -48,7 +48,7 @@ $262.agent.start(`
`);
const i32a = new Int32Array(
new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT)
new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT * 4)
);
$262.agent.broadcast(i32a.buffer);

View File

@ -19,7 +19,7 @@ features: [Atomics, SharedArrayBuffer, Symbol, Symbol.toPrimitive, TypedArray]
---*/
const i32a = new Int32Array(
new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT)
new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT * 4)
);
const poisonedValueOf = {

View File

@ -61,7 +61,7 @@ $262.agent.start(`
`);
const i32a = new Int32Array(
new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT)
new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT * 4)
);
$262.agent.broadcast(i32a.buffer);

View File

@ -29,7 +29,7 @@ features: [Atomics, SharedArrayBuffer, Symbol, Symbol.toPrimitive, TypedArray]
---*/
const i32a = new Int32Array(
new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT)
new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT * 4)
);
const poisonedValueOf = {

View File

@ -35,7 +35,7 @@ $262.agent.start(`
`);
const i32a = new Int32Array(
new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT)
new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT * 4)
);
$262.agent.broadcast(i32a.buffer);

View File

@ -52,7 +52,7 @@ $262.agent.start(`
`);
const i32a = new Int32Array(
new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT)
new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT * 4)
);
$262.agent.broadcast(i32a.buffer);

View File

@ -20,7 +20,7 @@ features: [Atomics, SharedArrayBuffer, Symbol, Symbol.toPrimitive, TypedArray]
---*/
const i32a = new Int32Array(
new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT)
new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT * 4)
);
const poisonedValueOf = {

View File

@ -41,7 +41,7 @@ $262.agent.start(`
`);
const i32a = new Int32Array(
new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT)
new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT * 4)
);
$262.agent.broadcast(i32a.buffer);

View File

@ -17,7 +17,7 @@ flags: [CanBlockIsFalse]
---*/
const i32a = new Int32Array(
new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT)
new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT * 4)
);
const valueOf = {

View File

@ -29,8 +29,7 @@ $262.agent.start(`
});
`);
$262.agent.start(
`
$262.agent.start(`
$262.agent.receiveBroadcast(function(sab) {
var i32a = new Int32Array(sab);
$262.agent.report("B " + Atomics.wait(i32a, 0, 0)); // undefined timeout arg => NaN => +Infinity
@ -39,7 +38,7 @@ $262.agent.start(
`);
const i32a = new Int32Array(
new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT)
new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT * 4)
);
$262.agent.broadcast(i32a.buffer);

View File

@ -31,7 +31,7 @@ $262.agent.start(`
`);
const i32a = new Int32Array(
new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT)
new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT * 4)
);
$262.agent.broadcast(i32a.buffer);

View File

@ -31,7 +31,7 @@ $262.agent.start(`
`);
const i32a = new Int32Array(
new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT)
new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT * 4)
);
$262.agent.broadcast(i32a.buffer);

View File

@ -27,7 +27,7 @@ $262.agent.start(`
`);
const i32a = new Int32Array(
new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT)
new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT * 4)
);
$262.agent.broadcast(i32a.buffer);

View File

@ -55,7 +55,7 @@ $262.agent.start(`
const i32a = new Int32Array(
new SharedArrayBuffer(4 * Int32Array.BYTES_PER_ELEMENT)
new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT * 4)
);
$262.agent.broadcast(i32a.buffer);

View File

@ -37,7 +37,7 @@ $262.agent.start(`
`);
const i32a = new Int32Array(
new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT)
new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT * 4)
);
$262.agent.broadcast(i32a.buffer);

View File

@ -16,7 +16,7 @@ features: [ArrayBuffer, arrow-function, Atomics, DataView, for-of, let, SharedAr
---*/
const i32a = new Int32Array(
new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT)
new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT * 4)
);
testWithAtomicsOutOfBoundsIndices(function(IdxGen) {

View File

@ -16,7 +16,7 @@ features: [ArrayBuffer, arrow-function, Atomics, BigInt, DataView, for-of, let,
---*/
const i64a = new BigInt64Array(
new SharedArrayBuffer(BigInt64Array.BYTES_PER_ELEMENT)
new SharedArrayBuffer(BigInt64Array.BYTES_PER_ELEMENT * 8)
);
testWithAtomicsOutOfBoundsIndices(function(IdxGen) {

View File

@ -17,7 +17,7 @@ features: [ArrayBuffer, Atomics, BigInt, TypedArray]
---*/
const i64a = new BigInt64Array(
new SharedArrayBuffer(BigInt64Array.BYTES_PER_ELEMENT)
new SharedArrayBuffer(BigInt64Array.BYTES_PER_ELEMENT * 8)
);
const poisoned = {
valueOf: function() {

View File

@ -26,7 +26,7 @@ features: [Atomics, SharedArrayBuffer, TypedArray]
---*/
const i32a = new Int32Array(
new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT)
new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT * 4)
);
assert.sameValue(

View File

@ -52,7 +52,7 @@ $262.agent.start(`
`);
const i32a = new Int32Array(
new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT)
new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT * 4)
);
$262.agent.broadcast(i32a.buffer);

View File

@ -50,7 +50,7 @@ $262.agent.start(`
`);
const i32a = new Int32Array(
new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT)
new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT * 4)
);
$262.agent.broadcast(i32a.buffer);

View File

@ -25,7 +25,7 @@ features: [Atomics, SharedArrayBuffer, TypedArray]
---*/
const i32a = new Int32Array(
new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT)
new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT * 4)
);
NaNs.forEach(nan => {

View File

@ -18,7 +18,7 @@ features: [Atomics, SharedArrayBuffer, TypedArray]
---*/
const i32a = new Int32Array(
new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT)
new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT * 4)
);
assert.throws(TypeError, function() {

View File

@ -18,7 +18,7 @@ features: [Atomics, SharedArrayBuffer, TypedArray]
---*/
const i32a = new Int32Array(
new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT)
new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT * 4)
);
const poisoned = {

View File

@ -18,7 +18,7 @@ $262.agent.start(`
`);
const i32a = new Int32Array(
new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT)
new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT * 4)
);
$262.agent.broadcast(i32a.buffer);

View File

@ -17,7 +17,7 @@ features: [Atomics, SharedArrayBuffer, TypedArray]
---*/
const i32a = new Int32Array(
new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT)
new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT * 4)
);
const poisoned = {

View File

@ -17,7 +17,7 @@ features: [ArrayBuffer, Atomics, TypedArray]
---*/
const i32a = new Int32Array(
new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT)
new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT * 4)
);
const poisoned = {

View File

@ -17,7 +17,7 @@ features: [Atomics, SharedArrayBuffer, TypedArray]
---*/
const i32a = new Int32Array(
new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT)
new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT * 4)
);
var poisoned = {

View File

@ -29,7 +29,7 @@ features: [Atomics, SharedArrayBuffer, Symbol, Symbol.toPrimitive, TypedArray]
---*/
const i32a = new Int32Array(
new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT)
new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT * 4)
);
const poisonedValueOf = {

View File

@ -39,7 +39,7 @@ $262.agent.start(`
`);
const i32a = new Int32Array(
new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT)
new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT * 4)
);
$262.agent.broadcast(i32a.buffer);

View File

@ -18,7 +18,7 @@ $262.agent.start(`
`);
const i32a = new Int32Array(
new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT)
new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT * 4)
);
$262.agent.broadcast(i32a.buffer);

View File

@ -27,7 +27,7 @@ info: |
features: [Atomics, SharedArrayBuffer, TypedArray]
---*/
var buffer = new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT);
var buffer = new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT * 4);
var i32a = new Int32Array(buffer);
var initial = 0b00000001000000001000000010000001;
var update = 0b00000001111111111000000011111111;