Bug 880807 - OdinMonkey: Fix signature of int multiplication by constant (r=luke)
authorC. Scott Ananian <cscott@cscott.net>
Fri, 07 Jun 2013 18:33:50 -0400
changeset 134444 4e56548d0b3d75dc443d4d874b65a28a672983ca
parent 134443 4cecde6e32b0b9c1821e07902b9247f15e326f37
child 134445 ff4a92ea700bae40c6619b332d94191b552f9558
push id29216
push userlwagner@mozilla.com
push dateSat, 08 Jun 2013 09:39:31 +0000
treeherdermozilla-inbound@4e56548d0b3d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersluke
bugs880807
milestone24.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 880807 - OdinMonkey: Fix signature of int multiplication by constant (r=luke)
js/src/ion/AsmJS.cpp
js/src/jit-test/tests/asm.js/testExpressions.js
--- a/js/src/ion/AsmJS.cpp
+++ b/js/src/ion/AsmJS.cpp
@@ -3861,17 +3861,17 @@ CheckMultiply(FunctionCompiler &f, Parse
     Type rhsType;
     if (!CheckExpr(f, rhs, Use::ToNumber, &rhsDef, &rhsType))
         return false;
 
     if (lhsType.isInt() && rhsType.isInt()) {
         if (!IsValidIntMultiplyConstant(lhs) && !IsValidIntMultiplyConstant(rhs))
             return f.fail(star, "one arg to int multiply must be a small (-2^20, 2^20) int literal");
         *def = f.mul(lhsDef, rhsDef, MIRType_Int32, MMul::Integer);
-        *type = Type::Signed;
+        *type = Type::Intish;
         return true;
     }
 
     if (!lhsType.isDoublish())
         return f.failf(lhs, "%s is not a subtype of doublish", lhsType.toChars());
     if (!rhsType.isDoublish())
         return f.failf(rhs, "%s is not a subtype of doublish", rhsType.toChars());
 
--- a/js/src/jit-test/tests/asm.js/testExpressions.js
+++ b/js/src/jit-test/tests/asm.js/testExpressions.js
@@ -4,16 +4,18 @@ assertAsmTypeFail(USE_ASM + "function f(
 assertAsmTypeFail(USE_ASM + "function f() { var i=0.0,j=0; return (i+j)|0 } return f");
 assertAsmTypeFail(USE_ASM + "function f() { var i=0,j=0.0; return (i-j)|0 } return f");
 assertAsmTypeFail(USE_ASM + "function f() { var i=0.0,j=0; return (i-j)|0 } return f");
 assertAsmTypeFail(USE_ASM + "function f() { var i=0,j=0.0; return (i*j)|0 } return f");
 assertAsmTypeFail(USE_ASM + "function f() { var i=0.0,j=0; return (i*j)|0 } return f");
 assertAsmTypeFail(USE_ASM + "function f() { var i=0,j=0; return (i*j)|0 } return f");
 assertAsmTypeFail(USE_ASM + "function f() { var i=0; return (i*1048576)|0 } return f");
 assertAsmTypeFail(USE_ASM + "function f() { var i=0; return (i*-1048576)|0 } return f");
+assertAsmTypeFail(USE_ASM + "function f() { var i=0,j=0; return (i + (j*4))|0 } return f");
+assertAsmTypeFail(USE_ASM + "function f() { var two30 = 1073741824; return (((two30 * 524288 * 16) + 1) & 1)|0 } return f");
 assertAsmTypeFail(USE_ASM + "function f() { var i=0,j=0.0; return (i/j)|0 } return f");
 assertAsmTypeFail(USE_ASM + "function f() { var i=0.0,j=0; return (i/j)|0 } return f");
 assertAsmTypeFail(USE_ASM + "function f() { var i=1,j=1; return (i/j)|0 } return f");
 assertAsmTypeFail(USE_ASM + "function f() { var i=0,j=0.0; return (i%j)|0 } return f");
 assertAsmTypeFail(USE_ASM + "function f() { var i=0.0,j=0; return (i%j)|0 } return f");
 assertAsmTypeFail(USE_ASM + "function f() { var i=0.0,j=0; return (i<j)|0 } return f");
 assertAsmTypeFail(USE_ASM + "function f() { var i=0,j=0.0; return (i<j)|0 } return f");
 assertAsmTypeFail(USE_ASM + "function f() { var i=0,j=0; return (i<j)|0 } return f");