michael@0: // Debugger.Frame preserves Ion frame identity michael@0: michael@0: load(libdir + "jitopts.js"); michael@0: michael@0: if (!jitTogglesMatch(Opts_Ion2NoParallelCompilation)) michael@0: quit(); michael@0: michael@0: withJitOptions(Opts_Ion2NoParallelCompilation, function () { michael@0: var g = newGlobal(); michael@0: var dbg1 = new Debugger; michael@0: var dbg2 = new Debugger; michael@0: michael@0: g.toggle = function toggle(x, d) { michael@0: if (d) { michael@0: dbg1.addDebuggee(g); michael@0: dbg2.addDebuggee(g); michael@0: var frame1 = dbg1.getNewestFrame(); michael@0: assertEq(frame1.environment.getVariable("x"), x); michael@0: assertEq(frame1.implementation, "ion"); michael@0: frame1.environment.setVariable("x", "not 42"); michael@0: assertEq(dbg2.getNewestFrame().environment.getVariable("x"), "not 42"); michael@0: } michael@0: }; michael@0: michael@0: g.eval("" + function f(x, d) { toggle(x, d); }); michael@0: michael@0: g.eval("(" + function test() { michael@0: for (var i = 0; i < 5; i++) michael@0: f(42, false); michael@0: f(42, true); michael@0: } + ")();"); michael@0: });