Bug 1406897 - Use JitFrameIter::operator++ in OnlyJSJitFrameIter::settle. r=luke, a=ritu
authorBenjamin Bouvier <benj@benj.me>
Wed, 11 Oct 2017 18:27:53 +0200
changeset 432417 fc014302c515e1900b5f6cef82f190e30b3e7534
parent 432416 6fcfa157e5b834d167abaf8c7a695bbf3ed16adf
child 432418 4c2e84704183f3c2c7d8f5d69d20d587ff3fb66c
push id7951
push userryanvm@gmail.com
push dateThu, 12 Oct 2017 01:54:38 +0000
treeherdermozilla-beta@4c2e84704183 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersluke, ritu
bugs1406897
milestone57.0
Bug 1406897 - Use JitFrameIter::operator++ in OnlyJSJitFrameIter::settle. r=luke, a=ritu
js/src/jit-test/tests/wasm/regress/onlyjsiter-while-wasm.js
js/src/vm/Stack.h
new file mode 100644
--- /dev/null
+++ b/js/src/jit-test/tests/wasm/regress/onlyjsiter-while-wasm.js
@@ -0,0 +1,14 @@
+if (typeof evalInCooperativeThread === 'undefined')
+    quit();
+
+try {
+    evalInCooperativeThread(`
+        var { f } = new WebAssembly.Instance(new WebAssembly.Module(wasmTextToBinary(\`
+        (module
+         (func $f (export "f") call $f)
+        )
+        \`))).exports;
+        gczeal(9);
+        f();
+    `);
+} catch(e) {}
--- a/js/src/vm/Stack.h
+++ b/js/src/vm/Stack.h
@@ -1829,17 +1829,17 @@ class JitFrameIter
 
 // A JitFrameIter that skips all the non-JSJit frames, skipping interleaved
 // frames of any another kind.
 
 class OnlyJSJitFrameIter : public JitFrameIter
 {
     void settle() {
         while (!done() && !isJSJit())
-            ++(*this);
+            JitFrameIter::operator++();
     }
 
   public:
     explicit OnlyJSJitFrameIter(Activation* act);
     explicit OnlyJSJitFrameIter(JSContext* cx);
     explicit OnlyJSJitFrameIter(const ActivationIterator& cx);
 
     void operator++() {