Debian Codegraph @

js/src/jit-test/tests/debug/RematerializedFrame-retval.js

raw
1 // |jit-test| slow; error: InternalError; --baseline-eager; --ion-eager
2 // Make sure that return values we store in RematerializedFrames via resumption
3 // values get propagated to the BaselineFrames we build from them.
4 //
5 // Test case from bug 1285939; there's another in bug 1282518, but this one
6 // takes less time to run, when it doesn't crash.
7
8 var lfLogBuffer = `
9 function testResumptionVal(resumptionVal, turnOffDebugMode) {
10 var g = newGlobal({newCompartment: true});
11 var dbg = new Debugger;
12 setInterruptCallback(function () {
13 dbg.addDebuggee(g);
14 var frame = dbg.getNewestFrame();
15 frame.onStep = function () {
16 frame.onStep = undefined;
17 return resumptionVal;
18 };
19 return true;
20 });
21 try {
22 return g.eval("(" + function f() {
23 invokeInterruptCallback(function (interruptRv) {
24 f({ valueOf: function () { dbg.g(dbg); }});
25 });
26 } + ")();");
27 } finally { }
28 }
29 assertEq(testResumptionVal({ return: "not 42" }), "not 42");
30 `;
31 loadFile(lfLogBuffer);
32 function loadFile(lfVarx) {
33 try {
34 let m = parseModule(lfVarx);
35 moduleLink(m);
36 moduleEvaluate(m);
37 } catch (lfVare) {}
38 }
39