Skip to content
Snippets Groups Projects
Commit feab96e6 authored by Rick Waldron's avatar Rick Waldron
Browse files

Atomics: ensure all SharedArrayBuffer sizes are uniform (r3)

parent d9084b98
No related branches found
No related tags found
No related merge requests found
Showing
with 25 additions and 26 deletions
......@@ -9,7 +9,7 @@ includes: [testAtomics.js, testTypedArray.js]
features: [ArrayBuffer, arrow-function, Atomics, DataView, for-of, let, SharedArrayBuffer, TypedArray]
---*/
var buffer = new SharedArrayBuffer(8);
var buffer = new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT * 2);
var views = intArrayConstructors.slice();
testWithTypedArrayConstructors(function(TA) {
......
......@@ -9,7 +9,7 @@ includes: [testAtomics.js, testBigIntTypedArray.js]
features: [ArrayBuffer, arrow-function, Atomics, BigInt, DataView, for-of, let, SharedArrayBuffer, TypedArray]
---*/
var buffer = new SharedArrayBuffer(8);
var buffer = new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT * 2);
testWithBigIntTypedArrayConstructors(function(TA) {
let view = new TA(buffer);
......
......@@ -9,7 +9,7 @@ includes: [testAtomics.js, testTypedArray.js]
features: [ArrayBuffer, arrow-function, Atomics, DataView, for-of, let, SharedArrayBuffer, TypedArray]
---*/
var buffer = new SharedArrayBuffer(8);
var buffer = new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT * 2);
var views = intArrayConstructors.slice();
testWithTypedArrayConstructors(function(TA) {
......
......@@ -9,7 +9,7 @@ includes: [testAtomics.js, testBigIntTypedArray.js]
features: [ArrayBuffer, arrow-function, Atomics, BigInt, DataView, for-of, let, SharedArrayBuffer, TypedArray]
---*/
var buffer = new SharedArrayBuffer(8);
var buffer = new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT * 2);
testWithBigIntTypedArrayConstructors(function(TA) {
let view = new TA(buffer);
......
......@@ -9,7 +9,7 @@ includes: [testAtomics.js, testTypedArray.js]
features: [ArrayBuffer, arrow-function, Atomics, DataView, for-of, let, SharedArrayBuffer, TypedArray]
---*/
var buffer = new SharedArrayBuffer(8);
var buffer = new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT * 2);
var views = intArrayConstructors.slice();
testWithTypedArrayConstructors(function(TA) {
......
......@@ -9,7 +9,7 @@ includes: [testAtomics.js, testBigIntTypedArray.js]
features: [ArrayBuffer, arrow-function, Atomics, BigInt, DataView, for-of, let, SharedArrayBuffer, TypedArray]
---*/
var buffer = new SharedArrayBuffer(8);
var buffer = new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT * 2);
testWithBigIntTypedArrayConstructors(function(TA) {
let view = new TA(buffer);
......
......@@ -9,7 +9,7 @@ includes: [testAtomics.js, testTypedArray.js]
features: [ArrayBuffer, arrow-function, Atomics, DataView, for-of, let, SharedArrayBuffer, TypedArray]
---*/
var buffer = new SharedArrayBuffer(8);
var buffer = new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT * 2);
var views = intArrayConstructors.slice();
testWithTypedArrayConstructors(function(TA) {
......
......@@ -9,7 +9,7 @@ includes: [testAtomics.js, testBigIntTypedArray.js]
features: [ArrayBuffer, arrow-function, Atomics, BigInt, DataView, for-of, let, SharedArrayBuffer, TypedArray]
---*/
var buffer = new SharedArrayBuffer(8);
var buffer = new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT * 2);
testWithBigIntTypedArrayConstructors(function(TA) {
let view = new TA(buffer);
......
......@@ -9,7 +9,7 @@ includes: [testAtomics.js, testTypedArray.js]
features: [ArrayBuffer, arrow-function, Atomics, DataView, for-of, let, SharedArrayBuffer, TypedArray]
---*/
var buffer = new SharedArrayBuffer(8);
var buffer = new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT * 2);
var views = intArrayConstructors.slice();
testWithTypedArrayConstructors(function(TA) {
......
......@@ -9,7 +9,7 @@ includes: [testAtomics.js, testBigIntTypedArray.js]
features: [ArrayBuffer, arrow-function, Atomics, BigInt, DataView, for-of, let, SharedArrayBuffer, TypedArray]
---*/
var buffer = new SharedArrayBuffer(8);
var buffer = new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT * 2);
testWithBigIntTypedArrayConstructors(function(TA) {
let view = new TA(buffer);
......
......@@ -9,7 +9,7 @@ includes: [testAtomics.js, testTypedArray.js]
features: [ArrayBuffer, arrow-function, Atomics, DataView, for-of, let, SharedArrayBuffer, TypedArray]
---*/
var buffer = new SharedArrayBuffer(8);
var buffer = new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT * 2);
var views = intArrayConstructors.slice();
testWithTypedArrayConstructors(function(TA) {
......
......@@ -9,7 +9,7 @@ includes: [testAtomics.js, testBigIntTypedArray.js]
features: [ArrayBuffer, arrow-function, Atomics, BigInt, DataView, for-of, let, SharedArrayBuffer, TypedArray]
---*/
var buffer = new SharedArrayBuffer(8);
var buffer = new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT * 2);
testWithBigIntTypedArrayConstructors(function(TA) {
let view = new TA(buffer);
......
......@@ -9,7 +9,7 @@ includes: [testAtomics.js, testTypedArray.js]
features: [ArrayBuffer, arrow-function, Atomics, DataView, for-of, let, SharedArrayBuffer, TypedArray]
---*/
var buffer = new SharedArrayBuffer(8);
var buffer = new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT * 2);
var views = intArrayConstructors.slice();
testWithTypedArrayConstructors(function(TA) {
......
......@@ -9,7 +9,7 @@ includes: [testAtomics.js, testBigIntTypedArray.js]
features: [ArrayBuffer, arrow-function, Atomics, BigInt, DataView, for-of, let, SharedArrayBuffer, TypedArray]
---*/
var buffer = new SharedArrayBuffer(8);
var buffer = new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT * 2);
testWithBigIntTypedArrayConstructors(function(TA) {
let view = new TA(buffer);
......
......@@ -9,7 +9,7 @@ includes: [testAtomics.js, testTypedArray.js]
features: [ArrayBuffer, arrow-function, Atomics, DataView, for-of, let, SharedArrayBuffer, TypedArray]
---*/
var buffer = new SharedArrayBuffer(8);
var buffer = new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT * 2);
var views = intArrayConstructors.slice();
testWithTypedArrayConstructors(function(TA) {
......
......@@ -9,7 +9,7 @@ includes: [testAtomics.js, testBigIntTypedArray.js]
features: [ArrayBuffer, arrow-function, Atomics, BigInt, DataView, for-of, let, SharedArrayBuffer, TypedArray]
---*/
var buffer = new SharedArrayBuffer(8);
var buffer = new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT * 2);
testWithBigIntTypedArrayConstructors(function(TA) {
let view = new TA(buffer);
......
......@@ -9,7 +9,7 @@ includes: [testAtomics.js, testTypedArray.js]
features: [ArrayBuffer, arrow-function, Atomics, DataView, for-of, let, SharedArrayBuffer, TypedArray]
---*/
var sab = new SharedArrayBuffer(8);
var sab = new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT * 2);
var views = intArrayConstructors.slice();
testWithTypedArrayConstructors(function(TA) {
......
......@@ -9,13 +9,12 @@ includes: [testAtomics.js, testBigIntTypedArray.js]
features: [ArrayBuffer, arrow-function, Atomics, BigInt, DataView, for-of, let, SharedArrayBuffer, TypedArray]
---*/
var sab = new SharedArrayBuffer(8);
const i64a = new BigInt64Array(
new SharedArrayBuffer(BigInt64Array.BYTES_PER_ELEMENT * 8)
);
testWithBigIntTypedArrayConstructors(function(TA) {
let view = new TA(sab);
testWithAtomicsOutOfBoundsIndices(function(IdxGen) {
assert.throws(RangeError, function() {
Atomics.xor(view, IdxGen(view), 0);
}, 'Atomics.xor(view, IdxGen(view), 0) throws RangeError');
});
testWithAtomicsOutOfBoundsIndices(function(IdxGen) {
assert.throws(RangeError, function() {
Atomics.xor(i64a, IdxGen(i64a), 0);
}, 'Atomics.xor(i64a, IdxGen(i64a), 0) throws RangeError');
});
......@@ -9,7 +9,7 @@ includes: [testBigIntTypedArray.js]
features: [ArrayBuffer, arrow-function, Atomics, BigInt, TypedArray]
---*/
var buffer = new ArrayBuffer(16);
var buffer = new ArrayBuffer(BigInt64Array.BYTES_PER_ELEMENT * 4);
testWithBigIntTypedArrayConstructors(function(TA) {
assert.throws(TypeError, function() {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment