Bug 1900740 - Skip non-Wasm frames in FrameIter::wasmUpdateBytecodeOffset. r=yury

Differential Revision: https://phabricator.services.mozilla.com/D212653
This commit is contained in:
Jan de Mooij 2024-06-06 06:59:55 +00:00
parent 9e6b32c9a6
commit e73a59312f
2 changed files with 30 additions and 1 deletions

View file

@ -0,0 +1,29 @@
// |jit-test| skip-if: !wasmDebuggingEnabled()
function c() {
var frame1 = dbg.getNewestFrame();
assertEq(frame1.script.format, "js");
assertEq(frame1.script.displayName, "c");
assertEq(frame1.offset > 0, true);
var frame2 = frame1.older;
assertEq(frame2.script.format, "wasm");
assertEq(frame2.offset > 0, true);
var frame3 = frame2.older;
assertEq(frame3.script.format, "js");
assertEq(frame3.script.displayName, "test");
assertEq(frame3.offset > 0, true);
}
var bin = wasmTextToBinary(`(module(import "m" "f" (func $f))(func (export "test")call $f))`);
var dbg = newGlobal({newCompartment: true}).Debugger(this);
var mod = new WebAssembly.Module(bin);
var inst = new WebAssembly.Instance(mod, {m: {f: c}});
function test() {
for (var i = 0; i < 20; i++) {
inst.exports.test();
}
}
test();

View file

@ -783,7 +783,7 @@ void FrameIter::wasmUpdateBytecodeOffset() {
// Relookup the current frame, updating the bytecode offset in the process.
data_.jitFrames_ = JitFrameIter(data_.activations_->asJit());
while (wasmFrame().debugFrame() != frame) {
while (!isWasm() || wasmFrame().debugFrame() != frame) {
++data_.jitFrames_;
}