Bug 1496297 - Use |jit-test| skip-if as appropriate in jit-test/tests/basic/ (r=jorendorff)
authorEric Faust <efausbmo@gmail.com>
Tue, 09 Oct 2018 15:41:50 -0700
changeset 498829 fdf9b230e27056c4a605c716fecda2b323b9837b
parent 498828 012e94d3d96c5513af221778411d331b308ee537
child 498830 b97fa179df851228f5093a54dec49fcdcb5d0584
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/basic/ (r=jorendorff)
js/src/jit-test/tests/basic/bug-1198090.js
js/src/jit-test/tests/basic/bug-1271507-2.js
js/src/jit-test/tests/basic/bug-1271507.js
js/src/jit-test/tests/basic/bug1207863.js
js/src/jit-test/tests/basic/bug1234414.js
js/src/jit-test/tests/basic/bug1240502.js
js/src/jit-test/tests/basic/bug1263868.js
js/src/jit-test/tests/basic/bug1264954.js
js/src/jit-test/tests/basic/bug1265693.js
js/src/jit-test/tests/basic/bug1278839.js
js/src/jit-test/tests/basic/bug1285227.js
js/src/jit-test/tests/basic/bug1296016.js
js/src/jit-test/tests/basic/bug1296249.js
js/src/jit-test/tests/basic/bug1300904.js
js/src/jit-test/tests/basic/bug1341326.js
js/src/jit-test/tests/basic/bug1344265.js
js/src/jit-test/tests/basic/bug1348407.js
js/src/jit-test/tests/basic/bug1355573.js
js/src/jit-test/tests/basic/bug1411294.js
js/src/jit-test/tests/basic/bug1447996.js
js/src/jit-test/tests/basic/bug1459258.js
js/src/jit-test/tests/basic/bug1470732.js
js/src/jit-test/tests/basic/dumpStringRepresentation.js
js/src/jit-test/tests/basic/evalInWorker-interrupt.js
js/src/jit-test/tests/basic/evalInWorker-jit-options.js
js/src/jit-test/tests/basic/evaluate-worker.js
js/src/jit-test/tests/basic/inflate-oom.js
js/src/jit-test/tests/basic/offThreadCompileScript-01.js
js/src/jit-test/tests/basic/offThreadCompileScript-02.js
js/src/jit-test/tests/basic/testApplyArrayInline.js
js/src/jit-test/tests/basic/testBug756919.js
js/src/jit-test/tests/basic/testOOMInAutoEnterCompartment.js
js/src/jit-test/tests/basic/withSourceHook.js
--- a/js/src/jit-test/tests/basic/bug-1198090.js
+++ b/js/src/jit-test/tests/basic/bug-1198090.js
@@ -1,12 +1,9 @@
-// |jit-test| allow-oom
-
-if (!('oomAtAllocation' in this))
-    quit();
+// |jit-test| allow-oom; skip-if: !('oomAtAllocation' in this)
 
 for (let a of [
         null, function() {}, function() {}, null, function() {}, function() {},
         function() {}, null, null, null, null, null, null, null, null,
         function() {}, null, null, null, function() {}
     ]) {
     oomAtAllocation(5);
 }
deleted file mode 100644
--- a/js/src/jit-test/tests/basic/bug-1271507-2.js
+++ /dev/null
@@ -1,4 +0,0 @@
-// |jit-test| allow-oom
-
-// Adapted from randomly chosen testcase: js/src/jit-test/tests/debug/bug-1238610.js
-load(libdir + "../tests/basic/bug-1271507.js");
--- a/js/src/jit-test/tests/basic/bug-1271507.js
+++ b/js/src/jit-test/tests/basic/bug-1271507.js
@@ -1,12 +1,9 @@
-// |jit-test| allow-oom
-if (typeof oomAfterAllocations != "function")
-  quit();
-
+// |jit-test| allow-oom; skip-if: typeof oomAfterAllocations !== 'function'
 lfcode = new Array();
 oomAfterAllocations(100);
 loadFile(file);
 lfGlobal = newGlobal()
 for (lfLocal in this)
   if (!(lfLocal in lfGlobal))
     lfGlobal[lfLocal] = this[lfLocal]
 offThreadCompileScript(lfVarx)
--- a/js/src/jit-test/tests/basic/bug1207863.js
+++ b/js/src/jit-test/tests/basic/bug1207863.js
@@ -1,12 +1,9 @@
-// |jit-test| allow-oom; allow-unhandlable-oom
-
-if (!("oomAtAllocation" in this && "resetOOMFailure" in this))
-    quit();
+// |jit-test| allow-oom; allow-unhandlable-oom; skip-if: !("oomAtAllocation" in this && "resetOOMFailure" in this)
 
 function oomTest(f) {
     var i = 1;
     do {
         try {
             oomAtAllocation(i);
             f();
         } catch (e) {
--- a/js/src/jit-test/tests/basic/bug1234414.js
+++ b/js/src/jit-test/tests/basic/bug1234414.js
@@ -1,10 +1,9 @@
-if (!('oomTest' in this))
-  quit();
+// |jit-test| skip-if: !('oomTest' in this)
 
 oomTest(() => {
     var max = 400;
     function f(b) {
         if (b) {
             f(b - 1);
         } else eval('"use strict"; const z = w; z = 1 + w; c = 5');
     }
--- a/js/src/jit-test/tests/basic/bug1240502.js
+++ b/js/src/jit-test/tests/basic/bug1240502.js
@@ -1,3 +1,2 @@
-if (!('oomTest' in this))
-    quit();
+// |jit-test| skip-if: !('oomTest' in this)
 oomTest(() => eval(`Array(..."ABC")`));
--- a/js/src/jit-test/tests/basic/bug1263868.js
+++ b/js/src/jit-test/tests/basic/bug1263868.js
@@ -1,10 +1,9 @@
-if (!('oomTest' in this))
-    quit();
+// |jit-test| skip-if: !('oomTest' in this)
 function g(f, params) {
     entryPoints(params);
 }
 function entry1() {};
 s = "g(entry1, {function: entry1});";
 f(s);
 f(s);
 function f(x) {
--- a/js/src/jit-test/tests/basic/bug1264954.js
+++ b/js/src/jit-test/tests/basic/bug1264954.js
@@ -1,8 +1,7 @@
-if (!('oomTest' in this))
-    quit();
+// |jit-test| skip-if: !('oomTest' in this)
 function f(x) {
     oomTest(() => eval(x));
 }
 f("");
 f("");
 f(`eval([   "x = \`\${new Error.lineNumber}" ].join())`);
--- a/js/src/jit-test/tests/basic/bug1265693.js
+++ b/js/src/jit-test/tests/basic/bug1265693.js
@@ -1,4 +1,2 @@
-if (!('oomTest' in this))
-    quit();
-
+// |jit-test| skip-if: !('oomTest' in this)
 oomTest(Function("Function.hasOwnProperty(1.1)"));
--- a/js/src/jit-test/tests/basic/bug1278839.js
+++ b/js/src/jit-test/tests/basic/bug1278839.js
@@ -1,4 +1,3 @@
-if (!('oomTest' in this))
-    quit();
+// |jit-test| skip-if: !('oomTest' in this)
 for (var i=0; i<2; i++)
     oomTest(() => eval("setJitCompilerOption(eval + Function, 0);"));
--- a/js/src/jit-test/tests/basic/bug1285227.js
+++ b/js/src/jit-test/tests/basic/bug1285227.js
@@ -1,5 +1,4 @@
-if (helperThreadCount() === 0)
-    quit();
+// |jit-test| skip-if: helperThreadCount() === 0
 evalInWorker(`
     (new WeakMap).set(FakeDOMObject.prototype, this)
 `);
--- a/js/src/jit-test/tests/basic/bug1296016.js
+++ b/js/src/jit-test/tests/basic/bug1296016.js
@@ -1,4 +1,3 @@
-if (helperThreadCount() === 0)
-    quit(0);
+// |jit-test| skip-if: helperThreadCount() === 0
 offThreadCompileScript(``);
 evalInWorker(`runOffThreadScript()`);
--- a/js/src/jit-test/tests/basic/bug1296249.js
+++ b/js/src/jit-test/tests/basic/bug1296249.js
@@ -1,10 +1,7 @@
-// |jit-test| slow
-if (!('oomTest' in this))
-    quit();
-
+// |jit-test| slow; skip-if: !('oomTest' in this)
 function f(x) {
     new Int32Array(x);
 }
 
 f(0);
 oomTest(() => f(2147483647));
--- a/js/src/jit-test/tests/basic/bug1300904.js
+++ b/js/src/jit-test/tests/basic/bug1300904.js
@@ -1,7 +1,6 @@
-if (!('oomTest' in this))
-    quit();
+// |jit-test| skip-if: !('oomTest' in this)
 Object.getOwnPropertyNames(this);
 oomTest(function() {
     this[0] = null;
     Object.freeze(this);
 });
--- a/js/src/jit-test/tests/basic/bug1341326.js
+++ b/js/src/jit-test/tests/basic/bug1341326.js
@@ -1,10 +1,9 @@
-if (helperThreadCount() == 0)
-    quit();
+// |jit-test| skip-if: helperThreadCount() === 0
 function eval(source) {
     offThreadCompileModule(source);
 }
 var N = 10000;
 var left = repeat_str('(1&', N);
 var right = repeat_str(')', N);
 var str = 'actual = '.concat(left, '1', right, ';');
 eval(str);
--- a/js/src/jit-test/tests/basic/bug1344265.js
+++ b/js/src/jit-test/tests/basic/bug1344265.js
@@ -1,5 +1,3 @@
-// |jit-test| allow-unhandlable-oom; allow-oom
-if (!('oomAfterAllocations' in this))
-    quit();
+// |jit-test| allow-unhandlable-oom; allow-oom; skip-if: !('oomAfterAllocations' in this)
 oomAfterAllocations(1);
 newExternalString("a");
--- a/js/src/jit-test/tests/basic/bug1348407.js
+++ b/js/src/jit-test/tests/basic/bug1348407.js
@@ -1,6 +1,5 @@
-if (!('oomTest' in this))
-    quit();
+// |jit-test| skip-if: !('oomTest' in this)
 x = evalcx("lazy");
 oomTest(function () {
     x.eval("1");
 });
--- a/js/src/jit-test/tests/basic/bug1355573.js
+++ b/js/src/jit-test/tests/basic/bug1355573.js
@@ -1,10 +1,9 @@
-if (getBuildConfiguration().debug === true)
-    quit(0);
+// |jit-test| skip-if: getBuildConfiguration().debug === true
 function f(){};
 Object.defineProperty(f, "name", {value: "a".repeat((1<<28)-1)});
 var ex = null;
 try {
     len = f.bind().name.length;
 } catch (e) {
     ex = e;
 }
--- a/js/src/jit-test/tests/basic/bug1411294.js
+++ b/js/src/jit-test/tests/basic/bug1411294.js
@@ -1,10 +1,9 @@
-if (!('oomTest' in this))
-    quit();
+// |jit-test| skip-if: !('oomTest' in this)
 oomTest(function() {
   eval(`var clonebuffer = serialize("abc");
   clonebuffer.clonebuffer = "\
 \\x00\\x00\\x00\\x00\\b\\x00\\xFF\\xFF\\f\
 \\x00\\x00\\x00\\x03\\x00\\xFF\\xFF\\x00\\x00\\x00\\x00\\x00\\x00\\x00\
 \\x00\\x00\\x00\\x00\\x00\\x00\\x00\\xF0?\\x00\\x00\\x00\\\x00\\x00\
 \\x00\\xFF\\xFF"
   var obj = deserialize(clonebuffer)
--- a/js/src/jit-test/tests/basic/bug1447996.js
+++ b/js/src/jit-test/tests/basic/bug1447996.js
@@ -1,10 +1,10 @@
-if (!('stackTest' in this))
-    quit();
+// |jit-test| skip-if: !('stackTest' in this)
+
 var x = 0;
 function f() {
     var s = "abcdef(((((((a|b)a|b)a|b)a|b)a|b)a|b)a|b)" + x;
     res = "abcdefa".match(new RegExp(s));
     x++;
 }
 f();
 stackTest(f, true);
--- a/js/src/jit-test/tests/basic/bug1459258.js
+++ b/js/src/jit-test/tests/basic/bug1459258.js
@@ -1,8 +1,7 @@
-if (!('oomTest' in this))
-    quit();
+// |jit-test| skip-if: !('oomTest' in this)
 oomTest(function() {
     return [0, Math.PI, NaN, Infinity, true, false, Symbol(), Math.tan,
             Reflect, Proxy, print, assertEq, Array, String, Boolean, Number, parseInt,
             parseFloat, Math.sin, Math.cos, Math.abs, Math.pow, Math.sqrt,
             Uint8Array, Int8Array, Int32Array, Int16Array, Uint16Array];
 });
--- a/js/src/jit-test/tests/basic/bug1470732.js
+++ b/js/src/jit-test/tests/basic/bug1470732.js
@@ -1,11 +1,9 @@
-if (helperThreadCount() === 0)
-    quit();
-
+// |jit-test| skip-if: helperThreadCount() === 0
 var i = 0;
 while(i++ < 500) {
   evalInWorker(`
     assertFloat32(0x23456789 | 0, false);
   `);
   let m = parseModule("");
   m.declarationInstantiation();
 }
--- a/js/src/jit-test/tests/basic/dumpStringRepresentation.js
+++ b/js/src/jit-test/tests/basic/dumpStringRepresentation.js
@@ -1,14 +1,13 @@
+// |jit-test| skip-if: typeof dumpStringRepresentation !== 'function'
+
 // Try the dumpStringRepresentation shell function on various types of
 // strings, and make sure it doesn't crash.
 
-if (typeof dumpStringRepresentation !== 'function')
-  quit(0);
-
 print("Empty string:");
 dumpStringRepresentation("");
 
 print("\nResult of coercion to string:");
 dumpStringRepresentation();
 
 print("\nString with an index value:");
 dumpStringRepresentation((12345).toString());
--- a/js/src/jit-test/tests/basic/evalInWorker-interrupt.js
+++ b/js/src/jit-test/tests/basic/evalInWorker-interrupt.js
@@ -1,3 +1,2 @@
-if (helperThreadCount() === 0)
-    quit();
+// |jit-test| skip-if: helperThreadCount() === 0
 evalInWorker("setInterruptCallback(function() {}); timeout(1000);");
--- a/js/src/jit-test/tests/basic/evalInWorker-jit-options.js
+++ b/js/src/jit-test/tests/basic/evalInWorker-jit-options.js
@@ -1,10 +1,9 @@
-if (helperThreadCount() === 0)
-    quit();
+// |jit-test| skip-if: helperThreadCount() === 0
 var fun = function() {
     var ex;
     try {
         setJitCompilerOption("baseline.warmup.trigger", 5);
     } catch(e) {
         ex = e;
     }
     assertEq(ex && ex.toString().includes("Can't set"), true);
--- a/js/src/jit-test/tests/basic/evaluate-worker.js
+++ b/js/src/jit-test/tests/basic/evaluate-worker.js
@@ -1,12 +1,9 @@
-// |jit-test| slow
-
-if (typeof evalInWorker == "undefined")
-    quit();
+// |jit-test| slow; skip-if: typeof evalInWorker === 'undefined'
 
 gcslice(11);
 evalInWorker("print('helo world');");
 for (i = 0; i < 100000; i++) {}
 
 evalInWorker("\
   for (var i = 0; i < 10; i++) { \
     var o = {}; \
--- a/js/src/jit-test/tests/basic/inflate-oom.js
+++ b/js/src/jit-test/tests/basic/inflate-oom.js
@@ -1,10 +1,9 @@
-if (!('oomTest' in this))
-    quit();
+// |jit-test| skip-if: !('oomTest' in this)
 function test() {
     function foo() {
         return 1;
     };
     oomTest(() => {
         gc();
         foo.toString();
     });
--- a/js/src/jit-test/tests/basic/offThreadCompileScript-01.js
+++ b/js/src/jit-test/tests/basic/offThreadCompileScript-01.js
@@ -1,18 +1,17 @@
+// |jit-test| skip-if: helperThreadCount() === 0
+
 // Any copyright is dedicated to the Public Domain.
 // http://creativecommons.org/licenses/publicdomain/
 
 // Test off-thread parsing.
 
 load(libdir + 'asserts.js');
 
-if (helperThreadCount() === 0)
-  quit(0);
-
 offThreadCompileScript('Math.sin(Math.PI/2)');
 assertEq(runOffThreadScript(), 1);
 
 offThreadCompileScript('a string which cannot be reduced to the start symbol');
 assertThrowsInstanceOf(runOffThreadScript, SyntaxError);
 
 offThreadCompileScript('smerg;');
 assertThrowsInstanceOf(runOffThreadScript, ReferenceError);
--- a/js/src/jit-test/tests/basic/offThreadCompileScript-02.js
+++ b/js/src/jit-test/tests/basic/offThreadCompileScript-02.js
@@ -1,12 +1,11 @@
-// Test offThreadCompileScript option handling.
+// |jit-test| skip-if: helperThreadCount() === 0
 
-if (helperThreadCount() === 0)
-  quit(0);
+// Test offThreadCompileScript option handling.
 
 offThreadCompileScript('Error()');
 assertEq(!!runOffThreadScript().stack.match(/^@<string>:1:1\n/), true);
 
 offThreadCompileScript('Error()',
                        { fileName: "candelabra", lineNumber: 6502 });
 assertEq(!!runOffThreadScript().stack.match(/^@candelabra:6502:1\n/), true);
 
--- a/js/src/jit-test/tests/basic/testApplyArrayInline.js
+++ b/js/src/jit-test/tests/basic/testApplyArrayInline.js
@@ -1,17 +1,16 @@
+// |jit-test| skip-if: !this.getJitCompilerOptions() || !getJitCompilerOptions()['ion.enable']
+
 // Test inlining in Ion of fun.apply(..., array).
 
 setJitCompilerOption("ion.warmup.trigger", 50);
 setJitCompilerOption("offthread-compilation.enable", 0);
 gcPreserveCode();
 
-if (!this.getJitCompilerOptions() || !getJitCompilerOptions()['ion.enable'])
-    quit(0);
-
 var itercount = 1000;
 var warmup = 100;
 
 // Force Ion to do something predictable without having to wait
 // forever for it.
 
 if (getJitCompilerOptions()["ion.warmup.trigger"] > warmup)
     setJitCompilerOption("ion.warmup.trigger", warmup);
--- a/js/src/jit-test/tests/basic/testBug756919.js
+++ b/js/src/jit-test/tests/basic/testBug756919.js
@@ -1,11 +1,9 @@
-if (!('oomTest' in this))
-    quit();
-
+// |jit-test| skip-if: !('oomTest' in this)
 function test(x) {
     var upvar = "";
     function f() { upvar += ""; }
     if (x > 0)
         test(x - 1);
     eval('');
 }
 
--- a/js/src/jit-test/tests/basic/testOOMInAutoEnterCompartment.js
+++ b/js/src/jit-test/tests/basic/testOOMInAutoEnterCompartment.js
@@ -1,11 +1,10 @@
-// |jit-test| slow
-// This test is too slow to run with ASan in a debug configuration
-if (getBuildConfiguration()['asan'] && getBuildConfiguration()['debug']) quit(0);
+// |jit-test| slow; skip-if: (getBuildConfiguration()['asan'] && getBuildConfiguration()['debug'])
+// This test is too slow to run at all with ASan in a debug configuration
 
 function fatty() {
     try {
         fatty();
     } catch (e) {
         foo();
     }
 }
--- a/js/src/jit-test/tests/basic/withSourceHook.js
+++ b/js/src/jit-test/tests/basic/withSourceHook.js
@@ -1,18 +1,15 @@
+// |jit-test| skip-if: typeof withSourceHook !== 'function'
+
 // Check that withSourceHook passes URLs, propagates exceptions, and
 // properly restores the original source hooks.
 
 load(libdir + 'asserts.js');
 
-// withSourceHook isn't defined if you pass the shell the --fuzzing-safe
-// option. Skip this test silently, to avoid spurious failures.
-if (typeof withSourceHook != 'function')
-  quit(0);
-
 var log = '';
 
 // Establish an outermost source hook.
 withSourceHook(function (url) {
   log += 'o';
   assertEq(url, 'outer');
   return '(function outer() { 3; })';
 }, function () {