Thu, 22 Jan 2015 13:21:57 +0100
Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6
1 // Eval-in-frame with different type on non-youngest Ion frame.
3 load(libdir + "jitopts.js");
5 if (!jitTogglesMatch(Opts_Ion2NoParallelCompilation))
6 quit(0);
8 withJitOptions(Opts_Ion2NoParallelCompilation, function () {
9 function test(shadow) {
10 var g = newGlobal();
11 var dbg = new Debugger;
13 // Note that we depend on CCW scripted functions being opaque to Ion
14 // optimization for this test.
15 g.h = function h(d) {
16 if (d) {
17 dbg.addDebuggee(g);
18 var f = dbg.getNewestFrame().older;
19 assertEq(f.implementation, "ion");
20 assertEq(f.environment.getVariable("foo"), 42);
22 // EIF of a different type too.
23 f.eval((shadow ? "var " : "") + "foo = 'string of 42'");
24 g.expected = shadow ? 42 : "string of 42";
25 }
26 }
28 g.eval("" + function f(d) {
29 var foo = 42;
30 g(d);
31 return foo;
32 });
33 g.eval("" + function g(d) {
34 h(d);
35 });
37 g.eval("(" + function () {
38 for (i = 0; i < 5; i++)
39 f(false);
40 assertEq(f(true), "string of 42");
41 } + ")();");
42 }
44 test(false);
45 test(true);
46 });