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

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

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

mercurial