Bug 1496297 - Use |jit-test| skip-if as appropriate in jit-test/tests/atomics/ (r=jorendorff)
authorEric Faust <efausbmo@gmail.com>
Tue, 09 Oct 2018 15:41:50 -0700
changeset 496127 6112cec4211f0bae17f06dab23d951e05d2deebd
parent 496126 9da32b3fe7051f57ea7ea8d516170639f3951964
child 496128 f6a61c3b3dbb8609c91c2aced93f8ce89b20a33f
push id9984
push userffxbld-merge
push dateMon, 15 Oct 2018 21:07:35 +0000
treeherdermozilla-beta@183d27ea8570 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjorendorff
bugs1496297
milestone64.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1496297 - Use |jit-test| skip-if as appropriate in jit-test/tests/atomics/ (r=jorendorff)
js/src/jit-test/tests/atomics/basic-tests.js
js/src/jit-test/tests/atomics/directives.txt
js/src/jit-test/tests/atomics/inline-add.js
js/src/jit-test/tests/atomics/inline-add2.js
js/src/jit-test/tests/atomics/inline-cmpxchg.js
js/src/jit-test/tests/atomics/mutual-exclusion.js
js/src/jit-test/tests/atomics/optimization-tests.js
js/src/jit-test/tests/atomics/store-does-not-truncate-returnval.js
--- a/js/src/jit-test/tests/atomics/basic-tests.js
+++ b/js/src/jit-test/tests/atomics/basic-tests.js
@@ -555,10 +555,9 @@ function runTests() {
     // Misc
     testIsLockFree();
     testIsLockFree2();
     testWeirdIndices();
 
     assertEq(Atomics[Symbol.toStringTag], "Atomics");
 }
 
-if (this.Atomics && this.SharedArrayBuffer)
-    runTests();
+runTests();
new file mode 100644
--- /dev/null
+++ b/js/src/jit-test/tests/atomics/directives.txt
@@ -0,0 +1,1 @@
+|jit-test| skip-if: !this.SharedArrayBuffer || !this.Atomics
--- a/js/src/jit-test/tests/atomics/inline-add.js
+++ b/js/src/jit-test/tests/atomics/inline-add.js
@@ -13,19 +13,16 @@ function add(ta) {
     var x = ta[0];
     Atomics.add(ta, 86, 6);
     var y = ta[1];
     var z = y + 1;
     var w = x + z;
     return w;
 }
 
-if (!this.SharedArrayBuffer || !this.Atomics)
-    quit(0);
-
 var sab = new SharedArrayBuffer(4096);
 var ia = new Int32Array(sab);
 for ( var i=0, limit=ia.length ; i < limit ; i++ )
     ia[i] = 37;
 var v = 0;
 for ( var i=0 ; i < 1000 ; i++ )
     v += add(ia);
 //print(v);
--- a/js/src/jit-test/tests/atomics/inline-add2.js
+++ b/js/src/jit-test/tests/atomics/inline-add2.js
@@ -13,19 +13,16 @@
 //  - loads and stores are not moved across the add
 //
 // Be sure to run with --ion-eager --ion-offthread-compile=off.
 
 function add(ta) {
     return Atomics.add(ta, 86, 6);
 }
 
-if (!this.SharedArrayBuffer || !this.Atomics)
-    quit(0);
-
 var sab = new SharedArrayBuffer(4096);
 var ia = new Uint32Array(sab);
 for ( var i=0, limit=ia.length ; i < limit ; i++ )
     ia[i] = 0xdeadbeef;		// Important: Not an int32-capable value
 var v = 0;
 for ( var i=0 ; i < 1000 ; i++ )
     v += add(ia);
 //print(v);
--- a/js/src/jit-test/tests/atomics/inline-cmpxchg.js
+++ b/js/src/jit-test/tests/atomics/inline-cmpxchg.js
@@ -13,19 +13,16 @@ function cmpxchg(ta) {
     var x = ta[0];
     Atomics.compareExchange(ta, 86, 37, 42);
     var y = ta[1];
     var z = y + 1;
     var w = x + z;
     return w;
 }
 
-if (!this.SharedArrayBuffer || !this.Atomics)
-    quit(0);
-
 var sab = new SharedArrayBuffer(4096);
 var ia = new Int32Array(sab);
 for ( var i=0, limit=ia.length ; i < limit ; i++ )
     ia[i] = 37;
 var v = 0;
 for ( var i=0 ; i < 1000 ; i++ )
     v += cmpxchg(ia);
 //print(v);
--- a/js/src/jit-test/tests/atomics/mutual-exclusion.js
+++ b/js/src/jit-test/tests/atomics/mutual-exclusion.js
@@ -1,23 +1,14 @@
+// |jit-test| skip-if: helperThreadCount() === 0
+
 // Let a few threads hammer on memory with atomics to provoke errors
 // in exclusion work.  This test is not 100% fail-safe: the test may
 // pass despite a bug, but this is unlikely.
 
-if (!(this.SharedArrayBuffer && this.getSharedObject && this.setSharedObject && this.evalInWorker))
-    quit(0);
-
-try {
-    // This will fail with --no-threads.
-    evalInWorker("37");
-}
-catch (e) {
-    quit(0);
-}
-
 // Map an Int32Array on shared memory.  The first location is used as
 // a counter, each worker counts up on exit and the main thread will
 // wait until the counter reaches the number of workers.  The other
 // elements are contended accumulators where we count up and down very
 // rapidly and for a long time, any failure in mutual exclusion should
 // lead to errors in the result.  (For example, the test fails almost
 // immediately when I disable simulation of mutual exclusion in the
 // ARM simulator.)
--- a/js/src/jit-test/tests/atomics/optimization-tests.js
+++ b/js/src/jit-test/tests/atomics/optimization-tests.js
@@ -6,19 +6,16 @@
 // It's useful to look at the code generated for this test with -D to
 // the JS shell.
 //
 // Bug 1138348 - unconstrained use of byte registers on x64
 // Bug 1077014 - code generation for Atomic operations for effect,
 //               all platforms
 // Bug 1141121 - immediate operand in atomic operations on x86/x64
 
-if (!(this.Atomics && this.SharedArrayBuffer))
-    quit(0);
-
 var sum = 0;
 
 function f(ia, k) {
     // For effect, variable value.  The generated code on x86/x64
     // should be one LOCK ADDB.  (On ARM, there should be no
     // sign-extend of the current value in the cell, otherwise this is
     // still a LDREX/STREX loop.)
     Atomics.add(ia, 0, k);
--- a/js/src/jit-test/tests/atomics/store-does-not-truncate-returnval.js
+++ b/js/src/jit-test/tests/atomics/store-does-not-truncate-returnval.js
@@ -1,11 +1,8 @@
-if (!this.SharedArrayBuffer)
-    quit(0);
-
 var ia = new Int32Array(new SharedArrayBuffer(4));
 
 // Atomics.store() returns the input value converted to integer as if
 // by ToInteger.
 //
 // JIT and interpreter have different paths here, so loop a little to
 // trigger the JIT properly.