Bug 1496297 - Use |jit-test| skip-if as appropriate in jit-test/tests/sharedbuf/ (r=jorendorff)
authorEric Faust <efausbmo@gmail.com>
Tue, 09 Oct 2018 15:41:50 -0700
changeset 498842 ca4e8e9425aeb3545b3c3788a953fcd93359e26a
parent 498841 085483ce64fefc6564581ed67f706471a8aa0a47
child 498843 0fb70553886a17318a1ef26a5b0ffc063ed4b9ae
push id1864
push userffxbld-merge
push dateMon, 03 Dec 2018 15:51:40 +0000
treeherdermozilla-release@f040763d99ad [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/sharedbuf/ (r=jorendorff)
js/src/jit-test/tests/sharedbuf/asm-link.js
js/src/jit-test/tests/sharedbuf/byteLength.js
js/src/jit-test/tests/sharedbuf/gc-one-view.js
js/src/jit-test/tests/sharedbuf/gc-two-views.js
js/src/jit-test/tests/sharedbuf/inline-access.js
js/src/jit-test/tests/sharedbuf/is-zeroed.js
js/src/jit-test/tests/sharedbuf/sab-construct-noargs-1068458.js
js/src/jit-test/tests/sharedbuf/sab-gating.js
js/src/jit-test/tests/sharedbuf/slice-same-memory.js
js/src/jit-test/tests/sharedbuf/slice.js
js/src/jit-test/tests/sharedbuf/subtypes.js
js/src/jit-test/tests/sharedbuf/typedarray-from-sharedtypedarray-with-overridden-length.js
--- a/js/src/jit-test/tests/sharedbuf/asm-link.js
+++ b/js/src/jit-test/tests/sharedbuf/asm-link.js
@@ -1,15 +1,15 @@
+// |jit-test| skip-if: !this.SharedArrayBuffer
+
 // Don't assert on linking.
 // Provide superficial functionality.
 
 function $(stdlib, foreign, heap) {
     "use asm";
     var f64 = new stdlib.Float64Array(heap);
     function f() { var v=0.0; v=+f64[0]; return +v; }
     return f
 }
 
-if (this.SharedArrayBuffer) {
-    var heap = new SharedArrayBuffer(65536);
-    (new Float64Array(heap))[0] = 3.14159;
-    assertEq($(this, {}, heap)(), 3.14159);
-}
+var heap = new SharedArrayBuffer(65536);
+(new Float64Array(heap))[0] = 3.14159;
+assertEq($(this, {}, heap)(), 3.14159);
--- a/js/src/jit-test/tests/sharedbuf/byteLength.js
+++ b/js/src/jit-test/tests/sharedbuf/byteLength.js
@@ -1,9 +1,8 @@
-// SharedArrayBuffer.prototype.byteLength
+// |jit-test| skip-if: !this.SharedArrayBuffer
 
-if (!this.SharedArrayBuffer)
-    quit(0);
+// SharedArrayBuffer.prototype.byteLength
 
 load(libdir + "asserts.js");
 
 let buffer = new SharedArrayBuffer(137);
 assertEq(buffer.byteLength, 137);
--- a/js/src/jit-test/tests/sharedbuf/gc-one-view.js
+++ b/js/src/jit-test/tests/sharedbuf/gc-one-view.js
@@ -1,10 +1,11 @@
+// |jit-test| skip-if: !this.SharedArrayBuffer
+
 // Test tracing of a single linked ArrayBufferViewObject.
 
 function f() {
     var x = new SharedArrayBuffer(0x1000);
     var y = new Int32Array(x);
     gc();
 }
 
-if (this.SharedArrayBuffer)
-    f();
+f();
--- a/js/src/jit-test/tests/sharedbuf/gc-two-views.js
+++ b/js/src/jit-test/tests/sharedbuf/gc-two-views.js
@@ -1,11 +1,12 @@
+// |jit-test| skip-if: !this.SharedArrayBuffer
+
 // Test tracing of two views of a SharedArrayBuffer. Uses a different path.
 
 function f() {
     var x = new SharedArrayBuffer(0x1000);
     var y = new Int32Array(x);
     var z = new Int8Array(x);
     gc();
 }
 
-if (this.SharedArrayBuffer)
-    f();
+f();
--- a/js/src/jit-test/tests/sharedbuf/inline-access.js
+++ b/js/src/jit-test/tests/sharedbuf/inline-access.js
@@ -1,27 +1,24 @@
-// |jit-test| slow;
+// |jit-test| slow; skip-if: !this.SharedArrayBuffer
 //
 // This is for testing inlining behavior in the jits.
 //
 // For Baseline, run:
 //    $ IONFLAGS=bl-ic .../js --ion-off --baseline-eager inline-access.js
 // Then inspect the output, there should be calls to "GetElem(TypedArray[Int32])",
 // "GetProp(NativeObj/NativeGetter 0x...)", and "SetElem_TypedArray stub"
 // for the read access, length access, and write access respectively, within f.
 //
 // For Ion, run:
 //    $ IONFLAGS=logs .../js --ion-offthread-compile=off inline-access.js
 // Then postprocess with iongraph and verify (by inspecting MIR late in the pipeline)
 // that it contains instructions like "typedarraylength", "loadtypedarrayelement",
 // and "storetypedarrayelement".
 
-if (!this.SharedArrayBuffer)
-    quit();
-
 function f(ta) {
     return (ta[2] = ta[0] + ta[1] + ta.length);
 }
 
 var v = new Int32Array(new SharedArrayBuffer(4096));
 var sum = 0;
 var iter = 1000;
 for ( var i=0 ; i < iter ; i++ )
--- a/js/src/jit-test/tests/sharedbuf/is-zeroed.js
+++ b/js/src/jit-test/tests/sharedbuf/is-zeroed.js
@@ -1,12 +1,13 @@
+// |jit-test| skip-if: !this.SharedArrayBuffer
+
 // Test that the SharedArrayBuffer memory is properly zeroed.
 
 function f() {
     var x = new SharedArrayBuffer(4096);
     var y = new Int32Array(x);
     assertEq(y[0], 0);
     assertEq(y[1], 0);
     assertEq(y[1023], 0);
 }
 
-if (this.SharedArrayBuffer)
-    f();
+f();
--- a/js/src/jit-test/tests/sharedbuf/sab-construct-noargs-1068458.js
+++ b/js/src/jit-test/tests/sharedbuf/sab-construct-noargs-1068458.js
@@ -1,10 +1,9 @@
-if (!this.SharedArrayBuffer)
-    quit();
+// |jit-test| skip-if: !this.SharedArrayBuffer
 
 // Note that as of 2014-09-18 it is not correct to construct a SharedArrayBuffer without
 // a length acceptable to asm.js: at-least 4K AND (power-of-two OR multiple-of-16M).
 // That is likely to change however (see bug 1068684).  The test case is constructed
 // to take that into account by catching exceptions.  That does not impact the
 // original bug, which is an assertion in the implementation.
 
 try {
--- a/js/src/jit-test/tests/sharedbuf/sab-gating.js
+++ b/js/src/jit-test/tests/sharedbuf/sab-gating.js
@@ -1,8 +1,7 @@
-// Check gating of shared memory features in plain js (bug 1231338).
-
+// |jit-test| skip-if: !this.sharedMemoryEnabled
 // Need this testing function to continue.
-if (!this.sharedMemoryEnabled)
-    quit(0);
+
+// Check gating of shared memory features in plain js (bug 1231338).
 
 assertEq(sharedMemoryEnabled(), !!this.SharedArrayBuffer);
 assertEq(sharedMemoryEnabled(), !!this.Atomics);
--- a/js/src/jit-test/tests/sharedbuf/slice-same-memory.js
+++ b/js/src/jit-test/tests/sharedbuf/slice-same-memory.js
@@ -1,10 +1,9 @@
-if (!this.SharedArrayBuffer)
-    quit(0);
+// |jit-test| skip-if: !this.SharedArrayBuffer
 
 load(libdir + "asserts.js");
 
 var sab = new SharedArrayBuffer(1 * Int32Array.BYTES_PER_ELEMENT);
 
 // Make a copy, sharing the same memory
 var sab2 = (setSharedObject(sab), getSharedObject());
 
--- a/js/src/jit-test/tests/sharedbuf/slice.js
+++ b/js/src/jit-test/tests/sharedbuf/slice.js
@@ -1,12 +1,11 @@
-// SharedArrayBuffer.prototype.slice
+// |jit-test| skip-if: !this.SharedArrayBuffer
 
-if (!this.SharedArrayBuffer)
-    quit(0);
+// SharedArrayBuffer.prototype.slice
 
 load(libdir + "asserts.js");
 
 let buf = new SharedArrayBuffer(1024);
 let bufAsI8 = new Int8Array(buf);
 for ( let i=0 ; i < buf.length ; i++ )
     bufAsI8[i] = i;
 
--- a/js/src/jit-test/tests/sharedbuf/subtypes.js
+++ b/js/src/jit-test/tests/sharedbuf/subtypes.js
@@ -1,12 +1,11 @@
-// Test cases for subclasses of SharedArrayBuffer.
+// |jit-test| skip-if: !this.SharedArrayBuffer
 
-if (!this.SharedArrayBuffer)
-    quit(0);
+// Test cases for subclasses of SharedArrayBuffer.
 
 load(libdir + "asserts.js");
 
 // Basic subclassing.
 
 class MySharedArrayBuffer1 extends SharedArrayBuffer {
     constructor(n) { super(n) }
 }
--- a/js/src/jit-test/tests/sharedbuf/typedarray-from-sharedtypedarray-with-overridden-length.js
+++ b/js/src/jit-test/tests/sharedbuf/typedarray-from-sharedtypedarray-with-overridden-length.js
@@ -1,10 +1,9 @@
-if (!this.SharedArrayBuffer)
-    quit(0);
+// |jit-test| skip-if: !this.SharedArrayBuffer
 
 // This would hit an assertion in debug builds due to an incorrect
 // type guard in the code that copies data from STA to TA.
 
 // Original test case
 
 var sab = new SharedArrayBuffer(4);