Bug 1406889 - Baldr: fix profiling debug-enabled debug (r=bbouvier)
authorLuke Wagner <luke@mozilla.com>
Tue, 10 Oct 2017 12:48:23 -0500
changeset 385478 3d8a1f95670dd01919dc53e53427aaf7028e2f7b
parent 385477 a7b7044ecb7b0a2c124c378123c07121076337d0
child 385479 55161cebaca079886f2d7e5f323928392d299f0b
push id32656
push userarchaeopteryx@coole-files.de
push dateWed, 11 Oct 2017 09:50:40 +0000
treeherdermozilla-central@20d9ad08dd36 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbbouvier
bugs1406889
milestone58.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 1406889 - Baldr: fix profiling debug-enabled debug (r=bbouvier) MozReview-Commit-ID: 5aJue8wIjm2
js/src/jit-test/tests/wasm/profiling.js
js/src/wasm/WasmTypes.h
--- a/js/src/jit-test/tests/wasm/profiling.js
+++ b/js/src/jit-test/tests/wasm/profiling.js
@@ -415,8 +415,26 @@ for (let type of ['f32', 'f64']) {
         // and get back to the jit exit.
         "<,2,>",
         // Normal unwinding.
         "2,>", ">", ""]);
 
     disableGeckoProfiling();
     setJitCompilerOption("baseline.warmup.trigger", prevOptions["baseline.warmup.trigger"]);
 })();
+
+// Make sure it's possible to single-step through call through debug-enabled code.
+(function() {
+ enableGeckoProfiling();
+
+ let g = newGlobal('');
+ let dbg = new Debugger(g);
+ dbg.onEnterFrame = () => {};
+ enableSingleStepProfiling();
+ g.eval(`
+    var code = wasmTextToBinary('(module (func (export "run") (result i32) i32.const 42))');
+    var i = new WebAssembly.Instance(new WebAssembly.Module(code));
+    assertEq(i.exports.run(), 42);
+ `);
+
+ disableSingleStepProfiling();
+ disableGeckoProfiling();
+})();
--- a/js/src/wasm/WasmTypes.h
+++ b/js/src/wasm/WasmTypes.h
@@ -1069,26 +1069,29 @@ class CodeRange
         return kind() == ImportJitExit || kind() == ImportInterpExit || kind() == BuiltinThunk;
     }
     bool isImportJitExit() const {
         return kind() == ImportJitExit;
     }
     bool isTrapExit() const {
         return kind() == TrapExit;
     }
+    bool isDebugTrap() const {
+        return kind() == DebugTrap;
+    }
     bool isThunk() const {
         return kind() == FarJumpIsland;
     }
 
     // Function, import exits and trap exits have standard callable prologues
     // and epilogues. Asynchronous frame iteration needs to know the offset of
     // the return instruction to calculate the frame pointer.
 
     bool hasReturn() const {
-        return isFunction() || isImportExit() || isTrapExit();
+        return isFunction() || isImportExit() || isTrapExit() || isDebugTrap();
     }
     uint32_t ret() const {
         MOZ_ASSERT(hasReturn());
         return ret_;
     }
 
     // Functions, export stubs and import stubs all have an associated function
     // index.