Bug 1337060: Release tmp after using it in emitSelect on x86; r=lth
authorBenjamin Bouvier <benj@benj.me>
Tue, 07 Feb 2017 17:00:47 +0100
changeset 341170 0a357a52ffa6b5eed1677fdaf90467b668931d6d
parent 341169 8cf10b012ee2f667abe4b30c0ea91e7f88587cdc
child 341171 565b22cf6c351554a171bde11018bb8605669fd5
push id86646
push userbbouvier@mozilla.com
push dateTue, 07 Feb 2017 16:46:11 +0000
treeherdermozilla-inbound@0a357a52ffa6 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerslth
bugs1337060
milestone54.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 1337060: Release tmp after using it in emitSelect on x86; r=lth MozReview-Commit-ID: CoteqTEylx
js/src/jit-test/tests/wasm/regress/long-select.js
js/src/wasm/WasmBaselineCompile.cpp
--- a/js/src/jit-test/tests/wasm/regress/long-select.js
+++ b/js/src/jit-test/tests/wasm/regress/long-select.js
@@ -19,8 +19,24 @@ wasmFullPassI64(`
 (module
   (func (result i64)
     i64.const 0x2800000033
     i64.const 0x9900000044
     i64.const 0x1000000013
     i64.const 0x1000000012
     i64.lt_s
     select) (export "run" 0))`, createI64("0x9900000044"));
+
+wasmFullPassI64(`
+(module
+    (func (export "run") (result i64) (param f32)
+        i64.const 0x13100000001
+        i64.const 0x23370000002
+        i64.const 0x34480000003
+        i32.const 1
+        select
+        i32.const 1
+        select
+        i64.const 0x45590000004
+        i32.const 1
+        select
+    )
+)`, createI64("0x13100000001"));
--- a/js/src/wasm/WasmBaselineCompile.cpp
+++ b/js/src/wasm/WasmBaselineCompile.cpp
@@ -6428,16 +6428,17 @@ BaseCompiler::emitSelect()
         masm.bind(&done);
 
         Label trueValue;
         RegI64 r0, r1;
         pop2xI64(&r0, &r1);
         masm.branch32(Assembler::Equal, tmp, Imm32(0), &trueValue);
         moveI64(r1, r0);
         masm.bind(&trueValue);
+        freeI32(tmp);
         freeI64(r1);
         pushI64(r0);
 #else
         RegI64 r0, r1;
         pop2xI64(&r0, &r1);
         emitBranchPerform(&b);
         moveI64(r1, r0);
         masm.bind(&done);