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

Thu, 22 Jan 2015 13:21:57 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 22 Jan 2015 13:21:57 +0100
branch
TOR_BUG_9701
changeset 15
b8a032363ba2
permissions
-rw-r--r--

Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6

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