Bug 1404714 - inIon() should return false when in wasm. r=nbp, a=test-only on a CLOSED TREE
authorBenjamin Bouvier <benj@benj.me>
Tue, 03 Oct 2017 19:57:05 +0200
changeset 432208 c643949f4241d2b75b2b99ac45ccea361ff16453
parent 432207 c8ec00d6c623850d7c9512b5d23d2aef7961143d
child 432209 ae5156434b2d962eb871c4460502701f67b816a3
push id7905
push userryanvm@gmail.com
push dateThu, 05 Oct 2017 15:54:35 +0000
treeherdermozilla-beta@c643949f4241 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersnbp, test-only
bugs1404714
milestone57.0
Bug 1404714 - inIon() should return false when in wasm. r=nbp, a=test-only on a CLOSED TREE MozReview-Commit-ID: 76qU9UjcROt
js/src/builtin/TestingFunctions.cpp
--- a/js/src/builtin/TestingFunctions.cpp
+++ b/js/src/builtin/TestingFunctions.cpp
@@ -2194,16 +2194,23 @@ testingFunc_inIon(JSContext* cx, unsigne
         JSString* error = JS_NewStringCopyZ(cx, "Ion is disabled.");
         if (!error)
             return false;
 
         args.rval().setString(error);
         return true;
     }
 
+    if (cx->activation()->isWasm()) {
+        // Exited through wasm. Note this is false when the fast wasm->jit exit
+        // was taken, in which case we actually have jit frames on the stack.
+        args.rval().setBoolean(false);
+        return true;
+    }
+
     ScriptFrameIter iter(cx);
     if (!iter.done() && iter.isIon()) {
         // Reset the counter of the IonScript's script.
         jit::JSJitFrameIter jitIter(cx);
         ++jitIter;
         jitIter.script()->resetWarmUpResetCounter();
     } else {
         // Check if we missed multiple attempts at compiling the innermost script.