mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-24 21:31:04 +00:00
Bug 1282518 - Propagate return values from RematerializedFrames to BaselineFrames. r=shu
This commit is contained in:
parent
8baceda97e
commit
002186dad9
39
js/src/jit-test/tests/debug/RematerializedFrame-retval.js
Normal file
39
js/src/jit-test/tests/debug/RematerializedFrame-retval.js
Normal file
@ -0,0 +1,39 @@
|
||||
// |jit-test| 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();
|
||||
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);
|
||||
m.declarationInstantiation();
|
||||
m.evaluation();
|
||||
} catch (lfVare) {}
|
||||
}
|
||||
|
@ -1720,6 +1720,8 @@ CopyFromRematerializedFrame(JSContext* cx, JitActivation* act, uint8_t* fp, size
|
||||
for (size_t i = 0; i < frame->script()->nfixed(); i++)
|
||||
*frame->valueSlot(i) = rematFrame->locals()[i];
|
||||
|
||||
frame->setReturnValue(rematFrame->returnValue());
|
||||
|
||||
if (rematFrame->hasCachedSavedFrame())
|
||||
frame->setHasCachedSavedFrame();
|
||||
|
||||
|
@ -219,7 +219,11 @@ class RematerializedFrame
|
||||
return UndefinedValue();
|
||||
}
|
||||
|
||||
Value returnValue() const {
|
||||
void setReturnValue(const Value& value) {
|
||||
returnValue_ = value;
|
||||
}
|
||||
|
||||
Value& returnValue() {
|
||||
return returnValue_;
|
||||
}
|
||||
|
||||
|
@ -437,7 +437,11 @@ AbstractFramePtr::setReturnValue(const Value& rval) const
|
||||
asInterpreterFrame()->setReturnValue(rval);
|
||||
return;
|
||||
}
|
||||
asBaselineFrame()->setReturnValue(rval);
|
||||
if (isBaselineFrame()) {
|
||||
asBaselineFrame()->setReturnValue(rval);
|
||||
return;
|
||||
}
|
||||
asRematerializedFrame()->setReturnValue(rval);
|
||||
}
|
||||
|
||||
inline JSObject*
|
||||
|
Loading…
Reference in New Issue
Block a user