diff --git a/test/built-ins/Atomics/notify/bigint/notify-all-on-loc.js b/test/built-ins/Atomics/notify/bigint/notify-all-on-loc.js index 937584979979dfb1927b192d6e633de4479cc016..790d099c5fd1c76c7f98ca5784416be593d2d509 100644 --- a/test/built-ins/Atomics/notify/bigint/notify-all-on-loc.js +++ b/test/built-ins/Atomics/notify/bigint/notify-all-on-loc.js @@ -22,6 +22,10 @@ const BUFFER_SIZE = 4; // `Atomics.notify`. const TIMEOUT = $262.agent.timeouts.long; +const i64a = new BigInt64Array( + new SharedArrayBuffer(BigInt64Array.BYTES_PER_ELEMENT * BUFFER_SIZE) +); + for (var i = 0; i < NUMAGENT; i++) { $262.agent.start(` $262.agent.receiveBroadcast(function(sab) { @@ -53,10 +57,6 @@ $262.agent.start(` }); `); -const i64a = new BigInt64Array( - new SharedArrayBuffer(BigInt64Array.BYTES_PER_ELEMENT * BUFFER_SIZE) -); - $262.agent.safeBroadcast(i64a); // Wait for agents to be running. diff --git a/test/built-ins/Atomics/wait/bigint/nan-for-timeout.js b/test/built-ins/Atomics/wait/bigint/nan-for-timeout.js index bc128b612f86bc39327a0736ff9f0f091338de87..f50a11ebf3f9edc70e99b65b2a59c14de2175c24 100644 --- a/test/built-ins/Atomics/wait/bigint/nan-for-timeout.js +++ b/test/built-ins/Atomics/wait/bigint/nan-for-timeout.js @@ -17,6 +17,10 @@ includes: [atomicsHelper.js] features: [Atomics, BigInt, SharedArrayBuffer, TypedArray] ---*/ +const i64a = new BigInt64Array( + new SharedArrayBuffer(BigInt64Array.BYTES_PER_ELEMENT * 4) +); + const RUNNING = 1; $262.agent.start(` @@ -29,10 +33,6 @@ $262.agent.start(` }); `); -const i64a = new BigInt64Array( - new SharedArrayBuffer(BigInt64Array.BYTES_PER_ELEMENT * 4) -); - $262.agent.safeBroadcast(i64a); $262.agent.waitUntil(i64a, RUNNING, 1n); diff --git a/test/built-ins/Atomics/wait/bigint/negative-timeout-agent.js b/test/built-ins/Atomics/wait/bigint/negative-timeout-agent.js index a0799b212040b7e38ab72ca17ea28dccaf06a4e7..8c9346bd9cd909522a6fb8fe00ef76fa5d8088bd 100644 --- a/test/built-ins/Atomics/wait/bigint/negative-timeout-agent.js +++ b/test/built-ins/Atomics/wait/bigint/negative-timeout-agent.js @@ -9,6 +9,10 @@ includes: [atomicsHelper.js] features: [Atomics, BigInt, SharedArrayBuffer, TypedArray] ---*/ +const i64a = new BigInt64Array( + new SharedArrayBuffer(BigInt64Array.BYTES_PER_ELEMENT * 4) +); + const RUNNING = 1; $262.agent.start(` @@ -21,10 +25,6 @@ $262.agent.start(` }); `); -const i64a = new BigInt64Array( - new SharedArrayBuffer(BigInt64Array.BYTES_PER_ELEMENT * 4) -); - $262.agent.safeBroadcast(i64a); $262.agent.waitUntil(i64a, RUNNING, 1n); diff --git a/test/built-ins/Atomics/wait/bigint/value-not-equal.js b/test/built-ins/Atomics/wait/bigint/value-not-equal.js index 1c48790c7f3b642a235a3c94e9a541148f5960af..d23f3bead541c5dabacd64cd618f9167671d06a0 100644 --- a/test/built-ins/Atomics/wait/bigint/value-not-equal.js +++ b/test/built-ins/Atomics/wait/bigint/value-not-equal.js @@ -19,9 +19,12 @@ features: [Atomics, BigInt, SharedArrayBuffer, TypedArray] ---*/ const RUNNING = 1; - const value = "42n"; +const i64a = new BigInt64Array( + new SharedArrayBuffer(BigInt64Array.BYTES_PER_ELEMENT * 4) +); + $262.agent.start(` $262.agent.receiveBroadcast(function(sab) { const i64a = new BigInt64Array(sab); @@ -33,10 +36,6 @@ $262.agent.start(` }); `); -const i64a = new BigInt64Array( - new SharedArrayBuffer(BigInt64Array.BYTES_PER_ELEMENT * 4) -); - // NB: We don't actually explicitly need to wait for the agent to start in this // test case, we only do it for consistency with other test cases which do // require the main agent to wait and yield control. diff --git a/test/built-ins/Atomics/wait/bigint/waiterlist-block-indexedposition-wake.js b/test/built-ins/Atomics/wait/bigint/waiterlist-block-indexedposition-wake.js index 5b700cb57f7fe7b7a96a18e222e8460026c29365..6f9c7c678ce64665cc192c4542e264f0dd94d957 100644 --- a/test/built-ins/Atomics/wait/bigint/waiterlist-block-indexedposition-wake.js +++ b/test/built-ins/Atomics/wait/bigint/waiterlist-block-indexedposition-wake.js @@ -25,6 +25,10 @@ features: [Atomics, BigInt, SharedArrayBuffer, TypedArray] var NUMAGENT = 2; var RUNNING = 4; +const i64a = new BigInt64Array( + new SharedArrayBuffer(BigInt64Array.BYTES_PER_ELEMENT * 5) +); + $262.agent.start(` $262.agent.receiveBroadcast(function(sab) { const i64a = new BigInt64Array(sab); @@ -47,10 +51,6 @@ $262.agent.start(` }); `); -const i64a = new BigInt64Array( - new SharedArrayBuffer(BigInt64Array.BYTES_PER_ELEMENT * 5) -); - $262.agent.safeBroadcast(i64a); // Wait until all agents started. diff --git a/test/built-ins/Atomics/wait/bigint/waiterlist-order-of-operations-is-fifo.js b/test/built-ins/Atomics/wait/bigint/waiterlist-order-of-operations-is-fifo.js index 5eb18a5b56bcde8e29d70e2486cd5997cd5a987a..bebe05a0b9c2f98bf37301759e1129d96c74b49e 100644 --- a/test/built-ins/Atomics/wait/bigint/waiterlist-order-of-operations-is-fifo.js +++ b/test/built-ins/Atomics/wait/bigint/waiterlist-order-of-operations-is-fifo.js @@ -16,11 +16,14 @@ includes: [atomicsHelper.js] features: [Atomics, BigInt, SharedArrayBuffer, TypedArray] ---*/ -var NUMAGENT = 3; - var WAIT_INDEX = 0; var RUNNING = 1; var LOCK_INDEX = 2; +var NUMAGENT = 3; + +const i64a = new BigInt64Array( + new SharedArrayBuffer(BigInt64Array.BYTES_PER_ELEMENT * 4) +); for (var i = 0; i < NUMAGENT; i++) { var agentNum = i; @@ -50,10 +53,6 @@ for (var i = 0; i < NUMAGENT; i++) { `); } -const i64a = new BigInt64Array( - new SharedArrayBuffer(BigInt64Array.BYTES_PER_ELEMENT * 4) -); - $262.agent.safeBroadcast(i64a); // Wait until all agents started. diff --git a/test/built-ins/Atomics/wait/bigint/was-woken-before-timeout.js b/test/built-ins/Atomics/wait/bigint/was-woken-before-timeout.js index 98a3e2319a4d4ffb8bfd2f7494d25b13b976d2f8..9359ebe34d992af87c1c82589744e0ea0f4e878c 100644 --- a/test/built-ins/Atomics/wait/bigint/was-woken-before-timeout.js +++ b/test/built-ins/Atomics/wait/bigint/was-woken-before-timeout.js @@ -25,6 +25,10 @@ features: [Atomics, BigInt, SharedArrayBuffer, TypedArray] const RUNNING = 1; const TIMEOUT = $262.agent.timeouts.huge; +const i64a = new BigInt64Array( + new SharedArrayBuffer(BigInt64Array.BYTES_PER_ELEMENT * 4) +); + $262.agent.start(` $262.agent.receiveBroadcast(function(sab) { const i64a = new BigInt64Array(sab); @@ -40,10 +44,6 @@ $262.agent.start(` }); `); -const i64a = new BigInt64Array( - new SharedArrayBuffer(BigInt64Array.BYTES_PER_ELEMENT * 4) -); - $262.agent.safeBroadcast(i64a); $262.agent.waitUntil(i64a, RUNNING, 1n);