summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/debug/RematerializedFrame-retval.js
blob: f426d6e5f0893a123f2aea54465b91097ec75dba (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
// |jit-test| slow; error: InternalError; --baseline-eager; --ion-eager
// Make sure that return values we store in RematerializedFrames via resumption
// values get propagated to the BaselineFrames we build from them.
//
// Test case from bug 1285939; there's another in bug 1282518, but this one
// takes less time to run, when it doesn't crash.

var lfLogBuffer = `
function testResumptionVal(resumptionVal, turnOffDebugMode) {
  var g = newGlobal({newCompartment: true});
  var dbg = new Debugger;
  setInterruptCallback(function () {
    dbg.addDebuggee(g);
    var frame = dbg.getNewestFrame();
    frame.onStep = function () {
      frame.onStep = undefined;
      return resumptionVal;
    };
    return true;
  });
  try {
    return g.eval("(" + function f() {
      invokeInterruptCallback(function (interruptRv) {
    f({ valueOf: function () { dbg.g(dbg); }});
  });
    } + ")();");
  } finally {  }
}
assertEq(testResumptionVal({ return: "not 42" }), "not 42");
`;
loadFile(lfLogBuffer);
function loadFile(lfVarx) {
    try {
         let m = parseModule(lfVarx);
         moduleLink(m);
         moduleEvaluate(m);
    } catch (lfVare) {}
}