js/src/jit-test/tests/debug/Frame-eval-20.js

changeset 0
6474c204b198
equal deleted inserted replaced
-1:000000000000 0:6074f4efe3b0
1 // Eval-in-frame with different type on non-youngest Ion frame.
2
3 load(libdir + "jitopts.js");
4
5 if (!jitTogglesMatch(Opts_Ion2NoParallelCompilation))
6 quit(0);
7
8 withJitOptions(Opts_Ion2NoParallelCompilation, function () {
9 function test(shadow) {
10 var g = newGlobal();
11 var dbg = new Debugger;
12
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);
21
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 }
27
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 });
36
37 g.eval("(" + function () {
38 for (i = 0; i < 5; i++)
39 f(false);
40 assertEq(f(true), "string of 42");
41 } + ")();");
42 }
43
44 test(false);
45 test(true);
46 });

mercurial