diff options
Diffstat (limited to 'js/src/jit-test/tests/auto-regress')
333 files changed, 5831 insertions, 0 deletions
diff --git a/js/src/jit-test/tests/auto-regress/bug1147907.js b/js/src/jit-test/tests/auto-regress/bug1147907.js new file mode 100644 index 0000000000..bf22640058 --- /dev/null +++ b/js/src/jit-test/tests/auto-regress/bug1147907.js @@ -0,0 +1,14 @@ +var evalInFrame = (function (global) { + var dbgGlobal = newGlobal({newCompartment: true}); + var dbg = new dbgGlobal.Debugger(); + return function evalInFrame(upCount, code) { + dbg.addDebuggee(global); + var frame = dbg.getNewestFrame().older; + var completion = frame.eval(code); + }; +})(this); +var x = 5; +{ + let x = eval("this.x++"); + evalInFrame(0, ("for (var x = 0; x < 3; ++x) { (function(){})() } ")) +} diff --git a/js/src/jit-test/tests/auto-regress/bug1183241.js b/js/src/jit-test/tests/auto-regress/bug1183241.js new file mode 100644 index 0000000000..6f236afd2e --- /dev/null +++ b/js/src/jit-test/tests/auto-regress/bug1183241.js @@ -0,0 +1,18 @@ +// |jit-test| error:TypeError +"use strict"; + +// Make it impossible to create a toSource() representation of |o|, because +// 100 * 2**22 exceeds the maximum string length. +var s = "a".repeat(2 ** 22); +var o = {}; +for (var i = 0; i < 100; ++i) { + o["$" + i] = s; +} + +Object.seal(o); + +// Before the patch the toSource() represention was generated when an +// assignment failed in strict mode. And because it's not possible to create +// a toSource() representation for |o| (see above), this line caused an +// InternalError to be thrown. With the patch this line throws a TypeError. +o.foo = 0; diff --git a/js/src/jit-test/tests/auto-regress/bug1263532.js b/js/src/jit-test/tests/auto-regress/bug1263532.js new file mode 100644 index 0000000000..e9d222d3c9 --- /dev/null +++ b/js/src/jit-test/tests/auto-regress/bug1263532.js @@ -0,0 +1,13 @@ +setJitCompilerOption("ion.warmup.trigger", 1); +function f(g) { + for (var i = 0; i < 99; i++) { + "abc".match("b."); + g(); + } +} +f(function() {}); +f(function() { + Object.defineProperty(RegExp.prototype, "sticky", { + get: function() {} + }); +}); diff --git a/js/src/jit-test/tests/auto-regress/bug1263558.js b/js/src/jit-test/tests/auto-regress/bug1263558.js new file mode 100644 index 0000000000..41705977ac --- /dev/null +++ b/js/src/jit-test/tests/auto-regress/bug1263558.js @@ -0,0 +1,16 @@ +// |jit-test| skip-if: !('oomTest' in this) + +evalcx(` + eval('\ + var appendToActual = function(s) {};\ + gczeal = function() {};\ + gcslice = function() {};\ + selectforgc = function() {};\ + if (!("verifyprebarriers" in this)) {\ + verifyprebarriers = function() {};\ + }\ + '); + oomTest(() => eval('Array(..."")')); + if ('Intl' in this) + new Intl.NumberFormat().format(0); +`, newGlobal()); diff --git a/js/src/jit-test/tests/auto-regress/bug1263857.js b/js/src/jit-test/tests/auto-regress/bug1263857.js new file mode 100644 index 0000000000..95dabfdc52 --- /dev/null +++ b/js/src/jit-test/tests/auto-regress/bug1263857.js @@ -0,0 +1,5 @@ +// |jit-test| allow-oom; allow-unhandlable-oom; skip-if: getBuildConfiguration("android") +// Disabled on Android due to harness problems (Bug 1532654) +gcparam("maxBytes", gcparam("gcBytes") + 1); +fullcompartmentchecks(true); +/x/g[Symbol.replace](" x".repeat(32768), ""); diff --git a/js/src/jit-test/tests/auto-regress/bug1263865.js b/js/src/jit-test/tests/auto-regress/bug1263865.js new file mode 100644 index 0000000000..e5b11769d9 --- /dev/null +++ b/js/src/jit-test/tests/auto-regress/bug1263865.js @@ -0,0 +1,11 @@ +// |jit-test| skip-if: !('oomTest' in this) + +loadFile(""); +loadFile(""); +loadFile("Array.prototype.splice.call(1)"); +function loadFile(lfVarx) { + parseInt("1"); + oomTest(function() { + eval(lfVarx); + }); +} diff --git a/js/src/jit-test/tests/auto-regress/bug1263879.js b/js/src/jit-test/tests/auto-regress/bug1263879.js new file mode 100644 index 0000000000..1baba2dd3e --- /dev/null +++ b/js/src/jit-test/tests/auto-regress/bug1263879.js @@ -0,0 +1,20 @@ +// |jit-test| skip-if: !('oomTest' in this) + +var lines = ` + + + +"".replace([[2], 3]) +`.split('\n'); +var code = ""; +while (true) { + var line = lines.shift(); + if (line == null) + break; + loadFile(); + code += line + "\n"; +} +loadFile(code); +function loadFile(code) { + oomTest(() => eval(code)); +} diff --git a/js/src/jit-test/tests/auto-regress/bug1263888.js b/js/src/jit-test/tests/auto-regress/bug1263888.js new file mode 100644 index 0000000000..c5e8a12dbf --- /dev/null +++ b/js/src/jit-test/tests/auto-regress/bug1263888.js @@ -0,0 +1,3 @@ +Array.prototype.constructor = []; +for (let i = 0; i < 100; i++) + [].slice(); diff --git a/js/src/jit-test/tests/auto-regress/bug1264561.js b/js/src/jit-test/tests/auto-regress/bug1264561.js new file mode 100644 index 0000000000..b5cc40bb22 --- /dev/null +++ b/js/src/jit-test/tests/auto-regress/bug1264561.js @@ -0,0 +1,6 @@ +var r = RegExp(""); +var s = ""; +s += "".replace(r, Function("x")); +for (var x = 0; x < 5; x++) { + s += "".replace(r, this); +} diff --git a/js/src/jit-test/tests/auto-regress/bug1264823.js b/js/src/jit-test/tests/auto-regress/bug1264823.js new file mode 100644 index 0000000000..afac37c3c6 --- /dev/null +++ b/js/src/jit-test/tests/auto-regress/bug1264823.js @@ -0,0 +1,12 @@ +// |jit-test| skip-if: !('oomTest' in this) + +loadFile(""); +loadFile(""); +loadFile(` function lalala() {} + new Map([[1, 2]]).forEach(lalala) + `); +function loadFile(lfVarx) { + return oomTest(function() { + eval(lfVarx) + }); +} diff --git a/js/src/jit-test/tests/auto-regress/bug1266579.js b/js/src/jit-test/tests/auto-regress/bug1266579.js new file mode 100644 index 0000000000..ff3f6986cc --- /dev/null +++ b/js/src/jit-test/tests/auto-regress/bug1266579.js @@ -0,0 +1,28 @@ +function test1() { + do { + "8pan08pa8pan08pa".split(""); + } while (!inIon()); +} + +function test2() { + do { + "abababababababababababababababab".split("a"); + } while (!inIon()); +} + +function test3() { + do { + "abcabcabcabcabcabcabcabcabcabcabcabcabcabcabc".split("ab"); + } while (!inIon()); +} + +function test4() { + do { + "".split(""); + } while (!inIon()); +} + +test1(); +test2(); +test3(); +test4(); diff --git a/js/src/jit-test/tests/auto-regress/bug1268034.js b/js/src/jit-test/tests/auto-regress/bug1268034.js new file mode 100644 index 0000000000..43f2a661fd --- /dev/null +++ b/js/src/jit-test/tests/auto-regress/bug1268034.js @@ -0,0 +1,6 @@ +// |jit-test| skip-if: !('oomTest' in this) + +oomTest(function() { + offThreadCompileToStencil(""); +}); +"".match(); diff --git a/js/src/jit-test/tests/auto-regress/bug1269074.js b/js/src/jit-test/tests/auto-regress/bug1269074.js new file mode 100644 index 0000000000..6e2cc33035 --- /dev/null +++ b/js/src/jit-test/tests/auto-regress/bug1269074.js @@ -0,0 +1,3 @@ +// |jit-test| allow-oom; skip-if: !('oomTest' in this) + +evalcx('oomTest(function() { Array(...""); })', newGlobal()); diff --git a/js/src/jit-test/tests/auto-regress/bug1276082.js b/js/src/jit-test/tests/auto-regress/bug1276082.js new file mode 100644 index 0000000000..5a32fa06a0 --- /dev/null +++ b/js/src/jit-test/tests/auto-regress/bug1276082.js @@ -0,0 +1,5 @@ +function f() { + (function() {}).bind()(/x/); +} +f(); +f(); diff --git a/js/src/jit-test/tests/auto-regress/bug1315943.js b/js/src/jit-test/tests/auto-regress/bug1315943.js new file mode 100644 index 0000000000..9aabb6f198 --- /dev/null +++ b/js/src/jit-test/tests/auto-regress/bug1315943.js @@ -0,0 +1,11 @@ +var s = "{}"; +for (var i = 0; i < 21; i++) s += s; +var g = newGlobal({newCompartment: true}); +var dbg = Debugger(g); +dbg.onDebuggerStatement = function(frame) { + var s = frame.eval("f").return.script; +}; +g.eval("line0 = Error().lineNumber;\n" + "debugger;\n" + // line0 + 1 + "function f(i) {\n" + // line0 + 2 + s + // line0 + 3 ... line0 + where - 2 + "}\n"); diff --git a/js/src/jit-test/tests/auto-regress/bug1317460.js b/js/src/jit-test/tests/auto-regress/bug1317460.js new file mode 100644 index 0000000000..ccd6aacf12 --- /dev/null +++ b/js/src/jit-test/tests/auto-regress/bug1317460.js @@ -0,0 +1,11 @@ +// |jit-test| error:TypeError + +g = newGlobal(); +g.parent = this; +g.eval("(" + function() { + Debugger(parent).onExceptionUnwind = function() { return 0; }; +} + ")()"); +async function f() { + t; +} +f(); diff --git a/js/src/jit-test/tests/auto-regress/bug1335619.js b/js/src/jit-test/tests/auto-regress/bug1335619.js new file mode 100644 index 0000000000..574fa1fcc5 --- /dev/null +++ b/js/src/jit-test/tests/auto-regress/bug1335619.js @@ -0,0 +1,11 @@ +// jsfunfuzz-generated +x = []; +y = x.push(Set, 1); +Array.prototype.shift.call(x); +// Adapted from randomly chosen test: js/src/tests/ecma_5/String/match-defines-match-elements.js +Object.defineProperty(Array.prototype, 1, { + set: function() {} +}) +// jsfunfuzz-generated +Array.prototype.splice.call(x, 3, {}, y); +new Set(x); diff --git a/js/src/jit-test/tests/auto-regress/bug1335623.js b/js/src/jit-test/tests/auto-regress/bug1335623.js new file mode 100644 index 0000000000..8d729f7fe7 --- /dev/null +++ b/js/src/jit-test/tests/auto-regress/bug1335623.js @@ -0,0 +1,9 @@ +// jsfunfuzz-generated +x = []; +// Adapted from randomly chosen test: js/src/tests/ecma_5/String/match-defines-match-elements.js +y = Object.defineProperty(Array.prototype, 1, { + set: function () {} +}); +// jsfunfuzz-generated +x.splice(0, 1, y, y); +new Float64Array(x); diff --git a/js/src/jit-test/tests/auto-regress/bug1343513-2.js b/js/src/jit-test/tests/auto-regress/bug1343513-2.js new file mode 100644 index 0000000000..e2bbe7bc95 --- /dev/null +++ b/js/src/jit-test/tests/auto-regress/bug1343513-2.js @@ -0,0 +1,9 @@ +// |jit-test| error:RangeError; skip-if: largeArrayBufferSupported(); --ion-warmup-threshold=50 +setJitCompilerOption("offthread-compilation.enable", 0); +gcPreserveCode(); + +var i = 0; +do { + i++; + var ta = new Int32Array(inIon() ? 0x20000001 : 1); +} while (!inIon()); diff --git a/js/src/jit-test/tests/auto-regress/bug1343513.js b/js/src/jit-test/tests/auto-regress/bug1343513.js new file mode 100644 index 0000000000..03f48d3912 --- /dev/null +++ b/js/src/jit-test/tests/auto-regress/bug1343513.js @@ -0,0 +1,9 @@ +// |jit-test| error:RangeError; skip-if: largeArrayBufferSupported(); --ion-warmup-threshold=50 +setJitCompilerOption("offthread-compilation.enable", 0); +gcPreserveCode(); + +var i = 0; +do { + i++; + var ta = new Int32Array(inIon() ? 0x7fffffff : 1); +} while (!inIon()); diff --git a/js/src/jit-test/tests/auto-regress/bug1357330.js b/js/src/jit-test/tests/auto-regress/bug1357330.js new file mode 100644 index 0000000000..a657ba8024 --- /dev/null +++ b/js/src/jit-test/tests/auto-regress/bug1357330.js @@ -0,0 +1,17 @@ +function byteValue(value) { + var isLittleEndian = new Uint8Array(new Uint16Array([1]).buffer)[0] !== 0; + var ui8 = new Uint8Array(new Float64Array([value]).buffer); + + var hex = "0123456789ABCDEF"; + var s = ""; + for (var i = 0; i < 8; ++i) { + var v = ui8[isLittleEndian ? 7 - i : i]; + s += hex[(v >> 4) & 0xf] + hex[v & 0xf]; + } + return s; +} + +var obj = {}; +Object.defineProperty(obj, "prop", {value: NaN}); +Object.defineProperty(obj, "prop", {value: -NaN}); +assertEq(byteValue(obj.prop), byteValue(NaN)); diff --git a/js/src/jit-test/tests/auto-regress/bug1357462.js b/js/src/jit-test/tests/auto-regress/bug1357462.js new file mode 100644 index 0000000000..f2364951fb --- /dev/null +++ b/js/src/jit-test/tests/auto-regress/bug1357462.js @@ -0,0 +1,6 @@ +var p = Object.freeze(["old-value"]); +var a = Object.setPrototypeOf([], p); + +assertEq(p[0], "old-value"); +assertEq(Reflect.set(a, 0, "new-value", p), false); +assertEq(p[0], "old-value"); diff --git a/js/src/jit-test/tests/auto-regress/bug1375446.js b/js/src/jit-test/tests/auto-regress/bug1375446.js new file mode 100644 index 0000000000..ef8ae4c640 --- /dev/null +++ b/js/src/jit-test/tests/auto-regress/bug1375446.js @@ -0,0 +1,10 @@ +// |jit-test| allow-oom; skip-if: !('oomTest' in this) + +loadFile(` + disassemble(function() { + return assertDeepEq(x.concat(obj), [1, 2, 3, "hey"]); + }) +`); +function loadFile(lfVarx) { + oomTest(new Function(lfVarx)); +} diff --git a/js/src/jit-test/tests/auto-regress/bug1390082-1.js b/js/src/jit-test/tests/auto-regress/bug1390082-1.js new file mode 100644 index 0000000000..7b583f3a48 --- /dev/null +++ b/js/src/jit-test/tests/auto-regress/bug1390082-1.js @@ -0,0 +1,10 @@ +Object.defineProperty(Array.prototype, "2", { + set: function () {} +}); +async function* f() { + yield {}; +} +var x = f(); +x.next(); +x.next(); +x.next(); diff --git a/js/src/jit-test/tests/auto-regress/bug1390082-2.js b/js/src/jit-test/tests/auto-regress/bug1390082-2.js new file mode 100644 index 0000000000..40283ce896 --- /dev/null +++ b/js/src/jit-test/tests/auto-regress/bug1390082-2.js @@ -0,0 +1,14 @@ +Object.prototype.set = function () {}; +let f = async function* () { + yield; +}; +let x = f(); +x.next(); +x.next().then(function () { + x.next(); +}); +Object.defineProperty(Array.prototype, "0", { + get: function () { + return 1; + } +}); diff --git a/js/src/jit-test/tests/auto-regress/bug1416809-1.js b/js/src/jit-test/tests/auto-regress/bug1416809-1.js new file mode 100644 index 0000000000..067943575b --- /dev/null +++ b/js/src/jit-test/tests/auto-regress/bug1416809-1.js @@ -0,0 +1,12 @@ +// https://tc39.github.io/proposal-async-iteration + +// Recursion between: +// 11.4.3.3 AsyncGeneratorResolve, step 8 +// 11.4.3.5 AsyncGeneratorResumeNext, step 11. + +var asyncIter = async function*(){ yield; }(); +asyncIter.next(); + +for (var i = 0; i < 20000; i++) { + asyncIter.next(); +} diff --git a/js/src/jit-test/tests/auto-regress/bug1416809-2.js b/js/src/jit-test/tests/auto-regress/bug1416809-2.js new file mode 100644 index 0000000000..eb63cdbe33 --- /dev/null +++ b/js/src/jit-test/tests/auto-regress/bug1416809-2.js @@ -0,0 +1,14 @@ +// https://tc39.github.io/proposal-async-iteration + +// Recursion between: +// 11.4.3.4 AsyncGeneratorReject, step 7. +// 11.4.3.5 AsyncGeneratorResumeNext, step 10.b.ii.2. + +ignoreUnhandledRejections(); + +var asyncIter = async function*(){ yield; }(); +asyncIter.next(); + +for (var i = 0; i < 20000; i++) { + asyncIter.throw(); +} diff --git a/js/src/jit-test/tests/auto-regress/bug1448582-1.js b/js/src/jit-test/tests/auto-regress/bug1448582-1.js new file mode 100644 index 0000000000..28f2e3ea9f --- /dev/null +++ b/js/src/jit-test/tests/auto-regress/bug1448582-1.js @@ -0,0 +1,21 @@ +// Overview: +// - The outer function is an IIFE which gets marked as a singleton. +// - The |o[index]| inner function is then also marked as a singleton. +// - The |o[index]| inner function has a dynamic name from a computed property name. +// - The |self| inner function uses |Function.prototype.caller| to reinvoke the outer function. +// +// When we reinvoke outer, we end up cloning a previously reused, i.e. non-cloned, +// function which triggered an assertion in js::SetFunctionNameIfNoOwnName(). + +(function(index) { + var o = { + [index]: function() {} + }; + + // Reinvoke the IIFE through |Function.prototype.caller|. + if (index === 0) { + (function self() { + self.caller(1); + })(); + } +})(0); diff --git a/js/src/jit-test/tests/auto-regress/bug1448582-2.js b/js/src/jit-test/tests/auto-regress/bug1448582-2.js new file mode 100644 index 0000000000..fdf59d281b --- /dev/null +++ b/js/src/jit-test/tests/auto-regress/bug1448582-2.js @@ -0,0 +1,25 @@ +// Overview: +// - The outer function is an IIFE which gets marked as a singleton. +// - The |o[index]| inner function is then also marked as a singleton. +// - The |o[index]| inner function has a dynamic name from a computed property name. +// - The |self| inner function uses |Function.prototype.caller| to reinvoke the outer function. +// +// When we reinvoke outer, we end up cloning a previously reused, i.e. non-cloned, +// function which triggered an assertion in js::SetFunctionNameIfNoOwnName(). + +(function(index) { + var o = { + [index]: function() {} + }; + + // Accessing |.name| sets the resolved-name flag, which triggered yet + // another assertion when compared to bug1448582-1.js + assertEq(o[index].name, String(index)); + + // Reinvoke the IIFE through |Function.prototype.caller|. + if (index === 0) { + (function self() { + self.caller(1); + })(); + } +})(0); diff --git a/js/src/jit-test/tests/auto-regress/bug1448582-3.js b/js/src/jit-test/tests/auto-regress/bug1448582-3.js new file mode 100644 index 0000000000..d6d491f433 --- /dev/null +++ b/js/src/jit-test/tests/auto-regress/bug1448582-3.js @@ -0,0 +1,22 @@ +// Overview: +// - The outer function is an IIFE which gets marked as a singleton. +// - The |fn| inner function is then also marked as a singleton. +// - The |self| inner function uses |Function.prototype.caller| to reinvoke the outer function. +// +// When we reinvoke outer, we end up cloning a previously reused, i.e. non-cloned, +// function. + +(function(index) { + var fn = function() {}; + + // Accessing |.name| sets the resolved-name flag, which should not be + // copied over to the function clone. + assertEq(fn.name, "fn"); + + // Reinvoke the IIFE through |Function.prototype.caller|. + if (index === 0) { + (function self() { + self.caller(1); + })(); + } +})(0); diff --git a/js/src/jit-test/tests/auto-regress/bug1448582-4.js b/js/src/jit-test/tests/auto-regress/bug1448582-4.js new file mode 100644 index 0000000000..a806e4a2e8 --- /dev/null +++ b/js/src/jit-test/tests/auto-regress/bug1448582-4.js @@ -0,0 +1,22 @@ +// Overview: +// - The outer function is an IIFE which gets marked as a singleton. +// - The |fn| inner function is then also marked as a singleton. +// - The |self| inner function uses |Function.prototype.caller| to reinvoke the outer function. +// +// When we reinvoke outer, we end up cloning a previously reused, i.e. non-cloned, +// function. + +(function(index) { + var fn = function(a) {}; + + // Accessing |.length| sets the resolved-length flag, which should not be + // copied over to the function clone. + assertEq(fn.length, 1); + + // Reinvoke the IIFE through |Function.prototype.caller|. + if (index === 0) { + (function self() { + self.caller(1); + })(); + } +})(0); diff --git a/js/src/jit-test/tests/auto-regress/bug1448582-5.js b/js/src/jit-test/tests/auto-regress/bug1448582-5.js new file mode 100644 index 0000000000..a877ee6c1e --- /dev/null +++ b/js/src/jit-test/tests/auto-regress/bug1448582-5.js @@ -0,0 +1,133 @@ +// Repeat 1448582-{1,3,4}.js for classes. + +(function(index) { + // Does not assert. + var c = class { constructor(){} }; + + if (index === 0) { + (function self() { + self.caller(1); + })(); + } +})(0); + +(function(index) { + var c = class { constructor(){} }; + + // Accessing |.name| sets the resolved-name flag, which should not be + // copied over to the function clone. + assertEq(c.name, "c"); + + if (index === 0) { + (function self() { + self.caller(1); + })(); + } +})(0); + +(function(index) { + var c = class { constructor(a){} }; + + // Accessing |.length| sets the resolved-length flag, which should not be + // copied over to the function clone. + assertEq(c.length, 1); + + if (index === 0) { + (function self() { + self.caller(1); + })(); + } +})(0); + + +// Repeat 1448582-{3,4}.js for generator functions. + +(function(index) { + function* f() {} + + // Accessing |.name| sets the resolved-name flag, which should not be + // copied over to the function clone. + assertEq(f.name, "f"); + + if (index === 0) { + (function self() { + self.caller(1); + })(); + } +})(0); + +(function(index) { + function* f(a) {} + + // Accessing |.length| sets the resolved-length flag, which should not be + // copied over to the function clone. + assertEq(f.length, 1); + + if (index === 0) { + (function self() { + self.caller(1); + })(); + } +})(0); + + +// Repeat 1448582-{3,4}.js for async functions. + +(function(index) { + async function f() {} + + // Accessing |.name| sets the resolved-name flag, which should not be + // copied over to the function clone. + assertEq(f.name, "f"); + + if (index === 0) { + (function self() { + self.caller(1); + })(); + } +})(0); + +(function(index) { + async function f(a) {} + + // Accessing |.length| sets the resolved-length flag, which should not be + // copied over to the function clone. + assertEq(f.length, 1); + + if (index === 0) { + (function self() { + self.caller(1); + })(); + } +})(0); + + +// Repeat 1448582-{3,4}.js for async generator functions. + +(function(index) { + async function* f() {} + + // Accessing |.name| sets the resolved-name flag, which should not be + // copied over to the function clone. + assertEq(f.name, "f"); + + if (index === 0) { + (function self() { + self.caller(1); + })(); + } +})(0); + +(function(index) { + async function* f(a) {} + + // Accessing |.length| sets the resolved-length flag, which should not be + // copied over to the function clone. + assertEq(f.length, 1); + + if (index === 0) { + (function self() { + self.caller(1); + })(); + } +})(0); diff --git a/js/src/jit-test/tests/auto-regress/bug1448582-6.js b/js/src/jit-test/tests/auto-regress/bug1448582-6.js new file mode 100644 index 0000000000..b864a1c13a --- /dev/null +++ b/js/src/jit-test/tests/auto-regress/bug1448582-6.js @@ -0,0 +1,26 @@ +// Overview: +// - The outer function is an IIFE which gets marked as a singleton. +// - The |o[index]| inner function is then also marked as a singleton. +// - The |o[index]| inner function has a dynamic name from a computed property name. +// - The |self| inner function uses |Function.prototype.caller| to reinvoke the outer function. + +(function(index) { + var o = { + [index]: class { + constructor() {} + + // The static method named "name" is added after assigning the + // inferred name. + static [(index === 0 ? "not-name" : "name")]() {} + } + } + + // The inferred name matches the current index. + assertEq(displayName(o[index]), String(index)); + + if (index === 0) { + (function self() { + self.caller(1); + })(); + } +})(0); diff --git a/js/src/jit-test/tests/auto-regress/bug1454285.js b/js/src/jit-test/tests/auto-regress/bug1454285.js new file mode 100644 index 0000000000..9170977be6 --- /dev/null +++ b/js/src/jit-test/tests/auto-regress/bug1454285.js @@ -0,0 +1,86 @@ +// IteratorClose in for-await-of with block-scoped function. + +// Non-local-jump without target. + +(async function() { + for await (let c of []) { + function f() {}; + return; + } +})(); +(async function() { + for await (let c of []) { + function f() {}; + break; + } +})(); +(async function() { + for await (let c of []) { + function f() {}; + continue; + } +})(); + +// Non-local-jump with target. + +(async function() { + for (let x of []) { + x: for (let y of []) { + for await (let c of []) { + function f() {}; + return; + } + } + } +})(); +(async function() { + for (let x of []) { + x: for (let y of []) { + for await (let c of []) { + function f() {}; + break x; + } + } + } +})(); +(async function() { + for (let x of []) { + x: for (let y of []) { + for await (let c of []) { + function f() {}; + continue x; + } + } + } +})(); + +(async function() { + for await (let x of []) { + x: for await (let y of []) { + for await (let c of []) { + function f() {}; + return; + } + } + } +})(); +(async function() { + for await (let x of []) { + x: for await (let y of []) { + for await (let c of []) { + function f() {}; + break x; + } + } + } +})(); +(async function() { + for await (let x of []) { + x: for await (let y of []) { + for await (let c of []) { + function f() {}; + continue x; + } + } + } +})(); diff --git a/js/src/jit-test/tests/auto-regress/bug1460436-1.js b/js/src/jit-test/tests/auto-regress/bug1460436-1.js new file mode 100644 index 0000000000..8b1ddd4fbc --- /dev/null +++ b/js/src/jit-test/tests/auto-regress/bug1460436-1.js @@ -0,0 +1,5 @@ +for (var j = 0; j < 2; ++j) { + for (var k = 0; k < 2; ++k) { + assertEq(Math.sign(Math.PI ? 2 : (function() {})() ? h : l), 1) + } +} diff --git a/js/src/jit-test/tests/auto-regress/bug1460436-2.js b/js/src/jit-test/tests/auto-regress/bug1460436-2.js new file mode 100644 index 0000000000..5a6a7dc17a --- /dev/null +++ b/js/src/jit-test/tests/auto-regress/bug1460436-2.js @@ -0,0 +1,9 @@ +function f(y) { + Math.sign(y) ? n : undefined +} +f(); +function g() {}; +(function() { + for (var j = 0; j < 1100; ++j) + f(!1 ^ 1 ? undefined | 0 : +w()) +})(); diff --git a/js/src/jit-test/tests/auto-regress/bug1462341.js b/js/src/jit-test/tests/auto-regress/bug1462341.js new file mode 100644 index 0000000000..37c4f2129c --- /dev/null +++ b/js/src/jit-test/tests/auto-regress/bug1462341.js @@ -0,0 +1,12 @@ +// |jit-test| allow-oom; skip-if: !('oomTest' in this) + +loadFile(` + switch (0) { + case (-1): + } +`); +function loadFile(lfVarx) { + oomTest(function() { + let m = parseModule(lfVarx); + }); +} diff --git a/js/src/jit-test/tests/auto-regress/bug1466626-1.js b/js/src/jit-test/tests/auto-regress/bug1466626-1.js new file mode 100644 index 0000000000..f82c4de48e --- /dev/null +++ b/js/src/jit-test/tests/auto-regress/bug1466626-1.js @@ -0,0 +1,7 @@ +// |jit-test| skip-if: !('oomTest' in this) + +oomTest(function() { + for (var i = 0; i < 10; ++i) { + Promise.resolve().then(); + } +}); diff --git a/js/src/jit-test/tests/auto-regress/bug1466626-2.js b/js/src/jit-test/tests/auto-regress/bug1466626-2.js new file mode 100644 index 0000000000..056ea075e2 --- /dev/null +++ b/js/src/jit-test/tests/auto-regress/bug1466626-2.js @@ -0,0 +1,14 @@ +// |jit-test| skip-if: !('oomTest' in this) + +var globals = []; +for (var i = 0; i < 24; ++i) { + var g = newGlobal(); + globals.push(g); +} + +var i = 0; +oomTest(function() { + globals[(i++) % globals.length].eval(` + evaluate("function f() {}", {envChainObject: this.env}); + `); +}); diff --git a/js/src/jit-test/tests/auto-regress/bug1466626-3.js b/js/src/jit-test/tests/auto-regress/bug1466626-3.js new file mode 100644 index 0000000000..bffecfce73 --- /dev/null +++ b/js/src/jit-test/tests/auto-regress/bug1466626-3.js @@ -0,0 +1,13 @@ +// |jit-test| skip-if: !('oomTest' in this) + +var g = newGlobal(); + +var i = 0; +oomTest(function() { + var s = String.fromCharCode((i++) & 0xffff); + var r = ""; + for (var j = 0; j < 1000; ++j) { + r = s + r; + } + g.String.prototype.toString.call(r); +}); diff --git a/js/src/jit-test/tests/auto-regress/bug1466626-4.js b/js/src/jit-test/tests/auto-regress/bug1466626-4.js new file mode 100644 index 0000000000..aa02a3ba08 --- /dev/null +++ b/js/src/jit-test/tests/auto-regress/bug1466626-4.js @@ -0,0 +1,10 @@ +// |jit-test| skip-if: !('oomTest' in this) + +var source = "{"; +for (var i = 0; i < 120; ++i) + source += `function f${i}(){}` +source += "}"; + +oomTest(function() { + Function(source); +}); diff --git a/js/src/jit-test/tests/auto-regress/bug1468629.js b/js/src/jit-test/tests/auto-regress/bug1468629.js new file mode 100644 index 0000000000..da2bb51899 --- /dev/null +++ b/js/src/jit-test/tests/auto-regress/bug1468629.js @@ -0,0 +1,11 @@ +function lfEvalInCache(lfCode, lfIncremental = false, lfRunOnce = false) { + let ctx = {}; + let code = cacheEntry(lfCode); + ctx_save = Object.create(ctx, { saveIncrementalBytecode: { value: true } }); + try { evaluate(code, ctx_save); } catch(exc) {} + try { evaluate(code, Object.create(ctx_save, { loadBytecode: { value: true } })); } catch(exc) {} +} +lfEvalInCache(` + function q() {} + Object.freeze(this); +`, false, true); diff --git a/js/src/jit-test/tests/auto-regress/bug1476417.js b/js/src/jit-test/tests/auto-regress/bug1476417.js new file mode 100644 index 0000000000..7748723f7e --- /dev/null +++ b/js/src/jit-test/tests/auto-regress/bug1476417.js @@ -0,0 +1,22 @@ +function f(x) { + var y, z; + + arguments; // Force creation of mapped arguments, so modifying |x| writes to the arguments object. + Math; // Access a global variable to create a resume point. + z = x + 1; // Was executed twice because only the resume point for 'Math' was present before the fix. + x = z; // Modifying |x| writes into the arguments object. We missed to create a resume point here. + y = 2 * x; // Triggers a bailout when overflowing int32 boundaries. + + return [x, y]; +} + +var x = [0, 0, 0x3FFFFFFF]; + +for (var j = 0; j < 3; ++j) { + var value = x[j]; + var expected = [value + 1, (value + 1) * 2]; + var actual = f(value); + + assertEq(actual[0], expected[0]); + assertEq(actual[1], expected[1]); +} diff --git a/js/src/jit-test/tests/auto-regress/bug1479076.js b/js/src/jit-test/tests/auto-regress/bug1479076.js new file mode 100644 index 0000000000..d3d5f9d6e2 --- /dev/null +++ b/js/src/jit-test/tests/auto-regress/bug1479076.js @@ -0,0 +1,6 @@ +fullcompartmentchecks(true); +var dbg = new Debugger(); +var g = newGlobal({newCompartment: true}); +g.eval("function f(){}"); +dbg.addDebuggee(g); +dbg.findScripts(); diff --git a/js/src/jit-test/tests/auto-regress/bug1481032.js b/js/src/jit-test/tests/auto-regress/bug1481032.js new file mode 100644 index 0000000000..f1384d6e96 --- /dev/null +++ b/js/src/jit-test/tests/auto-regress/bug1481032.js @@ -0,0 +1,6 @@ +x = []; +x[6] = 0; +Object.preventExtensions(x); + +// Don't assert. +x.length = 1; diff --git a/js/src/jit-test/tests/auto-regress/bug1483188.js b/js/src/jit-test/tests/auto-regress/bug1483188.js new file mode 100644 index 0000000000..0aebdba25c --- /dev/null +++ b/js/src/jit-test/tests/auto-regress/bug1483188.js @@ -0,0 +1,13 @@ +var P = newGlobal().eval(` +(class extends Promise { + static resolve(o) { + return o; + } +}); +`); +var alwaysPending = new Promise(() => {}); +function neverCalled() { + assertEq(true, false); +} +P.race([alwaysPending]).then(neverCalled, neverCalled); + diff --git a/js/src/jit-test/tests/auto-regress/bug1500255.js b/js/src/jit-test/tests/auto-regress/bug1500255.js new file mode 100644 index 0000000000..7a09cf2397 --- /dev/null +++ b/js/src/jit-test/tests/auto-regress/bug1500255.js @@ -0,0 +1,9 @@ + +setJitCompilerOption("offthread-compilation.enable", 0); +setJitCompilerOption("ion.warmup.trigger", 100); + +Array.prototype.__proto__ = function() {}; +var LENGTH = 1024; +var big = []; +for (var i = 0; i < LENGTH; i++) + big[i] = i; diff --git a/js/src/jit-test/tests/auto-regress/bug1524943.js b/js/src/jit-test/tests/auto-regress/bug1524943.js new file mode 100644 index 0000000000..1c5cc34123 --- /dev/null +++ b/js/src/jit-test/tests/auto-regress/bug1524943.js @@ -0,0 +1,4 @@ +Object.prototype[Symbol.iterator] = Array.prototype[Symbol.iterator]; + +// Just ensure it doesn't crash. +Uint8Array.from(0); diff --git a/js/src/jit-test/tests/auto-regress/bug1538542-1.js b/js/src/jit-test/tests/auto-regress/bug1538542-1.js new file mode 100644 index 0000000000..5057de6f94 --- /dev/null +++ b/js/src/jit-test/tests/auto-regress/bug1538542-1.js @@ -0,0 +1,13 @@ +var lfOffThreadGlobal = newGlobal(); +nukeAllCCWs(); +const thisGlobal = this; +const otherGlobalNewCompartment = newGlobal({ + newCompartment: true +}); +let { transplant } = transplantableObject(); + +// Just don't crash. +try { + transplant(otherGlobalNewCompartment); + transplant(thisGlobal); +} catch {} diff --git a/js/src/jit-test/tests/auto-regress/bug1538542-2.js b/js/src/jit-test/tests/auto-regress/bug1538542-2.js new file mode 100644 index 0000000000..3efc05ceb6 --- /dev/null +++ b/js/src/jit-test/tests/auto-regress/bug1538542-2.js @@ -0,0 +1,13 @@ +var lfOffThreadGlobal = newGlobal(); +nukeAllCCWs(); +const thisGlobal = this; +const otherGlobalNewCompartment = newGlobal({ + newCompartment: false +}); +let { transplant } = transplantableObject(); + +// Just don't crash. +try { + transplant(otherGlobalNewCompartment); + transplant(thisGlobal); +} catch {} diff --git a/js/src/jit-test/tests/auto-regress/bug1544364.js b/js/src/jit-test/tests/auto-regress/bug1544364.js new file mode 100644 index 0000000000..672bbae784 --- /dev/null +++ b/js/src/jit-test/tests/auto-regress/bug1544364.js @@ -0,0 +1,8 @@ +// |jit-test| error:Error + +let sandbox = evalcx("lazy"); + +let domObject = new FakeDOMObject(); +let {object, transplant} = transplantableObject({object: domObject}); + +transplant(sandbox); diff --git a/js/src/jit-test/tests/auto-regress/bug1546232-2.js b/js/src/jit-test/tests/auto-regress/bug1546232-2.js new file mode 100644 index 0000000000..bde98444c8 --- /dev/null +++ b/js/src/jit-test/tests/auto-regress/bug1546232-2.js @@ -0,0 +1,8 @@ +var g = newGlobal(); +g.eval(` +Array.from(function*() { + yield 1; + relazifyFunctions(); + yield 1; +}()); +`); diff --git a/js/src/jit-test/tests/auto-regress/bug1546232.js b/js/src/jit-test/tests/auto-regress/bug1546232.js new file mode 100644 index 0000000000..4c3204b809 --- /dev/null +++ b/js/src/jit-test/tests/auto-regress/bug1546232.js @@ -0,0 +1,4 @@ +var g = newGlobal(); +g.Int8Array.from([]); +relazifyFunctions(); +g.eval("[].values()"); diff --git a/js/src/jit-test/tests/auto-regress/bug1562102.js b/js/src/jit-test/tests/auto-regress/bug1562102.js new file mode 100644 index 0000000000..78f5ef9010 --- /dev/null +++ b/js/src/jit-test/tests/auto-regress/bug1562102.js @@ -0,0 +1,12 @@ +// |jit-test| allow-oom; allow-unhandlable-oom; skip-if: !('oomTest' in this) +oomTest( + function() { + evaluate(` +class C { + c; +} +`, { + compileAndGo: true +}); + } +) diff --git a/js/src/jit-test/tests/auto-regress/bug1574415.js b/js/src/jit-test/tests/auto-regress/bug1574415.js new file mode 100644 index 0000000000..81c61c41da --- /dev/null +++ b/js/src/jit-test/tests/auto-regress/bug1574415.js @@ -0,0 +1,11 @@ +var err = 0; + +for (let x of [0, Object.create(null)]) { + try { + (new Int8Array)[1] = x; + } catch (e) { + err += 1; + } +} + +assertEq(err, 1); diff --git a/js/src/jit-test/tests/auto-regress/bug1591019.js b/js/src/jit-test/tests/auto-regress/bug1591019.js new file mode 100644 index 0000000000..2c2aff3f44 --- /dev/null +++ b/js/src/jit-test/tests/auto-regress/bug1591019.js @@ -0,0 +1,4 @@ +// |jit-test| --ion-gvn=off; + +"foo".charAt(3.4); +for (name of []) {} diff --git a/js/src/jit-test/tests/auto-regress/bug1593971.js b/js/src/jit-test/tests/auto-regress/bug1593971.js new file mode 100644 index 0000000000..42ffbbd855 --- /dev/null +++ b/js/src/jit-test/tests/auto-regress/bug1593971.js @@ -0,0 +1,7 @@ +var ta = new Uint32Array(10); + +// Shadow the %TypedArray.prototype%.length getter. +Object.defineProperty(ta, "length", {value: 0x1000}); + +// Call Array.prototype.fill, not %TypedArray.prototype%.fill! +Array.prototype.fill.call(ta, 0); diff --git a/js/src/jit-test/tests/auto-regress/bug1652148.js b/js/src/jit-test/tests/auto-regress/bug1652148.js new file mode 100644 index 0000000000..232957edb6 --- /dev/null +++ b/js/src/jit-test/tests/auto-regress/bug1652148.js @@ -0,0 +1,5 @@ +// |jit-test| skip-if: !('oomTest' in this) + +oomTest(() => { + new AggregateError([]); +}); diff --git a/js/src/jit-test/tests/auto-regress/bug1652153.js b/js/src/jit-test/tests/auto-regress/bug1652153.js new file mode 100644 index 0000000000..875949c7ea --- /dev/null +++ b/js/src/jit-test/tests/auto-regress/bug1652153.js @@ -0,0 +1,12 @@ +// |jit-test| skip-if: !('oomTest' in this) + +x = "x"; + +lFile(x); + +function lFile() { + return oomTest(function() { + let error = new Error("foobar"); + let report = createErrorReport(error); + }); +} diff --git a/js/src/jit-test/tests/auto-regress/bug1669914.js b/js/src/jit-test/tests/auto-regress/bug1669914.js new file mode 100644 index 0000000000..9e433f685f --- /dev/null +++ b/js/src/jit-test/tests/auto-regress/bug1669914.js @@ -0,0 +1,10 @@ +function v0(v1, v2) { + try { + v3 = v0(); + } catch (v4) { + if (typeof disassemble === "function") { + disassemble("-r", Function("()=>e,d")); + } + } +} +v24 = v0("matchAll"); diff --git a/js/src/jit-test/tests/auto-regress/bug1670378.js b/js/src/jit-test/tests/auto-regress/bug1670378.js new file mode 100644 index 0000000000..da3c1e93dd --- /dev/null +++ b/js/src/jit-test/tests/auto-regress/bug1670378.js @@ -0,0 +1,8 @@ +// |jit-test| allow-unhandlable-oom; skip-if: !('oomTest' in this) + +const otherGlobalNewCompartment = newGlobal({newCompartment: true}); + +oomTest(function() { + let {transplant} = transplantableObject(); + transplant(otherGlobalNewCompartment); +}); diff --git a/js/src/jit-test/tests/auto-regress/bug1689880-1.js b/js/src/jit-test/tests/auto-regress/bug1689880-1.js new file mode 100644 index 0000000000..e2da308010 --- /dev/null +++ b/js/src/jit-test/tests/auto-regress/bug1689880-1.js @@ -0,0 +1,14 @@ +// |jit-test| error: ReferenceError + +// We elide the uninitialised lexical check for the second access to |x|, +// because we statically know that the first access will throw an error. +// `!x` is compiled straight from bytecode without going through any ICs, so +// already on first (eager) compilation we may be Warp compiling. + +function testNot(x = (x, !x)) { + function inner() { + // Close over |x|. + x; + } +} +testNot(); diff --git a/js/src/jit-test/tests/auto-regress/bug1689880-2.js b/js/src/jit-test/tests/auto-regress/bug1689880-2.js new file mode 100644 index 0000000000..2fefdc7ce2 --- /dev/null +++ b/js/src/jit-test/tests/auto-regress/bug1689880-2.js @@ -0,0 +1,14 @@ +// |jit-test| error: ReferenceError + +// We elide the uninitialised lexical check for the second access to |x|, +// because we statically know that the first access will throw an error. +// `x ? . : .` is compiled straight from bytecode without going through any +// ICs, so already on first (eager) compilation we may be Warp compiling. + +function testConditional(x = (x, (x ? 1 : 0))) { + function inner() { + // Close over |x|. + x; + } +} +testConditional(); diff --git a/js/src/jit-test/tests/auto-regress/bug1736307.js b/js/src/jit-test/tests/auto-regress/bug1736307.js new file mode 100644 index 0000000000..7fe3cbb6d9 --- /dev/null +++ b/js/src/jit-test/tests/auto-regress/bug1736307.js @@ -0,0 +1,3 @@ +for (var i = 0; i < 100; ++i) { + assertEq(typeof Uint16Array == undefined, false); +} diff --git a/js/src/jit-test/tests/auto-regress/bug1750496.js b/js/src/jit-test/tests/auto-regress/bug1750496.js new file mode 100644 index 0000000000..1cac966546 --- /dev/null +++ b/js/src/jit-test/tests/auto-regress/bug1750496.js @@ -0,0 +1,8 @@ +// |jit-test| --ion-offthread-compile=off; --ion-warmup-threshold=6; --baseline-warmup-threshold=0; --small-function-length=1024; --inlining-entry-threshold=1; --trial-inlining-warmup-threshold=5; +for (let v1 = 0; v1 < 4; v1++) { + const v28 = "aa".split(''); + v28[0] = 1; + const v35 = "aa".split(''); + assertEq(v35[0], "a"); + assertEq(Object.is(v35, v28), false); +} diff --git a/js/src/jit-test/tests/auto-regress/bug1763501.js b/js/src/jit-test/tests/auto-regress/bug1763501.js new file mode 100644 index 0000000000..72ce59903b --- /dev/null +++ b/js/src/jit-test/tests/auto-regress/bug1763501.js @@ -0,0 +1,6 @@ +function test(expected) { + with ({}) assertEq(new.target, expected); +} + +test(undefined); +new test(test); diff --git a/js/src/jit-test/tests/auto-regress/bug1765028.js b/js/src/jit-test/tests/auto-regress/bug1765028.js new file mode 100644 index 0000000000..dc39692334 --- /dev/null +++ b/js/src/jit-test/tests/auto-regress/bug1765028.js @@ -0,0 +1,3 @@ +gczeal(6, 1); +var a = []; +Array.call(a); diff --git a/js/src/jit-test/tests/auto-regress/bug1765249.js b/js/src/jit-test/tests/auto-regress/bug1765249.js new file mode 100644 index 0000000000..9c6ae09b92 --- /dev/null +++ b/js/src/jit-test/tests/auto-regress/bug1765249.js @@ -0,0 +1,34 @@ + // |jit-test| --fast-warmup; --no-threads + +function main() { + // Disable Warp compilation, so we don't inline |f|. + with ({}) {} + + let begin = 0; + for (let i = 1; i < 30; i++) { + f(begin); + begin = undefined; + } +} +main(); + +function g(i) { + return i < 3; +} + +function f(begin) { + // Loop body is only reachable on the first invocation. + for (let i = begin; i < 5; i++) { + // |arguments| with out-of-bounds access. This adds a guard on the prototype + // of the arguments object. + arguments[100]; + + // Loop with a call expression. This ensures we emit bail instructions for + // unreachable code after the first invocation. + for (let j = 0; g(j); j++) {} + + // Change the prototype of the arguments object. This will cause a failure + // on the prototype guard added above. + arguments.__proto__ = {}; + } +} diff --git a/js/src/jit-test/tests/auto-regress/bug1766225.js b/js/src/jit-test/tests/auto-regress/bug1766225.js new file mode 100644 index 0000000000..1539114712 --- /dev/null +++ b/js/src/jit-test/tests/auto-regress/bug1766225.js @@ -0,0 +1,12 @@ +// |jit-test| --ion-offthread-compile=off; --ion-warmup-threshold=1; --ion-gvn=off + +gczeal(4) +function a() {} +function b() { + a(Array.prototype.slice.call(arguments, 1, 3)); +} +function c() { + b(1, 2); +} +for (i=0 ; i<200; ++i) + c() diff --git a/js/src/jit-test/tests/auto-regress/bug1783507.js b/js/src/jit-test/tests/auto-regress/bug1783507.js new file mode 100644 index 0000000000..a7a4fd7f57 --- /dev/null +++ b/js/src/jit-test/tests/auto-regress/bug1783507.js @@ -0,0 +1,17 @@ +function main(x) { + var ta = new Int32Array(10); + + for (var i = 0; i < 100; ++i) { + // MCompare::Compare_UIntPtr with result only used on bailout. + var r = 0 in ta; + + // Path only entered through bailout condition. + if (x) { + // |r| must be recovered on bailout here. + x(r); + } + } +} + +main(); +main(() => {}); diff --git a/js/src/jit-test/tests/auto-regress/bug1790543.js b/js/src/jit-test/tests/auto-regress/bug1790543.js new file mode 100644 index 0000000000..1fb70c9d00 --- /dev/null +++ b/js/src/jit-test/tests/auto-regress/bug1790543.js @@ -0,0 +1,7 @@ +Array.prototype[0] = 0; + +var a = []; +for (var i = 0; i < 10_000; ++i) + a.push(0); + +assertEq(a.length, 10_000); diff --git a/js/src/jit-test/tests/auto-regress/bug1791401.js b/js/src/jit-test/tests/auto-regress/bug1791401.js new file mode 100644 index 0000000000..6b3a7a5dbd --- /dev/null +++ b/js/src/jit-test/tests/auto-regress/bug1791401.js @@ -0,0 +1,19 @@ +// |jit-test| skip-if: !('oomTest' in this) + +oomTest(function() { + var f = Function(` + // Don't actually enter the loop. This still causes the original bug and + // additionally makes the test complete faster. + // + // Don't directly use |false|, otherwise the byte code emitter won't emit + // the loop. + var False = [false, false][0]; + if (False) { + for (let x;;) { + // Capture |x|, so it's freshened each loop iteration. + Object(() => x); + } + } + `); + f(); +}); diff --git a/js/src/jit-test/tests/auto-regress/bug1798883.js b/js/src/jit-test/tests/auto-regress/bug1798883.js new file mode 100644 index 0000000000..9ebe5daa2e --- /dev/null +++ b/js/src/jit-test/tests/auto-regress/bug1798883.js @@ -0,0 +1,11 @@ +// |jit-test| skip-if: !('oomTest' in this) + +// String with an initial part which doesn't need to be normalised and a tail +// which gets normalised to "\u05E9\u05BC\u05C1". +var s = "a".repeat(32) + String.fromCharCode(0xFB2C); + +oomTest(function() { + // |normalize()| needs to be called at least twice to trigger the bug. + s.normalize(); + s.normalize(); +});
\ No newline at end of file diff --git a/js/src/jit-test/tests/auto-regress/bug1805881.js b/js/src/jit-test/tests/auto-regress/bug1805881.js new file mode 100644 index 0000000000..8f3df42198 --- /dev/null +++ b/js/src/jit-test/tests/auto-regress/bug1805881.js @@ -0,0 +1,21 @@ +// |jit-test| --baseline-warmup-threshold=10; --ion-warmup-threshold=100 + +function blackhole() { + with ({}); +} + +function main() { + for (let i = 0; i < 100; i++) { + try { + const v3 = 0..toString(i); + for (let j = 0; j < 100; j++) { + } + blackhole(v3); + } catch { + } + for (let j = 0; j < 6; ++j) { + } + } +} + +main(); diff --git a/js/src/jit-test/tests/auto-regress/bug1812148.js b/js/src/jit-test/tests/auto-regress/bug1812148.js new file mode 100644 index 0000000000..9b8290b449 --- /dev/null +++ b/js/src/jit-test/tests/auto-regress/bug1812148.js @@ -0,0 +1,49 @@ +const f = (x) => 1; +for (let v4 = 0; v4 < 100; v4++) { + for (const v8 of "arguments") { + v8 == "a"; + Symbol.for().description; + Symbol.for(); + Symbol.for(); + } + const v16 = Symbol.search; + let v17 = v16.description; + Symbol.for("arguments"); + const v19 = v16.description; + v17 = 0; + const v21 = Symbol.for(v19).description; + Symbol.for(v21); + Symbol.for(v21); + const v25 = Symbol.for().description; + Symbol.for(); + Symbol.for(); + Symbol.for(); + Symbol.for().description; + Symbol.for(); + Symbol.for(); + Symbol.for().description; + Symbol.for(); + Symbol.for(v25).description; + Symbol.for(); + Symbol.for(); + Symbol.for(); + Symbol.for(); + const v42 = (1024)[v16]; + const v43 = Symbol(); + Symbol.for(v19).description; + Symbol.for(); + Symbol.for(); + Symbol.for(v21).description; + Symbol.for(); + Symbol.for(); + Symbol.for(); + Symbol.for(); + Symbol.for(); + Symbol.for(); + Symbol.for(); + Symbol[v43] ||= v42; +} +f(0); +f(0); +f(0); +f(0); diff --git a/js/src/jit-test/tests/auto-regress/bug1813387.js b/js/src/jit-test/tests/auto-regress/bug1813387.js new file mode 100644 index 0000000000..b6afc9d01a --- /dev/null +++ b/js/src/jit-test/tests/auto-regress/bug1813387.js @@ -0,0 +1,10 @@ +var g = newGlobal(); +function foo() { + try { + foo(); + } catch { + g.Reflect.construct(g.Uint8ClampedArray, new g.Int8Array); + } +} + +foo(); diff --git a/js/src/jit-test/tests/auto-regress/bug1863390.js b/js/src/jit-test/tests/auto-regress/bug1863390.js new file mode 100644 index 0000000000..f414fceb7c --- /dev/null +++ b/js/src/jit-test/tests/auto-regress/bug1863390.js @@ -0,0 +1,6 @@ +var left = "left-rope-child"; +var right = newString("right-rope-child", {twoByte: true}); +var rope = newRope(left, right); +var result = rope.substring(0, left.length + 1); + +assertEq(result, "left-rope-childr"); diff --git a/js/src/jit-test/tests/auto-regress/bug1863428.js b/js/src/jit-test/tests/auto-regress/bug1863428.js new file mode 100644 index 0000000000..29939549f3 --- /dev/null +++ b/js/src/jit-test/tests/auto-regress/bug1863428.js @@ -0,0 +1,10 @@ +// |jit-test| --fast-warmup; --no-threads + +function foo() { + var args = new Float32Array(10); + return args[0]?.toString(); +} + +for (var i = 0; i < 50; i++) { + foo() +} diff --git a/js/src/jit-test/tests/auto-regress/bug1874929.js b/js/src/jit-test/tests/auto-regress/bug1874929.js new file mode 100644 index 0000000000..d49355faee --- /dev/null +++ b/js/src/jit-test/tests/auto-regress/bug1874929.js @@ -0,0 +1,12 @@ +// |jit-test| --ion-offthread-compile=off; --small-function-length=1500 + +function test() { + var r = 0; + for (let i = 100; i >= 0; --i) { + for (let j = 0; j < 15; ++j) { + r += ("aaaaaaaaaa").padStart(i, "bbb").length; + } + } + assertEq(r, 76575); +} +test(); diff --git a/js/src/jit-test/tests/auto-regress/bug1875487.js b/js/src/jit-test/tests/auto-regress/bug1875487.js new file mode 100644 index 0000000000..e682652330 --- /dev/null +++ b/js/src/jit-test/tests/auto-regress/bug1875487.js @@ -0,0 +1,26 @@ +function f(i) { + // Add use of the boxed Int32 parameter |i| as a Double. + (2 ** i); + + // This call into |g| will get inlined and an inline-arguments object will be + // created. |i| was unboxed to Double earlier, but we must not store the + // unboxed Double into the inline-arguments object, because other uses of the + // boxed Int32 |i| may expect Int32 inputs. + return g(i); +} + +function g(i) { + // Add use of aliased |i| as an Int32. + if (i) { + // Add use |arguments| to make |i| an aliased variable which gets stored in + // the inline-arguments object. + return arguments; + } +} + +// Don't inline |f| into the top-level script. +with ({}); + +for (let i = 0; i < 4000; i++) { + f(i); +} diff --git a/js/src/jit-test/tests/auto-regress/bug1879688.js b/js/src/jit-test/tests/auto-regress/bug1879688.js new file mode 100644 index 0000000000..a05ae548b5 --- /dev/null +++ b/js/src/jit-test/tests/auto-regress/bug1879688.js @@ -0,0 +1,7 @@ +// |jit-test| skip-if: !('oomTest' in this) + +let x = 0; +oomTest(function () { + let y = x++; + [](y.toString(y)); +}); diff --git a/js/src/jit-test/tests/auto-regress/bug464116.js b/js/src/jit-test/tests/auto-regress/bug464116.js new file mode 100644 index 0000000000..f6b38cc5d2 --- /dev/null +++ b/js/src/jit-test/tests/auto-regress/bug464116.js @@ -0,0 +1,31 @@ +// Binary: cache/js-dbg-32-7d06dac3fe83-linux +// Flags: -j +// +function partOfSHA1(str) +{ + var rotate_left = function (n,s) { return ( n<<s ) | (n>>>(32-s)); }, + W = [], H0 = 0x67452301, + H1 = 0xEFCDAB89, H2 = 0x98BADCFE, + H3 = 0x10325476, H4 = 0xC3D2E1F0, + A, B, C, D, E, temp, str_len = str.length, + word_array = []; + i = 0x080000000; + word_array.push( (str_len<<3)&0x0ffffffff ); + for ( blockstart=0; blockstart<word_array.length; blockstart+=16 ) { + A = H0; + B = H1; + C = H2; + D = H3; + E = H4; + for (i= 0; i<=19; ++i) { + temp = (rotate_left(A,5) + ((B&C) | (~B&D)) + E + W[i] + 0x5A827999) & 0x0ffffffff; + E = D; + D = C; + C = rotate_left(B,30); + B = A; + A = temp; + } + } +} + +partOfSHA1(1226369254122); diff --git a/js/src/jit-test/tests/auto-regress/bug466076.js b/js/src/jit-test/tests/auto-regress/bug466076.js new file mode 100644 index 0000000000..a5985bd5f9 --- /dev/null +++ b/js/src/jit-test/tests/auto-regress/bug466076.js @@ -0,0 +1,8 @@ +// Binary: cache/js-dbg-32-2fa341c1330b-linux +// Flags: -j +// +for (let j = 0; j < 2; ++j) { + if (j) { + (function() {})(); + } +} diff --git a/js/src/jit-test/tests/auto-regress/bug469262.js b/js/src/jit-test/tests/auto-regress/bug469262.js new file mode 100644 index 0000000000..da05527a7f --- /dev/null +++ b/js/src/jit-test/tests/auto-regress/bug469262.js @@ -0,0 +1,10 @@ +// |jit-test| error:TypeError + +// Binary: cache/js-dbg-32-2c8e43e57337-linux +// Flags: -j +// +function b() { this.m(); } +var g = {m: function(){}}; +var a = [g, g, {}]; +for (var i = 0; i < a.length; ++i) + b.call(a[i]); diff --git a/js/src/jit-test/tests/auto-regress/bug477877.js b/js/src/jit-test/tests/auto-regress/bug477877.js new file mode 100644 index 0000000000..659b954690 --- /dev/null +++ b/js/src/jit-test/tests/auto-regress/bug477877.js @@ -0,0 +1,179 @@ +// Binary: cache/js-dbg-32-a419ff2cf0c5-linux +// Flags: -j +// +var l=[ +-88, +-37, +-12, +-5, +9, +-7, +41, +-9, +43, +-11, +34, +38, +-22, +-17, +-16, +-34, +-33, +62, +63, +-36, +50, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +-128 +]; +var bits = [1, +1, +1, +1, +1, +1, +1, +1, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +]; +var t = 0; +var c = 3407; +var i; + +while (c--) { + i = 0; + while (l[i] < 0) { + if (bits[t]) { + i = - l[i]; + } else { + ++i; + } + ++t; + } +} diff --git a/js/src/jit-test/tests/auto-regress/bug479747.js b/js/src/jit-test/tests/auto-regress/bug479747.js new file mode 100644 index 0000000000..897682d149 --- /dev/null +++ b/js/src/jit-test/tests/auto-regress/bug479747.js @@ -0,0 +1,9 @@ +// |jit-test| error:TypeError + +// Binary: cache/js-dbg-32-9174e1bbfa9f-linux +// Flags: -j +// +'a'.replace(/a/g, [].push); +x = []; +x++; +(function(){ eval("for(let y in []) [][x]"); })(); diff --git a/js/src/jit-test/tests/auto-regress/bug486139.js b/js/src/jit-test/tests/auto-regress/bug486139.js new file mode 100644 index 0000000000..e518eb1b93 --- /dev/null +++ b/js/src/jit-test/tests/auto-regress/bug486139.js @@ -0,0 +1,6 @@ +// |jit-test| skip-if: !this.uneval + +// Binary: cache/js-dbg-64-023cb4350567-linux +// Flags: +// +uneval((function(){([z] = []).y >>= x})); diff --git a/js/src/jit-test/tests/auto-regress/bug487320.js b/js/src/jit-test/tests/auto-regress/bug487320.js new file mode 100644 index 0000000000..01293b5765 --- /dev/null +++ b/js/src/jit-test/tests/auto-regress/bug487320.js @@ -0,0 +1,11 @@ +// Binary: cache/js-dbg-64-57213af4a45d-linux +// Flags: +// +function outer(x) { + return (function foo() { + this.bar = foo; + return x; + })(); +} +print(outer(42)); +print(bar()); // BOOM! diff --git a/js/src/jit-test/tests/auto-regress/bug487534.js b/js/src/jit-test/tests/auto-regress/bug487534.js new file mode 100644 index 0000000000..cf2c859c90 --- /dev/null +++ b/js/src/jit-test/tests/auto-regress/bug487534.js @@ -0,0 +1,5 @@ +// Binary: cache/js-dbg-32-96746395df4f-linux +// Flags: -j +// +var fs = { x: /a/, y: /a/, z: /a/ }; +for (var p in fs) { this[fs[p]] = null; } diff --git a/js/src/jit-test/tests/auto-regress/bug487563.js b/js/src/jit-test/tests/auto-regress/bug487563.js new file mode 100644 index 0000000000..66ce94c07f --- /dev/null +++ b/js/src/jit-test/tests/auto-regress/bug487563.js @@ -0,0 +1,17 @@ +// Binary: cache/js-dbg-64-86c8e18f20eb-linux +// Flags: +// +try { + !(Iterator(( + eval("\ + (function(){\ + (function a() { \ + new function(){\ + __iterator__ = a\ + }\ + }\ + )(); \ + return this\ + })") + )())) +} catch(e) {} diff --git a/js/src/jit-test/tests/auto-regress/bug488015.js b/js/src/jit-test/tests/auto-regress/bug488015.js new file mode 100644 index 0000000000..5d19c2b95b --- /dev/null +++ b/js/src/jit-test/tests/auto-regress/bug488015.js @@ -0,0 +1,29 @@ +// Binary: cache/js-dbg-64-e1257570fef8-linux +// Flags: +// +var a = []; +function addEventListener(e, f, g) +{ + a.push(f); +} +function setTimeout(f, t) +{ + a.push(f); +} +var b; +this.document = {}; +function e(w) { + addEventListener("mousedown", d, true); + function d() { + var d; + w.setTimeout(function() { + b(d); + }, 0); + } + function b(d){ + w.document; /* Crash Here!! */ + } +} +e(this); +a[0](); +a[1](); diff --git a/js/src/jit-test/tests/auto-regress/bug488034.js b/js/src/jit-test/tests/auto-regress/bug488034.js new file mode 100644 index 0000000000..fa816d1a29 --- /dev/null +++ b/js/src/jit-test/tests/auto-regress/bug488034.js @@ -0,0 +1,7 @@ +// Binary: cache/js-dbg-64-e1257570fef8-linux +// Flags: +// +(function(){ + var x; + eval("var x; ((function () { return x; })())"); +})() diff --git a/js/src/jit-test/tests/auto-regress/bug488203.js b/js/src/jit-test/tests/auto-regress/bug488203.js new file mode 100644 index 0000000000..a24fae3464 --- /dev/null +++ b/js/src/jit-test/tests/auto-regress/bug488203.js @@ -0,0 +1,13 @@ +// |jit-test| error:InternalError + +// Binary: cache/js-dbg-32-756dd46daf6c-linux +// Flags: -j +// +var d = { + p: function () { + for (var i = 0; i < 9; ++i); + with (d) { q(); } + } +}; +d.q = function() { eval('this.p()'); } +d.p(); diff --git a/js/src/jit-test/tests/auto-regress/bug488421.js b/js/src/jit-test/tests/auto-regress/bug488421.js new file mode 100644 index 0000000000..c81684420a --- /dev/null +++ b/js/src/jit-test/tests/auto-regress/bug488421.js @@ -0,0 +1,12 @@ +// Binary: cache/js-dbg-64-862693caa320-linux +// Flags: +// +function f(foo) +{ + var x; + eval("this.__defineGetter__(\"y\", function () { return x; })"); +} +f(""); +try { +((function(){ throw y })()) +} catch(exc1) {} diff --git a/js/src/jit-test/tests/auto-regress/bug488693.js b/js/src/jit-test/tests/auto-regress/bug488693.js new file mode 100644 index 0000000000..ddc6b42163 --- /dev/null +++ b/js/src/jit-test/tests/auto-regress/bug488693.js @@ -0,0 +1,4 @@ +// Binary: cache/js-dbg-32-ec03b7905b5a-linux +// Flags: -j +// +(new Function("for (var x = 0; x < 2; ++x) { gczeal(2)} "))() diff --git a/js/src/jit-test/tests/auto-regress/bug489040.js b/js/src/jit-test/tests/auto-regress/bug489040.js new file mode 100644 index 0000000000..2541e84199 --- /dev/null +++ b/js/src/jit-test/tests/auto-regress/bug489040.js @@ -0,0 +1,4 @@ +// Binary: cache/js-dbg-32-c319b49e2880-linux +// Flags: -j +// +for (var y = 0; y < 2; ++y) { (/x/)[this] } diff --git a/js/src/jit-test/tests/auto-regress/bug489836.js b/js/src/jit-test/tests/auto-regress/bug489836.js new file mode 100644 index 0000000000..ba105cb5a2 --- /dev/null +++ b/js/src/jit-test/tests/auto-regress/bug489836.js @@ -0,0 +1,13 @@ +// Binary: cache/js-dbg-32-1a1611bb1063-linux +// Flags: -j +// +var e; +function w(f, y) { + e = 2 * f; + for (var i = 0; i < 1; i++) { + } +} +for (var u = 0; u < 4; ++u) { + w(undefined, 0); + w(1, (2) * 2); +} diff --git a/js/src/jit-test/tests/auto-regress/bug490191.js b/js/src/jit-test/tests/auto-regress/bug490191.js new file mode 100644 index 0000000000..d198832cbd --- /dev/null +++ b/js/src/jit-test/tests/auto-regress/bug490191.js @@ -0,0 +1,15 @@ +// Binary: cache/js-dbg-64-daefd30072a6-linux +// Flags: +// +function f(param) { + var w; + return eval("\ + (function(){\ + this.__defineGetter__(\"y\", function() { return ({\ + x: function(){ return w }()\ + }); })\ + });\ + "); +} +(f())(); +(new Function("eval(\"y\")"))(); diff --git a/js/src/jit-test/tests/auto-regress/bug490776.js b/js/src/jit-test/tests/auto-regress/bug490776.js new file mode 100644 index 0000000000..2348f1269c --- /dev/null +++ b/js/src/jit-test/tests/auto-regress/bug490776.js @@ -0,0 +1,37 @@ +// |jit-test| error:TypeError + +// Binary: cache/js-dbg-32-7504904b5f8f-linux +// Flags: -j +// +Object.extend = function(destination, source) { + for (var property in source) + destination[property] = source[property] +} +Object.extend(Function.prototype, { + curry: function() { + var __method = this, + args = $A(arguments) + return function() { + return __method( + arguments) + } + }, + wrap: function(wrapper) { + return function() { ([]( + $A(arguments))) + } + } +}) +function $A(iterable) { + var length = iterable.length + while (length--); +} +var ga = { + c: 3, + d: 4 +} +ga. +__defineGetter__("", /x/.test.wrap("").curry(true, "")) +for (var p in ga) { + ga[p] +} diff --git a/js/src/jit-test/tests/auto-regress/bug495843.js b/js/src/jit-test/tests/auto-regress/bug495843.js new file mode 100644 index 0000000000..673e8294ec --- /dev/null +++ b/js/src/jit-test/tests/auto-regress/bug495843.js @@ -0,0 +1,5 @@ +// Binary: cache/js-dbg-64-fe91973cc783-linux +// Flags: +// +const [x]=''; +for(;[] && false;){} diff --git a/js/src/jit-test/tests/auto-regress/bug496245.js b/js/src/jit-test/tests/auto-regress/bug496245.js new file mode 100644 index 0000000000..800257dcb2 --- /dev/null +++ b/js/src/jit-test/tests/auto-regress/bug496245.js @@ -0,0 +1,6 @@ +// |jit-test| error:TypeError + +// Binary: cache/js-dbg-64-9d6f5ab54933-linux +// Flags: +// +(function(a){ 1(function(){delete a;}); })(); diff --git a/js/src/jit-test/tests/auto-regress/bug496325.js b/js/src/jit-test/tests/auto-regress/bug496325.js new file mode 100644 index 0000000000..4f901d9f72 --- /dev/null +++ b/js/src/jit-test/tests/auto-regress/bug496325.js @@ -0,0 +1,19 @@ +// Binary: cache/js-dbg-32-9d6f5ab54933-linux +// Flags: -j +// +(function() { + var Y = function() {}; + function g() { + function f(x) { + for (var j = 0; j < 1; ++j) { + x.apply(this); + } + } + return function() { + f(Y); + } + }; + for (var i = 0; i < 2; ++i) { + g()(); + } +})(); diff --git a/js/src/jit-test/tests/auto-regress/bug499169.js b/js/src/jit-test/tests/auto-regress/bug499169.js new file mode 100644 index 0000000000..fd6b8c3446 --- /dev/null +++ b/js/src/jit-test/tests/auto-regress/bug499169.js @@ -0,0 +1,179 @@ +// Binary: cache/js-dbg-32-30b481fd82f5-linux +// Flags: -j +// +var Native = function(k) { + var f = k.initialize; + var d = f; + var j = function(n, l, o, m) { + n.prototype[l] = o; + }; + d.alias = function(n, l, o) { + n = this.prototype[n] + return j(this, l, n, o); + }; + d.implement = function(m, l, o) { + for (var n in m) { + j(this, n, m[n], l); + } + } + return d; +}; +(function() { + var a = { + Array: Array, + Function: Function, + }; + for (var h in a) { + new Native({ + initialize: a[h], + }); + } +} ()); +Array.alias("forEach", "each"); +function $merge() { + var a = Array.prototype.slice.call(arguments); + a.unshift({}); + return $mixin.apply(null, a); +} +function $mixin(e) { + for (var d = 1, a = arguments.length; d < a; d++) { + var b = arguments[d]; + for (var c in b) { + var g = b[c], + f = e[c]; + e[c] = f && $type(g) == "object" && $type(f) == "object" ? $mixin(f, g) : $unlink(g); + } + } +} +function $type(a) { + if (a == undefined) { + return false; + } + if (a.$family) { + } + return typeof a; +} +function $unlink(c) { + if ($type(c) == "object") { + b = {}; + } + return b; +} +var Window = new Native({ + initialize: function(a) {}, +}); +Array.implement({ + extend: function(c) { + return this; + } +}); +Function.implement({ + extend: function(a) { + for (var b in a) { + this[b] = a[b]; + } + return this; + }, + run: function(a, b) { + return this.apply(b, a); + } +}); +function Class(b) { + var a = function() { + Object.reset(this); + var c = this.initialize ? this.initialize.apply(this, arguments) : this; + }.extend(this); + a.implement(b); + return a; +} +Object.reset = function(a, c) { + if (c == null) { + for (var e in a) { + Object.reset(a, e); + } + } + switch ($type(a[c])) { + case "object": + var d = function() {}; + d.prototype = a[c]; + var b = new d; + a[c] = Object.reset(b); + } + return a; +}; +(new Native({initialize: Class})).extend({}); + function wrap(a, b, c) { + return function() { + var d = c.apply(this, arguments); + }.extend({}); + } +Class.implement({ + implement: function(a, d) { + if ($type(a) == "object") { + for (var e in a) { + this.implement(e, a[e]); + } + } + var f = Class.Mutators[a]; + if (f) { + d = f.call(this, d); + } + var c = this.prototype; + switch ($type(d)) { + case "function": + c[a] = wrap(this, a, d); + break; + case "object": + var b = c[a]; + if ($type(b) == "object") { + $mixin(b, d); + } else { + c[a] = $unlink(d); + } + } + } +}); +Class.Mutators = { + Extends: function(a) { + this.prototype = new a; + }, + Implements: function(a) { + a.each(function(b) { + b = new b; + this.implement(b); + }, + this); + } +}; +var Events = new Class({}); +var Options = new Class({ + setOptions: function() { + this.options = $merge.run([this.options].extend(arguments)); + } +}); +var Autocompleter = {}; +Autocompleter.Base = new Class({ + Implements: [Options, Events], + options: {}, +}); +Autocompleter.Ajax = {}; +Autocompleter.Ajax.Base = new Class({ + Extends: Autocompleter.Base, + options: { + postVar: "value", + onRequest: function(){}, + } +}); +Autocompleter.Ajax.Json = new Class({ + Extends: Autocompleter.Ajax.Base, +}); +Autocompleter.JsonP = new Class({ + Extends: Autocompleter.Ajax.Json, + options: { + minLength: 1 + }, + initialize: function(el, url, options) { + this.setOptions({}); + } +}); +new Autocompleter.JsonP(); diff --git a/js/src/jit-test/tests/auto-regress/bug502604.js b/js/src/jit-test/tests/auto-regress/bug502604.js new file mode 100644 index 0000000000..79be300e21 --- /dev/null +++ b/js/src/jit-test/tests/auto-regress/bug502604.js @@ -0,0 +1,30 @@ +// Binary: cache/js-dbg-32-b4fee3813956-linux +// Flags: -j +// +var aej=new Array( 'A3|297|420', 'dummy|1|1' ); +var aes=aej.length-1, +aet=new Array(); +for(var i=0; i <= aes; ++i) + aet[i] = aej[i].split('|'); +afo=4; +R=new Array( + '17523|2500|275||', + '17524|5000|300.3||', + '17535|500|207.4|=|120x120|=|=|=|=|=|=|=', + '17556|500|349.3|=|A5|=|=|=|=|=|=|=' +); +var ags = R.length-1; +px= new Array(); +for(var i=1; i<=ags; i++) { + px[i] = R[i].split('|'); + for(var j=0; j<=11;j++) + agt = ank(px[i][afo]); +} +function ank(akr) { + var XX=YY=0; + for(var i=0;i<aet.length;i++) + if((XX==0) && (akr.indexOf('x')>0)) { + var tt=akr.split('x'); + XX=tt[0];YY=tt[1] + } +} diff --git a/js/src/jit-test/tests/auto-regress/bug505305.js b/js/src/jit-test/tests/auto-regress/bug505305.js new file mode 100644 index 0000000000..9b86db3ef8 --- /dev/null +++ b/js/src/jit-test/tests/auto-regress/bug505305.js @@ -0,0 +1,5 @@ +// Binary: cache/js-dbg-32-aa85b2f55960-linux +// Flags: +// +var str = 'afoo$40bar'.substr(1); +print(str.replace(str, str)); diff --git a/js/src/jit-test/tests/auto-regress/bug511938.js b/js/src/jit-test/tests/auto-regress/bug511938.js new file mode 100644 index 0000000000..3e2df3bc94 --- /dev/null +++ b/js/src/jit-test/tests/auto-regress/bug511938.js @@ -0,0 +1,8 @@ +// Binary: cache/js-dbg-32-16baceea5fe2-linux +// Flags: -j +// +(function () { + for (let x = 0; x < 4; ++x) { + gczeal(2) + } +})() diff --git a/js/src/jit-test/tests/auto-regress/bug521163.js b/js/src/jit-test/tests/auto-regress/bug521163.js new file mode 100644 index 0000000000..f25648f0df --- /dev/null +++ b/js/src/jit-test/tests/auto-regress/bug521163.js @@ -0,0 +1,11 @@ +// |jit-test| error:ReferenceError + +// Binary: cache/js-dbg-32-c08baee44cf4-linux +// Flags: +// +for (c in [0]) { + { + let c = this.__defineGetter__("", function(){}); + eval("function w(){}")++ + } +} diff --git a/js/src/jit-test/tests/auto-regress/bug521279.js b/js/src/jit-test/tests/auto-regress/bug521279.js new file mode 100644 index 0000000000..1950ea0772 --- /dev/null +++ b/js/src/jit-test/tests/auto-regress/bug521279.js @@ -0,0 +1,6 @@ +// |jit-test| error:ReferenceError + +// Binary: cache/js-dbg-32-ca95f2397bc5-linux +// Flags: +// +for(let a in[0]){eval("var b")=x} diff --git a/js/src/jit-test/tests/auto-regress/bug522624.js b/js/src/jit-test/tests/auto-regress/bug522624.js new file mode 100644 index 0000000000..251519a47b --- /dev/null +++ b/js/src/jit-test/tests/auto-regress/bug522624.js @@ -0,0 +1,10 @@ +// |jit-test| skip-if: !this.uneval + +// Binary: cache/js-dbg-32-a847cf5b4669-linux +// Flags: -j +// +function r([]) { r(); } +var a = {}; +a.__defineGetter__("t", r); +try { a.t; } catch(e) { } +print(uneval(a)); diff --git a/js/src/jit-test/tests/auto-regress/bug528048.js b/js/src/jit-test/tests/auto-regress/bug528048.js new file mode 100644 index 0000000000..f162e5fdaf --- /dev/null +++ b/js/src/jit-test/tests/auto-regress/bug528048.js @@ -0,0 +1,20 @@ +// Binary: cache/js-dbg-32-761988dd0d81-linux +// Flags: -j +// +for (j = 0; j < 3; j++) {} +m = []; +m.concat(); +n = []; +n.concat([]); +Function("\ + for (i = 0; i < 8; i++)\ + ((function f1(b, c) {\ + if (c) {\ + return (gc)()\ + }\ + f1(b, 1);\ + ((function f2(d, e) {\ + return d.length == e ? 0 : d[e] + f2(d, e + 1)\ + })([{}, /x/, /x/], 0))\ + })())\ +")() diff --git a/js/src/jit-test/tests/auto-regress/bug533705.js b/js/src/jit-test/tests/auto-regress/bug533705.js new file mode 100644 index 0000000000..b112b9e903 --- /dev/null +++ b/js/src/jit-test/tests/auto-regress/bug533705.js @@ -0,0 +1,25 @@ +// Binary: cache/js-dbg-64-61b1c094b729-linux +// Flags: -j +// +function mk() { + return (function () {}); +} + +function f() { + var j = 55; + + var f = function () { + return j; + } + + var g = function() { + } + + var a = [ mk(), f, g, mk(), mk() ]; + + for (var i = 0; i < 5; ++i) { + a[i].p = 99; + } +} + +f(); diff --git a/js/src/jit-test/tests/auto-regress/bug543436.js b/js/src/jit-test/tests/auto-regress/bug543436.js new file mode 100644 index 0000000000..a1145cb594 --- /dev/null +++ b/js/src/jit-test/tests/auto-regress/bug543436.js @@ -0,0 +1,15 @@ +// Binary: cache/js-dbg-64-f57b95afb57e-linux +// Flags: +// +(function() { + try { + eval("\ + function() {\ + if (3)\ + (1 for (x in []));\ + else \ + (this._ = function(){})\ + }\ + "); + } catch(e) {} +})() diff --git a/js/src/jit-test/tests/auto-regress/bug557946.js b/js/src/jit-test/tests/auto-regress/bug557946.js new file mode 100644 index 0000000000..8d1e95c53b --- /dev/null +++ b/js/src/jit-test/tests/auto-regress/bug557946.js @@ -0,0 +1,44 @@ +// Binary: cache/js-dbg-64-6f1a38b94754-linux +// Flags: -j +// +/* vim: set ts=8 sts=4 et sw=4 tw=99: */ + +var x = 0; +var y = 0; + +function h() { + if (x == 1) + y++; + else + y--; +} + +function F() { + var m = null; + + function g(i) { + /* Force outgoing typemaps to have a string. */ + m = "badness"; + + /* Loop a bit. */ + for (var i = 0; i < 10; i++) { + h(); + } + } + + /* Spin for a while so trees build. */ + for (var i = 0; i < 100; i++) { + /* Capture m == TT_NULL in outgoing fi for rp[0] */ + g(); + + /* Flip the switch to bail out with deep nested frames. */ + if (i > 50) + x = 1; + + /* Set m = null on the loop tail to get better traces. */ + m = null; + } +} + +F(); + diff --git a/js/src/jit-test/tests/auto-regress/bug558618.js b/js/src/jit-test/tests/auto-regress/bug558618.js new file mode 100644 index 0000000000..3fe1dfb257 --- /dev/null +++ b/js/src/jit-test/tests/auto-regress/bug558618.js @@ -0,0 +1,15 @@ +// Binary: cache/js-dbg-64-e69034463eeb-linux +// Flags: -j +// +/* vim: set ts=8 sts=4 et sw=4 tw=99: */ +function f() { + this.search = function(a, b, c) { + arguments[3] = { } + arguments.length = 4; + for (var i = 0; i < 100; i++) { + print(arguments[3]); + } + } +} +var o = new f(); +o.search({x: -1, y: -1, w: 100600, h: 100600}); diff --git a/js/src/jit-test/tests/auto-regress/bug560566.js b/js/src/jit-test/tests/auto-regress/bug560566.js new file mode 100644 index 0000000000..bec7cb6237 --- /dev/null +++ b/js/src/jit-test/tests/auto-regress/bug560566.js @@ -0,0 +1,7 @@ +// Binary: cache/js-dbg-64-58c9dd4f0c1f-linux +// Flags: +// +var o = {} +Object.defineProperty(o, "x", {get: undefined, set: function() { Object.defineProperty(o, "x", {set: function() { }}); }, configurable: true}); +o.a = 0; +o.x = 0; diff --git a/js/src/jit-test/tests/auto-regress/bug562028.js b/js/src/jit-test/tests/auto-regress/bug562028.js new file mode 100644 index 0000000000..4f64431c0b --- /dev/null +++ b/js/src/jit-test/tests/auto-regress/bug562028.js @@ -0,0 +1,22 @@ +// |jit-test| skip-if: !this.uneval + +// Binary: cache/js-dbg-64-0723bab9f15d-linux +// Flags: +// +function f(code) { + uneval(Function(code.replace(/\/\*DUPTRY\d+/, + function(k) { + n = k.substr(8) + return g("try{}catch(e){}", n) + } + ))) +} +function g(s, n) { + if (n == 1) return s + s2 = s + s + r = n % 2 + d = (n - r) / 2; + m = g(s2, d) + return r ? m: m +} +f("if(/>/(\"\")){/*DUPTRY4968(u)}else if([]()){}") diff --git a/js/src/jit-test/tests/auto-regress/bug563034.js b/js/src/jit-test/tests/auto-regress/bug563034.js new file mode 100644 index 0000000000..2f3bb3ac60 --- /dev/null +++ b/js/src/jit-test/tests/auto-regress/bug563034.js @@ -0,0 +1,11 @@ +// Binary: cache/js-dbg-64-c9212eb6175b-linux +// Flags: +// +function f(a) { + function* g() { + yield function () { return a; }; + } + return g(); +} +var x; +assertEq(f(7).next().value(), 7); diff --git a/js/src/jit-test/tests/auto-regress/bug563126.js b/js/src/jit-test/tests/auto-regress/bug563126.js new file mode 100644 index 0000000000..9a42bacc2c --- /dev/null +++ b/js/src/jit-test/tests/auto-regress/bug563126.js @@ -0,0 +1,6 @@ +// |jit-test| error:ReferenceError + +// Binary: cache/js-dbg-64-985cdfad1c7e-linux +// Flags: +// +(function(x){ function a () { x = 2 }; tracing(true); a(); })() diff --git a/js/src/jit-test/tests/auto-regress/bug563127.js b/js/src/jit-test/tests/auto-regress/bug563127.js new file mode 100644 index 0000000000..eeb063db41 --- /dev/null +++ b/js/src/jit-test/tests/auto-regress/bug563127.js @@ -0,0 +1,6 @@ +// Binary: cache/js-dbg-64-985cdfad1c7e-linux +// Flags: -j +// +function a() {} +a(); +for(var j=0;j<3;++j){ evalcx("lazy");} diff --git a/js/src/jit-test/tests/auto-regress/bug564619.js b/js/src/jit-test/tests/auto-regress/bug564619.js new file mode 100644 index 0000000000..08541d5ec7 --- /dev/null +++ b/js/src/jit-test/tests/auto-regress/bug564619.js @@ -0,0 +1,14 @@ +// Binary: cache/js-dbg-32-a214b695dc7b-linux +// Flags: -j +// +(function() { + eval("\ + function c() {\ + for (var b = 0; b < 2; ++b) {\ + print(this)\ + }\ + }\ + c();\ + c();\ + ") +})() diff --git a/js/src/jit-test/tests/auto-regress/bug567577.js b/js/src/jit-test/tests/auto-regress/bug567577.js new file mode 100644 index 0000000000..6b6229d06a --- /dev/null +++ b/js/src/jit-test/tests/auto-regress/bug567577.js @@ -0,0 +1,8 @@ +// |jit-test| error:TypeError + +// Binary: cache/js-dbg-64-88a6e0534e03-linux +// Flags: -j +// +for (a in [/x/, null, new String - Infinity]) { + print(new evalcx(" ")) +} diff --git a/js/src/jit-test/tests/auto-regress/bug568786.js b/js/src/jit-test/tests/auto-regress/bug568786.js new file mode 100644 index 0000000000..cf14af148e --- /dev/null +++ b/js/src/jit-test/tests/auto-regress/bug568786.js @@ -0,0 +1,10 @@ +// Binary: cache/js-dbg-64-fadb38356e0f-linux +// Flags: +// +function f() { + this.e = function() {}; + Object.defineProperty(this, "e", ({ + get: eval + })); +} +new f(); diff --git a/js/src/jit-test/tests/auto-regress/bug571168.js b/js/src/jit-test/tests/auto-regress/bug571168.js new file mode 100644 index 0000000000..f759dccdd5 --- /dev/null +++ b/js/src/jit-test/tests/auto-regress/bug571168.js @@ -0,0 +1,9 @@ +// |jit-test| error:InternalError + +// Binary: cache/js-dbg-64-b84d0be52070-linux +// Flags: +// +var x = new Proxy(Function, {}); +if (x.__proto__ = x) { + print(x); +} diff --git a/js/src/jit-test/tests/auto-regress/bug579348.js b/js/src/jit-test/tests/auto-regress/bug579348.js new file mode 100644 index 0000000000..45ba59bec2 --- /dev/null +++ b/js/src/jit-test/tests/auto-regress/bug579348.js @@ -0,0 +1,6 @@ +// Binary: cache/js-dbg-32-2d09181ec4cd-linux +// Flags: -j +// +for(a in[0,0,0]) { + ([])[-1] +} diff --git a/js/src/jit-test/tests/auto-regress/bug580694.js b/js/src/jit-test/tests/auto-regress/bug580694.js new file mode 100644 index 0000000000..a3604d7e74 --- /dev/null +++ b/js/src/jit-test/tests/auto-regress/bug580694.js @@ -0,0 +1,20 @@ +// Binary: cache/js-dbg-32-7c6f62fcbd91-linux +// Flags: -m +// +function f3() { + try { + v = f() + } catch (r) {} +} +function f1(a, t) { + f2(f, a) +} +function f2() { + u = String() +} +f = (function () { + Proxy((function () {})(gc()), []) +}) +a = "" +f1() +f3(f, a) diff --git a/js/src/jit-test/tests/auto-regress/bug580699.js b/js/src/jit-test/tests/auto-regress/bug580699.js new file mode 100644 index 0000000000..234c6b5544 --- /dev/null +++ b/js/src/jit-test/tests/auto-regress/bug580699.js @@ -0,0 +1,12 @@ +// Binary: cache/js-dbg-32-7c6f62fcbd91-linux +// Flags: -m +// +function f() { + (function () { + x; + function a() {} + print(a) + })() +} +this.__defineGetter__("x", gc) +f() diff --git a/js/src/jit-test/tests/auto-regress/bug580701.js b/js/src/jit-test/tests/auto-regress/bug580701.js new file mode 100644 index 0000000000..906a6b6724 --- /dev/null +++ b/js/src/jit-test/tests/auto-regress/bug580701.js @@ -0,0 +1,6 @@ +// Binary: cache/js-dbg-32-7c6f62fcbd91-linux +// Flags: -m +// +for (let c in []) { + c = 0 +}(eval)() diff --git a/js/src/jit-test/tests/auto-regress/bug581785.js b/js/src/jit-test/tests/auto-regress/bug581785.js new file mode 100644 index 0000000000..62a4ffdabf --- /dev/null +++ b/js/src/jit-test/tests/auto-regress/bug581785.js @@ -0,0 +1,11 @@ +// Binary: cache/js-dbg-64-441daac3fef9-linux +// Flags: -j +// +function f() { + this.b = function() {}; + this.b = Object.e; + Object.defineProperty(this, "b", {}) +} +for (a in [0, 0, 0, 0]) { + new f +} diff --git a/js/src/jit-test/tests/auto-regress/bug582268.js b/js/src/jit-test/tests/auto-regress/bug582268.js new file mode 100644 index 0000000000..a42157e915 --- /dev/null +++ b/js/src/jit-test/tests/auto-regress/bug582268.js @@ -0,0 +1,6 @@ +// |jit-test| error:ReferenceError + +// Binary: cache/js-dbg-32-e0988eae6c08-linux +// Flags: -m +// +7%s diff --git a/js/src/jit-test/tests/auto-regress/bug582276.js b/js/src/jit-test/tests/auto-regress/bug582276.js new file mode 100644 index 0000000000..235f1a7329 --- /dev/null +++ b/js/src/jit-test/tests/auto-regress/bug582276.js @@ -0,0 +1,7 @@ +// Binary: cache/js-dbg-32-e0988eae6c08-linux +// Flags: -m +// +(function() { + this / z + var z = "" +})() diff --git a/js/src/jit-test/tests/auto-regress/bug583675.js b/js/src/jit-test/tests/auto-regress/bug583675.js new file mode 100644 index 0000000000..d12924535e --- /dev/null +++ b/js/src/jit-test/tests/auto-regress/bug583675.js @@ -0,0 +1,11 @@ +// |jit-test| error:TypeError + +// Binary: cache/js-dbg-32-2ee92d697741-linux +// Flags: -m +// +{ + gczeal(2) +} +(function () { + ''.w() +})() diff --git a/js/src/jit-test/tests/auto-regress/bug583680.js b/js/src/jit-test/tests/auto-regress/bug583680.js new file mode 100644 index 0000000000..5d23212297 --- /dev/null +++ b/js/src/jit-test/tests/auto-regress/bug583680.js @@ -0,0 +1,14 @@ +// Binary: cache/js-dbg-32-2ee92d697741-linux +// Flags: -m +// +function f(foo) { + foo.replace(/s/, "") + Function(foo)() +} +for (a = 0; a < 1000; a++) { + f("\ + for (var b = 0; b < 7; b++) {\ + gczeal(2)\ + }\ + ") +} diff --git a/js/src/jit-test/tests/auto-regress/bug583681.js b/js/src/jit-test/tests/auto-regress/bug583681.js new file mode 100644 index 0000000000..a6d86e3c60 --- /dev/null +++ b/js/src/jit-test/tests/auto-regress/bug583681.js @@ -0,0 +1,4 @@ +// Binary: cache/js-dbg-32-2ee92d697741-linux +// Flags: -m +// +Function[typeof h] diff --git a/js/src/jit-test/tests/auto-regress/bug584423.js b/js/src/jit-test/tests/auto-regress/bug584423.js new file mode 100644 index 0000000000..6dc2f08b1b --- /dev/null +++ b/js/src/jit-test/tests/auto-regress/bug584423.js @@ -0,0 +1,6 @@ +// |jit-test| skip-if: !this.uneval + +// Binary: cache/js-dbg-64-c761f8e85b8c-linux +// Flags: +// +uneval(Function("function r([],x){this.b=function(){x}}")) diff --git a/js/src/jit-test/tests/auto-regress/bug586538.js b/js/src/jit-test/tests/auto-regress/bug586538.js new file mode 100644 index 0000000000..f3d9685888 --- /dev/null +++ b/js/src/jit-test/tests/auto-regress/bug586538.js @@ -0,0 +1,12 @@ +// Binary: cache/js-dbg-32-f7cf2b7b7961-linux +// Flags: -m +// +Function("\ + for (var a = 0,i=0;i<10;++i) {\ + if (a % 3) {\ + return\ + }\ + function b() {}\ + b((function() {})([Infinity]))\ + }\ +")() diff --git a/js/src/jit-test/tests/auto-regress/bug590772.js b/js/src/jit-test/tests/auto-regress/bug590772.js new file mode 100644 index 0000000000..a5e81091d8 --- /dev/null +++ b/js/src/jit-test/tests/auto-regress/bug590772.js @@ -0,0 +1,4 @@ +// Binary: cache/js-dbg-32-f561f17e6c27-linux +// Flags: +// +Reflect.parse("for (var x in []) { }") diff --git a/js/src/jit-test/tests/auto-regress/bug591367.js b/js/src/jit-test/tests/auto-regress/bug591367.js new file mode 100644 index 0000000000..78cb0dca66 --- /dev/null +++ b/js/src/jit-test/tests/auto-regress/bug591367.js @@ -0,0 +1,6 @@ +// Binary: cache/js-dbg-32-33b05dd43cd4-linux +// Flags: -m +// +for (let x in []) { + t(x !== x) +} diff --git a/js/src/jit-test/tests/auto-regress/bug591795.js b/js/src/jit-test/tests/auto-regress/bug591795.js new file mode 100644 index 0000000000..a8227f7e6c --- /dev/null +++ b/js/src/jit-test/tests/auto-regress/bug591795.js @@ -0,0 +1,4 @@ +// Binary: cache/js-dbg-32-eae8350841be-linux +// Flags: +// +gczeal() diff --git a/js/src/jit-test/tests/auto-regress/bug593580.js b/js/src/jit-test/tests/auto-regress/bug593580.js new file mode 100644 index 0000000000..e6155b9c90 --- /dev/null +++ b/js/src/jit-test/tests/auto-regress/bug593580.js @@ -0,0 +1,29 @@ +// Binary: cache/js-dbg-64-60af58b42567-linux +// Flags: +// +realEval = eval +f = eval("(function(){for(let x in[\ + __defineGetter__(\"\",function(){})\ + ,__defineGetter__(\"\ + functional\ + \",Math.pow)\ + ]){\ + (__defineSetter__(\"\",function(){}))\ + ()\ + }})") +try { + f() +} catch (r) { + delete this.eval + delete this.Math + eval = realEval + e = this.toSource +} +f = eval("(function(){(__defineSetter__(\"\ + functional\ + \",(function(){return{t:function(){}}})))()})") +try { + f() +} catch (r) { + eval() +} diff --git a/js/src/jit-test/tests/auto-regress/bug596817.js b/js/src/jit-test/tests/auto-regress/bug596817.js new file mode 100644 index 0000000000..247bb0c2ce --- /dev/null +++ b/js/src/jit-test/tests/auto-regress/bug596817.js @@ -0,0 +1,12 @@ +// Binary: cache/js-dbg-32-a409054e1395-linux +// Flags: -m +// +load(libdir + 'asserts.js'); +// value is not iterable +(function() { + for (var [x] in [[] < []]) + { + // Just a useless expression. + []; + } +})(); diff --git a/js/src/jit-test/tests/auto-regress/bug596823.js b/js/src/jit-test/tests/auto-regress/bug596823.js new file mode 100644 index 0000000000..6b989b90ee --- /dev/null +++ b/js/src/jit-test/tests/auto-regress/bug596823.js @@ -0,0 +1,6 @@ +// Binary: cache/js-dbg-32-a409054e1395-linux +// Flags: -j +// +for (a = 0; a < 9; a++) { + "".charAt(3 / 0) +} diff --git a/js/src/jit-test/tests/auto-regress/bug599446.js b/js/src/jit-test/tests/auto-regress/bug599446.js new file mode 100644 index 0000000000..a3186853ff --- /dev/null +++ b/js/src/jit-test/tests/auto-regress/bug599446.js @@ -0,0 +1,7 @@ +// Binary: cache/js-dbg-32-1c913526c597-linux +// Flags: +// +(function () { + x = constructor +})() +new(x)(x) diff --git a/js/src/jit-test/tests/auto-regress/bug599464.js b/js/src/jit-test/tests/auto-regress/bug599464.js new file mode 100644 index 0000000000..15b293c073 --- /dev/null +++ b/js/src/jit-test/tests/auto-regress/bug599464.js @@ -0,0 +1,20 @@ +// Binary: cache/js-dbg-64-1c913526c597-linux +// Flags: +// +aa = eval +function bb() { + this.eval = aa +} +var f = (function () { + (Object.seal)(this) + l +}) +try { + f() +} catch (r) {} +bb() +try { + f() +} catch (r) { + bb() +} diff --git a/js/src/jit-test/tests/auto-regress/bug600138.js b/js/src/jit-test/tests/auto-regress/bug600138.js new file mode 100644 index 0000000000..d4f7341d87 --- /dev/null +++ b/js/src/jit-test/tests/auto-regress/bug600138.js @@ -0,0 +1,11 @@ +// Binary: cache/js-dbg-64-54700fad8cf9-linux +// Flags: -j +// +function z() { + this.a = function () {} + this.a = this + Object.defineProperty(this, "a", ({})) +} +for (e in [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]) { + new z() +} diff --git a/js/src/jit-test/tests/auto-regress/bug601070.js b/js/src/jit-test/tests/auto-regress/bug601070.js new file mode 100644 index 0000000000..11bbaab449 --- /dev/null +++ b/js/src/jit-test/tests/auto-regress/bug601070.js @@ -0,0 +1,5 @@ +// Binary: cache/js-dbg-32-82ff7c27fcb0-linux +// Flags: +// +var x = new Int32Array(); +x.set(x); diff --git a/js/src/jit-test/tests/auto-regress/bug601393.js b/js/src/jit-test/tests/auto-regress/bug601393.js new file mode 100644 index 0000000000..db14f473a7 --- /dev/null +++ b/js/src/jit-test/tests/auto-regress/bug601393.js @@ -0,0 +1,9 @@ +// Binary: cache/js-dbg-64-0230a9e80c1f-linux +// Flags: -m +// +var code = "(function(){ function eval(){} function eval(){} "; +for (var i = 0; i < 2048; ++i) { + code += " try{}catch(e){}"; +} +code += " })()" +eval(code); diff --git a/js/src/jit-test/tests/auto-regress/bug605011.js b/js/src/jit-test/tests/auto-regress/bug605011.js new file mode 100644 index 0000000000..dde0e31036 --- /dev/null +++ b/js/src/jit-test/tests/auto-regress/bug605011.js @@ -0,0 +1,19 @@ +// Binary: cache/js-dbg-32-47a8311cf0bb-linux +// Flags: +// +function g(x, n) { + for (var i = 0; i < n; ++i) { + x = { + a: x + }; + } + return x; +} +try { + d = g(0, 672); +} catch(exc1) {} +(function() { + try { + gczeal(2)(JSON.stringify(this)) + } catch(exc2) {} +})() diff --git a/js/src/jit-test/tests/auto-regress/bug605013.js b/js/src/jit-test/tests/auto-regress/bug605013.js new file mode 100644 index 0000000000..e058b256c1 --- /dev/null +++ b/js/src/jit-test/tests/auto-regress/bug605013.js @@ -0,0 +1,10 @@ +// |jit-test| error:ReferenceError + +// Binary: cache/js-dbg-32-47a8311cf0bb-linux +// Flags: +// +x = /x/ +Function("Object.defineProperty(x,new AttributeName,({e:true,enumerable:true}))")() +{ + throw (Object.keys)(x, /x/) +} diff --git a/js/src/jit-test/tests/auto-regress/bug606639.js b/js/src/jit-test/tests/auto-regress/bug606639.js new file mode 100644 index 0000000000..dd7b463bb9 --- /dev/null +++ b/js/src/jit-test/tests/auto-regress/bug606639.js @@ -0,0 +1,9 @@ +// |jit-test| error:Error + +// Binary: cache/js-dbg-64-32b049250e03-linux +// Flags: -m +// +function v(s) { eval(s); } +v("eval(function(){})()"); +var x = new Int32Array(0); +v("x.set()"); diff --git a/js/src/jit-test/tests/auto-regress/bug607502.js b/js/src/jit-test/tests/auto-regress/bug607502.js new file mode 100644 index 0000000000..1fbeab36e0 --- /dev/null +++ b/js/src/jit-test/tests/auto-regress/bug607502.js @@ -0,0 +1,8 @@ +// Binary: cache/js-dbg-32-d253c44465ae-linux +// Flags: -m +// +function q() { ++i; } +var i = 0; +Object.freeze(this); +q(); +q(); diff --git a/js/src/jit-test/tests/auto-regress/bug607513.js b/js/src/jit-test/tests/auto-regress/bug607513.js new file mode 100644 index 0000000000..cde7eba6b3 --- /dev/null +++ b/js/src/jit-test/tests/auto-regress/bug607513.js @@ -0,0 +1,5 @@ +// Binary: cache/js-dbg-64-d253c44465ae-linux +// Flags: +// +Object.freeze(this); +try { eval('const q;') } catch(exc1) {} diff --git a/js/src/jit-test/tests/auto-regress/bug612836.js b/js/src/jit-test/tests/auto-regress/bug612836.js new file mode 100644 index 0000000000..6ed4adb1c1 --- /dev/null +++ b/js/src/jit-test/tests/auto-regress/bug612836.js @@ -0,0 +1,4 @@ +// Binary: cache/js-dbg-32-7b8898c9b54c-linux +// Flags: +// +new Proxy(this,{}) diff --git a/js/src/jit-test/tests/auto-regress/bug613400.js b/js/src/jit-test/tests/auto-regress/bug613400.js new file mode 100644 index 0000000000..03448044ce --- /dev/null +++ b/js/src/jit-test/tests/auto-regress/bug613400.js @@ -0,0 +1,4 @@ +// Binary: cache/js-dbg-32-cbd2053aa825-linux +// Flags: +// +/(?!()m)/.exec("m"); diff --git a/js/src/jit-test/tests/auto-regress/bug620315.js b/js/src/jit-test/tests/auto-regress/bug620315.js new file mode 100644 index 0000000000..98b09cdec6 --- /dev/null +++ b/js/src/jit-test/tests/auto-regress/bug620315.js @@ -0,0 +1,4 @@ +// Binary: cache/js-dbg-64-fc50c521bf48-linux +// Flags: -j -m +// +new Function('"use strict"; for (var j = 0; j < 9; ++j) { 4 > this; }')() diff --git a/js/src/jit-test/tests/auto-regress/bug620637.js b/js/src/jit-test/tests/auto-regress/bug620637.js new file mode 100644 index 0000000000..772f420d78 --- /dev/null +++ b/js/src/jit-test/tests/auto-regress/bug620637.js @@ -0,0 +1,20 @@ +// |jit-test| error:Error + +// Binary: cache/js-dbg-64-aeeb631c6d43-linux +// Flags: +// +options('tracejit'); +var actual = '' +function f() { + for (var a = 0; a < 3; ++a) { + (function () { + for (var b = 0; b < 2; ++b) { + (function () { + for (a = 0, b = 0; b < 15; b++, actual = actual + "7") { + } + })(); + } + })(); + } +} +f(); diff --git a/js/src/jit-test/tests/auto-regress/bug621816.js b/js/src/jit-test/tests/auto-regress/bug621816.js new file mode 100644 index 0000000000..42a48730c6 --- /dev/null +++ b/js/src/jit-test/tests/auto-regress/bug621816.js @@ -0,0 +1,4 @@ +// Binary: cache/js-dbg-32-250bf984b8bc-linux +// Flags: -j +// +for (let j=0; j<9; ++j) { var a = new Int8Array(); a[0] = 5; a[0]; } diff --git a/js/src/jit-test/tests/auto-regress/bug621988.js b/js/src/jit-test/tests/auto-regress/bug621988.js new file mode 100644 index 0000000000..0cfb160600 --- /dev/null +++ b/js/src/jit-test/tests/auto-regress/bug621988.js @@ -0,0 +1,5 @@ +// Binary: cache/js-dbg-64-250bf984b8bc-linux +// Flags: +// +f = function() { L: 3; alert(5); } +print(f.toString(28800000,23,59,999)); diff --git a/js/src/jit-test/tests/auto-regress/bug634236.js b/js/src/jit-test/tests/auto-regress/bug634236.js new file mode 100644 index 0000000000..68eb8c48fb --- /dev/null +++ b/js/src/jit-test/tests/auto-regress/bug634236.js @@ -0,0 +1,13 @@ +// |jit-test| error:ReferenceError + +// Binary: cache/js-dbg-32-e25c8949931d-linux +// Flags: +// +(eval("\ + (function(){\ + b = {};\ + b.__proto__=evalcx('split');\ + print(b)\ + }\ + )\ +"))() diff --git a/js/src/jit-test/tests/auto-regress/bug635389.js b/js/src/jit-test/tests/auto-regress/bug635389.js new file mode 100644 index 0000000000..5eaff76612 --- /dev/null +++ b/js/src/jit-test/tests/auto-regress/bug635389.js @@ -0,0 +1,8 @@ +// |jit-test| error:InternalError + +// Binary: cache/js-dbg-64-a3946d490610-linux +// Flags: +// +var x = []; +x.join = x.toString; +"" + x; diff --git a/js/src/jit-test/tests/auto-regress/bug637205.js b/js/src/jit-test/tests/auto-regress/bug637205.js new file mode 100644 index 0000000000..9cb4f60b6d --- /dev/null +++ b/js/src/jit-test/tests/auto-regress/bug637205.js @@ -0,0 +1,45 @@ +// Binary: cache/js-dbg-64-21e90d198613-linux +// Flags: +// +load(libdir + "immutable-prototype.js"); + +var x = {}; +function jsTestDriverEnd() +{ + for (var optionName in x) + { + } + x = {}; +} + +var o2 = this; +var o5 = Object.prototype; + +function f28(o) { + var _var_ = o; + if (globalPrototypeChainIsMutable()) + _var_['__proto_'+'_'] = null; +} + +function _var_(f7) { + function f15(o) {} +} + +function f39(o) { + for(var j=0; j<5; j++) { + try { o.__proto__ = o2; } catch(e) {} + } +} + +for(var i=0; i<11; i++) { + f39(o5); + f28(o2); +} + +jsTestDriverEnd(); + +{ + delete Function; +} + +jsTestDriverEnd(); diff --git a/js/src/jit-test/tests/auto-regress/bug638212.js b/js/src/jit-test/tests/auto-regress/bug638212.js new file mode 100644 index 0000000000..4def4ca336 --- /dev/null +++ b/js/src/jit-test/tests/auto-regress/bug638212.js @@ -0,0 +1,21 @@ +// Binary: cache/js-dbg-64-01037ab16a65-linux +// Flags: -j -m -a +// +o2 = this; +function f0(o) { } +function f4(o) { } +(function() { +Object.seal(o2); +})(); +function f3(o) { } +function f7(o) { +var _var_ = o; +--(_var_["-1"]); +} +for(var i1=0; i1<6; i1++) { +f4(f3); +f4 = new Proxy(f7, {}); +} +f4(f0); + +try { eval("var __proto__"); } catch(exc1) {} diff --git a/js/src/jit-test/tests/auto-regress/bug638735.js b/js/src/jit-test/tests/auto-regress/bug638735.js new file mode 100644 index 0000000000..c941f53695 --- /dev/null +++ b/js/src/jit-test/tests/auto-regress/bug638735.js @@ -0,0 +1,23 @@ +// Binary: cache/js-dbg-64-290712e55ade-linux +// Flags: -j +// +var o9 = Function.prototype; +var o13 = Array; +function f5(o) { +ox1 = new Proxy(o, {}); +} +f5(o9); +f5(o13); +var o0 = []; +function f3(o) { + var prop = Object.getOwnPropertyNames(ox1)[0]; + if (prop) { Object.defineProperty(ox1, prop, {configurable: true,enumerable: true,unused: 1 }); } +}(function() { +for(var o3 in o0) { +f3(f3); +} +})(); + for (var i = 0; i < 9; i++) + { + new Array(1, 2); + } diff --git a/js/src/jit-test/tests/auto-regress/bug640079.js b/js/src/jit-test/tests/auto-regress/bug640079.js new file mode 100644 index 0000000000..2892bb5b3e --- /dev/null +++ b/js/src/jit-test/tests/auto-regress/bug640079.js @@ -0,0 +1,9 @@ +// |jit-test| error:ReferenceError + +// Binary: cache/js-dbg-32-adc45b0a01c8-linux +// Flags: -m -n +// +eval("\ + x = evalcx('split');\ + evalcx(\"for(e in <x/>){}\" ,x)\ +") diff --git a/js/src/jit-test/tests/auto-regress/bug643670.js b/js/src/jit-test/tests/auto-regress/bug643670.js new file mode 100644 index 0000000000..7014907173 --- /dev/null +++ b/js/src/jit-test/tests/auto-regress/bug643670.js @@ -0,0 +1,19 @@ +// |jit-test| error:ReferenceError + +// Binary: cache/js-dbg-32-55f463c562d4-linux +// Flags: -m -n -a +// +o3 = evalcx("split") +function f3(o) { + try { + new o + } catch(e) {} +} +function f16(o) { + Object.getOwnPropertyNames(o); + o.__defineGetter__("prototype", function() {}) +} +for (;;) { + new f3(o3); + f16(o3) +} diff --git a/js/src/jit-test/tests/auto-regress/bug643847.js b/js/src/jit-test/tests/auto-regress/bug643847.js new file mode 100644 index 0000000000..0574e20b43 --- /dev/null +++ b/js/src/jit-test/tests/auto-regress/bug643847.js @@ -0,0 +1,13 @@ +// Binary: cache/js-dbg-64-c811be25eaad-linux +// Flags: +// +function f(o) { + o.constructor = function() {}; +} +__proto__.__defineSetter__('constructor', +function(v) {}); +f({}); +Object.defineProperty(__proto__, 'constructor', { + writable: true, +}); +f({}); diff --git a/js/src/jit-test/tests/auto-regress/bug647464.js b/js/src/jit-test/tests/auto-regress/bug647464.js new file mode 100644 index 0000000000..2aee06b9e5 --- /dev/null +++ b/js/src/jit-test/tests/auto-regress/bug647464.js @@ -0,0 +1,4 @@ +// Binary: cache/js-dbg-32-c340841f0465-linux +// Flags: -m -n -a +// +RegExp.__proto__ diff --git a/js/src/jit-test/tests/auto-regress/bug648729.js b/js/src/jit-test/tests/auto-regress/bug648729.js new file mode 100644 index 0000000000..2b3d4cbdac --- /dev/null +++ b/js/src/jit-test/tests/auto-regress/bug648729.js @@ -0,0 +1,8 @@ +// Binary: cache/js-dbg-32-d3215d1e985a-linux +// Flags: -m -n -a +// +(function() { + for (let y in [0]) { + return + } +})() diff --git a/js/src/jit-test/tests/auto-regress/bug648739.js b/js/src/jit-test/tests/auto-regress/bug648739.js new file mode 100644 index 0000000000..f270f882bd --- /dev/null +++ b/js/src/jit-test/tests/auto-regress/bug648739.js @@ -0,0 +1,10 @@ +// |jit-test| error:TypeError + +// Binary: cache/js-dbg-64-6c8becdd1574-linux +// Flags: +// +(function () { + [] = x = /x/; + x.toString = Function.prototype.bind; + print(x) +})() diff --git a/js/src/jit-test/tests/auto-regress/bug648747.js b/js/src/jit-test/tests/auto-regress/bug648747.js new file mode 100644 index 0000000000..136999dc4d --- /dev/null +++ b/js/src/jit-test/tests/auto-regress/bug648747.js @@ -0,0 +1,51 @@ +// |jit-test| error:ReferenceError + +// Binary: cache/js-dbg-64-d3215d1e985a-linux +// Flags: -m -n -a +// +function ygTreeView(id) { + this.init(id) +} +ygTreeView.prototype.init = function (id) { + this.root = new ygRootNode(this) +}; +function ygNode() {} +ygNode.prototype.init = function (_32, _33, _34) { + this.children = [] + this.expanded = _34 + if (_33) _33.appendChild(this) +}; +ygNode.prototype.appendChild = function (_35) { + this.children[this.children.length] = _35 +}; +ygNode.prototype.hasChildren = function () { + return this.children.length > 0; +}; +ygNode.prototype.getHtml = function () { + var sb = []; + if (this.hasChildren(true) && this.expanded) sb[sb.length] = this.renderChildren() +}; +ygNode.prototype.renderChildren = function () { + this.completeRender() +}; +ygNode.prototype.completeRender = function () { + for (var i = 0;;) sb[sb.length] = this.children[i].getHtml() +}; +ygRootNode.prototype = new ygNode; + +function ygRootNode(_48) { + this.init(null, null, true) +} +ygTextNode.prototype = new ygNode; +function ygTextNode(_49, _50, _51) { + this.init(_49, _50, _51) +} +function buildUserTree() { + userTree = new ygTreeView("userTree") + addMenuNode(userTree, "N", "navheader") +} +function addMenuNode(tree, label, styleClass) { + new ygTextNode({}, tree.root, false) +} +buildUserTree(); +userTree.root.getHtml() diff --git a/js/src/jit-test/tests/auto-regress/bug648839.js b/js/src/jit-test/tests/auto-regress/bug648839.js new file mode 100644 index 0000000000..43908bad76 --- /dev/null +++ b/js/src/jit-test/tests/auto-regress/bug648839.js @@ -0,0 +1,10 @@ +// Binary: cache/js-dbg-64-d3215d1e985a-linux +// Flags: -m -n -a +// +ForIn_1( { length:4, company:"netscape", year:2000, 0:"zero" } ); +function ForIn_1( object ) { + PropertyArray = new Array(); + for ( PropertyArray[PropertyArray.length] in object ) { + object[1]; + } +} diff --git a/js/src/jit-test/tests/auto-regress/bug648852.js b/js/src/jit-test/tests/auto-regress/bug648852.js new file mode 100644 index 0000000000..0b8ed0db40 --- /dev/null +++ b/js/src/jit-test/tests/auto-regress/bug648852.js @@ -0,0 +1,12 @@ +// |jit-test| error:TypeError + +// Binary: cache/js-dbg-64-d3215d1e985a-linux +// Flags: -m -n -a +// +var toString = 1; +VERSION = ""; +function startTest() { + if (print) if (VERSION == "ECMA_1") {} +} +var VERSION = this; +startTest(); diff --git a/js/src/jit-test/tests/auto-regress/bug648992.js b/js/src/jit-test/tests/auto-regress/bug648992.js new file mode 100644 index 0000000000..b96d4b3092 --- /dev/null +++ b/js/src/jit-test/tests/auto-regress/bug648992.js @@ -0,0 +1,16 @@ +// Binary: cache/js-dbg-32-74a8fb1bbec5-linux +// Flags: -m -n -a +// +o0 = (3).__proto__ +function f(o) { + var prop + [o][0][prop] = [] + try { + ({ + x: function() { + return o + } + }.x()()) + } catch (e) {} +} +f(o0) diff --git a/js/src/jit-test/tests/auto-regress/bug648999.js b/js/src/jit-test/tests/auto-regress/bug648999.js new file mode 100644 index 0000000000..748a85bb16 --- /dev/null +++ b/js/src/jit-test/tests/auto-regress/bug648999.js @@ -0,0 +1,10 @@ +// |jit-test| error:TypeError + +// Binary: cache/js-dbg-64-74a8fb1bbec5-linux +// Flags: -m -n -a +// +test(); +function test() +{ + for (var j = 0; j < 10; ++j) new j; +} diff --git a/js/src/jit-test/tests/auto-regress/bug649017.js b/js/src/jit-test/tests/auto-regress/bug649017.js new file mode 100644 index 0000000000..62f2a63c7e --- /dev/null +++ b/js/src/jit-test/tests/auto-regress/bug649017.js @@ -0,0 +1,8 @@ +// |jit-test| error:TypeError + +// Binary: cache/js-dbg-64-74a8fb1bbec5-linux +// Flags: +// +try { + throw {toString: parseInt.call}; +} catch(e) { e.toString(); } diff --git a/js/src/jit-test/tests/auto-regress/bug649937.js b/js/src/jit-test/tests/auto-regress/bug649937.js new file mode 100644 index 0000000000..84152afc05 --- /dev/null +++ b/js/src/jit-test/tests/auto-regress/bug649937.js @@ -0,0 +1,21 @@ +// Binary: cache/js-dbg-64-a3eeee8f7803-linux +// Flags: -m -n +// +var i = 0; +var gTestcases = new Array; +var gTc = gTestcases; +function TestCase(n, d, e, a) { + this.description=d; + gTestcases[gTc++]=this; +} +function writeTestCaseResult( expect, actual, string ) {}; +new TestCase; +test(); +function test() { + for ( gTc=0 ; ; ) { + i++; + if (i > 20) { break; } + gTestcases[gTc].description+=" )"; + gTestcases=[1,]; + } +} diff --git a/js/src/jit-test/tests/auto-regress/bug650574.js b/js/src/jit-test/tests/auto-regress/bug650574.js new file mode 100644 index 0000000000..fdd1e56e5d --- /dev/null +++ b/js/src/jit-test/tests/auto-regress/bug650574.js @@ -0,0 +1,9 @@ +// |jit-test| error:InternalError; skip-if: !Error.prototype.toSource + +// Binary: cache/js-dbg-64-0906d9490eaf-linux +// Flags: +// +var e = Error(''); +e.fileName = e; +e.toSource(); +--> Crash with too much recursion in exn_toSource diff --git a/js/src/jit-test/tests/auto-regress/bug650658.js b/js/src/jit-test/tests/auto-regress/bug650658.js new file mode 100644 index 0000000000..b706ecb9dd --- /dev/null +++ b/js/src/jit-test/tests/auto-regress/bug650658.js @@ -0,0 +1,10 @@ +// |jit-test| error:TypeError + +// Binary: cache/js-dbg-64-ac0989a03bf1-linux +// Flags: -m -n -a +// +AddRegExpCases(/a*b/, "xxx", 0, null ); +AddRegExpCases(/x\d\dy/, "abcx45ysss235", 3,[] ); +function AddRegExpCases(regexp, pattern, index, matches_array ) { + return (matches_array.length, regexp); +} diff --git a/js/src/jit-test/tests/auto-regress/bug651827.js b/js/src/jit-test/tests/auto-regress/bug651827.js new file mode 100644 index 0000000000..12bda58da3 --- /dev/null +++ b/js/src/jit-test/tests/auto-regress/bug651827.js @@ -0,0 +1,9 @@ +// Binary: cache/js-dbg-32-1fe03044bfeb-linux +// Flags: -m -n -a +// +try { + function x() {} +} catch(e) {} +switch (undefined) { + case(y) = Infinity: +} diff --git a/js/src/jit-test/tests/auto-regress/bug653395.js b/js/src/jit-test/tests/auto-regress/bug653395.js new file mode 100644 index 0000000000..8d5ef33168 --- /dev/null +++ b/js/src/jit-test/tests/auto-regress/bug653395.js @@ -0,0 +1,19 @@ +// |jit-test| error:TypeError + +// Binary: cache/js-dbg-64-09cce9915b80-linux +// Flags: -m -n +// +try { + (function () { + __proto__ = new Uint32Array() + }()) +} catch (e) {}(function () { +})() +eval("\ +function testAtomize() {\ + x = {};\ + for (var i = false ; i < 65536; ++i)\ + x[String.fromCharCode(i)] = 1;\ +}\ +new testAtomize()(testAtomize(), 65536);\ +"); diff --git a/js/src/jit-test/tests/auto-regress/bug653789.js b/js/src/jit-test/tests/auto-regress/bug653789.js new file mode 100644 index 0000000000..68816a57f6 --- /dev/null +++ b/js/src/jit-test/tests/auto-regress/bug653789.js @@ -0,0 +1,8 @@ +// |jit-test| error:InternalError + +// Binary: cache/js-dbg-64-3dd6ec45084c-linux +// Flags: +// +this.__defineGetter__("x", eval); +eval.toString = toLocaleString +eval < x diff --git a/js/src/jit-test/tests/auto-regress/bug654392.js b/js/src/jit-test/tests/auto-regress/bug654392.js new file mode 100644 index 0000000000..ceae70f999 --- /dev/null +++ b/js/src/jit-test/tests/auto-regress/bug654392.js @@ -0,0 +1,15 @@ +// |jit-test| error:InternalError + +// Binary: cache/js-dbg-64-3062ff7fef83-linux +// Flags: -m -n +// +function enterFunc (funcName) {} +test(); +function test() +{ + enterFunc ( "NaN number", "'eeeefghi'.match(/e*/)", new test( "Date.prototype" )); + function err() { + return new Error(); + } + var error = err(s,s,s,s); +} diff --git a/js/src/jit-test/tests/auto-regress/bug654665.js b/js/src/jit-test/tests/auto-regress/bug654665.js new file mode 100644 index 0000000000..e1be9f9b89 --- /dev/null +++ b/js/src/jit-test/tests/auto-regress/bug654665.js @@ -0,0 +1,8 @@ +// Binary: cache/js-dbg-64-3062ff7fef83-linux +// Flags: -m -n -a +// +test(); +function test() +{ + for (var i = 0; i < 0e2.length; ); +} diff --git a/js/src/jit-test/tests/auto-regress/bug655507.js b/js/src/jit-test/tests/auto-regress/bug655507.js new file mode 100644 index 0000000000..ec6caa52ee --- /dev/null +++ b/js/src/jit-test/tests/auto-regress/bug655507.js @@ -0,0 +1,6 @@ +// Binary: cache/js-dbg-64-e09e209d988e-linux +// Flags: -m -n -a +// +a = new Array; +a[2] = "2"; +a[1]; diff --git a/js/src/jit-test/tests/auto-regress/bug655940.js b/js/src/jit-test/tests/auto-regress/bug655940.js new file mode 100644 index 0000000000..463635e236 --- /dev/null +++ b/js/src/jit-test/tests/auto-regress/bug655940.js @@ -0,0 +1,12 @@ +// Binary: cache/js-dbg-32-32e8c937a409-linux +// Flags: -m -n -a +// +NaN.__proto__; +function f0() { + try {} catch(e) {} +} +for (i = 0; i < 9; i++) { + new f0; + f0(); + gc() +} diff --git a/js/src/jit-test/tests/auto-regress/bug655950.js b/js/src/jit-test/tests/auto-regress/bug655950.js new file mode 100644 index 0000000000..21629924ff --- /dev/null +++ b/js/src/jit-test/tests/auto-regress/bug655950.js @@ -0,0 +1,13 @@ +// Binary: cache/js-dbg-32-32e8c937a409-linux +// Flags: -m -n +// +function f() { + try { + (new { + x: function() {} + }.x)(); + } catch (e) {} +} +for (var i = 0; i<10000; i++) { + f(); +} diff --git a/js/src/jit-test/tests/auto-regress/bug657198.js b/js/src/jit-test/tests/auto-regress/bug657198.js new file mode 100644 index 0000000000..a1d5a38be1 --- /dev/null +++ b/js/src/jit-test/tests/auto-regress/bug657198.js @@ -0,0 +1,36 @@ +// |jit-test| slow; + +// Binary: cache/js-dbg-32-599d1c6cba63-linux +// Flags: -j +// +eval("") +o15 = {} +function f11(o) { + props = Object.getOwnPropertyNames(o) + prop = props.length ? prop[prop.e] + "" : "" + o[prop] = 3 +} +function f12(o) { + _someglobal_ = o; + for (j = 0; j < 5; j++) { + for (x in { + x: { + x: function() { + return _someglobal_ + } + }.x() + }.x) { + ({ + x: { + x: function() {} + }.x() + }[x]) + } + gc() + } +} { + for (i = 0; i < 100; i++) { + f12(o15) + f11(o15) + } +} diff --git a/js/src/jit-test/tests/auto-regress/bug657586.js b/js/src/jit-test/tests/auto-regress/bug657586.js new file mode 100644 index 0000000000..2e28d30e01 --- /dev/null +++ b/js/src/jit-test/tests/auto-regress/bug657586.js @@ -0,0 +1,9 @@ +// Binary: cache/js-dbg-32-8aa5d9272628-linux +// Flags: -m -n +// +(function() { + with([]) {} + Object.defineProperty([], "", { + set: (function() {}) + }) +})() diff --git a/js/src/jit-test/tests/auto-regress/bug658803.js b/js/src/jit-test/tests/auto-regress/bug658803.js new file mode 100644 index 0000000000..95b1a5bba7 --- /dev/null +++ b/js/src/jit-test/tests/auto-regress/bug658803.js @@ -0,0 +1,17 @@ +// Binary: cache/js-dbg-32-33f1ad45ccb8-linux +// Flags: -m -n +// +function f() { + var N = 624; + this.init_genrand = function(s) { + for (z = 1; z < N; z++) {} + }; +}(function() { + new f; +}()); +function g(o) { + var props = Object.getOwnPropertyNames(o); + var prop = props[props.length - 1] + "p" + o[prop] = Number.prototype.__proto__; +} +g(Number.prototype.__proto__); diff --git a/js/src/jit-test/tests/auto-regress/bug659077.js b/js/src/jit-test/tests/auto-regress/bug659077.js new file mode 100644 index 0000000000..27487a6343 --- /dev/null +++ b/js/src/jit-test/tests/auto-regress/bug659077.js @@ -0,0 +1,16 @@ +// Binary: cache/js-dbg-32-29f08848d96c-linux +// Flags: -j +// +try { + function l() { } + function r() { } + d = 4; + var _ = q; +} catch (e) { } +try { + v = new ArrayBuffer(); + s = []; + function e() { } + let a; + eval("for(var[x]=e in this){(function(){})()}"); +} catch (e) { } diff --git a/js/src/jit-test/tests/auto-regress/bug659779.js b/js/src/jit-test/tests/auto-regress/bug659779.js new file mode 100644 index 0000000000..1001a7d5ca --- /dev/null +++ b/js/src/jit-test/tests/auto-regress/bug659779.js @@ -0,0 +1,33 @@ +// Binary: cache/js-dbg-64-8bcb569c9bf9-linux +// Flags: -m -n -a +// + +var gTestcases = new Array; +function TestCase(n, d, e, a) { + this.description=d + gTestcases[gTc++]=this +} +TestCase.prototype.dump=function () { return + toPrinted(this.description); }; +function toPrinted(value) { return value=value; } +function reportCompare (expected, actual, description) { + new TestCase("unknown-test-name", description, expected, actual) +} +function enterFunc (funcName) { + try { + expectCompile = 'No Error' + var actualCompile; + reportCompare(expectCompile, actualCompile, ': compile actual') + } catch(ex) {} +} +gTc=0; +function jsTestDriverEnd() { + for (var i = 0; i < gTestcases.length; i++) gTestcases[i].dump() +} +enterFunc(); +reportCompare(0, 0, 5.123456); +reportCompare(0, 0, this ); +jsTestDriverEnd(); +try { + this.__proto__=[] +} catch(ex) {} +jsTestDriverEnd() diff --git a/js/src/jit-test/tests/auto-regress/bug661840.js b/js/src/jit-test/tests/auto-regress/bug661840.js new file mode 100644 index 0000000000..40326bc138 --- /dev/null +++ b/js/src/jit-test/tests/auto-regress/bug661840.js @@ -0,0 +1,39 @@ +// |jit-test| error:ReferenceError + +// Binary: cache/js-dbg-32-11714be33655-linux +// Flags: -m -n +// +function f(a) {} +s = [{ + s: [], + s: function(d, b) {}, + t: function() { + try {} catch (e) {} + } +}, { + t: "", + s: [], + s: function(d, b) {} +}, { + t: "", + s: [], + s: function(d, b) {}, + t: function() {} +}, { + t: "", + x: "", + s: [], + g: function(b) {}, + t: function(f) {} +}, { + t: "", + s: [], + s: function() {} +}]; +v = 0 +Function("gc(evalcx('lazy'))")(); +gczeal(); +gc(); +(function() { + x +})() diff --git a/js/src/jit-test/tests/auto-regress/bug662132.js b/js/src/jit-test/tests/auto-regress/bug662132.js new file mode 100644 index 0000000000..a3f52a2be7 --- /dev/null +++ b/js/src/jit-test/tests/auto-regress/bug662132.js @@ -0,0 +1,14 @@ +// Binary: cache/js-dbg-32-6d423e5f2e48-linux +// Flags: -m -n +// +gczeal() +let n = {} +let o = {} +for (let i = 0; i < 5; i++) { + Array(); + for (let j = 0; j < 7; j++) { + o.__defineSetter__("", function() {}) + o.p3 = 1 + delete o.p3 + } +} diff --git a/js/src/jit-test/tests/auto-regress/bug665914.js b/js/src/jit-test/tests/auto-regress/bug665914.js new file mode 100644 index 0000000000..2b7b0ee10d --- /dev/null +++ b/js/src/jit-test/tests/auto-regress/bug665914.js @@ -0,0 +1,6 @@ +// |jit-test| error:TypeError + +// Binary: cache/js-dbg-32-57ef3b619966-linux +// Flags: +// +ArrayBuffer.prototype['byteLength'] diff --git a/js/src/jit-test/tests/auto-regress/bug666305.js b/js/src/jit-test/tests/auto-regress/bug666305.js new file mode 100644 index 0000000000..5a8d318716 --- /dev/null +++ b/js/src/jit-test/tests/auto-regress/bug666305.js @@ -0,0 +1,8 @@ +// |jit-test| error:TypeError + +// Binary: cache/js-dbg-32-0428dbdf3d58-linux +// Flags: +// +o = (new Uint32Array).buffer +o.__proto__ = o +o.__proto__ = o diff --git a/js/src/jit-test/tests/auto-regress/bug666599.js b/js/src/jit-test/tests/auto-regress/bug666599.js new file mode 100644 index 0000000000..6c76178296 --- /dev/null +++ b/js/src/jit-test/tests/auto-regress/bug666599.js @@ -0,0 +1,15 @@ +// Binary: cache/js-dbg-32-0428dbdf3d58-linux +// Flags: +// +o1 = new Float32Array().buffer +o2 = ArrayBuffer.prototype +o3 = new Uint32Array().buffer +for (i = 0; i < 2; i++) { + for (var x in o2) { + o3.__defineGetter__("", function() {}) + } + o2.__defineGetter__("", function() {}) + o1[ + x] + o1.__proto__ = o3 +} diff --git a/js/src/jit-test/tests/auto-regress/bug667824.js b/js/src/jit-test/tests/auto-regress/bug667824.js new file mode 100644 index 0000000000..c84b745ee9 --- /dev/null +++ b/js/src/jit-test/tests/auto-regress/bug667824.js @@ -0,0 +1,7 @@ +// Binary: cache/js-dbg-32-208160c856b7-linux +// Flags: -j +// +var x; +for (let a = 0; a < 8; a++) { + Function.prototype() +} diff --git a/js/src/jit-test/tests/auto-regress/bug668206.js b/js/src/jit-test/tests/auto-regress/bug668206.js new file mode 100644 index 0000000000..5af6ac9ff8 --- /dev/null +++ b/js/src/jit-test/tests/auto-regress/bug668206.js @@ -0,0 +1,9 @@ +// Binary: cache/js-dbg-64-0d2a1a6e967f-linux +// Flags: -j -m +// +function f() { + for (var i = 0; i < 2; ++i) {} +} +for (let a = 0; a < 40; a++) { + f((new Array) ^ 0) +} diff --git a/js/src/jit-test/tests/auto-regress/bug672104.js b/js/src/jit-test/tests/auto-regress/bug672104.js new file mode 100644 index 0000000000..1150ee42bd --- /dev/null +++ b/js/src/jit-test/tests/auto-regress/bug672104.js @@ -0,0 +1,13 @@ +// Binary: cache/js-dbg-64-a37127f33d22-linux +// Flags: -m -n +// +load(libdir + "immutable-prototype.js"); + +a = {}; +b = __proto__; +for (i = 0; i < 9; i++) { + if (globalPrototypeChainIsMutable()) { + __proto__ = a; + a.__proto__ = b + } +} diff --git a/js/src/jit-test/tests/auto-regress/bug673792.js b/js/src/jit-test/tests/auto-regress/bug673792.js new file mode 100644 index 0000000000..08bc11dac0 --- /dev/null +++ b/js/src/jit-test/tests/auto-regress/bug673792.js @@ -0,0 +1,7 @@ +// |jit-test| error:ReferenceError + +// Binary: cache/js-dbg-32-8c7adf094b8e-linux +// Flags: +// +a = {}.__proto__ +gc(evalcx('split')) diff --git a/js/src/jit-test/tests/auto-regress/bug674843.js b/js/src/jit-test/tests/auto-regress/bug674843.js new file mode 100644 index 0000000000..ff1167c9bb --- /dev/null +++ b/js/src/jit-test/tests/auto-regress/bug674843.js @@ -0,0 +1,63 @@ +// Binary: cache/js-dbg-64-d066929dd830-linux +// Flags: -m +// +function fnSupportsArrayIndexGettersOnObjects() { + if (fnExists(Object.defineProperty)) { + var obj = {}; + Object.defineProperty(obj, "0", { + get: function () { + supportsArrayIndexGettersOnObjects = true; + } + }); + var res = obj[0]; + } + return supportsArrayIndexGettersOnObjects; +} +function fnExists( /*arguments*/ ) { + return true; +} +var ES5Harness = (function () { + var $this = this; + function registerTest(test) { + if (!(test.precondition && !test.precondition())) { + try { + var res = test.test.call($this); + } catch (e) {} + } + } + return { + registerTest: registerTest + } +})(); +ES5Harness.registerTest({ + test: function testcase() { + function callbackfn(accum, val, idx, obj) { + if (idx === 1 && val === 1) {} + } + var obj = { + length: 10 + }; + Object.defineProperty(obj, "0", { + get: function () { + defineProperty(idx, idx, registerTest + ": }}}}}"); + }, + }); + try { + Array.prototype.reduce.call(obj, callbackfn, "initialValue"); + } finally {} + }, + precondition: function prereq() { + return fnExists(Array.prototype.reduce) && fnExists(Object.defineProperty) && fnSupportsArrayIndexGettersOnObjects(); + } +}); +ES5Harness.registerTest({ + test: function testcase() { + var obj = {}; + Object.defineProperty(obj, "property", { + configurable: new Date() + }); + }, + precondition: function prereq() { + return fnExists(gczeal(2)); + } +}); diff --git a/js/src/jit-test/tests/auto-regress/bug675251.js b/js/src/jit-test/tests/auto-regress/bug675251.js new file mode 100644 index 0000000000..d3f19c3bd5 --- /dev/null +++ b/js/src/jit-test/tests/auto-regress/bug675251.js @@ -0,0 +1,25 @@ +// |jit-test| error:InternalError + +// Binary: cache/js-dbg-64-d43c6dddeb2b-linux +// Flags: -m -n +// + +function printBugNumber (num) { + BUGNUMBER = num; + print ('BUGNUMBER: ' + num); +} +var actual = ''; +test(); +function test() { + printBugNumber(test); + function f(N) { + for (var i = 0; i != N; ++i) { + for (var repeat = 0;repeat != 2; ++repeat) { + var count = BUGNUMBER(repeat); + } + } + } + var array = [function() { f(10); }, ]; + for (var i = 0; i != array.length; ++i) + array[i](); +} diff --git a/js/src/jit-test/tests/auto-regress/bug677386.js b/js/src/jit-test/tests/auto-regress/bug677386.js new file mode 100644 index 0000000000..c763177985 --- /dev/null +++ b/js/src/jit-test/tests/auto-regress/bug677386.js @@ -0,0 +1,25 @@ +// |jit-test| error:ReferenceError + +// Binary: cache/js-dbg-64-82545b1e4129-linux +// Flags: +// + +var g = newGlobal({newCompartment: true}); +g.eval("var line0 = Error().lineNumber;\n" + + "function f() {\n" + // line0 + 1 + " return 2;\n" + // line0 + 2 + "}\n"); +var N = 4; +for (var i = 0; i < N; i++) { + var dbg = Debugger(g); + dbg.onDebuggerStatement = function (frame) { + var handler = {hit: function () { hits++; }}; + var s = frame.eval("f").return.script; + var offs = s.getLineOffsets(g.line0 + 2); + for (var j = 0; j < offs.length; j++) + s.setBreakpoint(offs[j], handler); + }; + g.eval('debugger;'); +} +gc(/c$...$/); +assertEq(g.f(), 2); diff --git a/js/src/jit-test/tests/auto-regress/bug677587.js b/js/src/jit-test/tests/auto-regress/bug677587.js new file mode 100644 index 0000000000..5497e7cef0 --- /dev/null +++ b/js/src/jit-test/tests/auto-regress/bug677587.js @@ -0,0 +1,11 @@ +// Binary: cache/js-dbg-64-f189dd6316eb-linux +// Flags: +// + +var g = newGlobal({newCompartment: true}); +g.eval("var a = {};"); +var dbg = new Debugger; +var gw = dbg.addDebuggee(g); +var desc = gw.getOwnPropertyDescriptor("a"); +gw.defineProperty("b", desc); +Debugger(g.a, g.b); diff --git a/js/src/jit-test/tests/auto-regress/bug677977.js b/js/src/jit-test/tests/auto-regress/bug677977.js new file mode 100644 index 0000000000..e2b0735613 --- /dev/null +++ b/js/src/jit-test/tests/auto-regress/bug677977.js @@ -0,0 +1,25 @@ +// Binary: cache/js-dbg-64-48e43edc8834-linux +// Flags: +// + +var g = newGlobal({newCompartment: true}); +var dbg = Debugger(g); +dbg.onDebuggerStatement = function (frame) { + var s = frame.eval("f").return.script; +}; +function test(s) { + g.eval("line0 = Error().lineNumber;\n" + + "debugger;\n" + // line0 + 1 + "function f(i) {\n" + // line0 + 2 + "}\n"); +} +test("i = 128;\n" + "}\n"); +var hits = 0; +dbg.onNewScript = function (s) { + hits++; +}; +assertEq(g.eval("eval('2 + 3')"), 5); +this.gczeal(hits, 2); +var fn = g.evaluate("(function (a) { return 5 + a; })"); +var g2 = newGlobal({newCompartment: true}); +dbg.addDebuggee(g2, dbg); diff --git a/js/src/jit-test/tests/auto-regress/bug678086.js b/js/src/jit-test/tests/auto-regress/bug678086.js new file mode 100644 index 0000000000..8d7a9ed7d0 --- /dev/null +++ b/js/src/jit-test/tests/auto-regress/bug678086.js @@ -0,0 +1,17 @@ +// |jit-test| error:Error + +// Binary: cache/js-dbg-64-48e43edc8834-linux +// Flags: +// + +function f() { + frame = dbg.getNewestFrame(); +} +var g = newGlobal(); +g.f = function (a, b) { return a + "/" + this . f( ) ; }; +var dbg = Debugger(g); +dbg.onDebuggerStatement = function (frame) { + var f = frame.eval("f").return; + assertEq(f.call(null, "a", "b").return, "a/b"); +}; +g.eval("debugger;"); diff --git a/js/src/jit-test/tests/auto-regress/bug678529.js b/js/src/jit-test/tests/auto-regress/bug678529.js new file mode 100644 index 0000000000..ff8b8058c2 --- /dev/null +++ b/js/src/jit-test/tests/auto-regress/bug678529.js @@ -0,0 +1,11 @@ +// |jit-test| error:Error + +// Binary: cache/js-dbg-32-48e43edc8834-linux +// Flags: -j -m -a +// + +var g = newGlobal(); +var dbg = Debugger(g); +dbg.onDebuggerStatement = function (stack) { return {return: 1234}; }; +g.eval("function f() { debugger; return 'bad'; }"); +assertEq(new g.f(), 1234); diff --git a/js/src/jit-test/tests/auto-regress/bug679799.js b/js/src/jit-test/tests/auto-regress/bug679799.js new file mode 100644 index 0000000000..fa899458f9 --- /dev/null +++ b/js/src/jit-test/tests/auto-regress/bug679799.js @@ -0,0 +1,16 @@ +// Binary: cache/js-dbg-64-2d95fc517e57-linux +// Flags: -m -n -a +// + +function test() +{ + var x = { "0": 3, "-0": 7 }; + try { + delete x["-0"]; + if ("-0" in x) + throw "0 not in x after insertion of 0 property"; + this ["-0"] = 7; + } catch(ex) {} +} +test(); +test(); diff --git a/js/src/jit-test/tests/auto-regress/bug679810.js b/js/src/jit-test/tests/auto-regress/bug679810.js new file mode 100644 index 0000000000..56eafcf294 --- /dev/null +++ b/js/src/jit-test/tests/auto-regress/bug679810.js @@ -0,0 +1,14 @@ +// Binary: cache/js-dbg-64-2d95fc517e57-linux +// Flags: -m -n +// + +function WorkerBee(name, dept, projs) { + this.projects &= projs || new Array(); +} +function Engineer(name, projs, machine) { + this.base = WorkerBee; + this.base(name, "engineering", projs) + this.machine = machine || ""; +} +Engineer.prototype = {}; +var les = new Engineer("Morris, Les", new Array("JavaScript"), "indy"); diff --git a/js/src/jit-test/tests/auto-regress/bug680797.js b/js/src/jit-test/tests/auto-regress/bug680797.js new file mode 100644 index 0000000000..aa151c3e7b --- /dev/null +++ b/js/src/jit-test/tests/auto-regress/bug680797.js @@ -0,0 +1,47 @@ +// |jit-test| slow; error:InternalError + +// Binary: cache/js-dbg-64-a2bbe9c999b4-linux +// Flags: -m -n +// +gczeal(2); +function Day( t ) {} +function YearFromTime( t ) {} +function HourFromTime( t ) {} +function MakeTime( hour, min, sec, ms ) {} +function MakeDay( year, month, date ) {} +function MakeDate( day, time ) {} +function TimeClip( t ) { + return ToInteger( t ); +} +function ToInteger( t ) { + sign = 1 + return sign * Math.floor( Math.abs( t ) ); +} +addNewTestCase( 28800000, 23, 59, 999,0, "TDATE = new Date(28800000);(TDATE).setHours(23,59,999);TDATE" ); +function addNewTestCase( time, hours, min, sec, ms, DateString) { + UTCDateFromTime( SetHours( time, hours, min, sec, ms )) +} +function MyDate() { return this.seconds=0; } +function UTCDateFromTime(t) { + MyDateFromTime(t) +} +function MyDateFromTime( t ) { + d = new MyDate + d.year=YearFromTime(t) + d.month= + d.date= + d.hours=HourFromTime(t) + d.minutes= + d.time=MakeTime( d.hours, d, d.seconds, d ) + d=TimeClip( MakeDate( MakeDay( d.year, d.month, ( ( MyDateFromTime(t) ) , null ) ), d.time ) ) +} +function SetHours( t, hour, min, sec, ms ) { + TIME = + HOUR = + MIN = min == 0 ? TIME : + SEC = sec == 0 ? addNewTestCaseSecFromTime : Number + var MS = ms == void 0 ? TIME : ms; + var RESULT6 = ( HOUR, MS ); + var UTC_TIME = MakeDate(Day(TIME), RESULT6); + return TimeClip(UTC_TIME); +} diff --git a/js/src/jit-test/tests/auto-regress/bug682252.js b/js/src/jit-test/tests/auto-regress/bug682252.js new file mode 100644 index 0000000000..dd39e1d286 --- /dev/null +++ b/js/src/jit-test/tests/auto-regress/bug682252.js @@ -0,0 +1,7 @@ +// Binary: cache/js-dbg-64-7054f0e3e70e-linux +// Flags: +// + +re = new RegExp("([^b]*)+((..)|(\\3))+?Sc*a!(a|ab)(c|bcd)(<*)", "i"); +var str = "aNULLxabcd"; +str.replace(re, function(s) { return s; }); diff --git a/js/src/jit-test/tests/auto-regress/bug682298.js b/js/src/jit-test/tests/auto-regress/bug682298.js new file mode 100644 index 0000000000..b29dfdb0bc --- /dev/null +++ b/js/src/jit-test/tests/auto-regress/bug682298.js @@ -0,0 +1,6 @@ +// |jit-test| error:ReferenceError + +// Binary: cache/js-dbg-32-cc1e08803869-linux +// Flags: +// +(function(){clear()})() diff --git a/js/src/jit-test/tests/auto-regress/bug682563.js b/js/src/jit-test/tests/auto-regress/bug682563.js new file mode 100644 index 0000000000..5522e5f3b2 --- /dev/null +++ b/js/src/jit-test/tests/auto-regress/bug682563.js @@ -0,0 +1,12 @@ +// Binary: cache/js-dbg-64-9a0172368402-linux +// Flags: -m -n +// +var TITLE = "Labeled statements"; +LabelTest(0, 0); +function LabelTest(limit, expect) { + woo: for (var result = 0; limit<100; result++,limit++) { + if (result == limit) { + result = 'Error'; + } else "$0$00" || this ? TITLE : 1; + }; +} diff --git a/js/src/jit-test/tests/auto-regress/bug684281.js b/js/src/jit-test/tests/auto-regress/bug684281.js new file mode 100644 index 0000000000..6612a87180 --- /dev/null +++ b/js/src/jit-test/tests/auto-regress/bug684281.js @@ -0,0 +1,14 @@ +// Binary: cache/js-dbg-64-fcca99426576-linux +// Flags: -m -n -a +// + +function printStatus (msg) {} +F = function () {}; +F.prototype = new Int32Array(1); +o = new F(); +function f2(o){ + with(this) + for(var x in o) + printStatus(o[x]); +} +f2([]); diff --git a/js/src/jit-test/tests/auto-regress/bug685472.js b/js/src/jit-test/tests/auto-regress/bug685472.js new file mode 100644 index 0000000000..1a63841814 --- /dev/null +++ b/js/src/jit-test/tests/auto-regress/bug685472.js @@ -0,0 +1,12 @@ +// |jit-test| error:TypeError + +// Binary: cache/js-dbg-64-b7d269a291b6-linux +// Flags: -m -n -a +// + +function Integer(value, exception) { + try {} catch (e) {} + new(value = this)(this.value); + Math.floor(({})[value.Math, this].abstract) +} +new Integer(3, false); diff --git a/js/src/jit-test/tests/auto-regress/bug686107.js b/js/src/jit-test/tests/auto-regress/bug686107.js new file mode 100644 index 0000000000..9135cd6c12 --- /dev/null +++ b/js/src/jit-test/tests/auto-regress/bug686107.js @@ -0,0 +1,15 @@ +// |jit-test| error:TypeError + +// Binary: cache/js-dbg-64-d078623f7875-linux +// Flags: -m -n -a +// + +function testKeyTransitions() { + var i, key, result, message; + var array = []; + for (i = 0; i != 10; i++) { + key = (i < 3) ? 'pop' : (/\u009e\u0029/g ); + array[key](i); + } +} +testKeyTransitions(); diff --git a/js/src/jit-test/tests/auto-regress/bug686179.js b/js/src/jit-test/tests/auto-regress/bug686179.js new file mode 100644 index 0000000000..9eb69e5840 --- /dev/null +++ b/js/src/jit-test/tests/auto-regress/bug686179.js @@ -0,0 +1,15 @@ +// Binary: cache/js-dbg-64-b31b25125429-linux +// Flags: -m -n -a +// + +(function () { + assertEquals = function assertEquals(expected, found, name_opt) { }; + assertTrue = function assertTrue(value, name_opt) { }; +})(); +function f0() {} +function f1(x) {} +function test(f) { + assertTrue(null === (assertEquals).arguments); +} +test(f0); +test(f1); diff --git a/js/src/jit-test/tests/auto-regress/bug687099.js b/js/src/jit-test/tests/auto-regress/bug687099.js new file mode 100644 index 0000000000..c013b72b9e --- /dev/null +++ b/js/src/jit-test/tests/auto-regress/bug687099.js @@ -0,0 +1,30 @@ +// Binary: cache/js-dbg-64-94ceb173baed-linux +// Flags: -m -n -a +// + +gczeal(2); +function iso(d) { + return new Date(d).toISOString(); +} +function check(s, millis){ + description = "Date.parse('"+s+"') == '"+iso(millis)+"'"; +} +function dd(year, month, day, hour, minute, second, millis){ + return Date.UTC(year, month-1, day, hour, minute, second, millis); +} +function TZAtDate(d){ + return d.getTimezoneOffset() * 60000; +} +function TZInMonth(month){ + return TZAtDate(new Date(dd(2009,month,1,0,0,0,0))); +} +JulTZ = TZInMonth(7); +check("2009-07-23T19:53:21.001+12:00", dd(2009,7,23,7,53,21,1)); +check("2009-07-23T19:53:21+12:00", dd(2009,7,23,7,53,21,0)); +check("2009-07-23T19:53+12:00", dd(2009,7,23,7,53,0,0)); +check("2009-07T19:53:21.001", dd(2009,0Xe ,1,19,53,21,1)+JulTZ); +check("2009-07T19:53:21", dd(2009,7,1,19,53,21,0)+JulTZ); +check("2009-07T19:53", dd(2009,7,1,19,53,0,0)+JulTZ); +check("2009-07-23T19:53:21.001+12:00", dd(2009,7,23,7,53,21,1)); +check("2009-07-23T00:00:00.000-07:00", dd(2009,7,23,7,0,0,0)); +check("2009-07-23T24:00:00.000-07:00", dd(2009,7,24,7,0,0,0)); diff --git a/js/src/jit-test/tests/auto-regress/bug687102.js b/js/src/jit-test/tests/auto-regress/bug687102.js new file mode 100644 index 0000000000..0612c332ac --- /dev/null +++ b/js/src/jit-test/tests/auto-regress/bug687102.js @@ -0,0 +1,7 @@ +// |jit-test| error:Error + +// Binary: cache/js-dbg-32-f3f5d8a8a473-linux +// Flags: +// +function caller(obj) {} +var pc = line2pc(caller, pc2line(caller, 0XeBebb ) + 2); diff --git a/js/src/jit-test/tests/auto-regress/bug687125.js b/js/src/jit-test/tests/auto-regress/bug687125.js new file mode 100644 index 0000000000..c4811e926d --- /dev/null +++ b/js/src/jit-test/tests/auto-regress/bug687125.js @@ -0,0 +1,25 @@ +// Binary: cache/js-dbg-64-f3f5d8a8a473-linux +// Flags: -m -n +// + +function MakeDay( year, month, date ) { + date = ToInteger(date ); + var t = ( year < 1970 ) ? 1 : 0; + return ( (Math.floor(t/86400000)) + date - 1 ); +} +function MakeDate( day, time ) { + if ( day == Number.POSITIVE_INFINITY || day == Number.NEGATIVE_INFINITY ) { } +} +function ToInteger( t ) { + var sign = ( t < 0 ) ? -1 : 1; + return ( sign * Math.floor( Math.abs( t ) ) ); +} +var UTCDate = MyDateFromTime( Number("946684800000") ); +function MyDate() { + this.date = 0; +} +function MyDateFromTime( t ) { + var d = new MyDate(); + d.value = ToInteger( MakeDate( MakeDay( d.year, d.month, d.date ), d.time ) ); + var i = 0; while (Uint32Array && i < 10000) { ++i; if (0 == 100000) return; } +} diff --git a/js/src/jit-test/tests/auto-regress/bug687399.js b/js/src/jit-test/tests/auto-regress/bug687399.js new file mode 100644 index 0000000000..4a6734d1a9 --- /dev/null +++ b/js/src/jit-test/tests/auto-regress/bug687399.js @@ -0,0 +1,30 @@ +// Binary: cache/js-dbg-64-06445f55f009-linux +// Flags: -m -n -a +// + +if (!this.emulatedJSON) { + emulatedJSON = function () { + function stringify(value, whitelist) { + var a, i, v; + switch (typeof value) { + case 'string': + if (!(value.propertyIsEnumerable('length'))) { + for (i = 0; i < l; i += 1) { + k = whitelist[i]; + if (typeof k === 'string') { + if (i %= 'not visited') {} + } + } + } + } + } + return { + stringify: stringify, + }; + }(); + var testPairs = [ ['{"five":5}'] ] + for (var i = 0; i < testPairs.length; i++) { + var pair = testPairs[i]; + var s = emulatedJSON.stringify(pair[1]) + } +} diff --git a/js/src/jit-test/tests/auto-regress/bug688968.js b/js/src/jit-test/tests/auto-regress/bug688968.js new file mode 100644 index 0000000000..0b1185d4c1 --- /dev/null +++ b/js/src/jit-test/tests/auto-regress/bug688968.js @@ -0,0 +1,8 @@ +// Binary: cache/js-dbg-64-fecae145d884-linux +// Flags: -m -n -a +// + +function foo(x) { + x === x--; +} +foo(1.2); diff --git a/js/src/jit-test/tests/auto-regress/bug688974.js b/js/src/jit-test/tests/auto-regress/bug688974.js new file mode 100644 index 0000000000..0c88dc5bd2 --- /dev/null +++ b/js/src/jit-test/tests/auto-regress/bug688974.js @@ -0,0 +1,13 @@ +// Binary: cache/js-dbg-64-fecae145d884-linux +// Flags: -m -n +// + +gczeal(2); +Object.defineProperty(Object.prototype, "b", {set: function() {}}); +function C(a, b) { + this.a=a; + this.b=b; +} +var f = C.bind(0x2004, 2); +for (var i=0; i<10000; ++i) + new f; diff --git a/js/src/jit-test/tests/auto-regress/bug689892.js b/js/src/jit-test/tests/auto-regress/bug689892.js new file mode 100644 index 0000000000..ad3fbc8575 --- /dev/null +++ b/js/src/jit-test/tests/auto-regress/bug689892.js @@ -0,0 +1,11 @@ +// Binary: cache/js-dbg-32-7f4867717226-linux +// Flags: -m -n -a +// + +function foo2(x, n) { + var i = 0; + while (--n >= 0) { + x[i++] = 0; + } +} +foo2([1,0Xae ,3,4,5],('0123456')); diff --git a/js/src/jit-test/tests/auto-regress/bug690933.js b/js/src/jit-test/tests/auto-regress/bug690933.js new file mode 100644 index 0000000000..d4a5b5f357 --- /dev/null +++ b/js/src/jit-test/tests/auto-regress/bug690933.js @@ -0,0 +1,14 @@ +// |jit-test| slow; error:allocation size overflow + +// Binary: cache/js-dbg-32-1463dc6308a8-linux +// Flags: +// + +var fe="vv"; +for (i=0; i<24; i++) + fe += fe; +var fu=new Function( + fe, fe, fe, fe, fe, fe, fe, fe, fe, fe, fe, fe, fe, fe, fe, fe, fe, fe, fe, + fe, fe, fe, fe, fe, fe, fe, fe, fe, fe, fe, fe, fe, fe, fe, fe, fe, fe, fe, + "done" +); diff --git a/js/src/jit-test/tests/auto-regress/bug691595.js b/js/src/jit-test/tests/auto-regress/bug691595.js new file mode 100644 index 0000000000..d62ee7cc76 --- /dev/null +++ b/js/src/jit-test/tests/auto-regress/bug691595.js @@ -0,0 +1,20 @@ +// |jit-test| error:ReferenceError + +// Binary: cache/js-dbg-64-acf3c1fb7c94-linux +// Flags: --ion-eager +// + +function k(f_arg) { + for (var i = 0; i < 10; ++i) { + f_arg( ) ; + } +} +function t() { + k(function (i) { actual ^ this | this; }); +} +var ans = 0; +for (var j = 0; j < 10; ++j) { + for (var i = 0; i < 10; ++i) { + ans += t(); + } +} diff --git a/js/src/jit-test/tests/auto-regress/bug692300.js b/js/src/jit-test/tests/auto-regress/bug692300.js new file mode 100644 index 0000000000..67698ee08a --- /dev/null +++ b/js/src/jit-test/tests/auto-regress/bug692300.js @@ -0,0 +1,10 @@ +// Binary: cache/js-dbg-64-38a487da2def-linux +// Flags: +// + +var x = newGlobal().Date; +var OBJ = new MyObject( new x(0) ); +try { eval("OBJ.valueOf()"); } catch(exc1) {} +function MyObject( value ) { + this.valueOf = x.prototype.valueOf; +} diff --git a/js/src/jit-test/tests/auto-regress/bug692366.js b/js/src/jit-test/tests/auto-regress/bug692366.js new file mode 100644 index 0000000000..4e8516d001 --- /dev/null +++ b/js/src/jit-test/tests/auto-regress/bug692366.js @@ -0,0 +1,6 @@ +// Binary: cache/js-dbg-64-32536d199fcf-linux +// Flags: +// +try { + Uint8Array.subarray(newGlobal()); +} catch(exc1) {} diff --git a/js/src/jit-test/tests/auto-regress/bug693144.js b/js/src/jit-test/tests/auto-regress/bug693144.js new file mode 100644 index 0000000000..bf89fc55b6 --- /dev/null +++ b/js/src/jit-test/tests/auto-regress/bug693144.js @@ -0,0 +1,12 @@ +// Binary: cache/js-dbg-64-b4da2d439cbc-linux +// Flags: -m -n -a +// + +function f() { + var oa = []; + for (var i = 0; i < 8; ++i) { + var o = {}; + oa[(new Int32Array(ArrayBuffer.prototype).length)] = o; + } +} +f(); diff --git a/js/src/jit-test/tests/auto-regress/bug693971.js b/js/src/jit-test/tests/auto-regress/bug693971.js new file mode 100644 index 0000000000..174a12f092 --- /dev/null +++ b/js/src/jit-test/tests/auto-regress/bug693971.js @@ -0,0 +1,12 @@ +// Binary: cache/js-dbg-64-07c668448519-linux +// Flags: -m -n +// + +function testContinue() { + for (i = 0; i < 100; ++i) { + if ([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]) + continue; + } + return 0; +} +assertEq(testContinue(), 0); diff --git a/js/src/jit-test/tests/auto-regress/bug694438.js b/js/src/jit-test/tests/auto-regress/bug694438.js new file mode 100644 index 0000000000..aaca0c0d1a --- /dev/null +++ b/js/src/jit-test/tests/auto-regress/bug694438.js @@ -0,0 +1,61 @@ +// Binary: cache/js-dbg-64-ae061e27e3df-linux +// Flags: -m -n +// + +var lfcode = new Array(); +lfcode.push("29cff0b98e80f8b27367a56b3c752dedc59a01fd.js"); +lfcode.push("da39a3ee5e6b4b0d3255bfef95601890afd80709.js"); +lfcode.push("3"); +lfcode.push("b40eb3beb80c7cde2828a33bd779f7826e25287d.js"); +lfcode.push("f7b783e07cd0e61b675319866b62c96b521d3c12.js"); +lfcode.push("29cff0b98e80f8b27367a56b3c752dedc59a01fd.js"); +lfcode.push("da39a3ee5e6b4b0d3255bfef95601890afd80709.js"); +lfcode.push("1"); +lfcode.push("02b39295c36bbe079e9dca0aca95d253d064a194.js"); +lfcode.push("f7b783e07cd0e61b675319866b62c96b521d3c12.js"); +lfcode.push("29cff0b98e80f8b27367a56b3c752dedc59a01fd.js"); +lfcode.push("da39a3ee5e6b4b0d3255bfef95601890afd80709.js"); +lfcode.push("4"); +lfcode.push("6d3ccd7e95a67392260056fd31425aa671cb5c54.js"); +lfcode.push("f7b783e07cd0e61b675319866b62c96b521d3c12.js"); +lfcode.push("29cff0b98e80f8b27367a56b3c752dedc59a01fd.js"); +lfcode.push("da39a3ee5e6b4b0d3255bfef95601890afd80709.js"); +lfcode.push("0"); +lfcode.push("0d88bd3fca079ce7b26f26e12511d3e36edb4202.js"); +lfcode.push("f7b783e07cd0e61b675319866b62c96b521d3c12.js"); +lfcode.push("29cff0b98e80f8b27367a56b3c752dedc59a01fd.js"); +lfcode.push("da39a3ee5e6b4b0d3255bfef95601890afd80709.js"); +lfcode.push("4"); +lfcode.push("c26e5241caa1d0dad95a2202a57cdc48322e5917.js"); +lfcode.push("f7b783e07cd0e61b675319866b62c96b521d3c12.js"); +lfcode.push("29cff0b98e80f8b27367a56b3c752dedc59a01fd.js"); +lfcode.push("da39a3ee5e6b4b0d3255bfef95601890afd80709.js"); +lfcode.push("3"); +lfcode.push("7eeb48e00f249e4a8ab82e7c70102725f3c88195.js"); +lfcode.push("f7b783e07cd0e61b675319866b62c96b521d3c12.js"); +lfcode.push("29cff0b98e80f8b27367a56b3c752dedc59a01fd.js"); +lfcode.push("da39a3ee5e6b4b0d3255bfef95601890afd80709.js"); +lfcode.push("2"); +lfcode.push("7b61d02cc95bbc7309f749c5deb5d4709687214f.js"); +lfcode.push("f7b783e07cd0e61b675319866b62c96b521d3c12.js"); +lfcode.push("29cff0b98e80f8b27367a56b3c752dedc59a01fd.js"); +lfcode.push("da39a3ee5e6b4b0d3255bfef95601890afd80709.js"); +lfcode.push("1"); +lfcode.push("8eafe3c62c3ce1635548fc09c4434ef0259bcfff.js"); +lfcode.push("f7b783e07cd0e61b675319866b62c96b521d3c12.js"); +lfcode.push("29cff0b98e80f8b27367a56b3c752dedc59a01fd.js"); +lfcode.push("da39a3ee5e6b4b0d3255bfef95601890afd80709.js"); +var lfRunTypeId = -1; +while (true) { + var file = lfcode.shift(); if (file == undefined) { break; } + loadFile(file); +} +function loadFile(lfVarx) { + try { + if (lfVarx.substr(-3) == ".js") { + switch (lfRunTypeId) { + case 4: eval("(function() { " + "" + " })();"); + } + } + } catch (lfVare) { } +} diff --git a/js/src/jit-test/tests/auto-regress/bug695290.js b/js/src/jit-test/tests/auto-regress/bug695290.js new file mode 100644 index 0000000000..0dff9c33e9 --- /dev/null +++ b/js/src/jit-test/tests/auto-regress/bug695290.js @@ -0,0 +1,11 @@ +// |jit-test| error:Error + +// Binary: cache/js-dbg-64-cf5da681d577-linux +// Flags: -m -n -a +// + +options("typeinfer"); +gczeal(2); +var g = newGlobal(); +gcparam("maxBytes", 22000); +let array = g.eval("new Array(1,2,3)"); diff --git a/js/src/jit-test/tests/auto-regress/bug696039.js b/js/src/jit-test/tests/auto-regress/bug696039.js new file mode 100644 index 0000000000..a28e60d3eb --- /dev/null +++ b/js/src/jit-test/tests/auto-regress/bug696039.js @@ -0,0 +1,21 @@ +// Binary: cache/js-dbg-32-67673422f7d2-linux +// Flags: -m -n -a +// + +gczeal(2); +var lfcode = new Array(); +lfcode.push(""); +lfcode.push(""); +while (lfcode.length > 0) { + var file = lfcode.shift(); + loadFile(file); +} +function loadFile(lfVarx) { + try { + eval("\ + Array.prototype[30] = 'B';\ + delete Array.prototype[30];\ + assertEquals('edcba', a.join(''));\ + "); + } catch (lfVare) {} +} diff --git a/js/src/jit-test/tests/auto-regress/bug697255.js b/js/src/jit-test/tests/auto-regress/bug697255.js new file mode 100644 index 0000000000..b9f0cae0d2 --- /dev/null +++ b/js/src/jit-test/tests/auto-regress/bug697255.js @@ -0,0 +1,12 @@ +// Binary: cache/js-dbg-32-6cd262091470-linux +// Flags: -j +// +a = evalcx("lazy"); +b = {} +b.__proto__ = a +a.__proto__ = String +for (var a = 0; a < 50; a++) { + try { + b + "" + } catch (e) {} +} diff --git a/js/src/jit-test/tests/auto-regress/bug698074.js b/js/src/jit-test/tests/auto-regress/bug698074.js new file mode 100644 index 0000000000..fd0c950226 --- /dev/null +++ b/js/src/jit-test/tests/auto-regress/bug698074.js @@ -0,0 +1,7 @@ +// Binary: cache/js-dbg-32-b01eb1ba58ce-linux +// Flags: +// +a = (0).__proto__ +b = (0).__proto__ +b.__defineSetter__("valueOf", function() {}) +a + 8 diff --git a/js/src/jit-test/tests/auto-regress/bug698148.js b/js/src/jit-test/tests/auto-regress/bug698148.js new file mode 100644 index 0000000000..b6feb657aa --- /dev/null +++ b/js/src/jit-test/tests/auto-regress/bug698148.js @@ -0,0 +1,16 @@ +// Binary: cache/js-dbg-64-b01eb1ba58ce-linux +// Flags: +// + +expect = 'Test skipped.'; +function addPointImagedata(pointArray, n, col, row) { + pointArray[expect + 2] = 2; +} +function createMandelSet() { + points = new Array; + for (var idx = 0; idx < 1440000 ; ++idx) { + points[idx] = 0 + } + addPointImagedata(points, ({}, {}), 0,0) +} +createMandelSet(); diff --git a/js/src/jit-test/tests/auto-regress/bug699674.js b/js/src/jit-test/tests/auto-regress/bug699674.js new file mode 100644 index 0000000000..8266213494 --- /dev/null +++ b/js/src/jit-test/tests/auto-regress/bug699674.js @@ -0,0 +1,5 @@ +// Binary: cache/js-dbg-32-6dc7901db1d6-linux +// Flags: +// +Array(24) +for(v in(Array(2440598491))){} diff --git a/js/src/jit-test/tests/auto-regress/bug700127.js b/js/src/jit-test/tests/auto-regress/bug700127.js new file mode 100644 index 0000000000..4ef82fb249 --- /dev/null +++ b/js/src/jit-test/tests/auto-regress/bug700127.js @@ -0,0 +1,17 @@ +// Binary: cache/js-dbg-64-921e1db5cf11-linux +// Flags: -m -n -a +// + +function addThis() {} +function Integer( value ) { + try { + checkValue( value ) + } catch (e) { } +} +function checkValue( value ) { + if ( addThis() != value || value ) + throw value='foo'; + return value; +} +Integer( 3 ); +Integer( NaN ); diff --git a/js/src/jit-test/tests/auto-regress/bug700295.js b/js/src/jit-test/tests/auto-regress/bug700295.js new file mode 100644 index 0000000000..f92039923c --- /dev/null +++ b/js/src/jit-test/tests/auto-regress/bug700295.js @@ -0,0 +1,22 @@ +// Binary: cache/js-dbg-64-1210706b4576-linux +// Flags: +// +load(libdir + "immutable-prototype.js"); + +if (globalPrototypeChainIsMutable()) { + this.__proto__ = null; + Object.prototype.__proto__ = this; +} + +function exploreProperties(obj) { + var props = []; + for (var o = obj; o; o = Object.getPrototypeOf(o)) { + props = props.concat(Object.getOwnPropertyNames(o)); + } + for (var i = 0; i < props.length; ++i) { + var p = props[i]; + var v = obj[p]; + } +} +var c = [{}]; +exploreProperties(c); diff --git a/js/src/jit-test/tests/auto-regress/bug701248.js b/js/src/jit-test/tests/auto-regress/bug701248.js new file mode 100644 index 0000000000..825c656b4d --- /dev/null +++ b/js/src/jit-test/tests/auto-regress/bug701248.js @@ -0,0 +1,8 @@ +// Binary: cache/js-dbg-64-c60535115ea1-linux +// Flags: +// + +function F(x, y) { + var { j, y, p, a } = testSyntax("#1=<a>b</a>", true) = this; +} +var src = F.toString(-1)+"\n"; diff --git a/js/src/jit-test/tests/auto-regress/bug701332.js b/js/src/jit-test/tests/auto-regress/bug701332.js new file mode 100644 index 0000000000..ca40e15a6e --- /dev/null +++ b/js/src/jit-test/tests/auto-regress/bug701332.js @@ -0,0 +1,15 @@ +// |jit-test| error:InternalError; slow; + +// Binary: cache/js-dbg-64-c60535115ea1-linux +// Flags: +// + +gczeal(2); +test(); +function test() { + function t(o, proplist) { + var props=proplist.split(/\s+/g); + }; + t({ bar: 123, baz: 123, quux: 123 }, 'bar baz quux'); + ( test(), this )(( "7.4.2-6-n" ) , actual, summary + ' : nonjit'); +} diff --git a/js/src/jit-test/tests/auto-regress/bug702003.js b/js/src/jit-test/tests/auto-regress/bug702003.js new file mode 100644 index 0000000000..da30715dc4 --- /dev/null +++ b/js/src/jit-test/tests/auto-regress/bug702003.js @@ -0,0 +1,25 @@ +// Binary: cache/js-dbg-64-50c1bcb49c76-linux +// Flags: -m -n -a +// + +var lfcode = new Array(); +lfcode.push("try { \ + gczeal(2);\ + exitFunc ('test');\ + } catch(exc1) {}\ +"); +lfcode.push("var summary = 'Foo'; \ + var actual = 'No Crash';\ + var expect = 'No Crash';\ + test();\ + function test() {\ + try {\ + eval('(function(){ <x/>.(yield 4) })().next();');\ + }\ catch(ex) { 'Bar'; }\ + }\ +"); +while (true) { + var code = lfcode.shift(); + if (code == undefined) { break; } + evaluate(code); +} diff --git a/js/src/jit-test/tests/auto-regress/bug702915.js b/js/src/jit-test/tests/auto-regress/bug702915.js new file mode 100644 index 0000000000..9829b19191 --- /dev/null +++ b/js/src/jit-test/tests/auto-regress/bug702915.js @@ -0,0 +1,85 @@ +// Binary: cache/js-dbg-64-d51bd1645a2f-linux +// Flags: -m -n -a +// +gczeal(4); +var callStack = new Array(); +var gTestcases = new Array(); +var gTc = gTestcases.length; +function TestCase(n, d, e, a) { + this.name = n; + this.description = d; + this.expect = e; + this.actual = a; + this.passed = getTestCaseResult(e, a); + this.reason = ''; + this.bugnumber = ''; + this.type = (typeof window == 'undefined' ? 'shell' : 'browser'); + gTestcases[gTc++] = this; +} +function enterFunc (funcName) { + try { throw foo; } catch(ex) {} +} +function getTestCaseResult(expected, actual) {} +function writeHeaderToLog( string ) {} +var lfcode = new Array(); +lfcode.push("\ + var code = ''; \ + code+=createCode((gczeal(2))); \ + function createCode(i) { \ + jstop+= + delete + i + \" string.';\"; \ + } \ +"); +lfcode.push("\ +var SECTION = '9.9-1'; \ +new TestCase( SECTION, '(Object(true)).__proto__', Boolean.prototype, (Object(true)).__proto__ ); \ +new TestCase( SECTION, '(Object(1)).__proto__', Number.prototype, (Object(1)).__proto__ ); \ +new TestCase( SECTION, '(Object(-1)).__proto__', Number.prototype, (Object(-1)).__proto__ ); \ +new TestCase( SECTION, '(Object(Number.MAX_VALUE)).__proto__', Number.prototype, (Object(Number.MAX_VALUE)).__proto__ ); \ +new TestCase( SECTION, '(Object(Number.MIN_VALUE)).__proto__', Number.prototype, (Object(Number.MIN_VALUE)).__proto__ ); \ +new TestCase( SECTION, '(Object(Number.POSITIVE_INFINITY)).__proto__', Number.prototype, (Object(Number.POSITIVE_INFINITY)).__proto__ ); \ +new TestCase( SECTION, '(Object(Number.NEGATIVE_INFINITY)).__proto__', Number.prototype, (Object(Number.NEGATIVE_INFINITY)).__proto__ ); \ +new TestCase( SECTION, '(Object(Number.NaN)).__proto__', Number.prototype, (Object(Number.NaN)).__proto__ ); \ +new TestCase( ) ; \ +new TestCase( SECTION, '(Object(\"\")).__proto__', String.prototype, (Object('')).__proto__ ); \ +new TestCase( SECTION, \"(Object('foo')).__proto__\", String.prototype, (Object('foo')).__proto__ ); \ +new TestCase( SECTION, \"Object( '' ).__proto__\", String.prototype, (Object(\"\")).__proto__ ); \ +new TestCase( SECTION, '(Object( new MyObject(true) )).toString()', '[object Object]', eval('(Object( new MyObject(true) )).toString()') ); \ +"); +lfcode.push("jsTestDriverEnd();"); +lfcode.push(""); +lfcode.push("\ + enterFunc ('test'); \ + Array.prototype[1] = 'bar'; \ + var a = []; \ + exitFunc ('test'); \ +"); +lfcode.push(""); +lfcode.push("\ + var VERSION = 'ECMA_1'; \ +var TITLE = 'Value Properties of the Math Object'; \ +writeHeaderToLog( SECTION + ' '+ TITLE); \ +new TestCase( '15.8.1.1', 'Math.E', \ + this . TITLE ); \ + 'typeof Math.E', \ +new TestCase( '15.8.1.2', \ + 'Math.LN10', \ + 'typeof Math.LN10', \ + typeof Math.LN10 ); \ +new TestCase( '15.8.1.3', \ + 'Math.LN2', \ + Math.LN2 ); \ +new TestCase( '15.8.1.3', \ + Math.LOG2E ); \ +new TestCase( '15.8.1.4', \ + Math.SQRT1_2); \ +new TestCase( '15.8.1.7', \ + typeof Math.SQRT2 ); \ +new TestCase( SECTION, \ + eval('var MATHPROPS=\"\";for( p in Math ){ MATHPROPS +=p; };MATHPROPS') ); \ +"); +while (true) { + var file = lfcode.shift(); if (file == undefined) { break; } + try { + eval(file); + } catch(exc1) { print(exc1); }; +} diff --git a/js/src/jit-test/tests/auto-regress/bug704136.js b/js/src/jit-test/tests/auto-regress/bug704136.js new file mode 100644 index 0000000000..c5e0b83e79 --- /dev/null +++ b/js/src/jit-test/tests/auto-regress/bug704136.js @@ -0,0 +1,8 @@ +// |jit-test| error:ReferenceError + +// Binary: cache/js-dbg-64-a335853be219-linux +// Flags: +// + +gczeal(4); +jsTestDriverEnd(); diff --git a/js/src/jit-test/tests/auto-regress/bug710192.js b/js/src/jit-test/tests/auto-regress/bug710192.js new file mode 100644 index 0000000000..399eee384f --- /dev/null +++ b/js/src/jit-test/tests/auto-regress/bug710192.js @@ -0,0 +1,10 @@ +// |jit-test| error:Error + +// Binary: cache/js-dbg-64-63bff373cb94-linux +// Flags: -m -n -a +// + +function f(a, b, c) { + arguments[('4294967295')] = 2; +} +assertEq(f(1), "1234"); diff --git a/js/src/jit-test/tests/auto-regress/bug713209.js b/js/src/jit-test/tests/auto-regress/bug713209.js new file mode 100644 index 0000000000..559cbfadfd --- /dev/null +++ b/js/src/jit-test/tests/auto-regress/bug713209.js @@ -0,0 +1,24 @@ +// Binary: cache/js-dbg-32-c5b90ea7e475-linux +// Flags: -m -n -a +// +load(libdir + "immutable-prototype.js"); + +var save__proto__ = __proto__; +if (globalPrototypeChainIsMutable()) + __proto__ = save__proto__; + +function bar(x, y) { + return x + y; +} +function foo(x, y) { + var a = 0; + for (var i = 0; i < 1000; i++) { + a += (this.toString); + a += bar(x, y); + a = bar(x, (a)); + a += bar(x, y); + } + return a; +} +var q = foo(0, 1); +print(q.toString()); diff --git a/js/src/jit-test/tests/auto-regress/bug713944.js b/js/src/jit-test/tests/auto-regress/bug713944.js new file mode 100644 index 0000000000..36377b2f2a --- /dev/null +++ b/js/src/jit-test/tests/auto-regress/bug713944.js @@ -0,0 +1,16 @@ +// Binary: cache/js-dbg-64-7e28cce342a6-linux +// Flags: +// +function f() { + constructor = {} +} +Object.defineProperty(function() { + return {}.__proto__ +}(), "constructor", { + set: function() {} +}) +f() +Object.defineProperty({}.__proto__, "constructor", { + value: 3 +}) +f() diff --git a/js/src/jit-test/tests/auto-regress/bug715682.js b/js/src/jit-test/tests/auto-regress/bug715682.js new file mode 100644 index 0000000000..191a95507e --- /dev/null +++ b/js/src/jit-test/tests/auto-regress/bug715682.js @@ -0,0 +1,4 @@ +// Binary: cache/js-dbg-64-10894668e37f-linux +// Flags: +// +({set"0"(l){}}) diff --git a/js/src/jit-test/tests/auto-regress/bug716512.js b/js/src/jit-test/tests/auto-regress/bug716512.js new file mode 100644 index 0000000000..631a19b811 --- /dev/null +++ b/js/src/jit-test/tests/auto-regress/bug716512.js @@ -0,0 +1,6 @@ +// |jit-test| error:Error + +// Binary: cache/js-dbg-64-9a230265bad5-linux +// Flags: +// +gcparam("maxBytes", -1); diff --git a/js/src/jit-test/tests/auto-regress/bug717249.js b/js/src/jit-test/tests/auto-regress/bug717249.js new file mode 100644 index 0000000000..5dfb880b6f --- /dev/null +++ b/js/src/jit-test/tests/auto-regress/bug717249.js @@ -0,0 +1,7 @@ +// |jit-test| error:TypeError + +// Binary: cache/js-dbg-64-4de07a341aab-linux +// Flags: -m -n -a +// + +[].__proto__(); diff --git a/js/src/jit-test/tests/auto-regress/bug717251.js b/js/src/jit-test/tests/auto-regress/bug717251.js new file mode 100644 index 0000000000..b3e5696585 --- /dev/null +++ b/js/src/jit-test/tests/auto-regress/bug717251.js @@ -0,0 +1,16 @@ +// Binary: cache/js-dbg-64-4de07a341aab-linux +// Flags: -m -n -a +// +load(libdir + "immutable-prototype.js"); + +if (globalPrototypeChainIsMutable()) + this.__proto__ = []; + +var msPerDay = 86400000; +for ( var time = 0, year = 1969; year >= 0; year-- ) { + time -= TimeInYear(year); +} +function DaysInYear( y ) {} +function TimeInYear( y ) { + return ( DaysInYear(y) * msPerDay ); +} diff --git a/js/src/jit-test/tests/auto-regress/bug718347.js b/js/src/jit-test/tests/auto-regress/bug718347.js new file mode 100644 index 0000000000..e8886a7967 --- /dev/null +++ b/js/src/jit-test/tests/auto-regress/bug718347.js @@ -0,0 +1,8 @@ +// |jit-test| error:TypeError + +// Binary: cache/js-dbg-64-49afabda6701-linux +// Flags: -m -n -a +// + +this.__proto__ = newGlobal(); +eval("(toLocaleString)();"); diff --git a/js/src/jit-test/tests/auto-regress/bug720380.js b/js/src/jit-test/tests/auto-regress/bug720380.js new file mode 100644 index 0000000000..d673ab8988 --- /dev/null +++ b/js/src/jit-test/tests/auto-regress/bug720380.js @@ -0,0 +1,8 @@ +// Binary: cache/js-dbg-64-42368fe44c8c-linux +// Flags: -m -n +// + +function MyObject( value ) { + this.toBoolean = (this[ this.Function = this ]++ ); +} +new MyObject(true); diff --git a/js/src/jit-test/tests/auto-regress/bug720396.js b/js/src/jit-test/tests/auto-regress/bug720396.js new file mode 100644 index 0000000000..8244185a9e --- /dev/null +++ b/js/src/jit-test/tests/auto-regress/bug720396.js @@ -0,0 +1,11 @@ +// |jit-test| error:TypeError + +// Binary: cache/js-dbg-64-1962ca549264-linux +// Flags: +// + +var g = newGlobal(); +var dbg1 = new Debugger; +var gw1 = dbg1.addDebuggee(g); +var dbg2 = new Debugger; +var gw2 = dbg2.addDebuggee((gw1.__proto__)); diff --git a/js/src/jit-test/tests/auto-regress/bug721497.js b/js/src/jit-test/tests/auto-regress/bug721497.js new file mode 100644 index 0000000000..021a7bc9ab --- /dev/null +++ b/js/src/jit-test/tests/auto-regress/bug721497.js @@ -0,0 +1,13 @@ +// |jit-test| error:ReferenceError + +// Binary: cache/js-dbg-64-edf8075b0333-linux +// Flags: +// + +var g = newGlobal({newCompartment: true}); +var dbg = new Debugger(g); +dbg.onDebuggerStatement = function (frame) { + assertEq(dumpStack(), true); +}; +g.eval("function f(a, [b, c], {x: [y], z: w}, {q}) { debugger; }"); +g.eval("f(1, [2, 3], {x: [4], z: 5}, {q: 6});"); diff --git a/js/src/jit-test/tests/auto-regress/bug722021.js b/js/src/jit-test/tests/auto-regress/bug722021.js new file mode 100644 index 0000000000..47a8bbc18c --- /dev/null +++ b/js/src/jit-test/tests/auto-regress/bug722021.js @@ -0,0 +1,8 @@ +// Binary: cache/js-dbg-64-8a59519e137e-linux +// Flags: -m -n -a +// + +var a = []; +for (let j = 0; j < 5; ++j) { + a.push(-2 in (a)); +} diff --git a/js/src/jit-test/tests/auto-regress/bug722023.js b/js/src/jit-test/tests/auto-regress/bug722023.js new file mode 100644 index 0000000000..e58cd39e00 --- /dev/null +++ b/js/src/jit-test/tests/auto-regress/bug722023.js @@ -0,0 +1,12 @@ +// Binary: cache/js-dbg-64-8a59519e137e-linux +// Flags: -m -n -a +// + +var obj = new Object(); +var index = [ (null ), 1073741824, 1073741825 ]; +for (var j in index) { + testProperty(index[j]); +} +function testProperty(i) { + actual = obj[String(i)]; +} diff --git a/js/src/jit-test/tests/auto-regress/bug722260.js b/js/src/jit-test/tests/auto-regress/bug722260.js new file mode 100644 index 0000000000..d9777c29bc --- /dev/null +++ b/js/src/jit-test/tests/auto-regress/bug722260.js @@ -0,0 +1,8 @@ +// Binary: cache/js-dbg-64-8a59519e137e-linux +// Flags: +// + +var m = new Map; +var key = -((/\u0024/ ).x); +var v = {}; +m.set(key,v); diff --git a/js/src/jit-test/tests/auto-regress/bug724875.js b/js/src/jit-test/tests/auto-regress/bug724875.js new file mode 100644 index 0000000000..a6e20496c9 --- /dev/null +++ b/js/src/jit-test/tests/auto-regress/bug724875.js @@ -0,0 +1,15 @@ +// Binary: cache/js-dbg-64-c34398f961e7-linux +// Flags: --ion-eager +// + +var lfcode = new Array(); +lfcode.push("gczeal(4);"); +lfcode.push(""); +while (true) { + var file = lfcode.shift(); + if (file == undefined) { break; } + loadFile(file); +} +function loadFile(lfVarx) { + eval(lfVarx); +} diff --git a/js/src/jit-test/tests/auto-regress/bug726636.js b/js/src/jit-test/tests/auto-regress/bug726636.js new file mode 100644 index 0000000000..595ed290ea --- /dev/null +++ b/js/src/jit-test/tests/auto-regress/bug726636.js @@ -0,0 +1,10 @@ +// |jit-test| error:Error + +// Binary: cache/js-dbg-64-4a9a6ffd1f21-linux +// Flags: +// +function jsTestDriverEnd() {} +this.__defineSetter__("x", function () {}); +x %= 5; +jsTestDriverEnd(); +mjitChunkLimit(); diff --git a/js/src/jit-test/tests/auto-regress/bug727330.js b/js/src/jit-test/tests/auto-regress/bug727330.js new file mode 100644 index 0000000000..bfa4533026 --- /dev/null +++ b/js/src/jit-test/tests/auto-regress/bug727330.js @@ -0,0 +1,9 @@ +// |jit-test| error:TypeError + +// Binary: cache/js-dbg-64-ff51ddfdf5d1-linux +// Flags: +// +var a = []; +for (var i = 0; i < 200; ++i) a.push({}); +var p = new Proxy({}, {preventExtensions() { return false; }}); +Object.preventExtensions(p); diff --git a/js/src/jit-test/tests/auto-regress/bug728509.js b/js/src/jit-test/tests/auto-regress/bug728509.js new file mode 100644 index 0000000000..102770aa5b --- /dev/null +++ b/js/src/jit-test/tests/auto-regress/bug728509.js @@ -0,0 +1,14 @@ +// Binary: cache/js-dbg-32-78fde7e54d92-linux +// Flags: -m -n -a +// +function g(code) { + try { + f = eval("(function(){" + code + "})") + } catch (r) {} + f() + try { + evalcx("(function(){return" + code + "})()") + } catch (e) {} +} +g("") +g(" function(x,[]){NaN.x::c}()") diff --git a/js/src/jit-test/tests/auto-regress/bug729571.js b/js/src/jit-test/tests/auto-regress/bug729571.js new file mode 100644 index 0000000000..449ce040fe --- /dev/null +++ b/js/src/jit-test/tests/auto-regress/bug729571.js @@ -0,0 +1,42 @@ +// Binary: cache/js-dbg-64-ca97bbcd6b90-linux +// Flags: --ion-eager +// + +gczeal(4); +function TestCase(n, d, e, a) {} +TestCase.prototype.dump = function () {}; +TestCase.prototype.testFailed = (function TestCase_testFailed() { + }); + try { + try { } catch(ex1) { } + } catch(ex) { } + options.initvalues = {}; + var optionNames = options().split(','); + var optionsframe = {}; + try { + optionsClear(); + } catch(ex) { } +var lfcode = new Array(); +lfcode.push("\ + try { } catch (exception) { }\ + try { } catch (exception) { }\ + try { } catch (exception) { }\ + try { } catch (actual) { }\ + var props = {};\ + function test(which) {\ + var g = newGlobal();\ + function addDebugger(g, i) {\ + var dbg = Debugger(g);\ + dbg.onDebuggerStatement = function (frame) { };\ + }\ + for (var i = 0; i < 3; i++) {\ + addDebugger(g, i);\ + }\ + g.eval(\"debugger;\");\ +}\ +for (var j = 0; j < 3; j++) test(j);\ +"); +while (true) { + var file = lfcode.shift(); if (file == undefined) { break; } + try { evaluate(file); } catch (lfVare) { } +} diff --git a/js/src/jit-test/tests/auto-regress/bug729797.js b/js/src/jit-test/tests/auto-regress/bug729797.js new file mode 100644 index 0000000000..4d5c4512bf --- /dev/null +++ b/js/src/jit-test/tests/auto-regress/bug729797.js @@ -0,0 +1,15 @@ +// |jit-test| error:InternalError + +// Binary: cache/js-dbg-64-5a04fd69aa09-linux +// Flags: --ion-eager +// + +var patterns = new Array(); +patterns[0] = ''; +test(); +function test() { + for (i in patterns) { + s = patterns[i]; + status =(test)(s); + } +} diff --git a/js/src/jit-test/tests/auto-regress/bug729886.js b/js/src/jit-test/tests/auto-regress/bug729886.js new file mode 100644 index 0000000000..b17ac1e299 --- /dev/null +++ b/js/src/jit-test/tests/auto-regress/bug729886.js @@ -0,0 +1,12 @@ +// |jit-test| error:ReferenceError + +// Binary: cache/js-opt-64-5a04fd69aa09-linux +// Flags: --ion-eager +// + +function deep1(x) { + if (0) { } + else i : dumpStack(); +} +for (var i = 0; 1; ++i) + deep1(i); diff --git a/js/src/jit-test/tests/auto-regress/bug730806.js b/js/src/jit-test/tests/auto-regress/bug730806.js new file mode 100644 index 0000000000..9c5ed54b7e --- /dev/null +++ b/js/src/jit-test/tests/auto-regress/bug730806.js @@ -0,0 +1,61 @@ +// Binary: cache/js-opt-32-2dc40eb83023-linux +// Flags: -m -n -a +// +function toPrinted(value) { + return value = value.replace(/\\n/g, 'NL') + .replace(/\\r/g, 'CR') + .replace(/[^\x20-\x7E]+/g, escapeString); +} +function escapeString (str) +{ + var a, b, c, d; + var len = str.length; + var result = ""; + var digits = ["0", "1", "2", "3", "4", "5", "6", "7", + "8", "9", "A", "B", "C", "D", "E", "F"]; + for (var i=0; i<len; i++) + { + var ch = str.charCodeAt(i); + a = digits[ch & 0xf]; + if (ch) + { + c = digits[ch & 0xf]; + ch >>= 4; + d = digits[ch & 0xf]; + result += "\\u" + d + c + b + a; + } + } +} +function reportCompare (expected, actual, description) { +function test() { + try + { + } + catch(e) + { + } + } +} +try { +gczeal(2,4); +function setprop() { +} +} catch(exc1) {} +var trimMethods = ['trim', 'trimLeft', 'trimRight']; +var whitespace = [ + {s : '\u2028', t : 'LINE SEPARATOR'}, + ]; +for (var j = 0; j < trimMethods.length; ++j) +{ + var method = trimMethods[j]; + for (var i = 0; i < whitespace.length; ++i) + { + var v = whitespace[i].s; + var t = whitespace[i].t; + v = v + v + v; + str = v; + expected = ''; + actual = str[method](); + reportCompare(expected, actual, t + ':' + '"' + toPrinted(str) + '".' + method + '()'); + } +} diff --git a/js/src/jit-test/tests/auto-regress/bug732719.js b/js/src/jit-test/tests/auto-regress/bug732719.js new file mode 100644 index 0000000000..7ae9ea4ee5 --- /dev/null +++ b/js/src/jit-test/tests/auto-regress/bug732719.js @@ -0,0 +1,26 @@ +// |jit-test| slow; error:InternalError + +// Binary: cache/js-dbg-32-343ec916dfd5-linux +// Flags: -m -n +// + +function TestCase(n, d, e, a) { + return TestCase.prototype.dump = function () {}; +} +function enterFunc (funcName) { +return function writeHeaderToLog( string ) {}; +} +gczeal(2); +function f() {} +try { +var BUGNUMBER = 350621; +test(); +} catch(exc1) {} +function test() { + enterFunc ( summary = this, test(BUGNUMBER)); + function gen1() { } + function test_it(RUNS) { } +} +new TestCase (String([(1),'a22','a23','a24']), + String('a11\na22\na23\na24'.match(new RegExp('a..$','g')))); +test(); diff --git a/js/src/jit-test/tests/auto-regress/bug732852.js b/js/src/jit-test/tests/auto-regress/bug732852.js new file mode 100644 index 0000000000..8936fa855f --- /dev/null +++ b/js/src/jit-test/tests/auto-regress/bug732852.js @@ -0,0 +1,10 @@ +// |jit-test| error:SyntaxError + +// Binary: cache/js-dbg-64-1fd6c40d3852-linux +// Flags: --ion-eager +// + +var ary = ["\u001Cfoo", "\u001Dfoo", "\u001Efoo", "\u001Ffoo"]; +for (var i in ary) { + ary[Number(i)].search("var MYVAR='077';++MYVAR") +} diff --git a/js/src/jit-test/tests/auto-regress/bug732855.js b/js/src/jit-test/tests/auto-regress/bug732855.js new file mode 100644 index 0000000000..62c66c305a --- /dev/null +++ b/js/src/jit-test/tests/auto-regress/bug732855.js @@ -0,0 +1,69 @@ +// Binary: cache/js-dbg-64-1fd6c40d3852-linux +// Flags: --ion-eager +// +function TestCase(n, d, e, a) {} +var msPerDay = 86400000; +var msPerHour = 3600000; +var now = new Date(); +var TIME_NOW = now.valueOf(); +function DaysInYear( y ) { + if ( y % 4 != 0 ) { + return 365; + } + return 366; +} +function TimeInYear( y ) { + return ( DaysInYear(y) * msPerDay ); +} +function TimeFromYear( y ) { + return ( msPerDay * DayFromYear(y) ); +} +function DayFromYear( y ) { + return ( 365*(y-1970) + + Math.floor((y-1601)/400) ); +} +function InLeapYear( t ) { + if ( DaysInYear(YearFromTime(t)) == 365 ) { + return 0; + } + if ( DaysInYear(YearFromTime(t)) == 366 ) { + } +} +function YearFromTime( t ) { + var sign = ( t < 0 ) ? -1 : 1; + var year = ( sign < 0 ) ? 1969 : 1970; + for ( var timeToTimeZero = t; ; ) { + timeToTimeZero -= sign * TimeInYear(year) + if ( sign < 0 ) { + } else { + if ( sign * timeToTimeZero < 0 ) { + break; + } else { + year += sign; + } + } + } + return ( year ); +} +function WeekDay( t ) {} +function LocalTZA() {} +function LocalTime( t ) { + var dst_start = GetDSTStart(t); +} +function GetFirstSundayInMonth( t, m ) { + var leap = InLeapYear(t); +} +function GetDSTStart( t ) { + return (GetFirstSundayInMonth(t, 2) + 7*msPerDay + 2*msPerHour - LocalTZA()); +} +var SECTION = "15.9.5.12"; +addTestCase( TIME_NOW ); +function addTestCase( t ) { + var start = TimeFromYear(YearFromTime(t)); + var stop = TimeFromYear(YearFromTime(t) + 1); + for (var d = start; d < stop; d += msPerDay) { + new TestCase( SECTION, + WeekDay((LocalTime(d))), + (__lookupGetter__) ); + } +} diff --git a/js/src/jit-test/tests/auto-regress/bug732856.js b/js/src/jit-test/tests/auto-regress/bug732856.js new file mode 100644 index 0000000000..e6a7d2a079 --- /dev/null +++ b/js/src/jit-test/tests/auto-regress/bug732856.js @@ -0,0 +1,19 @@ +// Binary: cache/js-dbg-64-1fd6c40d3852-linux +// Flags: --ion-eager +// + +var cnName = 'name'; +var cnNameGetter = function() {this.nameGETS++; return this._name;}; +obj = (new (function ( ) { } ) ); +obj.__defineGetter__(cnName, cnNameGetter); +function lameFunc(x, y) { + var lsw = (x & 0xFFFF) + (y & 0xFFFF); + var msw = (obj.name) + (y >> 16) + (lsw >> 16); +} +function runSomeTimes(func, iters) { + for (var i = 0; i < iters; ++i) { + result = func(42, 42); + } +} +for (var i = 0; i < 11000; ++i) + runSomeTimes(lameFunc, 1); diff --git a/js/src/jit-test/tests/auto-regress/bug732857.js b/js/src/jit-test/tests/auto-regress/bug732857.js new file mode 100644 index 0000000000..d78f3e3c70 --- /dev/null +++ b/js/src/jit-test/tests/auto-regress/bug732857.js @@ -0,0 +1,34 @@ +// Binary: cache/js-dbg-32-1fd6c40d3852-linux +// Flags: --ion-eager +// +load(libdir + "immutable-prototype.js"); + +function TestCase(n, d, e, a) {}; + +if (globalPrototypeChainIsMutable()) + this.__proto__ = []; + +var msPerDay = 86400000; +var TIME_1900 = -2208988800000; +function TimeFromYear( y ) { + return ( msPerDay * DayFromYear(y) ); +} +function DayFromYear( y ) { + return ( 365*(y-1970) + + Math.floor((y-1601)/400) ); +} +function YearFromTime( t ) { + var sign = ( t < 0 ) ? -1 : 1; + var year = ( sign < 0 ) ? 1969 : 1970; + return ( year ); +} +var SECTION = "15.9.5.10"; +addTestCase( TIME_1900 ); +function addTestCase( t ) { + var start = TimeFromYear(YearFromTime(t)); + var stop = TimeFromYear(YearFromTime(t) + 1); + for (var d = start; d < stop; d += msPerDay) { + new TestCase( SECTION, + (new Date( SECTION ? "Failed" : prototype += "'abc'.search(new RegExp('^'))") ).getDate() ); + } +} diff --git a/js/src/jit-test/tests/auto-regress/bug732861.js b/js/src/jit-test/tests/auto-regress/bug732861.js new file mode 100644 index 0000000000..6ceed608b0 --- /dev/null +++ b/js/src/jit-test/tests/auto-regress/bug732861.js @@ -0,0 +1,12 @@ +// |jit-test| error:ReferenceError + +// Binary: cache/js-dbg-64-1fd6c40d3852-linux +// Flags: --ion-eager +// + +j = 0; +out1: +for ((exception) = 0; ; j++) + if (j == 50) + break out1; +while (dbgeval("[]").proto ? g : 50) {} diff --git a/js/src/jit-test/tests/auto-regress/bug735313.js b/js/src/jit-test/tests/auto-regress/bug735313.js new file mode 100644 index 0000000000..fe57887fcc --- /dev/null +++ b/js/src/jit-test/tests/auto-regress/bug735313.js @@ -0,0 +1,15 @@ +// |jit-test| slow; allow-oom; + +// Binary: cache/js-dbg-64-dfcb11712ec2-linux +// Flags: +// + +a=[]; +for (var i=0; i<10; i++) { + a[a.length] = a; +} +try { + for (var i=0; i<26; i++) { + a[a.length] = a.toString(); + } +} catch(exc1) {} diff --git a/js/src/jit-test/tests/auto-regress/bug735936.js b/js/src/jit-test/tests/auto-regress/bug735936.js new file mode 100644 index 0000000000..a7f8db1acf --- /dev/null +++ b/js/src/jit-test/tests/auto-regress/bug735936.js @@ -0,0 +1,8 @@ +// |jit-test| error: SyntaxError +// Binary: cache/js-dbg-32-7e713db43d8d-linux +// Flags: +// +f = (function() { + "use strict"; + [arguments] = eval() +}) diff --git a/js/src/jit-test/tests/auto-regress/bug736609.js b/js/src/jit-test/tests/auto-regress/bug736609.js new file mode 100644 index 0000000000..a4b3633153 --- /dev/null +++ b/js/src/jit-test/tests/auto-regress/bug736609.js @@ -0,0 +1,10 @@ +// Binary: cache/js-dbg-32-c7ef262e3024-linux +// Flags: +// +try { + a = new ArrayBuffer(76); + b = new Uint32Array(a); + String() + c = new Uint8Array(a); + c.set(b) +} catch (e) {} diff --git a/js/src/jit-test/tests/auto-regress/bug737300.js b/js/src/jit-test/tests/auto-regress/bug737300.js new file mode 100644 index 0000000000..ad5b021916 --- /dev/null +++ b/js/src/jit-test/tests/auto-regress/bug737300.js @@ -0,0 +1,21 @@ +// |jit-test| error:ReferenceError + +// Binary: cache/js-dbg-64-b5b6e6aebb36-linux +// Flags: --ion-eager +// + +function loopy(p0) +{ + var r3 = p0; + var r4 = p0; + var r6 = p0; + var r7 = p0; + while (r2) { + while (r2) { + r5 = r6 & r1; + r3 = r4 & r3; + r2 = r7; + } + } +} +loopy(0); diff --git a/js/src/jit-test/tests/auto-regress/bug737737.js b/js/src/jit-test/tests/auto-regress/bug737737.js new file mode 100644 index 0000000000..cf219d5b33 --- /dev/null +++ b/js/src/jit-test/tests/auto-regress/bug737737.js @@ -0,0 +1,36 @@ +// Binary: cache/js-dbg-32-e96d5b1f47b8-linux +// Flags: --ion-eager +// +function b(z) { + switch (z) { + default: + primarySandbox = newGlobal() + } + return function(f, code) { + try { + evalcx(code, primarySandbox) + } catch (e) {} + } +} +function a(code) { + gc(); + f = Function(code) + c(f, code) +} +c = b() +a("\ + f2 = (function() {\ + a0 + o2.m;\ + a2.shift()\ + });\ + a2 = new Array;\ + Object.defineProperty(a2, 0, {\ + get: f2\ + });\ + o2 = {};\ + a0 = [];\ + a2.shift();\ + var x;\ +") +a("a0 = x") +a("a2.shift()") diff --git a/js/src/jit-test/tests/auto-regress/bug739402.js b/js/src/jit-test/tests/auto-regress/bug739402.js new file mode 100644 index 0000000000..d42de4e410 --- /dev/null +++ b/js/src/jit-test/tests/auto-regress/bug739402.js @@ -0,0 +1,142 @@ +// |jit-test| slow; + +// Binary: cache/js-dbg-32-be41973873db-linux +// Flags: --ion-eager +// +function MersenneTwister19937() { + N = 624; + var M = 397; + MATRIX_A = 567483615; + UPPER_MASK = 2147483648; + var LOWER_MASK = 767; + mt = Array(); + function unsigned32(n1) { + return n1 < 0 ? (n1 ^ UPPER_MASK) + UPPER_MASK : n1; + } + function addition32(n1, n2) { + return unsigned32(n1 + n2 & 4294967295); + } + function multiplication32(n1, n2) { + sum = 0; + for (i = 0; i < 32; ++i) { + if (n1 >> i & 1) { + sum = addition32(sum, unsigned32(n2 << i)); + } + } + return sum; + } + this.init_genrand = function() { + for (mti = 1; mti < N; mti++) { + mt[mti] = addition32(multiplication32(181433253, unsigned32(mt[mti - 1] ^ mt[mti - 1] >>> 30)), mti); + } + }; + this.genrand_int32 = function() { + mag01 = Array(0, MATRIX_A); + if (mti > N) { + for (kk = 0; kk < N - M; kk++) { + y = unsigned32(mt[kk] & UPPER_MASK | mt[kk + 1] & LOWER_MASK); + } + for (; kk < N; kk++) { + mt[kk] = unsigned32(mt[kk + (M - N)] ^ y >>> 1 ^ mag01[y & 1]); + } + mti = 0; + } + y = mt[mti++]; + return y; + }; +} +(function() { + var fuzzMT = new MersenneTwister19937; + fuzzSeed = 4; + fuzzMT.init_genrand(fuzzSeed); + rnd = function(n) { + var x = fuzzMT.genrand_int32() * 2.2e-10; + return Math.floor(x * n); + }; +}()); + +function rndElt(a) { + return a[rnd(a.length)]; +} +varBinderFor = ["", "t", ""]; +function forLoopHead(d, b, v, reps) { + var sInit = rndElt(varBinderFor) + v + "=0"; + var sCond = v + "<" + reps; + sNext = "++" + v; + return "for(" + sInit + ";" + sCond + ";" + sNext + ")"; +} +function makeBranchUnstableLoop(d, b) { + var reps = rnd(rnd(9)); + v = uniqueVarName(); + var mod = rnd(); + target = rnd(mod); + return "" + forLoopHead(d, b, v, reps) + "{" + "if(" + v + "%" + mod + "==" + target + "){" + makeStatement(d - 2, b) + "}" + "{" + makeStatement(d - 2) + "}" + "}"; +} +function weighted(wa) { + a = []; + for (var i = 0; i < wa.length; ++i) { + for (var j = 0; j < wa[i].w; ++j) { + a.push(wa[i].fun); + } + } + return a; +} +statementMakers = weighted([{ + w: 6, + fun: makeBranchUnstableLoop +}, {}]); +(function() { + builderStatementMakers = weighted([{ + w: 1, + fun: function() { + return "gc()"; + } + }, { + w: 10, + fun: function() {} + }]); + makeBuilderStatement = function() { + return rndElt(builderStatementMakers)(); + }; +}()); +function uniqueVarName() { + for (i = 0; i < 6; ++i) { + s = String.fromCharCode(97 + rnd(6)); + } + return s; +} +function makeLittleStatement(d) { + rnd(0); + if (rnd) { + rndElt(littleStatementMakers)(); + } +} +littleStatementMakers = [function() {}]; +function testOne() { + var code = makeOv(10); + tryItOut(code); +} +function makeStatement(d, b) { + if (rnd(0)) {} + if (rnd(2)) { + return makeBuilderStatement(); + } + d < 6 && rnd() == 0; + if (d < rnd(8)) { + return makeLittleStatement(); + } + return rndElt(statementMakers)(d, b); +} +function makeOv(d, B) { + if (rnd() == 0) {} + return "" + makeStatement(d, [""]); +} +function tryItOut(code) { + try { + f = Function(code); + f(); + } catch (r) {} +} +for (let aa = 0; aa < 9999; aa++) { + testOne(); +} diff --git a/js/src/jit-test/tests/auto-regress/bug739901.js b/js/src/jit-test/tests/auto-regress/bug739901.js new file mode 100644 index 0000000000..9bb1e26fbd --- /dev/null +++ b/js/src/jit-test/tests/auto-regress/bug739901.js @@ -0,0 +1,20 @@ +// Binary: cache/js-dbg-64-940078281bbf-linux +// Flags: --ion-eager +// +function List(l) { + this.l = l; +} +function f(p) { + return g(p.l); +}; +function g(p) { + return !(p instanceof List) ? null : f(p.l); +}; +list = + new List(new List( + new List(new List( + new List(new List( + new List(new List(null)))))))) +for (let i = 0; i < 99999; i++) { + g(list); +} diff --git a/js/src/jit-test/tests/auto-regress/bug740509.js b/js/src/jit-test/tests/auto-regress/bug740509.js new file mode 100644 index 0000000000..1e9c7b2f90 --- /dev/null +++ b/js/src/jit-test/tests/auto-regress/bug740509.js @@ -0,0 +1,82 @@ +// |jit-test| slow; + +// Binary: cache/js-dbg-64-fb23c30e3d60-linux +// Flags: -m -n -a +// +function TestCase(n, d, e, a) { +return TestCase.prototype.dump = function () { +}; +} +var lfcode = new Array(); +lfcode.push("2"); +lfcode.push("var lfcode = new Array();\ +lfcode.push(\"gczeal(4,1);\");\ +while (true) {\ + var file = lfcode.shift(); if (file == ((0Xa ) . shift )) { break; }\ + eval(file);\ +}\ +"); +lfcode.push("function testJSON(str, expectSyntaxError)\ +"); +lfcode.push("{ return 1; }"); +lfcode.push("Number.prototype.toString = function() { return 3; };\ +assertEq(JSON.stringify({ 3: 3, 4: 4 }, [(this . abstract )]),\ + '{\"3\":3}');\ +"); +lfcode.push("var HoursPerDay = 24;\ +var MinutesPerHour = 60;\ +var SecondsPerMinute = 60;\ +var msPerSecond = 1000;\ +var msPerMinute = 60000;\ +var TZ_ADJUST = TZ_DIFF * msPerHour;\ +var PST_DIFF = TZ_DIFF - TZ_PST;\ +var PST_ADJUST = TZ_PST * msPerHour;\ +var TIME_0000 = (function ()\ + {\ +var TIME_1970 = 0;\ +var TIME_1900 = -2208988800000;\ +var UTC_FEB_29_2000 = TIME_2000 + 31*msPerDay + 28*msPerDay;\ +var UTC_JAN_1_2005 = TIME_2000 + TimeInYear(2000) + TimeInYear(2001) +\ + TimeInYear(2002) + TimeInYear(2003) + TimeInYear(2004);\ +var TIME_NOW = now.valueOf();\ +function getTimeZoneDiff()\ +{\ + return -((new Date(2000, 1, 1)).getTimezoneOffset())/60;\ +function adjustResultArray(ResultArray, msMode)\ + { return ResultArray[UTC_HOURS] = HourFromTime(t); }\ + ResultArray[UTC_DATE] = DateFromTime(t);\ + ResultArray[UTC_MONTH] = MonthFromTime(t);\ + ResultArray[UTC_YEAR] = YearFromTime(t);\ +function DaysInYear( y ) {\ + return \"ERROR: DaysInYear(\" + y + \") case not covered\";\ +function DayNumber( t ) {\ +function TimeWithinDay( t ) {\ +function YearNumber( t ) {\ +function TimeFromYear( y ) {\ +function InLeapYear( t ) {\ + return \"ERROR: InLeapYear(\"+ t + \") case not covered\";\ + for ( var timeToTimeZero = t; ; ) {\ + return \"ERROR: MonthFromTime(\"+t+\") not known\";\ +function DayWithinYear( t ) {\ + return( Day(t) - DayFromYear(YearFromTime(t)));\ +"); +while (true) { + var file = lfcode.shift(); if (file == undefined) { break; } + if (file == "evaluate") { + } else { + loadFile(file); + } +} +function loadFile(lfVarx) { + try { + if (lfVarx.substr(-3) == ".js") { + } else if (!isNaN(lfVarx)) { + lfRunTypeId = parseInt(lfVarx); + } else { + switch (lfRunTypeId) { + case 1: eval(lfVarx); break; + case 2: new Function(lfVarx)(); break; + } + } + } catch (lfVare) { } +} diff --git a/js/src/jit-test/tests/auto-regress/bug740654.js b/js/src/jit-test/tests/auto-regress/bug740654.js new file mode 100644 index 0000000000..5b2d151ba0 --- /dev/null +++ b/js/src/jit-test/tests/auto-regress/bug740654.js @@ -0,0 +1,13 @@ +// |jit-test| error:InternalError + +// Binary: cache/js-dbg-32-92fe907ddac8-linux +// Flags: -m -n +// +o = {} +o.valueOf = function() { + for (var p in undefined) { + a = new Function; + } + +o; +}; ++o; diff --git a/js/src/jit-test/tests/auto-regress/bug741199.js b/js/src/jit-test/tests/auto-regress/bug741199.js new file mode 100644 index 0000000000..6205bfcfa3 --- /dev/null +++ b/js/src/jit-test/tests/auto-regress/bug741199.js @@ -0,0 +1,9 @@ +// Binary: cache/js-dbg-32-e96d5b1f47b8-linux +// Flags: --ion-eager +// + +var a = new Array(1000 * 100); +var i = a.length; +while (i-- != 0) {} +gc(); +(({ }).break--); diff --git a/js/src/jit-test/tests/auto-regress/bug743071.js b/js/src/jit-test/tests/auto-regress/bug743071.js new file mode 100644 index 0000000000..0c5e80d3c2 --- /dev/null +++ b/js/src/jit-test/tests/auto-regress/bug743071.js @@ -0,0 +1,51 @@ +// Binary: cache/js-dbg-64-a9a18824b4c1-linux +// Flags: --ion-eager +// + +{ + try + { + try + { + } + catch(ex1) + { + } + } + catch(ex) + { + } +} +function optionsClear() { + var optionNames = options().split(','); + for (var i = 0; i < optionNames.length; i++) + { + var optionName = optionNames[i]; + if (optionName && + optionName != "methodjit_always") + { + options(optionName); + } + } +} +{ + optionsClear(); + { + } +} +function test() { + for ( gTc=0; gTc < gTestcases.length; gTc++ ) { + try + { + } + catch(e) + { + } + } +} +try { +var g = newGlobal(); +g.eval("(" + function () { + dbg = new Debugger(debuggeeGlobal); + } + ")();"); +} catch(exc0) {} diff --git a/js/src/jit-test/tests/auto-regress/bug743094.js b/js/src/jit-test/tests/auto-regress/bug743094.js new file mode 100644 index 0000000000..982d9d3a87 --- /dev/null +++ b/js/src/jit-test/tests/auto-regress/bug743094.js @@ -0,0 +1,17 @@ +// Binary: cache/js-dbg-32-a9a18824b4c1-linux +// Flags: --ion-eager +// + +var i = 0; + +gczeal(2); +function test() { + // Recursion depth reduced to allow PBL with debug build (hence larger + // frames) to work. + if (i++ > 75) + return "function"; + var res = typeof (new test("1")) != 'function'; + return res ? "function" : "string"; +} + +test(); diff --git a/js/src/jit-test/tests/auto-regress/bug743096.js b/js/src/jit-test/tests/auto-regress/bug743096.js new file mode 100644 index 0000000000..81661ea6e1 --- /dev/null +++ b/js/src/jit-test/tests/auto-regress/bug743096.js @@ -0,0 +1,14 @@ +// Binary: cache/js-dbg-64-a9a18824b4c1-linux +// Flags: --ion-eager +// + +try { +function f() { + var obj = { + p0:0, p1:1, p2:2, p3:3, p4:4, p5:5, p6:6, p7:7, p8:8, p9:9, + p10:0, p11:1, set:2, p13:3, p14:4, p15:5, p16:6, p17:7, p18:8, p19:9, + with : function() { return 42; } + }; +} + actual = f(); +} catch(exc1) {} diff --git a/js/src/jit-test/tests/auto-regress/bug743876.js b/js/src/jit-test/tests/auto-regress/bug743876.js new file mode 100644 index 0000000000..2dd81faefa --- /dev/null +++ b/js/src/jit-test/tests/auto-regress/bug743876.js @@ -0,0 +1,35 @@ +// Binary: cache/js-dbg-64-434f50e70815-linux +// Flags: -m -n -a +// + +var lfcode = new Array(); +lfcode.push("3"); +lfcode.push("\ +evaluate(\"\");\ +function slice(a, b) {\ + return slice(index, ++(ArrayBuffer));\ +}\ +"); +lfcode.push("0"); +lfcode.push("var arr = [0, 1, 2, 3, 4];\ +function replacer() {\ + assertEq(arguments.length, 2);\ + var key = arguments[0], value = arguments[1];\ + return value;\ +}\ +assertEq(JSON.stringify(arr, replacer), '[0,1,2,3,4]');\ +"); +while (true) { + var file = lfcode.shift(); if (file == undefined) { break; } + loadFile(file); +} +function loadFile(lfVarx) { + if (!isNaN(lfVarx)) { + lfRunTypeId = parseInt(lfVarx); + } else { + switch (lfRunTypeId) { + case 0: evaluate(lfVarx); break; + case 3: function newFunc(x) { new Function(x)(); }; newFunc(lfVarx); break; + } + } +} diff --git a/js/src/jit-test/tests/auto-regress/bug745452.js b/js/src/jit-test/tests/auto-regress/bug745452.js new file mode 100644 index 0000000000..38ca2a42fc --- /dev/null +++ b/js/src/jit-test/tests/auto-regress/bug745452.js @@ -0,0 +1,7 @@ +// Binary: cache/js-dbg-64-55e7efcc1946-linux +// Flags: +// + +var o = Object.preventExtensions(new ArrayBuffer); +try { (function () { o.__proto__ = ({ __proto__: o, indexArray: ["abc"] }); })(); } catch(exc) {} +JSON.stringify(this); diff --git a/js/src/jit-test/tests/auto-regress/bug746103.js b/js/src/jit-test/tests/auto-regress/bug746103.js new file mode 100644 index 0000000000..75a34319b7 --- /dev/null +++ b/js/src/jit-test/tests/auto-regress/bug746103.js @@ -0,0 +1,15 @@ +// |jit-test| slow; error:InternalError + +// Binary: cache/js-dbg-64-c61e7c3a232a-linux +// Flags: -m -n -a +// + +gczeal(2); +function testCallProtoMethod() { + function X() { + this.valueOf = new testCallProtoMethod( "return this.value" ); + } + X.prototype.getName = function () { return "X"; } + var a = [new X, new X, new getName, new new this, new Y]; +} +testCallProtoMethod(); diff --git a/js/src/jit-test/tests/auto-regress/bug746376.js b/js/src/jit-test/tests/auto-regress/bug746376.js new file mode 100644 index 0000000000..7cbde055c8 --- /dev/null +++ b/js/src/jit-test/tests/auto-regress/bug746376.js @@ -0,0 +1,65 @@ +// Binary: cache/js-dbg-64-67bf9a4a1f77-linux +// Flags: --ion-eager +// +var callStack = new Array(); +var gTestcases = new Array(); +var gTc = gTestcases.length; +function TestCase(n, d, e, a) { + this.expect = e; + this.actual = a; + this.passed = getTestCaseResult(e, a); + this.reason = ''; + this.bugnumber = typeof(BUGNUMER) != 'undefined' ? BUGNUMBER : ''; + this.type = (typeof window == 'undefined' ? 'shell' : 'browser'); + gTestcases[gTc++] = this; +} +function reportCompare (expected, actual, description) { + var output = ""; + if (typeof description == "undefined") + if (expected != actual) + printStatus ("Expected value '" + toPrinted(expected) + + "' matched actual value '" + toPrinted(actual) + "'"); + var testcase = new TestCase("unknown-test-name", description, expected, actual); + testcase.reason = output; + if (testcase.passed) { } + return testcase.passed; +} +function enterFunc (funcName) { + var lastFunc = callStack.pop(); + reportCompare(funcName, lastFunc, "Test driver failure wrong exit function "); +} +function getTestCaseResult(expected, actual) {} +var lfcode = new Array(); +lfcode.push("\ +var summary = 'decompilation of \"let with with\" ';\ +var actual = '';\ +var expect = '';\ +test();\ +function test() {\ + enterFunc ('test');\ + gczeal(2);\ + for (let q = 0; q < 50; ++q) {\ + new Function('for (var i = 0; i < 5; ++i) { } ')();\ + var w = 'r'.match(/r/);\ + new Function('for (var j = 0; j < 1; ++j) { } ')();\ + }\ + reportCompare(expect, actual, summary);\ +}\ +"); +delete Debugger; +while (true) { + var file = lfcode.shift(); if (file == undefined) { break; } + if (file == "evaluate") { + } else { + loadFile(file); + } +} +function loadFile(lfVarx) { + try { + if (lfVarx.substr(-3) == ".js") { + } else { + evaluate(lfVarx); + } + } catch (lfVare) { + } +} diff --git a/js/src/jit-test/tests/auto-regress/bug746377.js b/js/src/jit-test/tests/auto-regress/bug746377.js new file mode 100644 index 0000000000..ba65b84a61 --- /dev/null +++ b/js/src/jit-test/tests/auto-regress/bug746377.js @@ -0,0 +1,14 @@ +// |jit-test| error:InternalError + +// Binary: cache/js-dbg-64-67bf9a4a1f77-linux +// Flags: --ion-eager +// + +var actual = ''; +test(); +function test() +{ + a = {x: 1}; + b = {__proto__: a}; + print(actual += test(1,2,3,4)); +} diff --git a/js/src/jit-test/tests/auto-regress/bug748119.js b/js/src/jit-test/tests/auto-regress/bug748119.js new file mode 100644 index 0000000000..759db8cb10 --- /dev/null +++ b/js/src/jit-test/tests/auto-regress/bug748119.js @@ -0,0 +1,95 @@ +// Binary: cache/js-dbg-32-17af008937e3-linux +// Flags: -m -n -a +// +var lfcode = new Array(); +lfcode.push("\ +var gTestcases = new Array();\ +var gTc = gTestcases.length;\ +function TestCase(n, d, e, a) {\ + this.passed = getTestCaseResult(e, a);\ + this.bugnumber = typeof(BUGNUMER) != 'undefined' ? BUGNUMBER : '';\ + gTestcases[gTc++] = this;\ +}\ +for (var i=0; i<len; i++) {}\ +function reportCompare (expected, actual, description) {\ + var testcase = new TestCase(\"unknown-test-name\", description, expected, actual);\ + if (testcase.passed)\ + printStatus (\"Expected match to '\" + toPrinted(expectedRegExp) + \"' matched actual value '\" + toPrinted(actual) + \"'\");\ +}\ +function getTestCaseResult(expected, actual)\ +function stopTest() {}\ +"); +lfcode.push("\ +var UBound = 0;\ +var TEST_PASSED = 'SyntaxError';\ +var TEST_FAILED = 'Generated an error, but NOT a SyntaxError!';\ +var statusitems = [];\ +var actualvalues = [];\ +var expectedvalues = [];\ +testThis(' /a**/ ');\ +testThis(' /a***/ ');\ +testThis(' /a++/ ');\ +testThis(' /a+++/ ');\ +testThis(' /a???/ ');\ +testThis(' /a????/ ');\ +testThis(' /+a/ ');\ +testThis(' /++a/ ');\ +testThis(' /?a/ ');\ +testThis(' /??a/ ');\ +testThis(' /x{1}{1}/ ');\ +testThis(' /x{1,}{1}/ ');\ +testThis(' /x{1,2}{1}/ ');\ +testThis(' /x{1}{1,}/ ');\ +testThis(' /x{1,}{1,}/ ');\ +testThis(' /x{1,2}{1,}/ ');\ +testThis(' /x{1}{1,2}/ ');\ +testThis(' /x{1,}{1,2}/ ');\ +function testThis(sInvalidSyntax) {\ + try {\ + eval(sInvalidSyntax);\ + } catch(e) {\ + actual = TEST_PASSED;\ + }\ +}\ +function checkThis(sAllowedSyntax) {}\ +reportCompare(expectedvalues[i], actualvalues[i], statusitems[i]);\ +exitFunc ('test');\ +"); +lfcode.push("gczeal(4);"); +lfcode.push("\ +var MSG_PATTERN = '\\nregexp = ';\ +var MSG_STRING = '\\nstring = ';\ +var MSG_EXPECT = '\\nExpect: ';\ +var MSG_ACTUAL = '\\nActual: ';\ +var TYPE_STRING = typeof 'abc';\ +function testRegExp(statuses, patterns, strings, actualmatches, expectedmatches)\ + lExpect = expectedmatch.length;\ + lActual = actualmatch.length;\ + var expected = formatArray(expectedmatch);\ + reportCompare(expected, actual, state + ERR_MATCH + CHAR_NL );\ +function getState(status, pattern, string) {\ + var delim = CHAR_COMMA + CHAR_SPACE;\ +"); +lfcode.push("\ +var gTestcases = new Array;\ +function TestCase(n, d, e, a) {}\ +function toPrinted(value) value=value.replace(/\\\\n/g, 'NL').replace(/[^\\x20-\\x7E]+/g, escapeString);\ +"); +lfcode.push("\ +var summary = 'Regression test for bug 385393';\ +var expect = 'No Crash';\ + reportCompare(expect, actual, summary);\ +"); +while (true) { + var file = lfcode.shift(); if (file == undefined) { break; } + loadFile(file); +} +function loadFile(lfVarx) { + try { + if (lfVarx.substr(-3) == ".js") { + switch (lfRunTypeId) { } + } else { + evaluate(lfVarx); + } + } catch (lfVare) { } +} diff --git a/js/src/jit-test/tests/auto-regress/bug754719.js b/js/src/jit-test/tests/auto-regress/bug754719.js new file mode 100644 index 0000000000..4c822d53ca --- /dev/null +++ b/js/src/jit-test/tests/auto-regress/bug754719.js @@ -0,0 +1,10 @@ +// Binary: cache/js-dbg-64-e8de64e7e9fe-linux +// Flags: +// + +function TestCase(n, d, e, a) {} +(function( ) { + for (var i = 0; i < 64; ++i) { + switch (~~(TestCase) % 3) {} + } +})(); diff --git a/js/src/jit-test/tests/auto-regress/bug755639.js b/js/src/jit-test/tests/auto-regress/bug755639.js new file mode 100644 index 0000000000..dc376f69e6 --- /dev/null +++ b/js/src/jit-test/tests/auto-regress/bug755639.js @@ -0,0 +1,34 @@ +// Binary: cache/js-dbg-64-bfc259be3fa2-linux +// Flags: -m -n -a +// + +if (typeof gcPreserveCode != "function") { + function gcPreserveCode() {} +} + +if (typeof gcslice != "function") { + function gcslice() {} +} + +function f(t) +{ + for (var i = 0; i < 1; ++i) { + if (typeof(t) != "string") { + } + } +} +function m(d) +{ + if (d == 0) + return ""; + f(m(d - 1)); +} +m(1); +gcPreserveCode(); +try { + mjitChunkLimit(1); +} catch(exc1) {} +gcslice(1); +m(1); +gc(); +m(2); diff --git a/js/src/jit-test/tests/auto-regress/bug755750.js b/js/src/jit-test/tests/auto-regress/bug755750.js new file mode 100644 index 0000000000..9fb667609e --- /dev/null +++ b/js/src/jit-test/tests/auto-regress/bug755750.js @@ -0,0 +1,10 @@ +// Binary: cache/js-dbg-32-00c7a320165b-linux +// Flags: -m -n +// + +test(); +function test() { + schedulegc(100); + var o = { __proto__: function(){} }; + for (var j = 0; j < 30000; ++j) { try { o.call(3); } catch (e) { } } +} diff --git a/js/src/jit-test/tests/auto-regress/bug756236.js b/js/src/jit-test/tests/auto-regress/bug756236.js new file mode 100644 index 0000000000..5c6b3a51a9 --- /dev/null +++ b/js/src/jit-test/tests/auto-regress/bug756236.js @@ -0,0 +1,15 @@ +// Binary: cache/js-dbg-64-14735b4dbccc-linux +// Flags: --ion-eager +// + +gczeal(4); +function startTest() {} +function TestCase(n, d, e, a) { + return dump = (function () {}); +} + if (typeof document != "object" || !document.location.href.match(/jsreftest.html/)) {} +function writeHeaderToLog( string ) {} +var SECTION = "11.4.5"; +new TestCase( SECTION, "var MYVAR= void 0; --MYVAR", NaN, eval("var MYVAR=void 0; --MYVAR") ); +new TestCase( SECTION, "var MYVAR=0;--MYVAR;MYVAR", -1, eval("var MYVAR=0;--MYVAR;MYVAR") ); +new TestCase( SECTION, "var MYVAR=0;--MYVAR;MYVAR", -1, eval("var MYVAR=0;--MYVAR;MYVAR") ); diff --git a/js/src/jit-test/tests/auto-regress/bug757428.js b/js/src/jit-test/tests/auto-regress/bug757428.js new file mode 100644 index 0000000000..b45f978609 --- /dev/null +++ b/js/src/jit-test/tests/auto-regress/bug757428.js @@ -0,0 +1,11 @@ +// Binary: cache/js-dbg-64-d80602d38aa8-linux +// Flags: --ion-eager +// + +function f(o) { + var prop = "arguments"; + f[prop] = f[prop]; +} +for(var i=0; i > -10; i-- ) { + f(f / 16); +} diff --git a/js/src/jit-test/tests/auto-regress/bug758164.js b/js/src/jit-test/tests/auto-regress/bug758164.js new file mode 100644 index 0000000000..fa94c520a6 --- /dev/null +++ b/js/src/jit-test/tests/auto-regress/bug758164.js @@ -0,0 +1,6 @@ +// Binary: cache/js-dbg-64-407632130d1b-linux +// Flags: +// + +gc(); +evaluate("gcslice(1);"); diff --git a/js/src/jit-test/tests/auto-regress/bug759719.js b/js/src/jit-test/tests/auto-regress/bug759719.js new file mode 100644 index 0000000000..816d0c1229 --- /dev/null +++ b/js/src/jit-test/tests/auto-regress/bug759719.js @@ -0,0 +1,81 @@ +// Binary: cache/js-dbg-64-e8a025a7101b-linux +// Flags: -m -n +// +var SECTION = ""; +function AddTestCase( description, expect, actual ) {} +function TestCase(n, d, e, a) {} +TestCase.prototype.dump = function () {}; +function printStatus (msg) { + msg = msg.toString(); + var lines = msg.split ("\n"); +} +function printBugNumber (num) {} +function optionsInit() {} +function optionsClear() {} + var optionsframe = {}; + try { + optionsClear(); + for (var optionName in options.initvalues) { } + } catch(ex) { + optionsInit(); + if (typeof window == 'undefined' && typeof print == 'function') + try { + gTestcases[gTc].passed = writeTestCaseResult( + gTestcases[gTc].description +" = "+ gTestcases[gTc].actual ); + } catch(e) { + if (typeof document != "object" || !document.location.href.match(/jsreftest.html/)) {} + } + } + code = "(function(x){ if(x) return x; })"; +gczeal(2); +for (var loopa2 = 0; loopa2 < 13; loopa2++) { + [, , , , , , ][(loopa2.loopa2)] &= (/\u0042[\u0061]\\u0026/ ); +} +this.summary = false; +printStatus (summary); +try {} catch(e) {} +var TIME_0000 = (function () { })(); +function getTimeZoneDiff() {} +new TestCase( SECTION, Array.prototype.reverse.length ); +new TestCase( SECTION, eval("delete Array.prototype.reverse.length; Array.prototype.reverse.length") ); +var S = "var A = new Array( true,false )"; +eval(S); +var R = Reverse(A); +new TestCase( SECTION, eval( S + "; A.reverse(); A.length") ); +CheckItems( R, A ); +CheckItems( R, A ); +eval(S); +new TestCase( SECTION, eval( S + "; A.reverse(); A.length") ); +CheckItems( R, A ); +var S = "var A = new Array(); A[8] = 'hi', A[3] = 'yo'"; +eval(S); +var R = Reverse(A); +new TestCase( SECTION, eval( S + "; A.reverse(); A.length") ); +CheckItems( R, A ); +var OBJECT_OBJECT = new Object(); +var FUNCTION_OBJECT = new Function( 'return this' ); +var BOOLEAN_OBJECT = new Boolean; +var DATE_OBJECT = new Date(0); +var STRING_OBJECT = new String('howdy'); +var NUMBER_OBJECT = new Number(Math.PI); +var ARRAY_OBJECT= new Array(1000); +var args = "null, void 0, Math.pow(2,32), 1.234e-32, OBJECT_OBJECT, BOOLEAN_OBJECT, FUNCTION_OBJECT, DATE_OBJECT, STRING_OBJECT,"+ + "ARRAY_OBJECT, NUMBER_OBJECT, Math, true, false, 123, '90210'"; +var S = "var A = new Array("+args+")"; +eval(S); +var R = Reverse(A); +new TestCase( SECTION, eval( S + "; A.reverse(); A.length") ); +CheckItems( R, A ); +var limit = 1000; +for (var i = 0; i < limit; i++ ) { + args += i +""; +} +function CheckItems( R, A ) { + for ( var i = 0; i < R.length; i++ ) { + new TestCase( ( code ) [i] ); + } +} +function Object_1( value ) {} +function Reverse( array ) { + return array; +} diff --git a/js/src/jit-test/tests/auto-regress/bug761864.js b/js/src/jit-test/tests/auto-regress/bug761864.js new file mode 100644 index 0000000000..c6f0c70441 --- /dev/null +++ b/js/src/jit-test/tests/auto-regress/bug761864.js @@ -0,0 +1,58 @@ +// Binary: cache/js-dbg-32-cf4face65451-linux +// Flags: -m -n +// +function printStatus (msg) { + var lines = msg.split (""); +} +function printBugNumber (num) { + var digits = ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "A", "B", "C", "D", "E", "F"]; +} +var lfcode = new Array(); +lfcode.push("gczeal(4);"); +lfcode.push("jsTestDriverEnd();"); +lfcode.push(""); +lfcode.push("var BUGNUMBER = \"(none)\";\ +var summary = \"gen.close(); gen.throw(ex) throws ex forever\";\ +var actual, expect;\ +printBugNumber(BUGNUMBER);\ +printStatus(summary);\ +function gen() {\ + var x = 5, y = 7;\ + yield z;\ +}\ +var failed = false;\ +var it = gen();\ +try {\ + it.close();\ + var doThrow = true;\ + var thrown = \"foobar\";\ + try { } catch (e) { }\ + try { } catch (e) { }\ + throw \"it.throw(\\\"\" + thrown + \"\\\") failed\";\ + var stopPassed = false;\ + try { } catch (e) {\ + if (\"1234\")\ + stopPassed = true;\ + }\ +} catch (e) {}\ +"); +var lfRunTypeId = -1; +while (true) { + var file = lfcode.shift(); if (file == undefined) { break; } + if (file == "evaluate") { + } else { + loadFile(file); + } +} +function loadFile(lfVarx) { + try { + if (lfVarx.substr(-3) == ".js") { + } else { + switch (lfRunTypeId) { + default: evaluate(lfVarx); + } + } + } catch (lfVare) { + print(lfVare); + } +} diff --git a/js/src/jit-test/tests/auto-regress/bug762324.js b/js/src/jit-test/tests/auto-regress/bug762324.js new file mode 100644 index 0000000000..ed5dd5f621 --- /dev/null +++ b/js/src/jit-test/tests/auto-regress/bug762324.js @@ -0,0 +1,8 @@ +// Binary: cache/js-dbg-64-f918d74f736c-linux +// Flags: +// +(function(){ + try { + Function("function d(e= Pron((function hy() {return {d: function() { vum =pln(+ 'Lte'); return {get: function() { thr; }, set: function() { thr; }}; }, g: function(){ (yum + 'LE');}, has: function() { (yum + '')},Own: f}; })(x), ((function sing(xg) { ; xg :vc; })([, nen(true),l, n, null, l, nan(true), nen(true),ull,ull,lean(true), ean(), nan(true), nun(true),an(true), nen(true),lean(true), n(true),ull,ull,an(true), nuean(), nan(true), null, ll, ll, ean(), nan(true), nen(true),lean(true), ean(), nl, n(true), ean(), n, nu, nen(true),lean(true), ll, ean(), nan(true), nuean(), nll, ean(true), nan(true), nun(true),(true), ean(true), nan(true), nen(true),n(true),an(true), nen(true),l, null,lean(true), n(true),an(true), nen(true),l, null,lean(true), ll, ean(true), nan(true), nuean(), null, n, ean(), null,lean(true), ean(), null], 0)), ((\"y\")))['ww']){/*jjj*/}gc();") + } catch (e) {} +})() diff --git a/js/src/jit-test/tests/auto-regress/bug763039.js b/js/src/jit-test/tests/auto-regress/bug763039.js new file mode 100644 index 0000000000..dcd8df564a --- /dev/null +++ b/js/src/jit-test/tests/auto-regress/bug763039.js @@ -0,0 +1,69 @@ +// Binary: cache/js-dbg-32-5cfb73435e06-linux +// Flags: --ion-eager +// +var actual = ''; +function TestCase(n, d, e, a) { + this.reason = ''; +} +function inSection(x) {} +function reportCompare (expected, actual, description) { + var testcase = new TestCase("unknown-test-name", description, expected, actual); + testcase.reason = output; +} +var lfcode = new Array(); +lfcode.push("4"); +lfcode.push("function START(summary) {\ +}\ +function TEST(section, expected, actual) {\ + return reportCompare(expected, actual, inSection(section) + SUMMARY);\ +}\ +var expect = (1);\ +TEST(1,1 << this < assertEq++ < this, actual);\ +"); +lfcode.push("\ +gczeal(4);\ +data >>>= RunSingleBenchmark(data);\ +"); +lfcode.push("4"); +lfcode.push("\ +var BUGNUMBER = 345855;\ +var summary = 'Blank yield expressions are not syntax errors';\ +test();\ +function test() {\ + try {\ + eval('(function() {x = 12 + yield;})');\ + } catch(ex) {}\ + try { eval('(function() {x = 12 + yield 42})'); } catch(ex) {\ + status = inSection(4);\ + }\ + try {\ + eval('(function() {x = 12 + (yield);})');\ + } catch(ex) { }\ + try {\ + eval('(function () {foo((yield))})');\ + } catch(ex) { }\ + try {\ + eval('(function() {x = 12 + (yield 42)})');\ + } catch(ex) { }\ + reportCompare(expect, actual, summary + ': function() {x = 12 + (yield 42)}');\ +}\ +"); +while (true) { + var file = lfcode.shift(); if (file == undefined) { break; } + loadFile(file); +} +function loadFile(lfVarx) { + try { + if (lfVarx.substr(-3) == ".js") { + } else if (!isNaN(lfVarx)) { + lfRunTypeId = lfVarx; + } else { + switch (lfRunTypeId) { + case 1: eval(read(lfVarx)); break; + default: evaluate(lfVarx); + } + } + } catch (lfVare) { + print(lfVare); + } +} diff --git a/js/src/jit-test/tests/auto-regress/bug763989.js b/js/src/jit-test/tests/auto-regress/bug763989.js new file mode 100644 index 0000000000..042df9f868 --- /dev/null +++ b/js/src/jit-test/tests/auto-regress/bug763989.js @@ -0,0 +1,47 @@ +// Binary: cache/js-dbg-32-4bcbb63b89c3-linux +// Flags: --ion-eager +// +var summary = ''; +function reportFailure (msg) {} +function toPrinted(value) { + value = value.replace(/\n/g, 'NL') +} +function reportCompare (expected, actual, description) { + var output = ""; + output += "Expected value '" + toPrinted(expected) + + "', Actual value '" + toPrinted(actual) + "' "; + reportFailure (description + " : " + output); +} +var lfcode = new Array(); +lfcode.push("\ + expect = actual = 'No Exception';\ + reportCompare(expect, actual, summary);\ +"); +lfcode.push("\ +function reportFailure (section, msg)\ + msg = inSection(section)+\"\"+msg;\ +"); +lfcode.push("\ +try {\ + for (var i in expect) \ + reportCompare(expect[i], actual[i], getStatus(i));\ +} catch(exc1) {}\ +function getStatus(i) {}\ +"); +lfcode.push("gczeal(2,(9));"); +lfcode.push("evaluate(\"reportCompare(expect, actual, summary);\");"); + gcPreserveCode() +while (true) { + var file = lfcode.shift(); if (file == undefined) { break; } + if (file == "evaluate") { + } else { + loadFile(file); + } +} +function loadFile(lfVarx) { + try { + if (lfVarx.substr(-3) != ".js") { + evaluate(lfVarx); + } + } catch (lfVare) {} +} diff --git a/js/src/jit-test/tests/auto-regress/bug765055.js b/js/src/jit-test/tests/auto-regress/bug765055.js new file mode 100644 index 0000000000..557d37e5c7 --- /dev/null +++ b/js/src/jit-test/tests/auto-regress/bug765055.js @@ -0,0 +1,7 @@ +// Binary: cache/js-dbg-32-85e31a4bdd41-linux +// Flags: +// + +function test( d = 1, a = this, ... f) { + function f() {} +} diff --git a/js/src/jit-test/tests/auto-regress/bug765483.js b/js/src/jit-test/tests/auto-regress/bug765483.js new file mode 100644 index 0000000000..2028b8000b --- /dev/null +++ b/js/src/jit-test/tests/auto-regress/bug765483.js @@ -0,0 +1,15 @@ +// |jit-test| error:ReferenceError; + +// Binary: cache/js-dbg-64-de23a9fc29db-linux +// Flags: --ion-eager +// + +load(libdir + "evalInFrame.js"); + +var obj1 = {}, obj2 = {}; +obj2['b'+i] = 0; +for (var k in obj2) { + (function g() { evalInFrame(1, "assertStackIs(['eval-code', f, 'bound(f)', 'global-code'])", true); })(); +} +for (var i = 0; i != array.length; ++i) + array[i](); diff --git a/js/src/jit-test/tests/auto-regress/bug766065.js b/js/src/jit-test/tests/auto-regress/bug766065.js new file mode 100644 index 0000000000..bfb323f786 --- /dev/null +++ b/js/src/jit-test/tests/auto-regress/bug766065.js @@ -0,0 +1,13 @@ +// |jit-test| error:ReferenceError + +// Binary: cache/js-dbg-32-19bfe36cace8-linux +// Flags: -m -n -a +// + +function testApplyCallHelper(f) { + for (var i = 0; i < 10; ++i) dumpStack.apply(this,[0,1]); +} +function testApplyCall() { + var r = testApplyCallHelper(function (a0,a1,a2,a3,a4,a5,a6,a7) { x = [a0,a1,a2,a3,a4,a5,a6,a7]; }); +} +testApplyCall(); diff --git a/js/src/jit-test/tests/auto-regress/bug767679.js b/js/src/jit-test/tests/auto-regress/bug767679.js new file mode 100644 index 0000000000..b336694568 --- /dev/null +++ b/js/src/jit-test/tests/auto-regress/bug767679.js @@ -0,0 +1,10 @@ +// Binary: cache/js-dbg-32-05a756967f25-linux +// Flags: --ion-eager +// +eval("\ + \"use strict\";\ + a();\ + function a() {\ + print\ + }\ +") diff --git a/js/src/jit-test/tests/auto-regress/bug770713.js b/js/src/jit-test/tests/auto-regress/bug770713.js new file mode 100644 index 0000000000..cdaf5a02ae --- /dev/null +++ b/js/src/jit-test/tests/auto-regress/bug770713.js @@ -0,0 +1,21 @@ +// Binary: cache/js-dbg-32-b39f4007be5a-linux +// Flags: -m -n -a +// + +gczeal(4); +var a = ['a','test string',456,9.34,new String("string object"),[],['h','i','j','k']]; +var b = [1,2,3,4,5,6,7,8,9,0]; +exhaustiveSliceTest("exhaustive slice test 1", a); +function mySlice(a, from, to) { + var returnArray = []; + try { } catch ( [ x ] ) { } finally { } + return returnArray; +} +function exhaustiveSliceTest(testname, a) { + var x = 0; + for (y = (2 + a.length); y >= -(2 + a.length); y--) { + var c = mySlice(a,x,y); + if (String(b) != String(c)) + " expected result: " + String(c) + "\n"; + } +} diff --git a/js/src/jit-test/tests/auto-regress/bug771027.js b/js/src/jit-test/tests/auto-regress/bug771027.js new file mode 100644 index 0000000000..d9038ad85d --- /dev/null +++ b/js/src/jit-test/tests/auto-regress/bug771027.js @@ -0,0 +1,9 @@ +// |jit-test| error:TypeError + +// Binary: cache/js-dbg-32-b6aa44d8f11f-linux +// Flags: +// + +Array.prototype.iterator = (function() { { while(0) { function Uint8ClampedArray() { } } } }); +var s = new Set(["testing", "testing", 123]); +assertEq(s.size(), 2); diff --git a/js/src/jit-test/tests/auto-regress/bug771157.js b/js/src/jit-test/tests/auto-regress/bug771157.js new file mode 100644 index 0000000000..af283fea1a --- /dev/null +++ b/js/src/jit-test/tests/auto-regress/bug771157.js @@ -0,0 +1,30 @@ +// Binary: cache/js-dbg-64-9cf3ea112635-linux +// Flags: --ion-eager +// + +var callStack = new Array(); +function TestCase(n, d, e, a) { + this.expect = e; + this.actual = a; + this.passed = getTestCaseResult(e, a); + dump(+ this.path + ' ' + 'reason: ' + toPrinted(this.reason)+ '\n'); +}; +function reportCompare (expected, actual, description) { + var testcase = new TestCase("unknown-test-name", description, expected, actual); +} +function enterFunc (funcName) { + callStack.push(funcName); + var lastFunc = callStack.pop(); + reportCompare(funcName, lastFunc, "Test driver failure wrong exit function "); +} +try { +var summary = 'String static methods'; +var actual = ''; +expect = '2'; +reportCompare(expect, actual, summary + " String.toUpperCase(new Boolean(true))"); +} catch(exc0) {} +try { +function TestCase(n, d, e, a) {} +enterFunc ('test'); +reportCompare(expect, actual, summary); +} catch(exc2) {} diff --git a/js/src/jit-test/tests/auto-regress/bug771946.js b/js/src/jit-test/tests/auto-regress/bug771946.js new file mode 100644 index 0000000000..3cfb590e14 --- /dev/null +++ b/js/src/jit-test/tests/auto-regress/bug771946.js @@ -0,0 +1,4 @@ +// Binary: cache/js-dbg-64-221f1a184f67-linux +// Flags: +// +new Date().setFullYear(Math.cos(1)) diff --git a/js/src/jit-test/tests/auto-regress/bug779390.js b/js/src/jit-test/tests/auto-regress/bug779390.js new file mode 100644 index 0000000000..9b85257224 --- /dev/null +++ b/js/src/jit-test/tests/auto-regress/bug779390.js @@ -0,0 +1,15 @@ +// Binary: cache/js-dbg-64-b46621aba6fd-linux +// Flags: --ion-eager +// + +function TestCase(n, d, e, a) { + this.passed = getTestCaseResult(e, a); +} +function getTestCaseResult(expected, actual) {} +try { +for (var i = 0; i < bomchars.length; i++) + try {} catch(ex) {} +} catch(exc0) {} +["a"].map(function(s) {gczeal(4);})[0] +new TestCase(); +new TestCase("", "", 5e-324, i); diff --git a/js/src/jit-test/tests/auto-regress/bug779818.js b/js/src/jit-test/tests/auto-regress/bug779818.js new file mode 100644 index 0000000000..717f91af33 --- /dev/null +++ b/js/src/jit-test/tests/auto-regress/bug779818.js @@ -0,0 +1,12 @@ +// Binary: cache/js-dbg-64-2169bca0c9a5-linux +// Flags: --ion-eager +// + +var SECTION = "lexical-015"; +(function() { + for (var a = 0; a < 9; a++) { + if (SECTION[a]) { + while (arguments[a]) break; + } + } +})() diff --git a/js/src/jit-test/tests/auto-regress/bug780003.js b/js/src/jit-test/tests/auto-regress/bug780003.js new file mode 100644 index 0000000000..414429ec09 --- /dev/null +++ b/js/src/jit-test/tests/auto-regress/bug780003.js @@ -0,0 +1,6 @@ +// |jit-test| error:ReferenceError + +// Binary: cache/js-dbg-64-9f3dc298e25b-linux +// Flags: --ion-eager +// +for(a in b){} diff --git a/js/src/jit-test/tests/auto-regress/bug781364.js b/js/src/jit-test/tests/auto-regress/bug781364.js new file mode 100644 index 0000000000..99a944145c --- /dev/null +++ b/js/src/jit-test/tests/auto-regress/bug781364.js @@ -0,0 +1,34 @@ +// Binary: cache/js-dbg-64-21b4797e4cb3-linux +// Flags: -m -a --ion-eager +// +k = m +function h() { + switch (true) { + default: + x = newGlobal('') + } + return function(f, code) { + try { + evalcx(code, x) + } catch (e) {} + } +} +function m() { + f() +} +function g(code) { + f = new Function(code); + k(f, code) +} +g("k=h()") +g("\ + a='';\ + Object.defineProperty(this,\"b\",{get:function(){a=this.d()}});\ + Object.defineProperty(this,\"c\",{get:function(){b}});\ + d=2;\ + b\ +"); +g("b"); +g("b"); +g("for(v of c);"); +g("a=eval(\"function f(){}\");b") diff --git a/js/src/jit-test/tests/auto-regress/bug781855.js b/js/src/jit-test/tests/auto-regress/bug781855.js new file mode 100644 index 0000000000..d061f85209 --- /dev/null +++ b/js/src/jit-test/tests/auto-regress/bug781855.js @@ -0,0 +1,11 @@ +// Binary: cache/js-dbg-32-b5ae446888f5-linux +// Flags: -m -n -a +// + +var Constr = function( ... property) {}; +Constr.prototype = []; +var c = new Constr(); +c.push(5); +gc(); +function enterFunc() {} +evaluate('enterFunc (c.length);'); diff --git a/js/src/jit-test/tests/auto-regress/bug782083.js b/js/src/jit-test/tests/auto-regress/bug782083.js new file mode 100644 index 0000000000..b6cb9a4e7d --- /dev/null +++ b/js/src/jit-test/tests/auto-regress/bug782083.js @@ -0,0 +1,16 @@ +// Binary: cache/js-dbg-32-f1764bf06b29-linux +// Flags: --ion-eager +// + +gcPreserveCode(); +function r() {} +gczeal(2); +evaluate(""); +evaluate("\ +function randomFloat () {\ + if (r < 0.25)\ + fac = 10000000;\ +}\ +for (var i = 0; i < 2000; i++)\ + randomFloat();\ +"); diff --git a/js/src/jit-test/tests/auto-regress/bug782129.js b/js/src/jit-test/tests/auto-regress/bug782129.js new file mode 100644 index 0000000000..44a543cd95 --- /dev/null +++ b/js/src/jit-test/tests/auto-regress/bug782129.js @@ -0,0 +1,24 @@ +// Binary: cache/js-dbg-32-f1764bf06b29-linux +// Flags: --ion-eager +// + +var callStack = new Array(); +function enterFunc (funcName) { + funcName += "()"; + callStack.push(funcName); +} +function exitFunc (funcName) { + var lastFunc = callStack.pop(); + funcName += "()"; + if (lastFunc != funcName) + print(); +} +try { + test(); +} catch(exc1) {} +function test() { + enterFunc ('test'); + test(); +} +for (var l = 0; l < 50000; l++) + exitFunc ('test'); diff --git a/js/src/jit-test/tests/auto-regress/bug783421.js b/js/src/jit-test/tests/auto-regress/bug783421.js new file mode 100644 index 0000000000..920a78f978 --- /dev/null +++ b/js/src/jit-test/tests/auto-regress/bug783421.js @@ -0,0 +1,30 @@ +// Binary: cache/js-dbg-64-50e4ff05741e-linux +// Flags: -m -n -a +// +gc() +var p = n +function m() { + return function(f, code, t) { + try { + evalcx(code, newGlobal()) + } catch (e) {} + } +} +function n() { + f() +} +function h(code) { + f = Function(code) + p(f, code, true) +} +h("\ + p=m();\ + gcPreserveCode();\ + gcslice(8);\ +") +h("\"\"") +h("") +h("gc()") +h("") +h("") +h("gczeal(4,2)") diff --git a/js/src/jit-test/tests/auto-regress/bug785089.js b/js/src/jit-test/tests/auto-regress/bug785089.js new file mode 100644 index 0000000000..50e2bfcf54 --- /dev/null +++ b/js/src/jit-test/tests/auto-regress/bug785089.js @@ -0,0 +1,4 @@ +// Binary: cache/js-dbg-64-198ca6edd0ae-linux +// Flags: +// +odeURIL:(function(){}) diff --git a/js/src/jit-test/tests/auto-regress/bug785305.js b/js/src/jit-test/tests/auto-regress/bug785305.js new file mode 100644 index 0000000000..4beba0d989 --- /dev/null +++ b/js/src/jit-test/tests/auto-regress/bug785305.js @@ -0,0 +1,8 @@ +// Binary: cache/js-dbg-64-29ca472bf2d2-linux +// Flags: +// +Reflect.parse("\ + function l(x = (function() {})) {\ + function x() {}\ + }\ +") diff --git a/js/src/jit-test/tests/auto-regress/bug785576.js b/js/src/jit-test/tests/auto-regress/bug785576.js new file mode 100644 index 0000000000..ffd0563a1b --- /dev/null +++ b/js/src/jit-test/tests/auto-regress/bug785576.js @@ -0,0 +1,11 @@ +// Binary: cache/js-dbg-64-29ca472bf2d2-linux +// Flags: -m -n -a +// +sandbox = newGlobal('') +evalcx("x=[]", sandbox) +evalcx("\ + x[0] = this;\ + Object.defineProperty(x, 0, {})\ +", sandbox) +gc() +evalcx("x.shift()", sandbox) diff --git a/js/src/jit-test/tests/auto-regress/bug785776.js b/js/src/jit-test/tests/auto-regress/bug785776.js new file mode 100644 index 0000000000..2bab1bfd52 --- /dev/null +++ b/js/src/jit-test/tests/auto-regress/bug785776.js @@ -0,0 +1,6 @@ +// Binary: cache/js-dbg-64-e08a67884b9b-linux +// Flags: -m -n -a +// +load(libdir + 'asserts.js'); +// has no @@iterator property +assertThrowsInstanceOf(() => {function f([x]){}f(DataView.prototype)}, TypeError); diff --git a/js/src/jit-test/tests/auto-regress/bug790921.js b/js/src/jit-test/tests/auto-regress/bug790921.js new file mode 100644 index 0000000000..afe8803f07 --- /dev/null +++ b/js/src/jit-test/tests/auto-regress/bug790921.js @@ -0,0 +1,14 @@ +// |jit-test| slow; allow-unhandlable-oom +// Binary: cache/js-dbg-64-fdfaef738a00-linux +// Flags: --ion-eager +// + +evaluate("\ +gcparam(\"maxBytes\", gcparam(\"gcBytes\") + 4 );\n\ +test();\n\ +function test() {\n\ + function flatten(arr)\n\ + { return actual = flatten([1, [2], 3]); }\ +}\n\ +"); +try {} catch (lfVare) {} diff --git a/js/src/jit-test/tests/auto-regress/bug795937.js b/js/src/jit-test/tests/auto-regress/bug795937.js new file mode 100644 index 0000000000..b681d15ff7 --- /dev/null +++ b/js/src/jit-test/tests/auto-regress/bug795937.js @@ -0,0 +1,6 @@ +// Binary: cache/js-dbg-64-895f66c4eada-linux +// Flags: +// + +var g = newGlobal(); +new Proxy(g, {}); diff --git a/js/src/jit-test/tests/auto-regress/bug797493.js b/js/src/jit-test/tests/auto-regress/bug797493.js new file mode 100644 index 0000000000..880495437a --- /dev/null +++ b/js/src/jit-test/tests/auto-regress/bug797493.js @@ -0,0 +1,15 @@ +// |jit-test| error:ReferenceError + +// Binary: cache/js-dbg-64-13fd49ef7786-linux +// Flags: +// + +var g = newGlobal({newCompartment: true}); +var dbg = new Debugger(g); +dbg.onDebuggerStatement = function handleDebugger(frame) { + frame.onPop = function handlePop(c) { + poppedFrames.indexOf(this) + } +}; +g.eval("function* g() { for (var i = 0; i < 10; i++) { debugger; yield i; } }"); +assertEq(g.eval("var t = 0; for (j of g()) t += j; t;"), 45); diff --git a/js/src/jit-test/tests/auto-regress/bug800878.js b/js/src/jit-test/tests/auto-regress/bug800878.js new file mode 100644 index 0000000000..ce6aabd586 --- /dev/null +++ b/js/src/jit-test/tests/auto-regress/bug800878.js @@ -0,0 +1,13 @@ +// |jit-test| error:Error + +// Binary: cache/js-dbg-32-1301a72b1c39-linux +// Flags: --ion-eager +// + +load(libdir + "evalInFrame.js"); + +[1,2,3,4,(':'),6,7,8].forEach( + function(x) { + assertEq(evalInFrame(0, ('^')), x); + } +); diff --git a/js/src/jit-test/tests/auto-regress/bug812235.js b/js/src/jit-test/tests/auto-regress/bug812235.js new file mode 100644 index 0000000000..ab5d4dd563 --- /dev/null +++ b/js/src/jit-test/tests/auto-regress/bug812235.js @@ -0,0 +1,10 @@ +// Binary: cache/js-dbg-64-a37525d304d9-linux +// Flags: --ion-eager +// +gc() +schedulezone(this) +gcslice(3) +function f() { + this["x"] = this["x"] = {} +} +new f() diff --git a/js/src/jit-test/tests/auto-regress/bug813029.js b/js/src/jit-test/tests/auto-regress/bug813029.js new file mode 100644 index 0000000000..4f78376aec --- /dev/null +++ b/js/src/jit-test/tests/auto-regress/bug813029.js @@ -0,0 +1,12 @@ +// Binary: cache/js-dbg-64-4fddb9923ef0-linux +// Flags: --ion-eager +// + +function printBugNumber (num) { + BUGNUMBER = num; +} +gcslice(1) +schedulezone(this); +gcslice(2); +var BUGNUMBER = ("one"); +printBugNumber(); diff --git a/js/src/jit-test/tests/auto-regress/bug829795.js b/js/src/jit-test/tests/auto-regress/bug829795.js new file mode 100644 index 0000000000..ecbd564498 --- /dev/null +++ b/js/src/jit-test/tests/auto-regress/bug829795.js @@ -0,0 +1,10 @@ +// |jit-test| error:TypeError + +// Binary: cache/js-dbg-64-44dcffe8792b-linux +// Flags: -a +// +try { + x = []; + Array.prototype.forEach() +} catch (e) {} +x.forEach() diff --git a/js/src/jit-test/tests/auto-regress/bug829813.js b/js/src/jit-test/tests/auto-regress/bug829813.js new file mode 100644 index 0000000000..18a5d21d80 --- /dev/null +++ b/js/src/jit-test/tests/auto-regress/bug829813.js @@ -0,0 +1,8 @@ +// Binary: cache/js-dbg-64-44dcffe8792b-linux +// Flags: +// +for (x in [0]) { + (function() { + return Object.propertyIsEnumerable + })().call([0], x) +} diff --git a/js/src/jit-test/tests/auto-regress/bug909441.js b/js/src/jit-test/tests/auto-regress/bug909441.js new file mode 100644 index 0000000000..fc6ba5ba56 --- /dev/null +++ b/js/src/jit-test/tests/auto-regress/bug909441.js @@ -0,0 +1,19 @@ +// |jit-test| error: too much recursion +function f(code) { + try { + g = Function(code) + } catch (e) {} + g() +} +f("\ + Object.defineProperty(this,\"x\",{\ + get: function(){\ + evaluate(\"Array(x)\",{\ + catchTermination:(function(){})\ + })\ + }\ + })\ +"); +f("x"); +f(")"); +f("x"); diff --git a/js/src/jit-test/tests/auto-regress/bug912379.js b/js/src/jit-test/tests/auto-regress/bug912379.js new file mode 100644 index 0000000000..fd0ae9b332 --- /dev/null +++ b/js/src/jit-test/tests/auto-regress/bug912379.js @@ -0,0 +1,12 @@ +s = newGlobal(); +evalcx("\ + try { \ + throw StopIteration;\ + } catch(a) {\ + x = a;\ + } \ + new Proxy(x, {});\ +", s); +evalcx("\ + n = x;\ +", s); diff --git a/js/src/jit-test/tests/auto-regress/class-method-async.js b/js/src/jit-test/tests/auto-regress/class-method-async.js new file mode 100644 index 0000000000..e8cce25874 --- /dev/null +++ b/js/src/jit-test/tests/auto-regress/class-method-async.js @@ -0,0 +1,5 @@ +class X { + async ["foo"]() { + return eval(); + } +} diff --git a/js/src/jit-test/tests/auto-regress/for-of-iterator-close-debugger.js b/js/src/jit-test/tests/auto-regress/for-of-iterator-close-debugger.js new file mode 100644 index 0000000000..c1daeff77d --- /dev/null +++ b/js/src/jit-test/tests/auto-regress/for-of-iterator-close-debugger.js @@ -0,0 +1,15 @@ +// |jit-test| error:ReferenceError + +// for-of should close iterator even if the exception is once caught by the +// debugger. + +var g = newGlobal({newCompartment: true}); +g.parent = this; +g.eval("new Debugger(parent).onExceptionUnwind = function () { };"); +// jsfunfuzz-generated +for (var x of []) {}; +for (var l of [0]) { + for (var y = 0; y < 1; y++) { + g2; + } +} |