Atomics: ensure all SharedArrayBuffer sizes are uniform (r3)

This commit is contained in:
Rick Waldron 2018-06-26 15:01:53 -04:00
parent d9084b98e7
commit feab96e601
19 changed files with 25 additions and 26 deletions

View File

@ -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) {

View File

@ -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);

View File

@ -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) {

View File

@ -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);

View File

@ -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) {

View File

@ -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);

View File

@ -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) {

View File

@ -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);

View File

@ -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) {

View File

@ -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);

View File

@ -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) {

View File

@ -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);

View File

@ -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) {

View File

@ -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);

View File

@ -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) {

View File

@ -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);

View File

@ -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) {

View File

@ -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');
});

View File

@ -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() {