Bug 1331592 - Skipping wasm frames during debugger eval. r=luke
authorYury Delendik <ydelendik@mozilla.com>
Wed, 18 Jan 2017 12:48:35 -0600
changeset 375012 29e806c862faaf43c984c12a2a17dd0053acb852
parent 375011 c4abb503bfcddd2c79f998047bbede6672b6bd0c
child 375013 3544f347daf2af7a48e9f8b4a8ff75181d948041
push id6996
push userjlorenzo@mozilla.com
push dateMon, 06 Mar 2017 20:48:21 +0000
treeherdermozilla-beta@d89512dab048 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersluke
bugs1331592
milestone53.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1331592 - Skipping wasm frames during debugger eval. r=luke MozReview-Commit-ID: 4ziVmSnuIhT
js/src/jit-test/tests/debug/bug1331592.js
js/src/vm/Stack.cpp
new file mode 100644
--- /dev/null
+++ b/js/src/jit-test/tests/debug/bug1331592.js
@@ -0,0 +1,28 @@
+// |jit-test| test-also-wasm-baseline; error: TestComplete
+
+if (!wasmIsSupported())
+     throw "TestComplete";
+
+var module = new WebAssembly.Module(wasmTextToBinary(`
+    (module
+        (import "global" "func" (result i32))
+        (func (export "func_0") (result i32)
+         call 0 ;; calls the import, which is func #0
+        )
+    )
+`));
+
+var dbg;
+(function (global) {
+    var dbgGlobal = newGlobal();
+    dbg = new dbgGlobal.Debugger();
+    dbg.addDebuggee(global);
+})(this);
+
+var instance = new WebAssembly.Instance(module, { global: { func: () => {
+    var frame = dbg.getNewestFrame().older;
+    frame.eval("some_error");
+}}});
+instance.exports.func_0();
+
+throw "TestComplete";
--- a/js/src/vm/Stack.cpp
+++ b/js/src/vm/Stack.cpp
@@ -703,16 +703,18 @@ FrameIter::operator++()
         {
             AbstractFramePtr eifPrev = interpFrame()->evalInFramePrev();
 
             popInterpreterFrame();
 
             while (!hasUsableAbstractFramePtr() || abstractFramePtr() != eifPrev) {
                 if (data_.state_ == JIT)
                     popJitFrame();
+                else if (data_.state_ == WASM)
+                    popWasmFrame();
                 else
                     popInterpreterFrame();
             }
 
             break;
         }
         popInterpreterFrame();
         break;