Bug 914981: Inline Sqrt even if the input is a Float32; r=mjrosenb
authorBenjamin Bouvier <bbouvier@mozilla.com>
Tue, 10 Sep 2013 22:57:36 -0700
changeset 146871 b04f8cdcd8f430a15b6661b363eaf7948ab83433
parent 146870 f948eaac8cfa508e76828b2a31a497904407a852
child 146872 ecfd306e73fc0f22783cdf8d3f0411984c93b292
push id270
push userpvanderbeken@mozilla.com
push dateThu, 06 Mar 2014 09:24:21 +0000
reviewersmjrosenb
bugs914981
milestone26.0a1
Bug 914981: Inline Sqrt even if the input is a Float32; r=mjrosenb
js/src/jit/MCallOptimize.cpp
--- a/js/src/jit/MCallOptimize.cpp
+++ b/js/src/jit/MCallOptimize.cpp
@@ -618,17 +618,17 @@ IonBuilder::inlineMathSqrt(CallInfo &cal
         return InliningStatus_NotInlined;
 
     if (callInfo.argc() != 1)
         return InliningStatus_NotInlined;
 
     MIRType argType = callInfo.getArg(0)->type();
     if (getInlineReturnType() != MIRType_Double)
         return InliningStatus_NotInlined;
-    if (argType != MIRType_Double && argType != MIRType_Int32)
+    if (!IsNumberType(argType))
         return InliningStatus_NotInlined;
 
     callInfo.unwrapArgs();
 
     MSqrt *sqrt = MSqrt::New(callInfo.getArg(0));
     current->add(sqrt);
     current->push(sqrt);
     return InliningStatus_Inlined;