Wed, 31 Dec 2014 06:09:35 +0100
Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.
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 });