diff options
author | Matt A. Tobin <mattatobin@localhost.localdomain> | 2018-02-02 04:16:08 -0500 |
---|---|---|
committer | Matt A. Tobin <mattatobin@localhost.localdomain> | 2018-02-02 04:16:08 -0500 |
commit | 5f8de423f190bbb79a62f804151bc24824fa32d8 (patch) | |
tree | 10027f336435511475e392454359edea8e25895d /js/src/jit-test/tests/jaeger/recompile | |
parent | 49ee0794b5d912db1f95dce6eb52d781dc210db5 (diff) | |
download | UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.gz UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.lz UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.xz UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.zip |
Add m-esr52 at 52.6.0
Diffstat (limited to 'js/src/jit-test/tests/jaeger/recompile')
70 files changed, 1365 insertions, 0 deletions
diff --git a/js/src/jit-test/tests/jaeger/recompile/arith.js b/js/src/jit-test/tests/jaeger/recompile/arith.js new file mode 100644 index 000000000..a705a2937 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/recompile/arith.js @@ -0,0 +1,49 @@ + +/* Handle recompilation of arithmetic operations, and on-stack int -> double conversion. */ + +function add(x, y) +{ + var z = x + y; + assertEq(z, 2147483732); + assertEq(z - 10, 2147483722); +} +add(0x7ffffff0, 100); + +function mul(x, y) +{ + var z = x * y; + assertEq(z, 4294967264); +} +mul(0x7ffffff0, 2); + +function div1(x, y) +{ + var z = x / y; + assertEq(z + 10, 20); +} +div1(100, 10); + +function div2(x, y) +{ + var z = x / y; + assertEq(z + 10, 20.5); +} +div2(105, 10); + +function uncopy(x, y) +{ + var q = x; + x += y; + q++; + assertEq(q, 2147483633); + assertEq(x, 2147483732); +} +uncopy(0x7ffffff0, 100); + +function addmore(x, y) +{ + var q = (x + 10) + (x + y); + assertEq(q, 4294967374); + x = q; +} +addmore(0x7ffffff0, 100); diff --git a/js/src/jit-test/tests/jaeger/recompile/bug617592.js b/js/src/jit-test/tests/jaeger/recompile/bug617592.js new file mode 100644 index 000000000..cec177480 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/recompile/bug617592.js @@ -0,0 +1,3 @@ + +var x; +-(x === null); diff --git a/js/src/jit-test/tests/jaeger/recompile/bug621292.js b/js/src/jit-test/tests/jaeger/recompile/bug621292.js new file mode 100644 index 000000000..11dca9471 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/recompile/bug621292.js @@ -0,0 +1,24 @@ + +/* Don't crash. */ + +var count = 0; + +function callbackfn(v) { + if (++count == 98) + count = 0x7ffffff0; + return arr[0] + count; +} + +function foo() { + arr = [1,2,3,4,5]; + for (var i = 0; i < 50; i++) + arr = arr.map(callbackfn); +} +foo(); + +function f(a,b,c) { + a = 1; b = 'str'; c = 2.1; + return arguments[0]; +} +for (var i = 0; i < 20; i++) + assertEq(f(10,'sss',1), 1); diff --git a/js/src/jit-test/tests/jaeger/recompile/bug621328.js b/js/src/jit-test/tests/jaeger/recompile/bug621328.js new file mode 100644 index 000000000..f755549c9 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/recompile/bug621328.js @@ -0,0 +1,9 @@ +function foo() { +}; +function f() { + var e = foo; + a = new e(); + assertEq(typeof(a), "object"); + e=a; +} +f(); diff --git a/js/src/jit-test/tests/jaeger/recompile/bug638977.js b/js/src/jit-test/tests/jaeger/recompile/bug638977.js new file mode 100644 index 000000000..0fac78224 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/recompile/bug638977.js @@ -0,0 +1,6 @@ +function f() { + gc(); + [].unshift(false); +} +f(); +f(); diff --git a/js/src/jit-test/tests/jaeger/recompile/bug639508.js b/js/src/jit-test/tests/jaeger/recompile/bug639508.js new file mode 100644 index 000000000..a25a70c60 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/recompile/bug639508.js @@ -0,0 +1,2 @@ +var o = 2; +o = o.p; diff --git a/js/src/jit-test/tests/jaeger/recompile/bug639882.js b/js/src/jit-test/tests/jaeger/recompile/bug639882.js new file mode 100644 index 000000000..3f9f898a2 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/recompile/bug639882.js @@ -0,0 +1,5 @@ +var x = 2; +x = -(x == 3); + +var y = ""; +typeof(z) + typeof(eval("z = y")); diff --git a/js/src/jit-test/tests/jaeger/recompile/bug640608.js b/js/src/jit-test/tests/jaeger/recompile/bug640608.js new file mode 100644 index 000000000..1c5c3c810 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/recompile/bug640608.js @@ -0,0 +1,10 @@ +try { +{ + function x() {} +} +o = (0).__proto__; +function f(o) { + o._("", function() {}) +} +f(o) +} catch (e) {} diff --git a/js/src/jit-test/tests/jaeger/recompile/bug641225.js b/js/src/jit-test/tests/jaeger/recompile/bug641225.js new file mode 100644 index 000000000..a6e3a86c7 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/recompile/bug641225.js @@ -0,0 +1,150 @@ +gczeal(1); +var o0 = Function.prototype; +o1 = {}; +var o4 = Error.prototype; +o5 = new Int32Array(100); +o6 = new Proxy({}, {}) +o8 = new Proxy(function() { return {}; }, { + get: function() { return 10; }, +}); +o9 = {}; +var o10 = -500; +var o12 = new Int32Array(100); +function f0(o) { +} +function f1(o) { +} +function f3(o) { + with(o) {} + o[o5] = o5; +} +function f5(o) { +}for(var f2 in o9) { + for(var i1=0; i1<83; i1++) { + for(var i3=0; i3<98; i3++) { + for(var x in f1) { f1[x]; }; + } + Object.defineProperty(o0, 'constructor', {enumerable: true,unused: 1 }); + f1(f5); + f4(f3); + f3(o8); + f2(o5); + o9.toString(1, 2); + f4.caller = o3; + f2(o6); + f0(f2); + f1(f2); + f0(f1); + var key = Object.getOwnPropertyNames(o9)[2]; if(key) delete o9[key]; + var props = Object.getOwnPropertyNames(o5); + if (props.length > 6) { + var prop = props[6]; + o8[prop] = o5[prop]; + } + f3(f1); + f1(f5); + } + for(var o3 in f1) { + f1(o3); + f4(o3); + o0 == f4; + f1(f3); + Object.freeze(o12); + f0(o9); + new f0(o1); + o4 = o5.call(o4, o4, o4, o4, o4, o4); + f2(o10); + var prop = Object.getOwnPropertyNames(o0)[15]; + if (prop) { Object.defineProperty(o0, prop, {configurable: true,enumerable: true,get: function(){},set: function(){},unused: 1 }); } + f3(f1); + new f2(o0); + } + f5(o9); + gc(); + f0(o2); + f3(f4); + new f4(o7); + f1 = new o10(f1, f1, f1, f1); + f5(o10); + f5(o7); + f0(o7); + f1(o10); + f3(o10); + delete f0.constructor; + f0(f3); + f1 = wrap(f3); + f4(f1); + delete o1.prototype; + f4(o5); + f2(f2); + o1 + ''; + f2(f2); + f0(o12); + f0(o12); + f1(o3); + o5[3] = 8.3; + o10['__proto_' + '_']; +} +for(var o2 in f5) { + for(var o10 in f3) { + delete f2['__proto_' + '_']; + o8 = f1.toString; + f1(o1); + f0(o9); + f2(o12); + var key = Object.getOwnPropertyNames(o3)[19]; if(key) o9 = o3[key]; + f1(o10); + f4(f1); + f1(o1); + f1(o7); + for(var x in o1) { o1[x]; }; + f0(o8); + f4(o1); + f0(o1); + f0.p0 = o6; + f3(o9); + f5(o8); + f2 >>> o7; + if(o3 === o8) {} + f5(o3); + } + o5[0] = f4; + o0.caller = function() { }; + Object.freeze(f0); + f4(o3); + o7.p0 = o3; + f1(f5); + f4(o10); + f2(o5); + f2(o5); + f0(o3); + o9.watch('p3', function() {}); + o8[o8] = o8; + f0(o5); + f1(o6); + f2 = Object.create(o5); + var key = Object.getOwnPropertyNames(o11)[23]; if(key) f2 = o11[key]; + f5(o9); + o12 = o6.bind(o12, o12, o12); + f5(f4); + f1(o1); + f0(o11); + f1(o11); + eval('f4'); + f4(o1); + Object.isExtensible(o7); +} +(function() { + f1(o12); + f5 + ''; + if(o8 != o3) {} +})(); +f1(o10); +f3(f0); +o4.toSource = function() { }; +var _o = o1; +var prop = Object.getOwnPropertyNames(_o)[5]; +if (prop) { _o[prop](o2, o2); } +f3(o0); +f1(f3); +Object.isExtensible(f1); diff --git a/js/src/jit-test/tests/jaeger/recompile/bug641269.js b/js/src/jit-test/tests/jaeger/recompile/bug641269.js new file mode 100644 index 000000000..7eca2e2d8 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/recompile/bug641269.js @@ -0,0 +1,8 @@ +// |jit-test| error: ReferenceError + +var g = newGlobal(); +var dbg = new g.Debugger(this); + +(function() { + const x = [][x] +})() diff --git a/js/src/jit-test/tests/jaeger/recompile/bug641535.js b/js/src/jit-test/tests/jaeger/recompile/bug641535.js new file mode 100644 index 000000000..732eeb08c --- /dev/null +++ b/js/src/jit-test/tests/jaeger/recompile/bug641535.js @@ -0,0 +1,2 @@ +var o = {}; +o[o.p] = 2; diff --git a/js/src/jit-test/tests/jaeger/recompile/bug642405.js b/js/src/jit-test/tests/jaeger/recompile/bug642405.js new file mode 100644 index 000000000..2bbca3483 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/recompile/bug642405.js @@ -0,0 +1,13 @@ +function startTest() {}; +try { +} +catch(ex) +{ + actual = ex + ''; +} +var actual = 'no error'; +var prefValue; +DESCRIPTION = "var class = true"; +EXPECTED = "error"; +foo(EXPECTED[prefValue], DESCRIPTION[prefValue], startTest[prefValue]); +function foo() {} diff --git a/js/src/jit-test/tests/jaeger/recompile/bug643182.js b/js/src/jit-test/tests/jaeger/recompile/bug643182.js new file mode 100644 index 000000000..cb134fe0b --- /dev/null +++ b/js/src/jit-test/tests/jaeger/recompile/bug643182.js @@ -0,0 +1,7 @@ +x = 123; +function f() {} +function g(o) { + y = x.p; + eval('o'); +} +g(f); diff --git a/js/src/jit-test/tests/jaeger/recompile/bug643376.js b/js/src/jit-test/tests/jaeger/recompile/bug643376.js new file mode 100644 index 000000000..300fbc90d --- /dev/null +++ b/js/src/jit-test/tests/jaeger/recompile/bug643376.js @@ -0,0 +1,8 @@ +SECTION = 0; +function TestCase() {} +function outer_func(x) +{ + var y = "inner"; + new TestCase( SECTION, { SECTION: ++y }); +} +outer_func(1111); diff --git a/js/src/jit-test/tests/jaeger/recompile/bug643669.js b/js/src/jit-test/tests/jaeger/recompile/bug643669.js new file mode 100644 index 000000000..d66639df4 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/recompile/bug643669.js @@ -0,0 +1,3 @@ +try {(function () { + eval("gc().l()") + })() } catch (e) {} diff --git a/js/src/jit-test/tests/jaeger/recompile/bug645044.js b/js/src/jit-test/tests/jaeger/recompile/bug645044.js new file mode 100644 index 000000000..e31762a8e --- /dev/null +++ b/js/src/jit-test/tests/jaeger/recompile/bug645044.js @@ -0,0 +1,4 @@ + +this.__defineGetter__("x", gc); +x.__proto__ = this; +__proto__ = 44; diff --git a/js/src/jit-test/tests/jaeger/recompile/bug646267.js b/js/src/jit-test/tests/jaeger/recompile/bug646267.js new file mode 100644 index 000000000..2f1503767 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/recompile/bug646267.js @@ -0,0 +1,8 @@ +function t(code) { + var f = new Function(code); + try { f(); } catch (e) { } +} +t(""); +t(""); +t(""); +t("this.function = 7;"); diff --git a/js/src/jit-test/tests/jaeger/recompile/bug647183.js b/js/src/jit-test/tests/jaeger/recompile/bug647183.js new file mode 100644 index 000000000..0405a548a --- /dev/null +++ b/js/src/jit-test/tests/jaeger/recompile/bug647183.js @@ -0,0 +1,23 @@ +var SECTION = ""; +var VERSION = ""; +function test() {} +function writeTestCaseResult( expect, actual, string ) { + if (typeof document != "object" || +!document.location.href.match(/jsreftest.html/)) { + } +} +TIME_0000 = now = new Date; +TIME_NOW = now.valueOf(); +function DaysInYear( y ) { +function MakeDate( day, time ) { + +} +} +function TimeClip( t ) { + if ( isNaN ) { Number.NaN; } +} +function runDSTOffsetCachingTestsFraction(part, parts) { print; }; +test_times=( TIME_NOW, TIME_0000, ( SECTION, VERSION+".getUTCMinutes()", + TIME_NOW.test_times,VERSION.SECTION ) , TIME_0000, TIME_0000, + 0, 0 ); +try { j = 0( SECTION, TimeClip(1.1), 0 ); } catch (e) {} diff --git a/js/src/jit-test/tests/jaeger/recompile/bug647199.js b/js/src/jit-test/tests/jaeger/recompile/bug647199.js new file mode 100644 index 000000000..b9d330f8f --- /dev/null +++ b/js/src/jit-test/tests/jaeger/recompile/bug647199.js @@ -0,0 +1,11 @@ +TryInWhile( new TryObject( "hello", ThrowException, true ) ); +function TryObject( value, throwFunction, result ) { + this.thrower=throwFunction +} +function ThrowException() TryInWhile(1); +function TryInWhile( object ) { + try { + object.thrower() + } catch ( e ) { + } +} diff --git a/js/src/jit-test/tests/jaeger/recompile/bug647532.js b/js/src/jit-test/tests/jaeger/recompile/bug647532.js new file mode 100644 index 000000000..3c8bc3f40 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/recompile/bug647532.js @@ -0,0 +1,4 @@ +try { Function("\ + __defineSetter__(\"x\",Object.keys)\ + (z=x instanceof[].some)\ +")() } catch (e) { } diff --git a/js/src/jit-test/tests/jaeger/recompile/bug647547.js b/js/src/jit-test/tests/jaeger/recompile/bug647547.js new file mode 100644 index 000000000..6f9c970aa --- /dev/null +++ b/js/src/jit-test/tests/jaeger/recompile/bug647547.js @@ -0,0 +1,9 @@ +DoWhile(new DoWhileObject); +new DoWhileObject("", Boolean); +function DoWhileObject( d, e, s ) { + this.whileExpression=e; +} +function DoWhile( object ) { + while ( object.whileExpression ) eval( ); + Boolean +} diff --git a/js/src/jit-test/tests/jaeger/recompile/bug647991-1.js b/js/src/jit-test/tests/jaeger/recompile/bug647991-1.js new file mode 100644 index 000000000..259752447 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/recompile/bug647991-1.js @@ -0,0 +1,18 @@ +function f() { + function g() { + eval(""); + gc(); + Math.abs(4); + NaN; + } + g(); +} +function h() { + var x, y; + x = Math.floor(-0); + y = parseInt("1"); +} + +f(); +h(); + diff --git a/js/src/jit-test/tests/jaeger/recompile/bug647991-2.js b/js/src/jit-test/tests/jaeger/recompile/bug647991-2.js new file mode 100644 index 000000000..6ebea8482 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/recompile/bug647991-2.js @@ -0,0 +1,2 @@ +[""][NaN] = 2; +-([][[""][String] = ""] = null); diff --git a/js/src/jit-test/tests/jaeger/recompile/bug648502.js b/js/src/jit-test/tests/jaeger/recompile/bug648502.js new file mode 100644 index 000000000..26caf6b61 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/recompile/bug648502.js @@ -0,0 +1,12 @@ +function f(x, y) { + -(undefined ? 0 : 0); + assertEq(y === y, true); + return 0; +} +f(1, 2); +{ + f(3, 3.14); + f(true, f(4, 5)); + + function g() {} +} diff --git a/js/src/jit-test/tests/jaeger/recompile/bug648567.js b/js/src/jit-test/tests/jaeger/recompile/bug648567.js new file mode 100644 index 000000000..5b7df219d --- /dev/null +++ b/js/src/jit-test/tests/jaeger/recompile/bug648567.js @@ -0,0 +1,16 @@ +var arr = [-10, true]; +true || arr[0]; + +function g() { + var x = arr[12]; + var y = arr.length; + arr[undefined] = x; + assertEq(y, 2); +} +{ + function f() { + gc(); + g(); + } + f(); +} diff --git a/js/src/jit-test/tests/jaeger/recompile/bug648843.js b/js/src/jit-test/tests/jaeger/recompile/bug648843.js new file mode 100644 index 000000000..37de8fbbe --- /dev/null +++ b/js/src/jit-test/tests/jaeger/recompile/bug648843.js @@ -0,0 +1,8 @@ + +function Q(on) +{ + options().match +} +function options() { return "methodjit"; } +gczeal(2); +for (i = 0; i < 100 ; ++i) { Q(Q(42, [])); } diff --git a/js/src/jit-test/tests/jaeger/recompile/bug648966.js b/js/src/jit-test/tests/jaeger/recompile/bug648966.js new file mode 100644 index 000000000..df0f9d8cd --- /dev/null +++ b/js/src/jit-test/tests/jaeger/recompile/bug648966.js @@ -0,0 +1,7 @@ + +function f(x) { + gc(); + -x; + -null; +} +f(); diff --git a/js/src/jit-test/tests/jaeger/recompile/bug649261.js b/js/src/jit-test/tests/jaeger/recompile/bug649261.js new file mode 100644 index 000000000..fabc38e73 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/recompile/bug649261.js @@ -0,0 +1,2 @@ +var DESCRIPTION; +eval("DESCRIPTION += \"Non-character escapes in identifiers negative test.\";"); diff --git a/js/src/jit-test/tests/jaeger/recompile/bug649769.js b/js/src/jit-test/tests/jaeger/recompile/bug649769.js new file mode 100644 index 000000000..28c823b42 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/recompile/bug649769.js @@ -0,0 +1,16 @@ + +function g(x) { + if (!x) { + throw 1; + } +} + +function f(a, b, c, d) { + var x = [].push(3); + g(true); + assertEq(x, 1); +} +f(1.2, 2, 3, 4); +gc(); +f(1, 2, 3, 4); + diff --git a/js/src/jit-test/tests/jaeger/recompile/bug651119.js b/js/src/jit-test/tests/jaeger/recompile/bug651119.js new file mode 100644 index 000000000..598a36574 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/recompile/bug651119.js @@ -0,0 +1,51 @@ +Object.extend = function(destination, source) { + for (var property in source) + destination[property] = source[property]; +}; +var Enumerable = { + _each: function(iterator) { + for (var i = 0, length = this.length; i < length; i++) + iterator(this[i]); + }, + each: function(iterator, context) { + var index = 0; + this._each(function(value) { + iterator.call(context, value, index++); + }); + }, + map: function(iterator, context) { + var results = []; + this.each(function(value, index) { + var res = iterator.call(context, value); + results.push(res); + }); + return results; + }, + invoke: function(method) { + var args = $A(arguments).slice(1); + return this.map(function(value) { + return value[method].apply(value, args); + }); + }, +}; +Object.extend(Array.prototype, Enumerable); +function $A(iterable) { + var length = iterable.length || 0, results = new Array(length); + while (length--) results[length] = iterable[length]; + return results; +} +function g() { + return [1, 2, 3, 4, 5].each(function(part) { + return 0; + }); +} +function f() { + g(); + g(); + g(); + g(); + var result = [[2, 1, 3], [6, 5, 4]]; + result = result.invoke('invoke', 'toString', 2); + result[0].join(', '); +}; +f(); diff --git a/js/src/jit-test/tests/jaeger/recompile/bug653980.js b/js/src/jit-test/tests/jaeger/recompile/bug653980.js new file mode 100644 index 000000000..f5a4d2a9f --- /dev/null +++ b/js/src/jit-test/tests/jaeger/recompile/bug653980.js @@ -0,0 +1,13 @@ + +function f(code) { + try { + Function(code)() + } catch(r) {} +} { + function x() {} +} +f("") +f("") +f("") +f("x::e") +if (typeof w == "") {} diff --git a/js/src/jit-test/tests/jaeger/recompile/bug654536.js b/js/src/jit-test/tests/jaeger/recompile/bug654536.js new file mode 100644 index 000000000..5a3266ff6 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/recompile/bug654536.js @@ -0,0 +1,6 @@ +function f() { + var x = Object.prototype.hasOwnProperty.call(1); + assertEq(x, false); + isNaN(2); +} +f(); diff --git a/js/src/jit-test/tests/jaeger/recompile/bug655949.js b/js/src/jit-test/tests/jaeger/recompile/bug655949.js new file mode 100644 index 000000000..1adace1a1 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/recompile/bug655949.js @@ -0,0 +1,6 @@ +var a; +try { + a(); +} catch(e) { + assertEq(e instanceof TypeError, true); +} diff --git a/js/src/jit-test/tests/jaeger/recompile/bug655998.js b/js/src/jit-test/tests/jaeger/recompile/bug655998.js new file mode 100644 index 000000000..a48eb3215 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/recompile/bug655998.js @@ -0,0 +1,7 @@ +function f(x) { + var y; + gc(); + ++x.x; +} +f(1); +f.call(2, 3); diff --git a/js/src/jit-test/tests/jaeger/recompile/bug656753.js b/js/src/jit-test/tests/jaeger/recompile/bug656753.js new file mode 100644 index 000000000..b897c7d09 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/recompile/bug656753.js @@ -0,0 +1,20 @@ + +var global = 0; + +function foo(i) { + global = i; + if (global == 8) { + eval("global = 'three'"); + throw global; + } +} + +var caught = false; +try { + for (var i = 0; i < 10; i++) { + Array.map([i], foo); + } +} catch (e) { caught = true; } + +assertEq(caught, true); +assertEq(global, 'three'); diff --git a/js/src/jit-test/tests/jaeger/recompile/bug657288.js b/js/src/jit-test/tests/jaeger/recompile/bug657288.js new file mode 100644 index 000000000..2a19c5c51 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/recompile/bug657288.js @@ -0,0 +1,9 @@ +// |jit-test| error: TypeError +new DoWhileObject; +function DoWhileObject(breakOut, breakIn, iterations, loops) { + loops.prototype = new DoWhile; + this.looping; +} +function DoWhile(object) { + do {} while (object); +} diff --git a/js/src/jit-test/tests/jaeger/recompile/bug658209.js b/js/src/jit-test/tests/jaeger/recompile/bug658209.js new file mode 100644 index 000000000..966c10f28 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/recompile/bug658209.js @@ -0,0 +1,10 @@ +for (var i=0; i<20; i++) { + (function () { + var x; + (function () { + x = /abc/; + x++; + gc(); + })(); + })(); +} diff --git a/js/src/jit-test/tests/jaeger/recompile/bug658211.js b/js/src/jit-test/tests/jaeger/recompile/bug658211.js new file mode 100644 index 000000000..02de29259 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/recompile/bug658211.js @@ -0,0 +1,13 @@ +function foo(x) { + return bar(x); +} +function bar(x) { + return x.f + 10; +} +var g = Object(); +g.f = 10; +assertEq(foo(g), 20); +assertEq(foo(g), 20); +assertEq(foo(g), 20); +eval("g.f = 'three'"); +assertEq(foo(g), 'three10'); diff --git a/js/src/jit-test/tests/jaeger/recompile/bug658212.js b/js/src/jit-test/tests/jaeger/recompile/bug658212.js new file mode 100644 index 000000000..a18764923 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/recompile/bug658212.js @@ -0,0 +1,30 @@ +var gTestcases = Array; +function TestCase(n, d, e, a) { + this.description = d + gTestcases[gTc] = this +} +TestCase.prototype.dump=function () + + + + + this.description + + + + + '\n';function printStatus (msg) +function toPrinted(value) { +} +function reportCompare(expected, actual, description) { + new TestCase("unknown-test-name", description, expected, actual) +} +gTc = 0;; +function jsTestDriverEnd() { + for (var i = 0; i < gTestcases.length; i++) + gTestcases[i].dump() +} +var summary = 'Do not assert with try/finally inside finally'; +var expect = 'No Crash'; +reportCompare(expect, printStatus, summary); +jsTestDriverEnd(); +jsTestDriverEnd(); +try { + f +} catch (ex) { + actual = '' +} +reportCompare(expect, actual, 5); +jsTestDriverEnd() diff --git a/js/src/jit-test/tests/jaeger/recompile/bug658561.js b/js/src/jit-test/tests/jaeger/recompile/bug658561.js new file mode 100644 index 000000000..ad10b3dac --- /dev/null +++ b/js/src/jit-test/tests/jaeger/recompile/bug658561.js @@ -0,0 +1,5 @@ +var s1 = 'xx'; +for (var x = 0; x < 10 ; ++x ) { + new function() s1++; + gc(); +} diff --git a/js/src/jit-test/tests/jaeger/recompile/bug658777.js b/js/src/jit-test/tests/jaeger/recompile/bug658777.js new file mode 100644 index 000000000..9bc6854f4 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/recompile/bug658777.js @@ -0,0 +1,11 @@ +function Employee(name, dept) this.name = name || ""; +function WorkerBee(name, dept, projs) { + this.base = Employee + this.base(name, dept) +} +function Engineer(name, projs, machine) { + this.base = WorkerBee + this.base(name, "engineering", projs) + __proto__["a" + constructor] = 1 +} +new Engineer; diff --git a/js/src/jit-test/tests/jaeger/recompile/bug659639.js b/js/src/jit-test/tests/jaeger/recompile/bug659639.js new file mode 100644 index 000000000..4e7ffe288 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/recompile/bug659639.js @@ -0,0 +1,16 @@ +test(); +function iso(d) { new Date(d).toISOString() } +function check(s,millis) { iso(millis); } +function dd(year, month, day, hour, minute, second, millis) { + return Date.UTC(year, 1, day, hour, minute, second, millis); +} +function test() { + try { + check("", 20092353211) + check("", 2009) + check("", 0) + check("", dd(BUGNUMBER, 7, 23, 19, 53, 21, 1)) + } catch (e) {} +} +var BUGNUMBER = "10278"; +test() diff --git a/js/src/jit-test/tests/jaeger/recompile/bug659766.js b/js/src/jit-test/tests/jaeger/recompile/bug659766.js new file mode 100644 index 000000000..012447ba4 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/recompile/bug659766.js @@ -0,0 +1,29 @@ +var gTestcases = new Array; +var gTc = gTestcases; +function TestCase(n, d, e, a) { + this.description=d + this.reason='' + gTestcases[gTc++]=this +} +TestCase.prototype.dump=function () + toPrinted(this.description) + toPrinted(this.reason) + '\n'; +function toPrinted(value) value=value.replace(/\\n/g, 'NL').replace(/[^\x20-\x7E]+/g, escapeString); +function escapeString (str) { + try { + err + } catch(ex) { } +} +function jsTestDriverEnd() { + for (var i = 0; i < gTestcases.length; i++) + gTestcases[i].dump() +} +var SECTION = "dowhile-007"; +DoWhile(); +function DoWhile( object ) result1=false; +new TestCase( + SECTION, + "break one: ", + result1 +); +jsTestDriverEnd(); +new TestCase( SECTION, "'�O� �:i��'.match(new RegExp('.+'))", [], '�O� �:i��'); +jsTestDriverEnd(); diff --git a/js/src/jit-test/tests/jaeger/recompile/bug660737.js b/js/src/jit-test/tests/jaeger/recompile/bug660737.js new file mode 100644 index 000000000..b36b8ee77 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/recompile/bug660737.js @@ -0,0 +1,10 @@ +(function() { + function f(l) { + w++ + } + for each(let w in ['', '', 0]) { + try { + f(w) + } catch (e) {} + } +})() diff --git a/js/src/jit-test/tests/jaeger/recompile/bug661859.js b/js/src/jit-test/tests/jaeger/recompile/bug661859.js new file mode 100644 index 000000000..b99e301a1 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/recompile/bug661859.js @@ -0,0 +1,24 @@ +function TestCase(n, d, e, a) this.expect = e; +function reportCompare(expected, actual, description) { + typeof actual +} +expect = 1; +var summary = 'Do not assert: top < ss->printer->script->depth'; +var actual = 'No Crash'; +var expect = 'No Crash'; +test(); +function notInlined(f) { + // prevent inlining this function, as a consequence, it prevent inlining + // Array.prototype.some (Bug 1087468) + with ({}) {} + return f; +} +function test(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z) { + try { + p = [1].some(notInlined(function (y) test())) ? 4 : 0x0041; + } catch (ex) {} + reportCompare(expect, actual, summary) +} +test(); +TestCase(); +test() diff --git a/js/src/jit-test/tests/jaeger/recompile/bug663690.js b/js/src/jit-test/tests/jaeger/recompile/bug663690.js new file mode 100644 index 000000000..1738d0196 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/recompile/bug663690.js @@ -0,0 +1,14 @@ + +function g(c) { + b = b = h(c); +} +function j(s) { + return Function(s) +} +function h(c) { + return j(c)() +} +g() +var a +Boolean.__proto__[a] = [] +g("return gc()") diff --git a/js/src/jit-test/tests/jaeger/recompile/bug671943-1.js b/js/src/jit-test/tests/jaeger/recompile/bug671943-1.js new file mode 100644 index 000000000..3562f9327 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/recompile/bug671943-1.js @@ -0,0 +1,12 @@ +gczeal(2); +o1 = Iterator; +var o2 = (function() { return arguments; })(); +function f(o) { + for(var j=0; j<20; j++) { + Object.seal(o2); + (function() { return eval(o); })() == o1; + (function() { return {x: arguments}.x; })(); + if (false) {}; + } +} +f({}); diff --git a/js/src/jit-test/tests/jaeger/recompile/bug671943-2.js b/js/src/jit-test/tests/jaeger/recompile/bug671943-2.js new file mode 100644 index 000000000..7b262b9b6 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/recompile/bug671943-2.js @@ -0,0 +1,10 @@ +if (typeof schedulegc != 'undefined') + schedulegc(11); +function foo(n) { + if (n == 10) + foo.apply = function(a, b) { return b[0]; } + return n; +} +function bar() { return foo.apply(null, arguments); } +for (var i = 0; i < 20; i++) + assertEq(bar(i), i); diff --git a/js/src/jit-test/tests/jaeger/recompile/bug672123.js b/js/src/jit-test/tests/jaeger/recompile/bug672123.js new file mode 100644 index 000000000..d2ca2497e --- /dev/null +++ b/js/src/jit-test/tests/jaeger/recompile/bug672123.js @@ -0,0 +1,46 @@ +var caught = false; +function h(code) { + f = eval("(function(){" + code + "})") + g() +} +function g() { + try { + f(); + } catch (r) { caught = true } +} +h("") +for (i = 0; i < 9; i++) { + h("") +} +h("") +h("") +h("") +h("") +h("") +h("") +h("") +h("") +h("") +h("") +h("") +h("") +h("") +h("") +h("") +h("") +h("") +h("") +h("") +h("") +h("") +h("") +h("") +h("") +h("") +h("") +h("") +h("") +h("") +h("") +h("\"\"(gc())") +assertEq(caught, true); diff --git a/js/src/jit-test/tests/jaeger/recompile/bug673812.js b/js/src/jit-test/tests/jaeger/recompile/bug673812.js new file mode 100644 index 000000000..cf16ba78b --- /dev/null +++ b/js/src/jit-test/tests/jaeger/recompile/bug673812.js @@ -0,0 +1,18 @@ +gczeal(2); +try { + DoWhile_3(); +} catch (e) {} +function f() { + test(); + yield 170; +} +function test() { + function foopy() { + try { + for (var i in f()); + } catch (e) {} + } + foopy(); + gc(); +} +test(); diff --git a/js/src/jit-test/tests/jaeger/recompile/bug674391.js b/js/src/jit-test/tests/jaeger/recompile/bug674391.js new file mode 100644 index 000000000..7fdc2c303 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/recompile/bug674391.js @@ -0,0 +1,11 @@ +a = []; +for (var i = 0; i < 1000; i++) { + a[i] = i; +} +function foo(x) { + for (var i in x) { + } +} +if (typeof schedulegc != "undefined") + schedulegc(100); +foo(a); diff --git a/js/src/jit-test/tests/jaeger/recompile/bug676764.js b/js/src/jit-test/tests/jaeger/recompile/bug676764.js new file mode 100644 index 000000000..fca27de64 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/recompile/bug676764.js @@ -0,0 +1,14 @@ + +try { with( {"a":1} ) { + (function () { + for (;;) { + t + } + })() +} } catch (e) {} + +with( {"b":2} ) { + (function () { + for (b = 0; b < 18; ++b) {} + })(); +} diff --git a/js/src/jit-test/tests/jaeger/recompile/callic.js b/js/src/jit-test/tests/jaeger/recompile/callic.js new file mode 100644 index 000000000..6647c9acf --- /dev/null +++ b/js/src/jit-test/tests/jaeger/recompile/callic.js @@ -0,0 +1,27 @@ + +/* Recompilation while being processed by a call IC. */ + +var g; +function foo() { + for (g = 0; g < 5; g++) { + bar(); + } + function bar() { + with ({}) { + eval("g = undefined;"); + } + } +} +foo(); + +assertEq(g, NaN); + +/* Recompilation while being processed by a native call IC. */ + +function native() { + var x; + x = x; + x = Math.ceil(NaN); + assertEq(x, NaN); +} +native(); diff --git a/js/src/jit-test/tests/jaeger/recompile/exotic.js b/js/src/jit-test/tests/jaeger/recompile/exotic.js new file mode 100644 index 000000000..3a00dd362 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/recompile/exotic.js @@ -0,0 +1,74 @@ + +// Test exotic ways of triggering recompilation. + +// Lowered native call. + +var x = 0; +var y = true; +for (var i = 0; i < 20; i++) { + x += Array.map.apply(undefined, [[0], function(x) { if (i == 10) eval("y = 20"); return 1; }])[0]; +} +assertEq(x, 20); +assertEq(y, 20); + +// Recompilation triggered by local function. + +var o = {}; +function what(q) { + function inner() { return q; } + o.f = inner; + var a = o.f(); + return a; +} +for (var i = 0; i < 10; i++) { + var a = what(i); + assertEq(a, i); +} + +// Lowered scripted call to apply returning code pointer. + +var global = 3; +function foo(x, y) { + var q = x.apply(null, y); + if (q != 10) + assertEq(global, true); +} +foo(function(a) { global = a; return 10; }, [1]); +foo(function(a) { global = a; return 10; }, [1]); +foo(function(a) { global = a; return 10; }, [1]); +assertEq(global, 1); +foo(function(a) { global = a; return 3; }, [true]); +assertEq(global, true); + +// Lowered scripted call returning NULL. + +var oglobal = 3; +function xfoo(x, y) { + var q = x.apply(null, y); + if (q != 10) + assertEq(oglobal, true); +} +xfoo(function(a) { oglobal = a; return 10; }, [1]); +xfoo(function(a) { oglobal = a; return 10; }, [1]); +xfoo(function(a) { oglobal = a; return 10; }, [1]); +assertEq(oglobal, 1); +xfoo(function(a) { [1,2,3]; oglobal = a; return 3; }, [true]); +assertEq(oglobal, true); + +// Recompilation out of SplatApplyArgs. + +weirdarray = [,,1,2,3]; +Object.defineProperty(weirdarray, 0, {get: function() { vglobal = 'true'; }}); + +var vglobal = 3; +function yfoo(x, y) { + var q = x.apply(null, y); + if (q != 10) + assertEq(vglobal, 'true'); + else + assertEq(vglobal, 3); +} +yfoo(function(a) { return 10; }, [1]); +yfoo(function(a) { return 10; }, [1]); +yfoo(function(a) { return 10; }, [1]); +yfoo(function() { return 0; }, weirdarray); diff --git a/js/src/jit-test/tests/jaeger/recompile/flush.js b/js/src/jit-test/tests/jaeger/recompile/flush.js new file mode 100644 index 000000000..81681e604 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/recompile/flush.js @@ -0,0 +1,18 @@ + +/* Handle flushing of scripted call ICs pointing to recompiled functions. */ + +function add(x, y) { + var z = x + y; + return String(x + y); +} + +function foo() { + var x = 0x7ffffff0; + var res = ""; + for (var i = 0; i < 20; i++) { + res += add(x, i) + ","; + res += add(x, i) + ","; + } + assertEq(res, "2147483632,2147483632,2147483633,2147483633,2147483634,2147483634,2147483635,2147483635,2147483636,2147483636,2147483637,2147483637,2147483638,2147483638,2147483639,2147483639,2147483640,2147483640,2147483641,2147483641,2147483642,2147483642,2147483643,2147483643,2147483644,2147483644,2147483645,2147483645,2147483646,2147483646,2147483647,2147483647,2147483648,2147483648,2147483649,2147483649,2147483650,2147483650,2147483651,2147483651,"); +} +foo(); diff --git a/js/src/jit-test/tests/jaeger/recompile/getelem.js b/js/src/jit-test/tests/jaeger/recompile/getelem.js new file mode 100644 index 000000000..1c976ac7e --- /dev/null +++ b/js/src/jit-test/tests/jaeger/recompile/getelem.js @@ -0,0 +1,26 @@ + +/* Unexpected values out of GETELEM */ + +function foo() { + var x = [1,2,3]; + var y; + var z = x[y]; + y = 10; + assertEq(z, "twelve"); +} +Array.prototype["undefined"] = "twelve"; +foo(); + +function fna() { + var a = {}; + a[true] = 1; + assertEq(a["true"], 1); +} +fna(); + +function fnb() { + var a = []; + a[1.1] = 2; + assertEq(a["1.1"], 2); +} +fnb(); diff --git a/js/src/jit-test/tests/jaeger/recompile/incdec.js b/js/src/jit-test/tests/jaeger/recompile/incdec.js new file mode 100644 index 000000000..93786ba34 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/recompile/incdec.js @@ -0,0 +1,92 @@ + +/* Handle recompilation on overflow of inc/dec operations. */ + +function local() +{ + var j = 0x7ffffff0; + for (var i = 0; i < 100; i++) + j++; + assertEq(j, 2147483732); +} +local(); + +function olocal() +{ + var j = 0x7ffffff0; + for (var i = 0; i < 100; i++) { + if (j++ == 5000) + break; + } + assertEq(j, 2147483732); +} +olocal(); + +function arg(j) +{ + for (var i = 0; i < 100; i++) + j++; + assertEq(j, 2147483732); +} +arg(0x7ffffff0); + +function oarg(j) +{ + for (var i = 0; i < 100; i++) { + if (j++ == 5000) + break; + } + assertEq(j, 2147483732); +} +oarg(0x7ffffff0); + +// basic global inc/dec correctness +var x = 1.23; +x = x--; +x = x++; +x = ++x; +x = --x; +assertEq(x, 1.23); + +var g = 0x7ffffff0; +function glob() +{ + for (var i = 0; i < 100; i++) + g++; + assertEq(g, 2147483732); +} +glob(); + +function gname() +{ + n = 0x7ffffff0; + for (var i = 0; i < 100; i++) + n++; + assertEq(n, 2147483732); +} +gname(); + +function prop() +{ + var v = {f: 0x7ffffff0}; + for (var i = 0; i < 100; i++) + v.f++; + assertEq(v.f, 2147483732); +} +prop(); + +function elem(v, f) +{ + for (var i = 0; i < 100; i++) + v[f]++; + assertEq(v.f, 2147483732); +} +elem({f: 0x7ffffff0}, "f"); + +function name() +{ + var v = 0x7ffffff0; + var i; + eval("for (i = 0; i < 100; i++) v++"); + assertEq(v + 10, 2147483742); +} +name(); diff --git a/js/src/jit-test/tests/jaeger/recompile/inlinestubs.js b/js/src/jit-test/tests/jaeger/recompile/inlinestubs.js new file mode 100644 index 000000000..05a7ee8ef --- /dev/null +++ b/js/src/jit-test/tests/jaeger/recompile/inlinestubs.js @@ -0,0 +1,43 @@ +// rejoining after recompilation from CompileFunction or a native called by an inlined frame. + +var global = 0; +var arr = [ + function() { return 0; }, + function() { return 1; }, + function() { return 2; }, + function() { return 3; }, + function() { return 4; }, + function() { return 5; }, + function() { return 6; }, + function() { return 7; }, + function() { global = -"three"; return 8; } + ]; +function wrap_call(i) { + var fn = arr["" + i]; + return fn(); +} +function foo1() { + var res = 0; + for (var i = 0; i < arr.length; i++) { + res += wrap_call(i); + var expected = (i == arr.length - 1) ? NaN : 10; + assertEq(global + 10, expected); + } +} +foo1(); + +var callfn = Function.call; +function wrap_floor(x, y) { + var z = x; + if (y) + z = {}; // trick the compiler into not inlining the floor() call. + return Math.floor(z); +} + +function foo2(x, y) { + var z = 0; + for (var i = 0; i < y; i++) + z = wrap_floor(x + i, false); + assertEq(z + 10, 2147483661); +} +foo2(0x7ffffff0 + .5, 20); diff --git a/js/src/jit-test/tests/jaeger/recompile/memory-01.js b/js/src/jit-test/tests/jaeger/recompile/memory-01.js new file mode 100644 index 000000000..aa1474621 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/recompile/memory-01.js @@ -0,0 +1,12 @@ + +function foo(n) { + for (var i = 0; i < n; i++) {} + return i; +} + +assertEq(foo(1000), 1000); + +gc(); + +eval("assertEq(foo(1000.5), 1001)"); + diff --git a/js/src/jit-test/tests/jaeger/recompile/memory-02.js b/js/src/jit-test/tests/jaeger/recompile/memory-02.js new file mode 100644 index 000000000..875487abc --- /dev/null +++ b/js/src/jit-test/tests/jaeger/recompile/memory-02.js @@ -0,0 +1,19 @@ + +var g = 10; + +function bar(n) { + return g; +} + +function foo(n, v) { + for (var i = 0; i < n; i++) + assertEq(bar(i), v); +} + +foo(10, 10); + +gc(); + +eval("g = 10.5"); + +foo(10, 10.5); diff --git a/js/src/jit-test/tests/jaeger/recompile/memory-03.js b/js/src/jit-test/tests/jaeger/recompile/memory-03.js new file mode 100644 index 000000000..c5eaf8296 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/recompile/memory-03.js @@ -0,0 +1,6 @@ + +eval("var x = 10; function foo() { return x; }"); + +assertEq(foo(), 10); +gc(); +assertEq(foo(), 10); diff --git a/js/src/jit-test/tests/jaeger/recompile/memory-04.js b/js/src/jit-test/tests/jaeger/recompile/memory-04.js new file mode 100644 index 000000000..794c93802 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/recompile/memory-04.js @@ -0,0 +1,8 @@ + +function foo(x, y) { + gc(); + var z = x + y; + print(z); +} + +foo(0x7ffffff0, 100); diff --git a/js/src/jit-test/tests/jaeger/recompile/native.js b/js/src/jit-test/tests/jaeger/recompile/native.js new file mode 100644 index 000000000..72a6c2576 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/recompile/native.js @@ -0,0 +1,26 @@ + +/* Handle recompilations triggered by native calls. */ + +function dofloor(v) +{ + var res = ""; + for (var i = 0; i < 10; i++) { + var q = Math.floor(v + i); + res += q + ","; + } + assertEq(res, "2147483642,2147483643,2147483644,2147483645,2147483646,2147483647,2147483648,2147483649,2147483650,2147483651,"); +} +dofloor(0x7ffffffa + .5); + +function mapfloor(a) +{ + var b = a.map(function(v) { return Math.floor(v); }); + + var res = ""; + for (var i = 0; i < b.length; i++) + res += b[i] + ","; + return res; +} +mapfloor([1,2]); +mapfloor([3,4]); +assertEq(mapfloor([0x7ffffffa + 2.5, 0x7ffffffa + 20.5]), "2147483644,2147483662,"); diff --git a/js/src/jit-test/tests/jaeger/recompile/nativemulti.js b/js/src/jit-test/tests/jaeger/recompile/nativemulti.js new file mode 100644 index 000000000..d61158697 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/recompile/nativemulti.js @@ -0,0 +1,21 @@ + +/* Recompilation that requires patching the same native stub multiple times. */ + +var first = 0; +var second = 0; + +function foreachweird(a, f, vfirst, vsecond) +{ + a.forEach(f); + assertEq(first, vfirst); + assertEq(second, vsecond); +} + +function weird() { + eval("first = 'one';"); + eval("second = 'two';"); +} + +foreachweird([0], function() {}, 0, 0); +foreachweird([0], function() {}, 0, 0); +foreachweird([0], weird, 'one', 'two'); diff --git a/js/src/jit-test/tests/jaeger/recompile/nativestack.js b/js/src/jit-test/tests/jaeger/recompile/nativestack.js new file mode 100644 index 000000000..350649afc --- /dev/null +++ b/js/src/jit-test/tests/jaeger/recompile/nativestack.js @@ -0,0 +1,25 @@ + +/* Recompilation that requires patching the same native stub multiple times on one stack. */ + +var first = 0; +var second = 0; + +function eacher(f, vfirst, vsecond) { + var a = [0]; + a.forEach(f); + assertEq(first, vfirst); + assertEq(second, vsecond); +} + +function one() { + eacher(two, 'one', 'two'); +} + +function two() { + eval("first = 'one';"); + eval("second = 'two';"); +} + +eacher(function () {}, 0, 0); +eacher(function () {}, 0, 0); +eacher(one, 'one', 'two'); diff --git a/js/src/jit-test/tests/jaeger/recompile/patchdouble.js b/js/src/jit-test/tests/jaeger/recompile/patchdouble.js new file mode 100644 index 000000000..4de083813 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/recompile/patchdouble.js @@ -0,0 +1,7 @@ +// only fix doubles for slots which the recompiled script thinks are doubles. +function foo(x) { + var y = x & 0xffff; + y = (y * (x * 1000)); + assertEq(y, 140735340806145000); +} +foo(0x7fffffff); diff --git a/js/src/jit-test/tests/jaeger/recompile/property.js b/js/src/jit-test/tests/jaeger/recompile/property.js new file mode 100644 index 000000000..37223563a --- /dev/null +++ b/js/src/jit-test/tests/jaeger/recompile/property.js @@ -0,0 +1,26 @@ + +/* Handle recompilation on undefined properties and array holes. */ + +var v = {}; +if (typeof v == 'string') + v.x = 0; +function prop(v) +{ + var z = v.x + 1; + assertEq(z, NaN); +} +prop(v); + +v = []; +v[0] = 0; +v[1] = 1; +v[3] = 3; +v[4] = 4; +function elem(x) +{ + var x = ""; + for (var i = 0; i < 5; i++) + x += v[i]; + assertEq(x, "01undefined34"); +} +elem(v); diff --git a/js/src/jit-test/tests/jaeger/recompile/propic.js b/js/src/jit-test/tests/jaeger/recompile/propic.js new file mode 100644 index 000000000..f394c4c46 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/recompile/propic.js @@ -0,0 +1,24 @@ + +/* Recompilation while being processed by property ICs. */ + +var ga = 10; +var gb = 10; + +Object.defineProperty(Object.prototype, "a", { + set: function(a) { eval("ga = true;"); }, + get: function() { eval("gb = true;"); } + }); + +function foo() { + var x = {}; + x.a = 10; + assertEq(ga + 1, 2); +} +foo(); + +function bar() { + var x = {}; + var a = x.a; + assertEq(gb + 1, 2); +} +bar(); diff --git a/js/src/jit-test/tests/jaeger/recompile/staticoverflow.js b/js/src/jit-test/tests/jaeger/recompile/staticoverflow.js new file mode 100644 index 000000000..738777244 --- /dev/null +++ b/js/src/jit-test/tests/jaeger/recompile/staticoverflow.js @@ -0,0 +1,26 @@ + +// overflows occurring during constant folding + +var y = -null - y; +assertEq(y, NaN); + +var x = -(void 0); +assertEq(x, NaN); + +function overdiv() { + for(var i=0; i<25; i++) { + var a, b; + function f() { + } + a = f(); + b = (123 ^ 1) / 1234; + } +} +overdiv(); + +function overadd() { + var a = 0x7ffffff0; + var b = 100; + return a + b; +} +overadd(); diff --git a/js/src/jit-test/tests/jaeger/recompile/undef.js b/js/src/jit-test/tests/jaeger/recompile/undef.js new file mode 100644 index 000000000..a738c802c --- /dev/null +++ b/js/src/jit-test/tests/jaeger/recompile/undef.js @@ -0,0 +1,61 @@ + +/* Handle recompilation on undefined variables. */ + +function local() +{ + var x; + x++; + assertEq(x, NaN); + x = 0; +} +local(); + +function name(v) +{ + var x; + with (v) { + x++; + assertEq(x, NaN); + } + assertEq(x, NaN); + x = 0; +} +name({}); + +function letname(v) +{ + if (v) { + let x; + with (v) { + x = "twelve"; + } + assertEq(x, "twelve"); + } +} +letname({}); + +function upvar() +{ + var x; + function inner() { + x++; + assertEq(x, NaN); + } + inner(); +} +upvar(); + +var x; +var y; + +function global() +{ + x++; + assertEq(x, NaN); + var z = 2 + y; + assertEq(z, NaN); +} +global(); + +x = 0; +y = 0; |