Bug 1304672: Rename NewAsmJS factory functions into New; r?luke draft
authorBenjamin Bouvier <benj@benj.me>
Wed, 02 Nov 2016 17:09:05 +0100
changeset 432762 09280b420dcd9509d9b4ca1ddde5206d3d589972
parent 432761 e177e93164c346207aa2ebb4dd8215b46f8f166e
child 432763 acfe4bfd5593fa7289583574ac90deba55ac24fe
push id34416
push userbbouvier@mozilla.com
push dateWed, 02 Nov 2016 18:00:01 +0000
reviewersluke
bugs1304672
milestone52.0a1
Bug 1304672: Rename NewAsmJS factory functions into New; r?luke MozReview-Commit-ID: L1Vbl48Idqi
js/src/asmjs/WasmIonCompile.cpp
js/src/jit/AlignmentMaskAnalysis.cpp
js/src/jit/FoldLinearArithConstants.cpp
js/src/jit/IonBuilder.cpp
js/src/jit/MCallOptimize.cpp
js/src/jit/MIR.cpp
js/src/jit/MIR.h
js/src/jsapi-tests/testJitFoldsTo.cpp
js/src/jsapi-tests/testJitRangeAnalysis.cpp
--- a/js/src/asmjs/WasmIonCompile.cpp
+++ b/js/src/asmjs/WasmIonCompile.cpp
@@ -235,26 +235,26 @@ class FunctionCompiler
         curBlock_->add(tlsPointer_);
         if (!mirGen_.ensureBallast())
             return false;
 
         for (size_t i = args.length(); i < locals_.length(); i++) {
             MInstruction* ins = nullptr;
             switch (locals_[i]) {
               case ValType::I32:
-                ins = MConstant::NewAsmJS(alloc(), Int32Value(0), MIRType::Int32);
+                ins = MConstant::New(alloc(), Int32Value(0), MIRType::Int32);
                 break;
               case ValType::I64:
                 ins = MConstant::NewInt64(alloc(), 0);
                 break;
               case ValType::F32:
-                ins = MConstant::NewAsmJS(alloc(), Float32Value(0.f), MIRType::Float32);
+                ins = MConstant::New(alloc(), Float32Value(0.f), MIRType::Float32);
                 break;
               case ValType::F64:
-                ins = MConstant::NewAsmJS(alloc(), DoubleValue(0.0), MIRType::Double);
+                ins = MConstant::New(alloc(), DoubleValue(0.0), MIRType::Double);
                 break;
               case ValType::I8x16:
                 ins = MSimdConstant::New(alloc(), SimdConstant::SplatX16(0), MIRType::Int8x16);
                 break;
               case ValType::I16x8:
                 ins = MSimdConstant::New(alloc(), SimdConstant::SplatX8(0), MIRType::Int16x8);
                 break;
               case ValType::I32x4:
@@ -278,17 +278,17 @@ class FunctionCompiler
             }
 
             curBlock_->add(ins);
             curBlock_->initSlot(info().localSlot(i), ins);
             if (!mirGen_.ensureBallast())
                 return false;
         }
 
-        dummyIns_ = MConstant::NewAsmJS(alloc(), Int32Value(0), MIRType::Int32);
+        dummyIns_ = MConstant::New(alloc(), Int32Value(0), MIRType::Int32);
         curBlock_->add(dummyIns_);
 
         addInterruptCheck();
 
         return true;
     }
 
     void finish()
@@ -333,17 +333,17 @@ class FunctionCompiler
         curBlock_->add(constant);
         return constant;
     }
 
     MDefinition* constant(const Value& v, MIRType type)
     {
         if (inDeadCode())
             return nullptr;
-        MConstant* constant = MConstant::NewAsmJS(alloc(), v, type);
+        MConstant* constant = MConstant::New(alloc(), v, type);
         curBlock_->add(constant);
         return constant;
     }
 
     MDefinition* constant(int64_t i)
     {
         if (inDeadCode())
             return nullptr;
@@ -365,33 +365,32 @@ class FunctionCompiler
     {
         if (inDeadCode())
             return nullptr;
         MConstant* constant = MConstant::New(alloc(), d);
         curBlock_->add(constant);
         return constant;
     }
 
-    // Specialized for MToFloat32
     template <class T>
     MDefinition* unary(MDefinition* op)
     {
         if (inDeadCode())
             return nullptr;
-        T* ins = T::NewAsmJS(alloc(), op);
+        T* ins = T::New(alloc(), op);
         curBlock_->add(ins);
         return ins;
     }
 
     template <class T>
     MDefinition* unary(MDefinition* op, MIRType type)
     {
         if (inDeadCode())
             return nullptr;
-        T* ins = T::NewAsmJS(alloc(), op, type);
+        T* ins = T::New(alloc(), op, type);
         curBlock_->add(ins);
         return ins;
     }
 
     template <class T>
     MDefinition* binary(MDefinition* lhs, MDefinition* rhs)
     {
         if (inDeadCode())
@@ -401,33 +400,33 @@ class FunctionCompiler
         return ins;
     }
 
     template <class T>
     MDefinition* binary(MDefinition* lhs, MDefinition* rhs, MIRType type)
     {
         if (inDeadCode())
             return nullptr;
-        T* ins = T::NewAsmJS(alloc(), lhs, rhs, type);
+        T* ins = T::New(alloc(), lhs, rhs, type);
         curBlock_->add(ins);
         return ins;
     }
 
     bool mustPreserveNaN(MIRType type)
     {
         return IsFloatingPointType(type) && mg().kind == ModuleKind::Wasm;
     }
 
     MDefinition* sub(MDefinition* lhs, MDefinition* rhs, MIRType type)
     {
         if (inDeadCode())
             return nullptr;
 
         // wasm can't fold x - 0.0 because of NaN with custom payloads.
-        MSub* ins = MSub::NewAsmJS(alloc(), lhs, rhs, type, mustPreserveNaN(type));
+        MSub* ins = MSub::New(alloc(), lhs, rhs, type, mustPreserveNaN(type));
         curBlock_->add(ins);
         return ins;
     }
 
     MDefinition* unarySimd(MDefinition* input, MSimdUnaryArith::Operation op, MIRType type)
     {
         if (inDeadCode())
             return nullptr;
@@ -615,53 +614,42 @@ class FunctionCompiler
             return nullptr;
 
         // wasm can't fold x * 1.0 because of NaN with custom payloads.
         auto* ins = MMul::NewWasm(alloc(), lhs, rhs, type, mode, mustPreserveNaN(type));
         curBlock_->add(ins);
         return ins;
     }
 
-    MDefinition* div(MDefinition* lhs, MDefinition* rhs, MIRType type, bool unsignd,
-                     bool trapOnError)
-    {
-        if (inDeadCode())
-            return nullptr;
-        auto* ins = MDiv::NewAsmJS(alloc(), lhs, rhs, type, unsignd, trapOnError, trapOffset(),
-                                   mustPreserveNaN(type));
-        curBlock_->add(ins);
-        return ins;
-    }
-
-    MDefinition* mod(MDefinition* lhs, MDefinition* rhs, MIRType type, bool unsignd,
-                     bool trapOnError)
+    MDefinition* div(MDefinition* lhs, MDefinition* rhs, MIRType type, bool unsignd)
     {
         if (inDeadCode())
             return nullptr;
-        MMod* ins = MMod::NewAsmJS(alloc(), lhs, rhs, type, unsignd, trapOnError, trapOffset());
+        bool trapOnError = !mg().isAsmJS();
+        auto* ins = MDiv::New(alloc(), lhs, rhs, type, unsignd, trapOnError, trapOffset(),
+                              mustPreserveNaN(type));
         curBlock_->add(ins);
         return ins;
     }
 
-    template <class T>
-    MDefinition* bitwise(MDefinition* lhs, MDefinition* rhs, MIRType type)
+    MDefinition* mod(MDefinition* lhs, MDefinition* rhs, MIRType type, bool unsignd)
     {
         if (inDeadCode())
             return nullptr;
-        T* ins = T::NewAsmJS(alloc(), lhs, rhs, type);
+        bool trapOnError = !mg().isAsmJS();
+        auto* ins = MMod::New(alloc(), lhs, rhs, type, unsignd, trapOnError, trapOffset());
         curBlock_->add(ins);
         return ins;
     }
 
-    template <class T>
-    MDefinition* bitwise(MDefinition* op)
+    MDefinition* bitnot(MDefinition* op)
     {
         if (inDeadCode())
             return nullptr;
-        T* ins = T::NewAsmJS(alloc(), op);
+        auto* ins = MBitNot::NewInt32(alloc(), op);
         curBlock_->add(ins);
         return ins;
     }
 
     MDefinition* select(MDefinition* trueExpr, MDefinition* falseExpr, MDefinition* condExpr)
     {
         if (inDeadCode())
             return nullptr;
@@ -669,64 +657,54 @@ class FunctionCompiler
         curBlock_->add(ins);
         return ins;
     }
 
     MDefinition* extendI32(MDefinition* op, bool isUnsigned)
     {
         if (inDeadCode())
             return nullptr;
-        MExtendInt32ToInt64* ins = MExtendInt32ToInt64::NewAsmJS(alloc(), op, isUnsigned);
+        auto* ins = MExtendInt32ToInt64::New(alloc(), op, isUnsigned);
         curBlock_->add(ins);
         return ins;
     }
 
     MDefinition* convertI64ToFloatingPoint(MDefinition* op, MIRType type, bool isUnsigned)
     {
         if (inDeadCode())
             return nullptr;
-        MInt64ToFloatingPoint* ins = MInt64ToFloatingPoint::NewAsmJS(alloc(), op, type, isUnsigned);
+        auto* ins = MInt64ToFloatingPoint::New(alloc(), op, type, isUnsigned);
         curBlock_->add(ins);
         return ins;
     }
 
     MDefinition* rotate(MDefinition* input, MDefinition* count, MIRType type, bool left)
     {
         if (inDeadCode())
             return nullptr;
-        auto* ins = MRotate::NewAsmJS(alloc(), input, count, type, left);
-        curBlock_->add(ins);
-        return ins;
-    }
-
-    template <class T>
-    MDefinition* asmJSTruncate(MDefinition* op, bool isUnsigned)
-    {
-        if (inDeadCode())
-            return nullptr;
-        T* ins = T::NewAsmJS(alloc(), op, isUnsigned);
+        auto* ins = MRotate::New(alloc(), input, count, type, left);
         curBlock_->add(ins);
         return ins;
     }
 
     template <class T>
     MDefinition* truncate(MDefinition* op, bool isUnsigned)
     {
         if (inDeadCode())
             return nullptr;
-        T* ins = T::NewAsmJS(alloc(), op, isUnsigned, trapOffset());
+        auto* ins = T::New(alloc(), op, isUnsigned, trapOffset());
         curBlock_->add(ins);
         return ins;
     }
 
     MDefinition* compare(MDefinition* lhs, MDefinition* rhs, JSOp op, MCompare::CompareType type)
     {
         if (inDeadCode())
             return nullptr;
-        MCompare* ins = MCompare::NewAsmJS(alloc(), lhs, rhs, op, type);
+        auto* ins = MCompare::New(alloc(), lhs, rhs, op, type);
         curBlock_->add(ins);
         return ins;
     }
 
     void assign(unsigned slot, MDefinition* def)
     {
         if (inDeadCode())
             return;
@@ -913,19 +891,19 @@ class FunctionCompiler
     {
         if (inDeadCode())
             return true;
 
         ABIArg arg = call->abi_.next(ToMIRType(type));
         switch (arg.kind()) {
 #ifdef JS_CODEGEN_REGISTER_PAIR
           case ABIArg::GPR_PAIR: {
-            auto mirLow = MWrapInt64ToInt32::NewAsmJS(alloc(), argDef, /* bottomHalf = */ true);
+            auto mirLow = MWrapInt64ToInt32::New(alloc(), argDef, /* bottomHalf = */ true);
             curBlock_->add(mirLow);
-            auto mirHigh = MWrapInt64ToInt32::NewAsmJS(alloc(), argDef, /* bottomHalf = */ false);
+            auto mirHigh = MWrapInt64ToInt32::New(alloc(), argDef, /* bottomHalf = */ false);
             curBlock_->add(mirHigh);
             return call->regArgs_.append(MWasmCall::Arg(AnyRegister(arg.gpr64().low), mirLow)) &&
                    call->regArgs_.append(MWasmCall::Arg(AnyRegister(arg.gpr64().high), mirHigh));
           }
 #endif
           case ABIArg::GPR:
           case ABIArg::FPU:
             return call->regArgs_.append(MWasmCall::Arg(arg.reg(), argDef));
@@ -1036,17 +1014,17 @@ class FunctionCompiler
             MOZ_ASSERT(sig.id.kind() == SigIdDesc::Kind::None);
             const TableDesc& table = mg_.tables[mg_.asmJSSigToTableIndex[sigIndex]];
             MOZ_ASSERT(IsPowerOfTwo(table.limits.initial));
             MOZ_ASSERT(!table.external);
             MOZ_ASSERT(call.tlsStackOffset_ == MWasmCall::DontSaveTls);
 
             MConstant* mask = MConstant::New(alloc(), Int32Value(table.limits.initial - 1));
             curBlock_->add(mask);
-            MBitAnd* maskedIndex = MBitAnd::NewAsmJS(alloc(), index, mask, MIRType::Int32);
+            MBitAnd* maskedIndex = MBitAnd::New(alloc(), index, mask, MIRType::Int32);
             curBlock_->add(maskedIndex);
 
             index = maskedIndex;
             callee = CalleeDesc::asmJSTable(table);
         } else {
             MOZ_ASSERT(sig.id.kind() != SigIdDesc::Kind::None);
             MOZ_ASSERT(mg_.tables.length() == 1);
             const TableDesc& table = mg_.tables[0];
@@ -1483,17 +1461,17 @@ class FunctionCompiler
         return blockPatches_[absolute].append(ControlFlowPatch(ins, index));
     }
 
     bool br(uint32_t relativeDepth, MDefinition* maybeValue)
     {
         if (inDeadCode())
             return true;
 
-        MGoto* jump = MGoto::NewAsm(alloc());
+        MGoto* jump = MGoto::New(alloc());
         if (!addControlFlowPatch(jump, relativeDepth, MGoto::TargetIndex))
             return false;
 
         pushDef(maybeValue);
 
         curBlock_->end(jump);
         curBlock_ = nullptr;
         return true;
@@ -1503,17 +1481,17 @@ class FunctionCompiler
     {
         if (inDeadCode())
             return true;
 
         MBasicBlock* joinBlock = nullptr;
         if (!newBlock(curBlock_, &joinBlock))
             return false;
 
-        MTest* test = MTest::NewAsm(alloc(), condition, joinBlock);
+        MTest* test = MTest::New(alloc(), condition, joinBlock);
         if (!addControlFlowPatch(test, relativeDepth, MTest::TrueBranchIndex))
             return false;
 
         pushDef(maybeValue);
 
         curBlock_->end(test);
         curBlock_ = joinBlock;
         return true;
@@ -1665,17 +1643,37 @@ class FunctionCompiler
     }
 };
 
 template <>
 MDefinition* FunctionCompiler::unary<MToFloat32>(MDefinition* op)
 {
     if (inDeadCode())
         return nullptr;
-    auto* ins = MToFloat32::NewAsmJS(alloc(), op, mustPreserveNaN(op->type()));
+    auto* ins = MToFloat32::New(alloc(), op, mustPreserveNaN(op->type()));
+    curBlock_->add(ins);
+    return ins;
+}
+
+template <>
+MDefinition* FunctionCompiler::unary<MNot>(MDefinition* op)
+{
+    if (inDeadCode())
+        return nullptr;
+    auto* ins = MNot::NewInt32(alloc(), op);
+    curBlock_->add(ins);
+    return ins;
+}
+
+template <>
+MDefinition* FunctionCompiler::unary<MAbs>(MDefinition* op, MIRType type)
+{
+    if (inDeadCode())
+        return nullptr;
+    auto* ins = MAbs::NewWasm(alloc(), op, type);
     curBlock_->add(ins);
     return ins;
 }
 
 } // end anonymous namespace
 
 static bool
 EmitBlock(FunctionCompiler& f)
@@ -2197,17 +2195,17 @@ EmitTruncate(FunctionCompiler& f, ValTyp
              bool isUnsigned)
 {
     MDefinition* input;
     if (!f.iter().readConversion(operandType, resultType, &input))
         return false;
 
     if (resultType == ValType::I32) {
         if (f.mg().isAsmJS())
-            f.iter().setResult(f.asmJSTruncate<MTruncateToInt32>(input, isUnsigned));
+            f.iter().setResult(f.unary<MTruncateToInt32>(input));
         else
             f.iter().setResult(f.truncate<MWasmTruncateToInt32>(input, isUnsigned));
     } else {
         MOZ_ASSERT(resultType == ValType::I64);
         MOZ_ASSERT(!f.mg().isAsmJS());
         f.iter().setResult(f.truncate<MWasmTruncateToInt64>(input, isUnsigned));
     }
     return true;
@@ -2279,38 +2277,37 @@ EmitRotate(FunctionCompiler& f, ValType 
     if (!f.iter().readBinary(type, &lhs, &rhs))
         return false;
 
     MDefinition* result = f.rotate(lhs, rhs, ToMIRType(type), isLeftRotation);
     f.iter().setResult(result);
     return true;
 }
 
-template <typename MIRClass>
 static bool
-EmitBitwise(FunctionCompiler& f, ValType operandType)
+EmitBitNot(FunctionCompiler& f, ValType operandType)
 {
     MDefinition* input;
     if (!f.iter().readUnary(operandType, &input))
         return false;
 
-    f.iter().setResult(f.bitwise<MIRClass>(input));
+    f.iter().setResult(f.bitnot(input));
     return true;
 }
 
 template <typename MIRClass>
 static bool
 EmitBitwise(FunctionCompiler& f, ValType operandType, MIRType mirType)
 {
     MDefinition* lhs;
     MDefinition* rhs;
     if (!f.iter().readBinary(operandType, &lhs, &rhs))
         return false;
 
-    f.iter().setResult(f.bitwise<MIRClass>(lhs, rhs, mirType));
+    f.iter().setResult(f.binary<MIRClass>(lhs, rhs, mirType));
     return true;
 }
 
 static bool
 EmitMul(FunctionCompiler& f, ValType operandType, MIRType mirType)
 {
     MDefinition* lhs;
     MDefinition* rhs;
@@ -2325,31 +2322,29 @@ EmitMul(FunctionCompiler& f, ValType ope
 static bool
 EmitDiv(FunctionCompiler& f, ValType operandType, MIRType mirType, bool isUnsigned)
 {
     MDefinition* lhs;
     MDefinition* rhs;
     if (!f.iter().readBinary(operandType, &lhs, &rhs))
         return false;
 
-    bool trapOnError = !f.mg().isAsmJS();
-    f.iter().setResult(f.div(lhs, rhs, mirType, isUnsigned, trapOnError));
+    f.iter().setResult(f.div(lhs, rhs, mirType, isUnsigned));
     return true;
 }
 
 static bool
 EmitRem(FunctionCompiler& f, ValType operandType, MIRType mirType, bool isUnsigned)
 {
     MDefinition* lhs;
     MDefinition* rhs;
     if (!f.iter().readBinary(operandType, &lhs, &rhs))
         return false;
 
-    bool trapOnError = !f.mg().isAsmJS();
-    f.iter().setResult(f.mod(lhs, rhs, mirType, isUnsigned, trapOnError));
+    f.iter().setResult(f.mod(lhs, rhs, mirType, isUnsigned));
     return true;
 }
 
 static bool
 EmitMinMax(FunctionCompiler& f, ValType operandType, MIRType mirType, bool isMax)
 {
     MDefinition* lhs;
     MDefinition* rhs;
@@ -3240,21 +3235,21 @@ EmitExpr(FunctionCompiler& f)
       case Expr::I32TruncSF64:
       case Expr::I32TruncUF64:
         return EmitTruncate(f, ValType::F64, ValType::I32, expr == Expr::I32TruncUF64);
       case Expr::I32WrapI64:
         return EmitConversion<MWrapInt64ToInt32>(f, ValType::I64, ValType::I32);
       case Expr::I32ReinterpretF32:
         return EmitReinterpret(f, ValType::I32, ValType::F32, MIRType::Int32);
       case Expr::I32Clz:
-        return EmitUnary<MClz>(f, ValType::I32);
+        return EmitUnaryWithType<MClz>(f, ValType::I32, MIRType::Int32);
       case Expr::I32Ctz:
-        return EmitUnary<MCtz>(f, ValType::I32);
+        return EmitUnaryWithType<MCtz>(f, ValType::I32, MIRType::Int32);
       case Expr::I32Popcnt:
-        return EmitUnary<MPopcnt>(f, ValType::I32);
+        return EmitUnaryWithType<MPopcnt>(f, ValType::I32, MIRType::Int32);
       case Expr::I32Abs:
         return EmitUnaryWithType<MAbs>(f, ValType::I32, MIRType::Int32);
       case Expr::I32Neg:
         return EmitUnaryWithType<MAsmJSNeg>(f, ValType::I32, MIRType::Int32);
       case Expr::I32Or:
         return EmitBitwise<MBitOr>(f, ValType::I32, MIRType::Int32);
       case Expr::I32And:
         return EmitBitwise<MBitAnd>(f, ValType::I32, MIRType::Int32);
@@ -3262,17 +3257,17 @@ EmitExpr(FunctionCompiler& f)
         return EmitBitwise<MBitXor>(f, ValType::I32, MIRType::Int32);
       case Expr::I32Shl:
         return EmitBitwise<MLsh>(f, ValType::I32, MIRType::Int32);
       case Expr::I32ShrS:
         return EmitBitwise<MRsh>(f, ValType::I32, MIRType::Int32);
       case Expr::I32ShrU:
         return EmitBitwise<MUrsh>(f, ValType::I32, MIRType::Int32);
       case Expr::I32BitNot:
-        return EmitBitwise<MBitNot>(f, ValType::I32);
+        return EmitBitNot(f, ValType::I32);
       case Expr::I32Load8S:
         return EmitLoad(f, ValType::I32, Scalar::Int8);
       case Expr::I32Load8U:
         return EmitLoad(f, ValType::I32, Scalar::Uint8);
       case Expr::I32Load16S:
         return EmitLoad(f, ValType::I32, Scalar::Int16);
       case Expr::I32Load16U:
         return EmitLoad(f, ValType::I32, Scalar::Uint16);
@@ -3339,21 +3334,21 @@ EmitExpr(FunctionCompiler& f)
       case Expr::I64ShrU:
         return EmitBitwise<MUrsh>(f, ValType::I64, MIRType::Int64);
       case Expr::I64Rotr:
       case Expr::I64Rotl:
         return EmitRotate(f, ValType::I64, expr == Expr::I64Rotl);
       case Expr::I64Eqz:
         return EmitConversion<MNot>(f, ValType::I64, ValType::I32);
       case Expr::I64Clz:
-        return EmitUnary<MClz>(f, ValType::I64);
+        return EmitUnaryWithType<MClz>(f, ValType::I64, MIRType::Int64);
       case Expr::I64Ctz:
-        return EmitUnary<MCtz>(f, ValType::I64);
+        return EmitUnaryWithType<MCtz>(f, ValType::I64, MIRType::Int64);
       case Expr::I64Popcnt:
-        return EmitUnary<MPopcnt>(f, ValType::I64);
+        return EmitUnaryWithType<MPopcnt>(f, ValType::I64, MIRType::Int64);
       case Expr::I64Load8S:
         return EmitLoad(f, ValType::I64, Scalar::Int8);
       case Expr::I64Load8U:
         return EmitLoad(f, ValType::I64, Scalar::Uint8);
       case Expr::I64Load16S:
         return EmitLoad(f, ValType::I64, Scalar::Int16);
       case Expr::I64Load16U:
         return EmitLoad(f, ValType::I64, Scalar::Uint16);
--- a/js/src/jit/AlignmentMaskAnalysis.cpp
+++ b/js/src/jit/AlignmentMaskAnalysis.cpp
@@ -31,17 +31,17 @@ AnalyzeAsmHeapAddress(MDefinition* ptr, 
     //   a&m
     //   (a&m)+1
     //   (a&m)+2
     // and it will allow the constants to be folded by the
     // EffectiveAddressAnalysis pass.
     //
     // Putting the add on the outside might seem like it exposes other users of
     // the expression to the possibility of i32 overflow, if we aren't in asm.js
-    // and they aren't naturally truncating. However, since we use MAdd::NewAsmJS
+    // and they aren't naturally truncating. However, since we use MAdd::New
     // with MIRType::Int32, we make sure that the value is truncated, just as it
     // would be by the MBitAnd.
 
     MOZ_ASSERT(IsCompilingAsmJS());
 
     if (!ptr->isBitAnd())
         return;
 
@@ -60,19 +60,19 @@ AnalyzeAsmHeapAddress(MDefinition* ptr, 
         return;
 
     uint32_t i = op1->toConstant()->toInt32();
     uint32_t m = rhs->toConstant()->toInt32();
     if (!IsAlignmentMask(m) || (i & m) != i)
         return;
 
     // The pattern was matched! Produce the replacement expression.
-    MInstruction* and_ = MBitAnd::NewAsmJS(graph.alloc(), op0, rhs, MIRType::Int32);
+    MInstruction* and_ = MBitAnd::New(graph.alloc(), op0, rhs, MIRType::Int32);
     ptr->block()->insertBefore(ptr->toBitAnd(), and_);
-    MInstruction* add = MAdd::NewAsmJS(graph.alloc(), and_, op1, MIRType::Int32);
+    MInstruction* add = MAdd::New(graph.alloc(), and_, op1, MIRType::Int32);
     ptr->block()->insertBefore(ptr->toBitAnd(), add);
     ptr->replaceAllUsesWith(add);
     ptr->block()->discard(ptr->toBitAnd());
 }
 
 bool
 AlignmentMaskAnalysis::analyze()
 {
--- a/js/src/jit/FoldLinearArithConstants.cpp
+++ b/js/src/jit/FoldLinearArithConstants.cpp
@@ -62,17 +62,17 @@ AnalyzeAdd(TempAllocator& alloc, MAdd* a
         {
             return;
         }
     }
 
     MInstruction* rhs = MConstant::New(alloc, Int32Value(sum.constant));
     add->block()->insertBefore(add, rhs);
 
-    MAdd* addNew = MAdd::NewAsmJS(alloc, sum.term, rhs, MIRType::Int32);
+    MAdd* addNew = MAdd::New(alloc, sum.term, rhs, MIRType::Int32);
 
     add->replaceAllLiveUsesWith(addNew);
     add->block()->insertBefore(add, addNew);
     JitSpew(JitSpew_FLAC, "replaced with: %s%u", addNew->opName(), addNew->id());
     JitSpew(JitSpew_FLAC, "and constant: %s%u (%d)", rhs->opName(), rhs->id(), sum.constant);
 
     // Mark the stale nodes as RecoveredOnBailout since the Sink pass has
     // been run before this pass. DCE will then remove the unused nodes.
--- a/js/src/jit/IonBuilder.cpp
+++ b/js/src/jit/IonBuilder.cpp
@@ -14355,18 +14355,18 @@ IonBuilder::loadTypedObjectElements(MDef
     // the terms in this lienar sum due to alignment restrictions, but due to
     // limitations of ExtractLinearSum when applied to the terms in derived
     // typed objects this isn't always be possible. In these cases, fall back
     // on an explicit division operation.
     if (ownerByteOffset.divide(scale)) {
         *ownerScaledOffset = ConvertLinearSum(alloc(), current, ownerByteOffset);
     } else {
         MDefinition* unscaledOffset = ConvertLinearSum(alloc(), current, ownerByteOffset);
-        *ownerScaledOffset = MDiv::NewAsmJS(alloc(), unscaledOffset, constantInt(scale),
-                                            MIRType::Int32, /* unsigned = */ false);
+        *ownerScaledOffset = MDiv::New(alloc(), unscaledOffset, constantInt(scale),
+                                       MIRType::Int32, /* unsigned = */ false);
         current->add((*ownerScaledOffset)->toInstruction());
     }
 }
 
 // Looks up the offset/type-repr-set of the field `id`, given the type
 // set `objTypes` of the field owner. If a field is found, returns true
 // and sets *fieldOffset, *fieldPrediction, and *fieldIndex. Returns false
 // otherwise. Infallible.
--- a/js/src/jit/MCallOptimize.cpp
+++ b/js/src/jit/MCallOptimize.cpp
@@ -1055,17 +1055,17 @@ IonBuilder::inlineMathClz32(CallInfo& ca
     if (returnType != MIRType::Int32)
         return InliningStatus_NotInlined;
 
     if (!IsNumberType(callInfo.getArg(0)->type()))
         return InliningStatus_NotInlined;
 
     callInfo.setImplicitlyUsedUnchecked();
 
-    MClz* ins = MClz::New(alloc(), callInfo.getArg(0));
+    MClz* ins = MClz::New(alloc(), callInfo.getArg(0), MIRType::Int32);
     current->add(ins);
     current->push(ins);
     return InliningStatus_Inlined;
 
 }
 
 IonBuilder::InliningStatus
 IonBuilder::inlineMathRound(CallInfo& callInfo)
@@ -1122,17 +1122,17 @@ IonBuilder::inlineMathSqrt(CallInfo& cal
     MIRType argType = callInfo.getArg(0)->type();
     if (getInlineReturnType() != MIRType::Double)
         return InliningStatus_NotInlined;
     if (!IsNumberType(argType))
         return InliningStatus_NotInlined;
 
     callInfo.setImplicitlyUsedUnchecked();
 
-    MSqrt* sqrt = MSqrt::New(alloc(), callInfo.getArg(0));
+    MSqrt* sqrt = MSqrt::New(alloc(), callInfo.getArg(0), MIRType::Double);
     current->add(sqrt);
     current->push(sqrt);
     return InliningStatus_Inlined;
 }
 
 IonBuilder::InliningStatus
 IonBuilder::inlineMathAtan2(CallInfo& callInfo)
 {
--- a/js/src/jit/MIR.cpp
+++ b/js/src/jit/MIR.cpp
@@ -420,22 +420,16 @@ AliasSet::Name(size_t flag)
       case 7: return "AsmJSGlobalVar";
       case 8: return "AsmJSHeap";
       case 9: return "TypedArrayLength";
       default:
         MOZ_CRASH("Unknown flag");
     }
 }
 
-MTest*
-MTest::NewAsm(TempAllocator& alloc, MDefinition* ins, MBasicBlock* ifFalse)
-{
-    return new(alloc) MTest(ins, nullptr, ifFalse);
-}
-
 void
 MTest::cacheOperandMightEmulateUndefined(CompilerConstraintList* constraints)
 {
     MOZ_ASSERT(operandMightEmulateUndefined());
 
     if (!getOperand(0)->maybeEmulatesUndefined(constraints))
         markNoOperandEmulatesUndefined();
 }
@@ -843,17 +837,17 @@ MConstant::New(TempAllocator& alloc, was
 
 MConstant*
 MConstant::NewInt64(TempAllocator& alloc, int64_t i)
 {
     return new(alloc) MConstant(i);
 }
 
 MConstant*
-MConstant::NewAsmJS(TempAllocator& alloc, const Value& v, MIRType type)
+MConstant::New(TempAllocator& alloc, const Value& v, MIRType type)
 {
     if (type == MIRType::Float32)
         return NewFloat32(alloc, v.toNumber());
     MConstant* res = New(alloc, v);
     MOZ_ASSERT(res->type() == type);
     return res;
 }
 
@@ -2161,30 +2155,16 @@ MCeil::trySpecializeFloat32(TempAllocato
 void
 MRound::trySpecializeFloat32(TempAllocator& alloc)
 {
     MOZ_ASSERT(type() == MIRType::Int32);
     if (EnsureFloatInputOrConvert(this, alloc))
         specialization_ = MIRType::Float32;
 }
 
-MCompare*
-MCompare::NewAsmJS(TempAllocator& alloc, MDefinition* left, MDefinition* right, JSOp op,
-                   CompareType compareType)
-{
-    MOZ_ASSERT(compareType == Compare_Int32 || compareType == Compare_UInt32 ||
-               compareType == Compare_Int64 || compareType == Compare_UInt64 ||
-               compareType == Compare_Double || compareType == Compare_Float32);
-    MCompare* comp = new(alloc) MCompare(left, right, op);
-    comp->compareType_ = compareType;
-    comp->operandMightEmulateUndefined_ = false;
-    comp->setResultType(MIRType::Int32);
-    return comp;
-}
-
 MTableSwitch*
 MTableSwitch::New(TempAllocator& alloc, MDefinition* ins, int32_t low, int32_t high)
 {
     return new(alloc) MTableSwitch(alloc, ins, low, high);
 }
 
 MGoto*
 MGoto::New(TempAllocator& alloc, MBasicBlock* target)
@@ -2196,17 +2176,17 @@ MGoto::New(TempAllocator& alloc, MBasicB
 MGoto*
 MGoto::New(TempAllocator::Fallible alloc, MBasicBlock* target)
 {
     MOZ_ASSERT(target);
     return new(alloc) MGoto(target);
 }
 
 MGoto*
-MGoto::NewAsm(TempAllocator& alloc)
+MGoto::New(TempAllocator& alloc)
 {
     return new(alloc) MGoto(nullptr);
 }
 
 void
 MUnbox::printOpcode(GenericPrinter& out) const
 {
     PrintOpcodeName(out, op());
@@ -3787,17 +3767,17 @@ MCompare::cacheOperandMightEmulateUndefi
         return;
     if (getOperand(1)->maybeEmulatesUndefined(constraints))
         return;
 
     markNoOperandEmulatesUndefined();
 }
 
 MBitNot*
-MBitNot::NewAsmJS(TempAllocator& alloc, MDefinition* input)
+MBitNot::NewInt32(TempAllocator& alloc, MDefinition* input)
 {
     MBitNot* ins = new(alloc) MBitNot(input);
     ins->specialization_ = MIRType::Int32;
     MOZ_ASSERT(ins->type() == MIRType::Int32);
     return ins;
 }
 
 MDefinition*
@@ -3877,87 +3857,87 @@ MTypeOf::cacheInputMaybeCallableOrEmulat
 
 MBitAnd*
 MBitAnd::New(TempAllocator& alloc, MDefinition* left, MDefinition* right)
 {
     return new(alloc) MBitAnd(left, right, MIRType::Int32);
 }
 
 MBitAnd*
-MBitAnd::NewAsmJS(TempAllocator& alloc, MDefinition* left, MDefinition* right, MIRType type)
+MBitAnd::New(TempAllocator& alloc, MDefinition* left, MDefinition* right, MIRType type)
 {
     MBitAnd* ins = new(alloc) MBitAnd(left, right, type);
     ins->specializeAs(type);
     return ins;
 }
 
 MBitOr*
 MBitOr::New(TempAllocator& alloc, MDefinition* left, MDefinition* right)
 {
     return new(alloc) MBitOr(left, right, MIRType::Int32);
 }
 
 MBitOr*
-MBitOr::NewAsmJS(TempAllocator& alloc, MDefinition* left, MDefinition* right, MIRType type)
+MBitOr::New(TempAllocator& alloc, MDefinition* left, MDefinition* right, MIRType type)
 {
     MBitOr* ins = new(alloc) MBitOr(left, right, type);
     ins->specializeAs(type);
     return ins;
 }
 
 MBitXor*
 MBitXor::New(TempAllocator& alloc, MDefinition* left, MDefinition* right)
 {
     return new(alloc) MBitXor(left, right, MIRType::Int32);
 }
 
 MBitXor*
-MBitXor::NewAsmJS(TempAllocator& alloc, MDefinition* left, MDefinition* right, MIRType type)
+MBitXor::New(TempAllocator& alloc, MDefinition* left, MDefinition* right, MIRType type)
 {
     MBitXor* ins = new(alloc) MBitXor(left, right, type);
     ins->specializeAs(type);
     return ins;
 }
 
 MLsh*
 MLsh::New(TempAllocator& alloc, MDefinition* left, MDefinition* right)
 {
     return new(alloc) MLsh(left, right, MIRType::Int32);
 }
 
 MLsh*
-MLsh::NewAsmJS(TempAllocator& alloc, MDefinition* left, MDefinition* right, MIRType type)
+MLsh::New(TempAllocator& alloc, MDefinition* left, MDefinition* right, MIRType type)
 {
     MLsh* ins = new(alloc) MLsh(left, right, type);
     ins->specializeAs(type);
     return ins;
 }
 
 MRsh*
 MRsh::New(TempAllocator& alloc, MDefinition* left, MDefinition* right)
 {
     return new(alloc) MRsh(left, right, MIRType::Int32);
 }
 
 MRsh*
-MRsh::NewAsmJS(TempAllocator& alloc, MDefinition* left, MDefinition* right, MIRType type)
+MRsh::New(TempAllocator& alloc, MDefinition* left, MDefinition* right, MIRType type)
 {
     MRsh* ins = new(alloc) MRsh(left, right, type);
     ins->specializeAs(type);
     return ins;
 }
 
 MUrsh*
 MUrsh::New(TempAllocator& alloc, MDefinition* left, MDefinition* right)
 {
     return new(alloc) MUrsh(left, right, MIRType::Int32);
 }
 
 MUrsh*
-MUrsh::NewAsmJS(TempAllocator& alloc, MDefinition* left, MDefinition* right, MIRType type)
+MUrsh::New(TempAllocator& alloc, MDefinition* left, MDefinition* right, MIRType type)
 {
     MUrsh* ins = new(alloc) MUrsh(left, right, type);
     ins->specializeAs(type);
 
     // Since Ion has no UInt32 type, we use Int32 and we have a special
     // exception to the type rules: we can return values in
     // (INT32_MIN,UINT32_MAX] and still claim that we have an Int32 type
     // without bailing out. This is necessary because Ion has no UInt32
@@ -5606,17 +5586,17 @@ MWasmUnsignedToDouble::foldsTo(TempAlloc
 }
 
 MDefinition*
 MWasmUnsignedToFloat32::foldsTo(TempAllocator& alloc)
 {
     if (input()->isConstant() && input()->type() == MIRType::Int32) {
         double dval = double(uint32_t(input()->toConstant()->toInt32()));
         if (IsFloat32Representable(dval))
-            return MConstant::NewAsmJS(alloc, JS::Float32Value(float(dval)), MIRType::Float32);
+            return MConstant::New(alloc, JS::Float32Value(float(dval)), MIRType::Float32);
     }
 
     return this;
 }
 
 MWasmCall*
 MWasmCall::New(TempAllocator& alloc, const wasm::CallSiteDesc& desc, const wasm::CalleeDesc& callee,
                const Args& args, MIRType resultType, uint32_t spIncrement, uint32_t tlsStackOffset,
--- a/js/src/jit/MIR.h
+++ b/js/src/jit/MIR.h
@@ -1574,21 +1574,21 @@ class MConstant : public MNullaryInstruc
     explicit MConstant(int64_t i);
 
   public:
     INSTRUCTION_HEADER(Constant)
     static MConstant* New(TempAllocator& alloc, const Value& v,
                           CompilerConstraintList* constraints = nullptr);
     static MConstant* New(TempAllocator::Fallible alloc, const Value& v,
                           CompilerConstraintList* constraints = nullptr);
+    static MConstant* New(TempAllocator& alloc, const Value& v, MIRType type);
     static MConstant* New(TempAllocator& alloc, wasm::RawF32 bits);
     static MConstant* New(TempAllocator& alloc, wasm::RawF64 bits);
     static MConstant* NewFloat32(TempAllocator& alloc, double d);
     static MConstant* NewInt64(TempAllocator& alloc, int64_t i);
-    static MConstant* NewAsmJS(TempAllocator& alloc, const Value& v, MIRType type);
     static MConstant* NewConstraintlessObject(TempAllocator& alloc, JSObject* v);
     static MConstant* Copy(TempAllocator& alloc, MConstant* src) {
         return new(alloc) MConstant(*src);
     }
 
     // Try to convert this constant to boolean, similar to js::ToBoolean.
     // Returns false if the type is MIRType::Magic*.
     bool MOZ_MUST_USE valueToBoolean(bool* res) const;
@@ -3030,18 +3030,18 @@ class MGoto
         setSuccessor(0, target);
     }
 
   public:
     INSTRUCTION_HEADER(Goto)
     static MGoto* New(TempAllocator& alloc, MBasicBlock* target);
     static MGoto* New(TempAllocator::Fallible alloc, MBasicBlock* target);
 
-    // Factory for asm, which may patch the target later.
-    static MGoto* NewAsm(TempAllocator& alloc);
+    // Variant that may patch the target later.
+    static MGoto* New(TempAllocator& alloc);
 
     static const size_t TargetIndex = 0;
 
     MBasicBlock* target() {
         return getSuccessor(0);
     }
     AliasSet getAliasSet() const override {
         return AliasSet::None();
@@ -3070,24 +3070,26 @@ class MTest
     MTest(MDefinition* ins, MBasicBlock* trueBranch, MBasicBlock* falseBranch)
       : operandMightEmulateUndefined_(true)
     {
         initOperand(0, ins);
         setSuccessor(0, trueBranch);
         setSuccessor(1, falseBranch);
     }
 
+    // Variant which may patch the ifTrue branch later.
+    MTest(MDefinition* ins, MBasicBlock* falseBranch)
+      : MTest(ins, nullptr, falseBranch)
+    {}
+
   public:
     INSTRUCTION_HEADER(Test)
     TRIVIAL_NEW_WRAPPERS
     NAMED_OPERANDS((0, input))
 
-    // Factory for asm, which may patch the ifTrue branch later.
-    static MTest* NewAsm(TempAllocator& alloc, MDefinition* ins, MBasicBlock* ifFalse);
-
     static const size_t TrueBranchIndex = 0;
 
     MBasicBlock* ifTrue() const {
         return getSuccessor(0);
     }
     MBasicBlock* ifFalse() const {
         return getSuccessor(1);
     }
@@ -4572,21 +4574,30 @@ class MCompare
         operandMightEmulateUndefined_(true),
         operandsAreNeverNaN_(false),
         truncateOperands_(false)
     {
         setResultType(MIRType::Boolean);
         setMovable();
     }
 
+    MCompare(MDefinition* left, MDefinition* right, JSOp jsop, CompareType compareType)
+      : MCompare(left, right, jsop)
+    {
+        MOZ_ASSERT(compareType == Compare_Int32 || compareType == Compare_UInt32 ||
+                   compareType == Compare_Int64 || compareType == Compare_UInt64 ||
+                   compareType == Compare_Double || compareType == Compare_Float32);
+        compareType_ = compareType;
+        operandMightEmulateUndefined_ = false;
+        setResultType(MIRType::Int32);
+    }
+
   public:
     INSTRUCTION_HEADER(Compare)
     TRIVIAL_NEW_WRAPPERS
-    static MCompare* NewAsmJS(TempAllocator& alloc, MDefinition* left, MDefinition* right, JSOp op,
-                              CompareType compareType);
 
     MOZ_MUST_USE bool tryFold(bool* result);
     MOZ_MUST_USE bool evaluateConstantOperands(TempAllocator& alloc, bool* result);
     MDefinition* foldsTo(TempAllocator& alloc) override;
     void filtersUndefinedOrNull(bool trueBranch, MDefinition** subject, bool* filtersUndefined,
                                 bool* filtersNull);
 
     CompareType compareType() const {
@@ -5200,20 +5211,16 @@ class MToDouble
         if (def->mightBeType(MIRType::Object) || def->mightBeType(MIRType::Symbol))
             setGuard();
     }
 
   public:
     INSTRUCTION_HEADER(ToDouble)
     TRIVIAL_NEW_WRAPPERS
 
-    static MToDouble* NewAsmJS(TempAllocator& alloc, MDefinition* def) {
-        return new(alloc) MToDouble(def);
-    }
-
     MDefinition* foldsTo(TempAllocator& alloc) override;
     bool congruentTo(const MDefinition* ins) const override {
         if (!ins->isToDouble() || ins->toToDouble()->conversion() != conversion())
             return false;
         return congruentIfOperandsEqual(ins);
     }
     AliasSet getAliasSet() const override {
         return AliasSet::None();
@@ -5264,26 +5271,26 @@ class MToFloat32
         setMovable();
 
         // An object might have "valueOf", which means it is effectful.
         // ToNumber(symbol) throws.
         if (def->mightBeType(MIRType::Object) || def->mightBeType(MIRType::Symbol))
             setGuard();
     }
 
+    explicit MToFloat32(MDefinition* def, bool mustPreserveNaN)
+      : MToFloat32(def)
+    {
+        mustPreserveNaN_ = mustPreserveNaN;
+    }
+
   public:
     INSTRUCTION_HEADER(ToFloat32)
     TRIVIAL_NEW_WRAPPERS
 
-    static MToFloat32* NewAsmJS(TempAllocator& alloc, MDefinition* def, bool mustPreserveNaN) {
-        auto* ret = MToFloat32::New(alloc, def, NonStringPrimitives);
-        ret->mustPreserveNaN_ = mustPreserveNaN;
-        return ret;
-    }
-
     virtual MDefinition* foldsTo(TempAllocator& alloc) override;
     bool congruentTo(const MDefinition* ins) const override {
         if (!congruentIfOperandsEqual(ins))
             return false;
         auto* other = ins->toToFloat32();
         return other->conversion() == conversion() &&
                other->mustPreserveNaN_ == mustPreserveNaN_;
     }
@@ -5313,19 +5320,17 @@ class MWasmUnsignedToDouble
       : MUnaryInstruction(def)
     {
         setResultType(MIRType::Double);
         setMovable();
     }
 
   public:
     INSTRUCTION_HEADER(WasmUnsignedToDouble)
-    static MWasmUnsignedToDouble* NewAsmJS(TempAllocator& alloc, MDefinition* def) {
-        return new(alloc) MWasmUnsignedToDouble(def);
-    }
+    TRIVIAL_NEW_WRAPPERS
 
     MDefinition* foldsTo(TempAllocator& alloc) override;
     bool congruentTo(const MDefinition* ins) const override {
         return congruentIfOperandsEqual(ins);
     }
     AliasSet getAliasSet() const override {
         return AliasSet::None();
     }
@@ -5340,19 +5345,17 @@ class MWasmUnsignedToFloat32
       : MUnaryInstruction(def)
     {
         setResultType(MIRType::Float32);
         setMovable();
     }
 
   public:
     INSTRUCTION_HEADER(WasmUnsignedToFloat32)
-    static MWasmUnsignedToFloat32* NewAsmJS(TempAllocator& alloc, MDefinition* def) {
-        return new(alloc) MWasmUnsignedToFloat32(def);
-    }
+    TRIVIAL_NEW_WRAPPERS
 
     MDefinition* foldsTo(TempAllocator& alloc) override;
     bool congruentTo(const MDefinition* ins) const override {
         return congruentIfOperandsEqual(ins);
     }
     AliasSet getAliasSet() const override {
         return AliasSet::None();
     }
@@ -5361,31 +5364,27 @@ class MWasmUnsignedToFloat32
 };
 
 class MWrapInt64ToInt32
   : public MUnaryInstruction,
     public NoTypePolicy::Data
 {
     bool bottomHalf_;
 
-    explicit MWrapInt64ToInt32(MDefinition* def, bool bottomHalf)
+    explicit MWrapInt64ToInt32(MDefinition* def, bool bottomHalf = true)
       : MUnaryInstruction(def),
         bottomHalf_(bottomHalf)
     {
         setResultType(MIRType::Int32);
         setMovable();
     }
 
   public:
     INSTRUCTION_HEADER(WrapInt64ToInt32)
-    static MWrapInt64ToInt32* NewAsmJS(TempAllocator& alloc, MDefinition* def,
-                                       bool bottomHalf = true)
-    {
-        return new(alloc) MWrapInt64ToInt32(def, bottomHalf);
-    }
+    TRIVIAL_NEW_WRAPPERS
 
     MDefinition* foldsTo(TempAllocator& alloc) override;
     bool congruentTo(const MDefinition* ins) const override {
         if (!ins->isWrapInt64ToInt32())
             return false;
         if (ins->toWrapInt64ToInt32()->bottomHalf() != bottomHalf())
             return false;
         return congruentIfOperandsEqual(ins);
@@ -5410,19 +5409,17 @@ class MExtendInt32ToInt64
         isUnsigned_(isUnsigned)
     {
         setResultType(MIRType::Int64);
         setMovable();
     }
 
   public:
     INSTRUCTION_HEADER(ExtendInt32ToInt64)
-    static MExtendInt32ToInt64* NewAsmJS(TempAllocator& alloc, MDefinition* def, bool isUnsigned) {
-        return new(alloc) MExtendInt32ToInt64(def, isUnsigned);
-    }
+    TRIVIAL_NEW_WRAPPERS
 
     bool isUnsigned() const { return isUnsigned_; }
 
     MDefinition* foldsTo(TempAllocator& alloc) override;
     bool congruentTo(const MDefinition* ins) const override {
         if (!ins->isExtendInt32ToInt64())
             return false;
         if (ins->toExtendInt32ToInt64()->isUnsigned_ != isUnsigned_)
@@ -5448,21 +5445,17 @@ class MWasmTruncateToInt64
     {
         setResultType(MIRType::Int64);
         setGuard(); // not removable because of possible side-effects.
         setMovable();
     }
 
   public:
     INSTRUCTION_HEADER(WasmTruncateToInt64)
-    static MWasmTruncateToInt64* NewAsmJS(TempAllocator& alloc, MDefinition* def, bool isUnsigned,
-                                          wasm::TrapOffset trapOffset)
-    {
-        return new(alloc) MWasmTruncateToInt64(def, isUnsigned, trapOffset);
-    }
+    TRIVIAL_NEW_WRAPPERS
 
     bool isUnsigned() const { return isUnsigned_; }
     wasm::TrapOffset trapOffset() const { return trapOffset_; }
 
     bool congruentTo(const MDefinition* ins) const override {
         return congruentIfOperandsEqual(ins) &&
                ins->toWasmTruncateToInt64()->isUnsigned() == isUnsigned_;
     }
@@ -5485,22 +5478,17 @@ class MWasmTruncateToInt32
     {
         setResultType(MIRType::Int32);
         setGuard(); // not removable because of possible side-effects.
         setMovable();
     }
 
   public:
     INSTRUCTION_HEADER(WasmTruncateToInt32)
-
-    static MWasmTruncateToInt32* NewAsmJS(TempAllocator& alloc, MDefinition* def, bool isUnsigned,
-                                          wasm::TrapOffset trapOffset)
-    {
-        return new(alloc) MWasmTruncateToInt32(def, isUnsigned, trapOffset);
-    }
+    TRIVIAL_NEW_WRAPPERS
 
     bool isUnsigned() const {
         return isUnsigned_;
     }
     wasm::TrapOffset trapOffset() const {
         return trapOffset_;
     }
 
@@ -5528,21 +5516,17 @@ class MInt64ToFloatingPoint
     {
         MOZ_ASSERT(IsFloatingPointType(type));
         setResultType(type);
         setMovable();
     }
 
   public:
     INSTRUCTION_HEADER(Int64ToFloatingPoint)
-    static MInt64ToFloatingPoint* NewAsmJS(TempAllocator& alloc, MDefinition* def, MIRType type,
-                                           bool isUnsigned)
-    {
-        return new(alloc) MInt64ToFloatingPoint(def, type, isUnsigned);
-    }
+    TRIVIAL_NEW_WRAPPERS
 
     bool isUnsigned() const { return isUnsigned_; }
 
     bool congruentTo(const MDefinition* ins) const override {
         if (!ins->isInt64ToFloatingPoint())
             return false;
         if (ins->toInt64ToFloatingPoint()->isUnsigned_ != isUnsigned_)
             return false;
@@ -5634,20 +5618,16 @@ class MTruncateToInt32
         if (def->mightBeType(MIRType::Object) || def->mightBeType(MIRType::Symbol))
             setGuard();
     }
 
   public:
     INSTRUCTION_HEADER(TruncateToInt32)
     TRIVIAL_NEW_WRAPPERS
 
-    static MTruncateToInt32* NewAsmJS(TempAllocator& alloc, MDefinition* def, bool _) {
-        return new(alloc) MTruncateToInt32(def);
-    }
-
     MDefinition* foldsTo(TempAllocator& alloc) override;
 
     bool congruentTo(const MDefinition* ins) const override {
         return congruentIfOperandsEqual(ins);
     }
     AliasSet getAliasSet() const override {
         return AliasSet::None();
     }
@@ -5744,17 +5724,17 @@ class MBitNot
         setResultType(MIRType::Int32);
         setMovable();
     }
 
   public:
     INSTRUCTION_HEADER(BitNot)
     TRIVIAL_NEW_WRAPPERS
 
-    static MBitNot* NewAsmJS(TempAllocator& alloc, MDefinition* input);
+    static MBitNot* NewInt32(TempAllocator& alloc, MDefinition* input);
 
     MDefinition* foldsTo(TempAllocator& alloc) override;
     void setSpecialization(MIRType type) {
         specialization_ = type;
         setResultType(type);
     }
 
     bool congruentTo(const MDefinition* ins) const override {
@@ -5895,18 +5875,17 @@ class MBitAnd : public MBinaryBitwiseIns
 {
     MBitAnd(MDefinition* left, MDefinition* right, MIRType type)
       : MBinaryBitwiseInstruction(left, right, type)
     { }
 
   public:
     INSTRUCTION_HEADER(BitAnd)
     static MBitAnd* New(TempAllocator& alloc, MDefinition* left, MDefinition* right);
-    static MBitAnd* NewAsmJS(TempAllocator& alloc, MDefinition* left, MDefinition* right,
-                             MIRType type);
+    static MBitAnd* New(TempAllocator& alloc, MDefinition* left, MDefinition* right, MIRType type);
 
     MDefinition* foldIfZero(size_t operand) override {
         return getOperand(operand); // 0 & x => 0;
     }
     MDefinition* foldIfNegOne(size_t operand) override {
         return getOperand(1 - operand); // x & -1 => x
     }
     MDefinition* foldIfEqual() override {
@@ -5930,18 +5909,17 @@ class MBitOr : public MBinaryBitwiseInst
 {
     MBitOr(MDefinition* left, MDefinition* right, MIRType type)
       : MBinaryBitwiseInstruction(left, right, type)
     { }
 
   public:
     INSTRUCTION_HEADER(BitOr)
     static MBitOr* New(TempAllocator& alloc, MDefinition* left, MDefinition* right);
-    static MBitOr* NewAsmJS(TempAllocator& alloc, MDefinition* left, MDefinition* right,
-                            MIRType type);
+    static MBitOr* New(TempAllocator& alloc, MDefinition* left, MDefinition* right, MIRType type);
 
     MDefinition* foldIfZero(size_t operand) override {
         return getOperand(1 - operand); // 0 | x => x, so if ith is 0, return (1-i)th
     }
     MDefinition* foldIfNegOne(size_t operand) override {
         return getOperand(operand); // x | -1 => -1
     }
     MDefinition* foldIfEqual() override {
@@ -5963,18 +5941,17 @@ class MBitXor : public MBinaryBitwiseIns
 {
     MBitXor(MDefinition* left, MDefinition* right, MIRType type)
       : MBinaryBitwiseInstruction(left, right, type)
     { }
 
   public:
     INSTRUCTION_HEADER(BitXor)
     static MBitXor* New(TempAllocator& alloc, MDefinition* left, MDefinition* right);
-    static MBitXor* NewAsmJS(TempAllocator& alloc, MDefinition* left, MDefinition* right,
-                             MIRType type);
+    static MBitXor* New(TempAllocator& alloc, MDefinition* left, MDefinition* right, MIRType type);
 
     MDefinition* foldIfZero(size_t operand) override {
         return getOperand(1 - operand); // 0 ^ x => x
     }
     MDefinition* foldIfNegOne(size_t operand) override {
         return this;
     }
     MDefinition* foldIfEqual() override {
@@ -6018,18 +5995,17 @@ class MLsh : public MShiftInstruction
 {
     MLsh(MDefinition* left, MDefinition* right, MIRType type)
       : MShiftInstruction(left, right, type)
     { }
 
   public:
     INSTRUCTION_HEADER(Lsh)
     static MLsh* New(TempAllocator& alloc, MDefinition* left, MDefinition* right);
-    static MLsh* NewAsmJS(TempAllocator& alloc, MDefinition* left, MDefinition* right,
-                          MIRType type);
+    static MLsh* New(TempAllocator& alloc, MDefinition* left, MDefinition* right, MIRType type);
 
     MDefinition* foldIfZero(size_t operand) override {
         // 0 << x => 0
         // x << 0 => x
         return getOperand(0);
     }
 
     void computeRange(TempAllocator& alloc) override;
@@ -6045,18 +6021,17 @@ class MRsh : public MShiftInstruction
 {
     MRsh(MDefinition* left, MDefinition* right, MIRType type)
       : MShiftInstruction(left, right, type)
     { }
 
   public:
     INSTRUCTION_HEADER(Rsh)
     static MRsh* New(TempAllocator& alloc, MDefinition* left, MDefinition* right);
-    static MRsh* NewAsmJS(TempAllocator& alloc, MDefinition* left, MDefinition* right,
-                          MIRType type);
+    static MRsh* New(TempAllocator& alloc, MDefinition* left, MDefinition* right, MIRType type);
 
     MDefinition* foldIfZero(size_t operand) override {
         // 0 >> x => 0
         // x >> 0 => x
         return getOperand(0);
     }
     void computeRange(TempAllocator& alloc) override;
 
@@ -6077,18 +6052,17 @@ class MUrsh : public MShiftInstruction
     MUrsh(MDefinition* left, MDefinition* right, MIRType type)
       : MShiftInstruction(left, right, type),
         bailoutsDisabled_(false)
     { }
 
   public:
     INSTRUCTION_HEADER(Ursh)
     static MUrsh* New(TempAllocator& alloc, MDefinition* left, MDefinition* right);
-    static MUrsh* NewAsmJS(TempAllocator& alloc, MDefinition* left, MDefinition* right,
-                           MIRType type);
+    static MUrsh* New(TempAllocator& alloc, MDefinition* left, MDefinition* right, MIRType type);
 
     MDefinition* foldIfZero(size_t operand) override {
         // 0 >>> x => 0
         if (operand == 0)
             return getOperand(0);
 
         return this;
     }
@@ -6130,19 +6104,16 @@ class MSignExtend
     {
         setResultType(MIRType::Int32);
         setMovable();
     }
 
   public:
     INSTRUCTION_HEADER(SignExtend)
     TRIVIAL_NEW_WRAPPERS
-    static MSignExtend* NewAsmJS(TempAllocator& alloc, MDefinition* op, Mode mode) {
-        return new(alloc) MSignExtend(op, mode);
-    }
 
     Mode mode() { return mode_; }
 
     MOZ_MUST_USE bool writeRecoverData(CompactBufferWriter& writer) const override;
     bool canRecoverOnBailout() const override {
         return true;
     }
 
@@ -6293,22 +6264,23 @@ class MAbs
         setMovable();
         specialization_ = type;
     }
 
   public:
     INSTRUCTION_HEADER(Abs)
     TRIVIAL_NEW_WRAPPERS
 
-    static MAbs* NewAsmJS(TempAllocator& alloc, MDefinition* num, MIRType type) {
+    static MAbs* NewWasm(TempAllocator& alloc, MDefinition* num, MIRType type) {
         auto* ins = new(alloc) MAbs(num, type);
         if (type == MIRType::Int32)
             ins->implicitTruncate_ = true;
         return ins;
     }
+
     bool congruentTo(const MDefinition* ins) const override {
         return congruentIfOperandsEqual(ins);
     }
     bool fallible() const;
 
     AliasSet getAliasSet() const override {
         return AliasSet::None();
     }
@@ -6338,23 +6310,19 @@ class MClz
         MOZ_ASSERT(IsNumberType(num->type()));
         specialization_ = type;
         setResultType(type);
         setMovable();
     }
 
   public:
     INSTRUCTION_HEADER(Clz)
+    TRIVIAL_NEW_WRAPPERS
     NAMED_OPERANDS((0, num))
-    static MClz* New(TempAllocator& alloc, MDefinition* num) {
-        return new(alloc) MClz(num, MIRType::Int32);
-    }
-    static MClz* NewAsmJS(TempAllocator& alloc, MDefinition* num) {
-        return new(alloc) MClz(num, num->type());
-    }
+
     bool congruentTo(const MDefinition* ins) const override {
         return congruentIfOperandsEqual(ins);
     }
 
     AliasSet getAliasSet() const override {
         return AliasSet::None();
     }
 
@@ -6381,23 +6349,19 @@ class MCtz
         MOZ_ASSERT(IsNumberType(num->type()));
         specialization_ = type;
         setResultType(type);
         setMovable();
     }
 
   public:
     INSTRUCTION_HEADER(Ctz)
+    TRIVIAL_NEW_WRAPPERS
     NAMED_OPERANDS((0, num))
-    static MCtz* New(TempAllocator& alloc, MDefinition* num) {
-        return new(alloc) MCtz(num, MIRType::Int32);
-    }
-    static MCtz* NewAsmJS(TempAllocator& alloc, MDefinition* num) {
-        return new(alloc) MCtz(num, num->type());
-    }
+
     bool congruentTo(const MDefinition* ins) const override {
         return congruentIfOperandsEqual(ins);
     }
 
     AliasSet getAliasSet() const override {
         return AliasSet::None();
     }
 
@@ -6421,23 +6385,19 @@ class MPopcnt
         MOZ_ASSERT(IsIntType(type));
         specialization_ = type;
         setResultType(type);
         setMovable();
     }
 
   public:
     INSTRUCTION_HEADER(Popcnt)
+    TRIVIAL_NEW_WRAPPERS
     NAMED_OPERANDS((0, num))
-    static MPopcnt* New(TempAllocator& alloc, MDefinition* num) {
-        return new(alloc) MPopcnt(num, MIRType::Int32);
-    }
-    static MPopcnt* NewAsmJS(TempAllocator& alloc, MDefinition* num) {
-        return new(alloc) MPopcnt(num, num->type());
-    }
+
     bool congruentTo(const MDefinition* ins) const override {
         return congruentIfOperandsEqual(ins);
     }
 
     AliasSet getAliasSet() const override {
         return AliasSet::None();
     }
 
@@ -6455,23 +6415,18 @@ class MSqrt
     {
         setResultType(type);
         specialization_ = type;
         setMovable();
     }
 
   public:
     INSTRUCTION_HEADER(Sqrt)
-    static MSqrt* New(TempAllocator& alloc, MDefinition* num) {
-        return new(alloc) MSqrt(num, MIRType::Double);
-    }
-    static MSqrt* NewAsmJS(TempAllocator& alloc, MDefinition* num, MIRType type) {
-        MOZ_ASSERT(IsFloatingPointType(type));
-        return new(alloc) MSqrt(num, type);
-    }
+    TRIVIAL_NEW_WRAPPERS
+
     bool congruentTo(const MDefinition* ins) const override {
         return congruentIfOperandsEqual(ins);
     }
 
     AliasSet getAliasSet() const override {
         return AliasSet::None();
     }
     void computeRange(TempAllocator& alloc) override;
@@ -6495,22 +6450,17 @@ class MCopySign
       : MBinaryInstruction(lhs, rhs)
     {
         setResultType(type);
         setMovable();
     }
 
   public:
     INSTRUCTION_HEADER(CopySign)
-
-    static MCopySign* NewAsmJS(TempAllocator& alloc, MDefinition* lhs, MDefinition* rhs,
-                               MIRType type)
-    {
-        return new(alloc) MCopySign(lhs, rhs, type);
-    }
+    TRIVIAL_NEW_WRAPPERS
 
     bool congruentTo(const MDefinition* ins) const override {
         return congruentIfOperandsEqual(ins);
     }
     AliasSet getAliasSet() const override {
         return AliasSet::None();
     }
 
@@ -6818,40 +6768,37 @@ class MMathFunction
         }
     }
 
     ALLOW_CLONE(MMathFunction)
 };
 
 class MAdd : public MBinaryArithInstruction
 {
-    // Is this instruction really an int at heart?
     MAdd(MDefinition* left, MDefinition* right)
       : MBinaryArithInstruction(left, right)
     {
         setResultType(MIRType::Value);
     }
 
+    MAdd(MDefinition* left, MDefinition* right, MIRType type)
+      : MAdd(left, right)
+    {
+        specialization_ = type;
+        setResultType(type);
+        if (type == MIRType::Int32) {
+            setTruncateKind(Truncate);
+            setCommutative();
+        }
+    }
+
   public:
     INSTRUCTION_HEADER(Add)
     TRIVIAL_NEW_WRAPPERS
 
-    static MAdd* NewAsmJS(TempAllocator& alloc, MDefinition* left, MDefinition* right,
-                          MIRType type)
-    {
-        auto* add = new(alloc) MAdd(left, right);
-        add->specialization_ = type;
-        add->setResultType(type);
-        if (type == MIRType::Int32) {
-            add->setTruncateKind(Truncate);
-            add->setCommutative();
-        }
-        return add;
-    }
-
     bool isFloat32Commutative() const override { return true; }
 
     double getIdentity() override {
         return 0;
     }
 
     bool fallible() const;
     void computeRange(TempAllocator& alloc) override;
@@ -6870,32 +6817,30 @@ class MAdd : public MBinaryArithInstruct
 class MSub : public MBinaryArithInstruction
 {
     MSub(MDefinition* left, MDefinition* right)
       : MBinaryArithInstruction(left, right)
     {
         setResultType(MIRType::Value);
     }
 
+    MSub(MDefinition* left, MDefinition* right, MIRType type, bool mustPreserveNaN = false)
+      : MSub(left, right)
+    {
+        specialization_ = type;
+        setResultType(type);
+        setMustPreserveNaN(mustPreserveNaN);
+        if (type == MIRType::Int32)
+            setTruncateKind(Truncate);
+    }
+
   public:
     INSTRUCTION_HEADER(Sub)
     TRIVIAL_NEW_WRAPPERS
 
-    static MSub* NewAsmJS(TempAllocator& alloc, MDefinition* left, MDefinition* right,
-                          MIRType type, bool mustPreserveNaN = false)
-    {
-        auto* sub = new(alloc) MSub(left, right);
-        sub->specialization_ = type;
-        sub->setResultType(type);
-        sub->setMustPreserveNaN(mustPreserveNaN);
-        if (type == MIRType::Int32)
-            sub->setTruncateKind(Truncate);
-        return sub;
-    }
-
     double getIdentity() override {
         return 0;
     }
 
     bool isFloat32Commutative() const override { return true; }
 
     bool fallible() const;
     void computeRange(TempAllocator& alloc) override;
@@ -7052,20 +6997,20 @@ class MDiv : public MBinaryArithInstruct
   public:
     INSTRUCTION_HEADER(Div)
     static MDiv* New(TempAllocator& alloc, MDefinition* left, MDefinition* right) {
         return new(alloc) MDiv(left, right, MIRType::Value);
     }
     static MDiv* New(TempAllocator& alloc, MDefinition* left, MDefinition* right, MIRType type) {
         return new(alloc) MDiv(left, right, type);
     }
-    static MDiv* NewAsmJS(TempAllocator& alloc, MDefinition* left, MDefinition* right,
-                          MIRType type, bool unsignd, bool trapOnError = false,
-                          wasm::TrapOffset trapOffset = wasm::TrapOffset(),
-                          bool mustPreserveNaN = false)
+    static MDiv* New(TempAllocator& alloc, MDefinition* left, MDefinition* right,
+                     MIRType type, bool unsignd, bool trapOnError = false,
+                     wasm::TrapOffset trapOffset = wasm::TrapOffset(),
+                     bool mustPreserveNaN = false)
     {
         auto* div = new(alloc) MDiv(left, right, type);
         div->unsigned_ = unsignd;
         div->trapOnError_ = trapOnError;
         div->trapOffset_ = trapOffset;
         if (trapOnError)
             div->setGuard(); // not removable because of possible side-effects.
         div->setMustPreserveNaN(mustPreserveNaN);
@@ -7187,19 +7132,19 @@ class MMod : public MBinaryArithInstruct
         setResultType(type);
     }
 
   public:
     INSTRUCTION_HEADER(Mod)
     static MMod* New(TempAllocator& alloc, MDefinition* left, MDefinition* right) {
         return new(alloc) MMod(left, right, MIRType::Value);
     }
-    static MMod* NewAsmJS(TempAllocator& alloc, MDefinition* left, MDefinition* right,
-                          MIRType type, bool unsignd, bool trapOnError = false,
-                          wasm::TrapOffset trapOffset = wasm::TrapOffset())
+    static MMod* New(TempAllocator& alloc, MDefinition* left, MDefinition* right,
+                     MIRType type, bool unsignd, bool trapOnError = false,
+                     wasm::TrapOffset trapOffset = wasm::TrapOffset())
     {
         auto* mod = new(alloc) MMod(left, right, type);
         mod->unsigned_ = unsignd;
         mod->trapOnError_ = trapOnError;
         mod->trapOffset_ = trapOffset;
         if (trapOnError)
             mod->setGuard(); // not removable because of possible side-effects.
         if (type == MIRType::Int32)
@@ -9107,17 +9052,17 @@ class MNot
         setMovable();
         if (constraints)
             cacheOperandMightEmulateUndefined(constraints);
     }
 
     void cacheOperandMightEmulateUndefined(CompilerConstraintList* constraints);
 
   public:
-    static MNot* NewAsmJS(TempAllocator& alloc, MDefinition* input) {
+    static MNot* NewInt32(TempAllocator& alloc, MDefinition* input) {
         MOZ_ASSERT(input->type() == MIRType::Int32 || input->type() == MIRType::Int64);
         auto* ins = new(alloc) MNot(input);
         ins->setResultType(MIRType::Int32);
         return ins;
     }
 
     INSTRUCTION_HEADER(Not)
     TRIVIAL_NEW_WRAPPERS
@@ -13522,19 +13467,17 @@ class MAsmJSNeg
       : MUnaryInstruction(op)
     {
         setResultType(type);
         setMovable();
     }
 
   public:
     INSTRUCTION_HEADER(AsmJSNeg)
-    static MAsmJSNeg* NewAsmJS(TempAllocator& alloc, MDefinition* op, MIRType type) {
-        return new(alloc) MAsmJSNeg(op, type);
-    }
+    TRIVIAL_NEW_WRAPPERS
 };
 
 class MWasmBoundsCheck
   : public MUnaryInstruction,
     public NoTypePolicy::Data
 {
     bool redundant_;
     wasm::TrapOffset trapOffset_;
@@ -14082,21 +14025,17 @@ class MWasmReinterpret
           default:              MOZ_CRASH("unexpected reinterpret conversion");
         }
         setMovable();
         setResultType(toType);
     }
 
   public:
     INSTRUCTION_HEADER(WasmReinterpret)
-
-    static MWasmReinterpret* NewAsmJS(TempAllocator& alloc, MDefinition* val, MIRType toType)
-    {
-        return new(alloc) MWasmReinterpret(val, toType);
-    }
+    TRIVIAL_NEW_WRAPPERS
 
     AliasSet getAliasSet() const override {
         return AliasSet::None();
     }
     bool congruentTo(const MDefinition* ins) const override {
         return congruentIfOperandsEqual(ins);
     }
 
@@ -14113,24 +14052,19 @@ class MRotate
       : MBinaryInstruction(input, count), isLeftRotate_(isLeftRotate)
     {
         setMovable();
         setResultType(type);
     }
 
   public:
     INSTRUCTION_HEADER(Rotate)
+    TRIVIAL_NEW_WRAPPERS
     NAMED_OPERANDS((0, input), (1, count))
 
-    static MRotate* NewAsmJS(TempAllocator& alloc, MDefinition* input, MDefinition* count,
-                             MIRType type, bool isLeft)
-    {
-        return new(alloc) MRotate(input, count, type, isLeft);
-    }
-
     AliasSet getAliasSet() const override {
         return AliasSet::None();
     }
     bool congruentTo(const MDefinition* ins) const override {
         return congruentIfOperandsEqual(ins) && ins->toRotate()->isLeftRotate() == isLeftRotate_;
     }
 
     bool isLeftRotate() const {
--- a/js/src/jsapi-tests/testJitFoldsTo.cpp
+++ b/js/src/jsapi-tests/testJitFoldsTo.cpp
@@ -214,17 +214,17 @@ BEGIN_TEST(testJitFoldsTo_UnsignedDiv)
     MinimalFunc func;
     MBasicBlock* block = func.createEntryBlock();
 
     // return 1.0 / 0xffffffff
     MConstant* c0 = MConstant::New(func.alloc, Int32Value(1));
     block->add(c0);
     MConstant* c1 = MConstant::New(func.alloc, Int32Value(0xffffffff));
     block->add(c1);
-    MDiv* div = MDiv::NewAsmJS(func.alloc, c0, c1, MIRType::Int32, /*unsignd=*/true);
+    MDiv* div = MDiv::New(func.alloc, c0, c1, MIRType::Int32, /*unsignd=*/true);
     block->add(div);
     MReturn* ret = MReturn::New(func.alloc, div);
     block->end(ret);
 
     if (!func.runGVN())
         return false;
 
     // Test that the div got folded to 0.
@@ -239,17 +239,17 @@ BEGIN_TEST(testJitFoldsTo_UnsignedMod)
     MinimalFunc func;
     MBasicBlock* block = func.createEntryBlock();
 
     // return 1.0 % 0xffffffff
     MConstant* c0 = MConstant::New(func.alloc, Int32Value(1));
     block->add(c0);
     MConstant* c1 = MConstant::New(func.alloc, Int32Value(0xffffffff));
     block->add(c1);
-    MMod* mod = MMod::NewAsmJS(func.alloc, c0, c1, MIRType::Int32, /*unsignd=*/true);
+    MMod* mod = MMod::New(func.alloc, c0, c1, MIRType::Int32, /*unsignd=*/true);
     block->add(mod);
     MReturn* ret = MReturn::New(func.alloc, mod);
     block->end(ret);
 
     if (!func.runGVN())
         return false;
 
     // Test that the mod got folded to 1.
--- a/js/src/jsapi-tests/testJitRangeAnalysis.cpp
+++ b/js/src/jsapi-tests/testJitRangeAnalysis.cpp
@@ -129,17 +129,17 @@ BEGIN_TEST(testJitRangeAnalysis_MathSign
     MCompare* cmp = MCompare::New(func.alloc, p, c0, JSOP_LT);
     cmp->setCompareType(MCompare::Compare_Double);
     entry->add(cmp);
     entry->end(MTest::New(func.alloc, cmp, thenBlock, elseBlock));
 
     // {
     //   return Math.sign(p + -0);
     // }
-    MAdd* thenAdd = MAdd::NewAsmJS(func.alloc, p, cm0, MIRType::Double);
+    MAdd* thenAdd = MAdd::New(func.alloc, p, cm0, MIRType::Double);
     thenBlock->add(thenAdd);
     MMathFunction* thenSign = MMathFunction::New(func.alloc, thenAdd, MMathFunction::Sign, &cache);
     thenBlock->add(thenSign);
     MReturn* thenRet = MReturn::New(func.alloc, thenSign);
     thenBlock->end(thenRet);
 
     // else
     // {
@@ -147,29 +147,29 @@ BEGIN_TEST(testJitRangeAnalysis_MathSign
     MCompare* elseCmp = MCompare::New(func.alloc, p, c0, JSOP_GE);
     elseCmp->setCompareType(MCompare::Compare_Double);
     elseBlock->add(elseCmp);
     elseBlock->end(MTest::New(func.alloc, elseCmp, elseThenBlock, elseElseBlock));
 
     //   {
     //     return Math.sign(p + -0);
     //   }
-    MAdd* elseThenAdd = MAdd::NewAsmJS(func.alloc, p, cm0, MIRType::Double);
+    MAdd* elseThenAdd = MAdd::New(func.alloc, p, cm0, MIRType::Double);
     elseThenBlock->add(elseThenAdd);
     MMathFunction* elseThenSign = MMathFunction::New(func.alloc, elseThenAdd, MMathFunction::Sign, &cache);
     elseThenBlock->add(elseThenSign);
     MReturn* elseThenRet = MReturn::New(func.alloc, elseThenSign);
     elseThenBlock->end(elseThenRet);
 
     //   else
     //   {
     //     return Math.sign(p + -0);
     //   }
     // }
-    MAdd* elseElseAdd = MAdd::NewAsmJS(func.alloc, p, cm0, MIRType::Double);
+    MAdd* elseElseAdd = MAdd::New(func.alloc, p, cm0, MIRType::Double);
     elseElseBlock->add(elseElseAdd);
     MMathFunction* elseElseSign = MMathFunction::New(func.alloc, elseElseAdd, MMathFunction::Sign, &cache);
     elseElseBlock->add(elseElseSign);
     MReturn* elseElseRet = MReturn::New(func.alloc, elseElseSign);
     elseElseBlock->end(elseElseRet);
 
     if (!func.runRangeAnalysis())
         return false;
@@ -231,17 +231,17 @@ BEGIN_TEST(testJitRangeAnalysis_StrictCo
     entry->add(cmp);
     entry->end(MTest::New(func.alloc, cmp, thenBlock, elseBlock));
 
     // {
     //   return p + -0;
     // }
     MConstant* cm0 = MConstant::New(func.alloc, DoubleValue(-0.0));
     thenBlock->add(cm0);
-    MAdd* thenAdd = MAdd::NewAsmJS(func.alloc, p, cm0, MIRType::Double);
+    MAdd* thenAdd = MAdd::New(func.alloc, p, cm0, MIRType::Double);
     thenBlock->add(thenAdd);
     MReturn* thenRet = MReturn::New(func.alloc, thenAdd);
     thenBlock->end(thenRet);
 
     // else
     // {
     //   return 0;
     // }