Bug 1267269 - Make MIRType an enum class. r=bbouvier
authorJan de Mooij <jdemooij@mozilla.com>
Tue, 26 Apr 2016 16:42:24 +0200
changeset 294965 b940a11bc55979007650b550fd2b6e55bc584ca5
parent 294964 178243415be60cfd4bed7adae993736ab0238f12
child 294966 4019894b820fb7b19a37643bb99bd4eb3bdb7c84
push id30217
push usercbook@mozilla.com
push dateWed, 27 Apr 2016 09:58:13 +0000
treeherdermozilla-central@ab0044bfa1df [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbbouvier
bugs1267269
milestone49.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 1267269 - Make MIRType an enum class. r=bbouvier
js/src/asmjs/WasmIonCompile.cpp
js/src/asmjs/WasmStubs.cpp
js/src/asmjs/WasmTypes.h
js/src/jit/AlignmentMaskAnalysis.cpp
js/src/jit/BaselineCompiler.cpp
js/src/jit/BaselineIC.cpp
js/src/jit/BaselineInspector.cpp
js/src/jit/CodeGenerator.cpp
js/src/jit/EagerSimdUnbox.cpp
js/src/jit/EffectiveAddressAnalysis.cpp
js/src/jit/Ion.cpp
js/src/jit/IonAnalysis.cpp
js/src/jit/IonBuilder.cpp
js/src/jit/IonBuilder.h
js/src/jit/IonCaches.cpp
js/src/jit/IonTypes.h
js/src/jit/JSONSpewer.cpp
js/src/jit/JitCompartment.h
js/src/jit/JitFrames.cpp
js/src/jit/LIR.cpp
js/src/jit/LIR.h
js/src/jit/Lowering.cpp
js/src/jit/MCallOptimize.cpp
js/src/jit/MIR.cpp
js/src/jit/MIR.h
js/src/jit/MIRGraph.cpp
js/src/jit/MacroAssembler-inl.h
js/src/jit/MacroAssembler.cpp
js/src/jit/MacroAssembler.h
js/src/jit/OptimizationTracking.cpp
js/src/jit/RangeAnalysis.cpp
js/src/jit/Recover.cpp
js/src/jit/RegisterSets.h
js/src/jit/ScalarReplacement.cpp
js/src/jit/TypePolicy.cpp
js/src/jit/VMFunctions.h
js/src/jit/arm/Assembler-arm.cpp
js/src/jit/arm/CodeGenerator-arm.cpp
js/src/jit/arm/Lowering-arm.cpp
js/src/jit/arm/MacroAssembler-arm.cpp
js/src/jit/arm64/Assembler-arm64.cpp
js/src/jit/arm64/Lowering-arm64.h
js/src/jit/arm64/MacroAssembler-arm64.h
js/src/jit/mips-shared/CodeGenerator-mips-shared.cpp
js/src/jit/mips-shared/Lowering-mips-shared.cpp
js/src/jit/mips32/Assembler-mips32.cpp
js/src/jit/mips32/CodeGenerator-mips32.cpp
js/src/jit/mips32/Lowering-mips32.cpp
js/src/jit/mips32/MacroAssembler-mips32.cpp
js/src/jit/mips64/Assembler-mips64.cpp
js/src/jit/mips64/CodeGenerator-mips64.cpp
js/src/jit/mips64/Lowering-mips64.cpp
js/src/jit/mips64/MacroAssembler-mips64.cpp
js/src/jit/mips64/MacroAssembler-mips64.h
js/src/jit/shared/CodeGenerator-shared.cpp
js/src/jit/shared/Lowering-shared-inl.h
js/src/jit/shared/Lowering-shared.cpp
js/src/jit/x64/Assembler-x64.cpp
js/src/jit/x64/CodeGenerator-x64.cpp
js/src/jit/x64/Lowering-x64.cpp
js/src/jit/x64/MacroAssembler-x64.cpp
js/src/jit/x64/MacroAssembler-x64.h
js/src/jit/x86-shared/CodeGenerator-x86-shared.cpp
js/src/jit/x86-shared/Lowering-x86-shared.cpp
js/src/jit/x86/Assembler-x86.cpp
js/src/jit/x86/CodeGenerator-x86.cpp
js/src/jit/x86/Lowering-x86.cpp
js/src/jit/x86/MacroAssembler-x86.cpp
js/src/jsapi-tests/testJitDCEinGVN.cpp
js/src/jsapi-tests/testJitFoldsTo.cpp
js/src/jsapi-tests/testJitRangeAnalysis.cpp
js/src/shell/js.cpp
js/src/vm/TypeInference.cpp
js/src/vm/TypeInference.h
js/src/vm/UnboxedObject.cpp
--- a/js/src/asmjs/WasmIonCompile.cpp
+++ b/js/src/asmjs/WasmIonCompile.cpp
@@ -122,36 +122,36 @@ class FunctionCompiler
             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::NewAsmJS(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::NewAsmJS(alloc(), Float32Value(0.f), MIRType::Float32);
                 break;
               case ValType::F64:
-                ins = MConstant::NewAsmJS(alloc(), DoubleValue(0.0), MIRType_Double);
+                ins = MConstant::NewAsmJS(alloc(), DoubleValue(0.0), MIRType::Double);
                 break;
               case ValType::I32x4:
-                ins = MSimdConstant::New(alloc(), SimdConstant::SplatX4(0), MIRType_Int32x4);
+                ins = MSimdConstant::New(alloc(), SimdConstant::SplatX4(0), MIRType::Int32x4);
                 break;
               case ValType::F32x4:
-                ins = MSimdConstant::New(alloc(), SimdConstant::SplatX4(0.f), MIRType_Float32x4);
+                ins = MSimdConstant::New(alloc(), SimdConstant::SplatX4(0.f), MIRType::Float32x4);
                 break;
               case ValType::B32x4:
                 // Bool32x4 uses the same data layout as Int32x4.
-                ins = MSimdConstant::New(alloc(), SimdConstant::SplatX4(0), MIRType_Bool32x4);
+                ins = MSimdConstant::New(alloc(), SimdConstant::SplatX4(0), MIRType::Bool32x4);
                 break;
               case ValType::Limit:
                 MOZ_CRASH("Limit");
             }
 
             curBlock_->add(ins);
             curBlock_->initSlot(info().localSlot(i), ins);
             if (!mirGen_.ensureBallast())
@@ -371,27 +371,27 @@ class FunctionCompiler
         return ins;
     }
 
     MDefinition* simdAllTrue(MDefinition* boolVector)
     {
         if (inDeadCode())
             return nullptr;
 
-        MSimdAllTrue* ins = MSimdAllTrue::New(alloc(), boolVector, MIRType_Int32);
+        MSimdAllTrue* ins = MSimdAllTrue::New(alloc(), boolVector, MIRType::Int32);
         curBlock_->add(ins);
         return ins;
     }
 
     MDefinition* simdAnyTrue(MDefinition* boolVector)
     {
         if (inDeadCode())
             return nullptr;
 
-        MSimdAnyTrue* ins = MSimdAnyTrue::New(alloc(), boolVector, MIRType_Int32);
+        MSimdAnyTrue* ins = MSimdAnyTrue::New(alloc(), boolVector, MIRType::Int32);
         curBlock_->add(ins);
         return ins;
     }
 
     // fromXXXBits()
     MDefinition* bitcastSimd(MDefinition* vec, MIRType from, MIRType to)
     {
         if (inDeadCode())
@@ -846,17 +846,17 @@ class FunctionCompiler
             return true;
         }
 
         MAsmJSLoadFuncPtr* ptrFun;
         if (mg().isAsmJS()) {
             MOZ_ASSERT(IsPowerOfTwo(length));
             MConstant* mask = MConstant::New(alloc(), Int32Value(length - 1));
             curBlock_->add(mask);
-            MBitAnd* maskedIndex = MBitAnd::NewAsmJS(alloc(), index, mask, MIRType_Int32);
+            MBitAnd* maskedIndex = MBitAnd::NewAsmJS(alloc(), index, mask, MIRType::Int32);
             curBlock_->add(maskedIndex);
             ptrFun = MAsmJSLoadFuncPtr::New(alloc(), maskedIndex, globalDataOffset);
             curBlock_->add(ptrFun);
         } else {
             // For wasm code, as a space optimization, the ModuleGenerator does not allocate a
             // table for signatures which do not contain any indirectly-callable functions.
             // However, these signatures may still be called (it is not a validation error)
             // so we instead have a flag alwaysThrow which throws an exception instead of loading
@@ -965,26 +965,26 @@ class FunctionCompiler
     }
 
   public:
     void pushDef(MDefinition* def)
     {
         if (inDeadCode())
             return;
         MOZ_ASSERT(!hasPushed(curBlock_));
-        if (def && def->type() != MIRType_None)
+        if (def && def->type() != MIRType::None)
             curBlock_->push(def);
     }
 
     MDefinition* popDefIfPushed()
     {
         if (!hasPushed(curBlock_))
             return nullptr;
         MDefinition* def = curBlock_->pop();
-        MOZ_ASSERT(def->type() != MIRType_Value);
+        MOZ_ASSERT(def->type() != MIRType::Value);
         return def;
     }
 
     template <typename GetBlock>
     void ensurePushInvariants(const GetBlock& getBlock, size_t numBlocks)
     {
         // Preserve the invariant that, for every iterated MBasicBlock, either:
         // every MBasicBlock has a pushed expression with the same type (to
@@ -1429,48 +1429,48 @@ class FunctionCompiler
 };
 
 static bool
 EmitLiteral(FunctionCompiler& f, ValType type, MDefinition** def)
 {
     switch (type) {
       case ValType::I32: {
         int32_t val = f.readVarS32();
-        *def = f.constant(Int32Value(val), MIRType_Int32);
+        *def = f.constant(Int32Value(val), MIRType::Int32);
         return true;
       }
       case ValType::I64: {
         int64_t val = f.readVarS64();
         *def = f.constant(val);
         return true;
       }
       case ValType::F32: {
         float val = f.readF32();
-        *def = f.constant(Float32Value(val), MIRType_Float32);
+        *def = f.constant(Float32Value(val), MIRType::Float32);
         return true;
       }
       case ValType::F64: {
         double val = f.readF64();
-        *def = f.constant(DoubleValue(val), MIRType_Double);
+        *def = f.constant(DoubleValue(val), MIRType::Double);
         return true;
       }
       case ValType::I32x4: {
         SimdConstant lit(f.readI32X4());
-        *def = f.constant(lit, MIRType_Int32x4);
+        *def = f.constant(lit, MIRType::Int32x4);
         return true;
       }
       case ValType::F32x4: {
         SimdConstant lit(f.readF32X4());
-        *def = f.constant(lit, MIRType_Float32x4);
+        *def = f.constant(lit, MIRType::Float32x4);
         return true;
       }
       case ValType::B32x4: {
         // Boolean vectors are stored as an Int vector with -1 / 0 lanes.
         SimdConstant lit(f.readI32X4());
-        *def = f.constant(lit, MIRType_Bool32x4);
+        *def = f.constant(lit, MIRType::Bool32x4);
         return true;
       }
       case ValType::Limit:
         break;
     }
     MOZ_CRASH("unexpected literal type");
 }
 
@@ -1513,18 +1513,18 @@ EmitHeapAddress(FunctionCompiler& f, MDe
     // TODO Remove this after implementing non-wraparound offset semantics.
     uint32_t endOffset = access->endOffset();
     if (endOffset < offset)
         return false;
     bool accessNeedsBoundsCheck = true;
     // Assume worst case.
     bool atomicAccess = true;
     if (endOffset > f.mirGen().foldableOffsetRange(accessNeedsBoundsCheck, atomicAccess)) {
-        MDefinition* rhs = f.constant(Int32Value(offset), MIRType_Int32);
-        *base = f.binary<MAdd>(*base, rhs, MIRType_Int32);
+        MDefinition* rhs = f.constant(Int32Value(offset), MIRType::Int32);
+        *base = f.binary<MAdd>(*base, rhs, MIRType::Int32);
         offset = 0;
         access->setOffset(offset);
     }
 
     return true;
 }
 
 static bool
@@ -1974,17 +1974,17 @@ EmitExtractLane(FunctionCompiler& f, Val
 static bool
 EmitSimdBooleanLaneExpr(FunctionCompiler& f, MDefinition** def)
 {
     MDefinition* i32;
     if (!EmitExpr(f, &i32))
         return false;
     // Now compute !i32 - 1 to force the value range into {0, -1}.
     MDefinition* noti32 = f.unary<MNot>(i32);
-    *def = f.binary<MSub>(noti32, f.constant(Int32Value(1), MIRType_Int32), MIRType_Int32);
+    *def = f.binary<MSub>(noti32, f.constant(Int32Value(1), MIRType::Int32), MIRType::Int32);
     return true;
 }
 
 static bool
 EmitSimdReplaceLane(FunctionCompiler& f, ValType simdType, MDefinition** def)
 {
     MDefinition* vector;
     if (!EmitExpr(f, &vector))
@@ -2179,35 +2179,35 @@ EmitSimdCtor(FunctionCompiler& f, ValTyp
 {
     switch (type) {
       case ValType::I32x4: {
         MDefinition* args[4];
         for (unsigned i = 0; i < 4; i++) {
             if (!EmitExpr(f, &args[i]))
                 return false;
         }
-        *def = f.constructSimd<MSimdValueX4>(args[0], args[1], args[2], args[3], MIRType_Int32x4);
+        *def = f.constructSimd<MSimdValueX4>(args[0], args[1], args[2], args[3], MIRType::Int32x4);
         return true;
       }
       case ValType::F32x4: {
         MDefinition* args[4];
         for (unsigned i = 0; i < 4; i++) {
             if (!EmitExpr(f, &args[i]))
                 return false;
         }
-        *def = f.constructSimd<MSimdValueX4>(args[0], args[1], args[2], args[3], MIRType_Float32x4);
+        *def = f.constructSimd<MSimdValueX4>(args[0], args[1], args[2], args[3], MIRType::Float32x4);
         return true;
       }
       case ValType::B32x4: {
         MDefinition* args[4];
         for (unsigned i = 0; i < 4; i++) {
             if (!EmitSimdBooleanLaneExpr(f, &args[i]))
                 return false;
         }
-        *def = f.constructSimd<MSimdValueX4>(args[0], args[1], args[2], args[3], MIRType_Bool32x4);
+        *def = f.constructSimd<MSimdValueX4>(args[0], args[1], args[2], args[3], MIRType::Bool32x4);
         return true;
       }
       case ValType::I32:
       case ValType::I64:
       case ValType::F32:
       case ValType::F64:
       case ValType::Limit:
         break;
@@ -2242,17 +2242,17 @@ EmitMultiply(FunctionCompiler& f, ValTyp
 {
     MDefinition* lhs;
     if (!EmitExpr(f, &lhs))
         return false;
     MDefinition* rhs;
     if (!EmitExpr(f, &rhs))
         return false;
     MIRType mirType = ToMIRType(type);
-    *def = f.mul(lhs, rhs, mirType, mirType == MIRType_Int32 ? MMul::Integer : MMul::Normal);
+    *def = f.mul(lhs, rhs, mirType, mirType == MIRType::Int32 ? MMul::Integer : MMul::Normal);
     return true;
 }
 
 static bool
 EmitSelect(FunctionCompiler& f, MDefinition** def)
 {
     MDefinition* trueExpr;
     if (!EmitExpr(f, &trueExpr))
@@ -2263,17 +2263,17 @@ EmitSelect(FunctionCompiler& f, MDefinit
         return false;
 
     MDefinition* condExpr;
     if (!EmitExpr(f, &condExpr))
         return false;
 
     if (trueExpr && falseExpr &&
         trueExpr->type() == falseExpr->type() &&
-        trueExpr->type() != MIRType_None)
+        trueExpr->type() != MIRType::None)
     {
         *def = f.select(trueExpr, falseExpr, condExpr);
     } else {
         *def = nullptr;
     }
 
     return true;
 }
--- a/js/src/asmjs/WasmStubs.cpp
+++ b/js/src/asmjs/WasmStubs.cpp
@@ -161,77 +161,77 @@ wasm::GenerateEntry(MacroAssembler& masm
     masm.reserveStack(AlignBytes(StackArgBytes(sig.args()), AsmJSStackAlignment));
 
     // Copy parameters out of argv and into the registers/stack-slots specified by
     // the system ABI.
     for (ABIArgValTypeIter iter(sig.args()); !iter.done(); iter++) {
         unsigned argOffset = iter.index() * Module::SizeOfEntryArg;
         Address src(argv, argOffset);
         MIRType type = iter.mirType();
-        MOZ_ASSERT_IF(type == MIRType_Int64, JitOptions.wasmTestMode);
+        MOZ_ASSERT_IF(type == MIRType::Int64, JitOptions.wasmTestMode);
         switch (iter->kind()) {
           case ABIArg::GPR:
-            if (type == MIRType_Int32)
+            if (type == MIRType::Int32)
                 masm.load32(src, iter->gpr());
-            else if (type == MIRType_Int64)
+            else if (type == MIRType::Int64)
                 masm.load64(src, iter->gpr64());
             break;
 #ifdef JS_CODEGEN_REGISTER_PAIR
           case ABIArg::GPR_PAIR:
             MOZ_CRASH("wasm uses hardfp for function calls.");
             break;
 #endif
           case ABIArg::FPU: {
             static_assert(Module::SizeOfEntryArg >= jit::Simd128DataSize,
                           "EntryArg must be big enough to store SIMD values");
             switch (type) {
-              case MIRType_Int32x4:
-              case MIRType_Bool32x4:
+              case MIRType::Int32x4:
+              case MIRType::Bool32x4:
                 masm.loadUnalignedInt32x4(src, iter->fpu());
                 break;
-              case MIRType_Float32x4:
+              case MIRType::Float32x4:
                 masm.loadUnalignedFloat32x4(src, iter->fpu());
                 break;
-              case MIRType_Double:
+              case MIRType::Double:
                 masm.loadDouble(src, iter->fpu());
                 break;
-              case MIRType_Float32:
+              case MIRType::Float32:
                 masm.loadFloat32(src, iter->fpu());
                 break;
               default:
                 MOZ_MAKE_COMPILER_ASSUME_IS_UNREACHABLE("unexpected FPU type");
                 break;
             }
             break;
           }
           case ABIArg::Stack:
             switch (type) {
-              case MIRType_Int32:
+              case MIRType::Int32:
                 masm.load32(src, scratch);
                 masm.storePtr(scratch, Address(masm.getStackPointer(), iter->offsetFromArgBase()));
                 break;
-              case MIRType_Int64:
+              case MIRType::Int64:
                 masm.load64(src, scratch64);
                 masm.store64(scratch64, Address(masm.getStackPointer(), iter->offsetFromArgBase()));
                 break;
-              case MIRType_Double:
+              case MIRType::Double:
                 masm.loadDouble(src, ScratchDoubleReg);
                 masm.storeDouble(ScratchDoubleReg, Address(masm.getStackPointer(), iter->offsetFromArgBase()));
                 break;
-              case MIRType_Float32:
+              case MIRType::Float32:
                 masm.loadFloat32(src, ScratchFloat32Reg);
                 masm.storeFloat32(ScratchFloat32Reg, Address(masm.getStackPointer(), iter->offsetFromArgBase()));
                 break;
-              case MIRType_Int32x4:
-              case MIRType_Bool32x4:
+              case MIRType::Int32x4:
+              case MIRType::Bool32x4:
                 masm.loadUnalignedInt32x4(src, ScratchSimd128Reg);
                 masm.storeAlignedInt32x4(ScratchSimd128Reg,
                                          Address(masm.getStackPointer(), iter->offsetFromArgBase()));
                 break;
-              case MIRType_Float32x4:
+              case MIRType::Float32x4:
                 masm.loadUnalignedFloat32x4(src, ScratchSimd128Reg);
                 masm.storeAlignedFloat32x4(ScratchSimd128Reg,
                                            Address(masm.getStackPointer(), iter->offsetFromArgBase()));
                 break;
               default:
                 MOZ_MAKE_COMPILER_ASSUME_IS_UNREACHABLE("unexpected stack arg type");
             }
             break;
@@ -298,26 +298,26 @@ static void
 FillArgumentArray(MacroAssembler& masm, const ValTypeVector& args, unsigned argOffset,
                   unsigned offsetToCallerStackArgs, Register scratch, ToValue toValue)
 {
     Register64 scratch64(scratch);
     for (ABIArgValTypeIter i(args); !i.done(); i++) {
         Address dstAddr(masm.getStackPointer(), argOffset + i.index() * sizeof(Value));
 
         MIRType type = i.mirType();
-        MOZ_ASSERT_IF(type == MIRType_Int64, JitOptions.wasmTestMode);
+        MOZ_ASSERT_IF(type == MIRType::Int64, JitOptions.wasmTestMode);
 
         switch (i->kind()) {
           case ABIArg::GPR:
-            if (type == MIRType_Int32) {
+            if (type == MIRType::Int32) {
                 if (toValue)
                     masm.storeValue(JSVAL_TYPE_INT32, i->gpr(), dstAddr);
                 else
                     masm.store32(i->gpr(), dstAddr);
-            } else if (type == MIRType_Int64) {
+            } else if (type == MIRType::Int64) {
                 // We can't box int64 into Values (yet).
                 if (toValue)
                     masm.breakpoint();
                 else
                     masm.store64(i->gpr64(), dstAddr);
             } else {
                 MOZ_CRASH("unexpected input type?");
             }
@@ -326,47 +326,47 @@ FillArgumentArray(MacroAssembler& masm, 
           case ABIArg::GPR_PAIR:
             MOZ_CRASH("AsmJS uses hardfp for function calls.");
             break;
 #endif
           case ABIArg::FPU: {
             MOZ_ASSERT(IsFloatingPointType(type));
             FloatRegister srcReg = i->fpu();
             if (toValue) {
-                if (type == MIRType_Float32) {
+                if (type == MIRType::Float32) {
                     masm.convertFloat32ToDouble(i->fpu(), ScratchDoubleReg);
                     srcReg = ScratchDoubleReg;
                 }
                 masm.canonicalizeDouble(srcReg);
             }
             masm.storeDouble(srcReg, dstAddr);
             break;
           }
           case ABIArg::Stack:
-            if (type == MIRType_Int32) {
+            if (type == MIRType::Int32) {
                 Address src(masm.getStackPointer(), offsetToCallerStackArgs + i->offsetFromArgBase());
                 masm.load32(src, scratch);
                 if (toValue)
                     masm.storeValue(JSVAL_TYPE_INT32, scratch, dstAddr);
                 else
                     masm.store32(scratch, dstAddr);
-            } else if (type == MIRType_Int64) {
+            } else if (type == MIRType::Int64) {
                 // We can't box int64 into Values (yet).
                 if (toValue) {
                     masm.breakpoint();
                 } else {
                     Address src(masm.getStackPointer(), offsetToCallerStackArgs + i->offsetFromArgBase());
                     masm.load64(src, scratch64);
                     masm.store64(scratch64, dstAddr);
                 }
             } else {
                 MOZ_ASSERT(IsFloatingPointType(type));
                 Address src(masm.getStackPointer(), offsetToCallerStackArgs + i->offsetFromArgBase());
                 if (toValue) {
-                    if (type == MIRType_Float32) {
+                    if (type == MIRType::Float32) {
                         masm.loadFloat32(src, ScratchFloat32Reg);
                         masm.convertFloat32ToDouble(ScratchFloat32Reg, ScratchDoubleReg);
                     } else {
                         masm.loadDouble(src, ScratchDoubleReg);
                     }
                     masm.canonicalizeDouble(ScratchDoubleReg);
                 } else {
                     masm.loadDouble(src, ScratchDoubleReg);
@@ -384,19 +384,19 @@ FillArgumentArray(MacroAssembler& masm, 
 ProfilingOffsets
 wasm::GenerateInterpExit(MacroAssembler& masm, const Import& import, uint32_t importIndex)
 {
     const Sig& sig = import.sig();
 
     masm.setFramePushed(0);
 
     // Argument types for InvokeImport_*:
-    static const MIRType typeArray[] = { MIRType_Pointer,   // ImportExit
-                                         MIRType_Int32,     // argc
-                                         MIRType_Pointer }; // argv
+    static const MIRType typeArray[] = { MIRType::Pointer,   // ImportExit
+                                         MIRType::Int32,     // argc
+                                         MIRType::Pointer }; // argv
     MIRTypeVector invokeArgTypes;
     MOZ_ALWAYS_TRUE(invokeArgTypes.append(typeArray, ArrayLength(typeArray)));
 
     // At the point of the call, the stack layout shall be (sp grows to the left):
     //   | stack args | padding | Value argv[] | padding | retaddr | caller stack args |
     // The padding between stack args and argv ensures that argv is aligned. The
     // padding between argv and retaddr ensures that sp is aligned.
     unsigned argOffset = AlignBytes(StackArgBytes(invokeArgTypes), sizeof(double));
@@ -740,17 +740,17 @@ wasm::GenerateJitExit(MacroAssembler& ma
 
     if (oolConvert.used()) {
         masm.bind(&oolConvert);
         masm.setFramePushed(nativeFramePushed);
 
         // Coercion calls use the following stack layout (sp grows to the left):
         //   | args | padding | Value argv[1] | padding | exit AsmJSFrame |
         MIRTypeVector coerceArgTypes;
-        JS_ALWAYS_TRUE(coerceArgTypes.append(MIRType_Pointer));
+        JS_ALWAYS_TRUE(coerceArgTypes.append(MIRType::Pointer));
         unsigned offsetToCoerceArgv = AlignBytes(StackArgBytes(coerceArgTypes), sizeof(Value));
         MOZ_ASSERT(nativeFramePushed >= offsetToCoerceArgv + sizeof(Value));
         AssertStackAlignment(masm, ABIStackAlignment);
 
         // Store return value into argv[0]
         masm.storeValue(JSReturnOperand, Address(masm.getStackPointer(), offsetToCoerceArgv));
 
         // argument 0: argv
--- a/js/src/asmjs/WasmTypes.h
+++ b/js/src/asmjs/WasmTypes.h
@@ -84,32 +84,32 @@ IsSimdBoolType(ValType vt)
 {
     return vt == ValType::B32x4;
 }
 
 static inline jit::MIRType
 ToMIRType(ValType vt)
 {
     switch (vt) {
-      case ValType::I32: return jit::MIRType_Int32;
-      case ValType::I64: return jit::MIRType_Int64;
-      case ValType::F32: return jit::MIRType_Float32;
-      case ValType::F64: return jit::MIRType_Double;
-      case ValType::I32x4: return jit::MIRType_Int32x4;
-      case ValType::F32x4: return jit::MIRType_Float32x4;
-      case ValType::B32x4: return jit::MIRType_Bool32x4;
+      case ValType::I32: return jit::MIRType::Int32;
+      case ValType::I64: return jit::MIRType::Int64;
+      case ValType::F32: return jit::MIRType::Float32;
+      case ValType::F64: return jit::MIRType::Double;
+      case ValType::I32x4: return jit::MIRType::Int32x4;
+      case ValType::F32x4: return jit::MIRType::Float32x4;
+      case ValType::B32x4: return jit::MIRType::Bool32x4;
       case ValType::Limit: break;
     }
     MOZ_MAKE_COMPILER_ASSUME_IS_UNREACHABLE("bad type");
 }
 
 static inline jit::MIRType
 ToMIRType(ExprType et)
 {
-    return IsVoid(et) ? jit::MIRType_None : ToMIRType(ValType(et));
+    return IsVoid(et) ? jit::MIRType::None : ToMIRType(ValType(et));
 }
 
 static inline const char*
 ToCString(ExprType type)
 {
     switch (type) {
       case ExprType::Void:  return "void";
       case ExprType::I32:   return "i32";
--- a/js/src/jit/AlignmentMaskAnalysis.cpp
+++ b/js/src/jit/AlignmentMaskAnalysis.cpp
@@ -32,17 +32,17 @@ AnalyzeAsmHeapAddress(MDefinition* ptr, 
     //   (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
-    // with MIRType_Int32, we make sure that the value is truncated, just as it
+    // 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;
 
     MDefinition* lhs = ptr->toBitAnd()->getOperand(0);
@@ -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::NewAsmJS(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::NewAsmJS(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/BaselineCompiler.cpp
+++ b/js/src/jit/BaselineCompiler.cpp
@@ -2490,17 +2490,17 @@ BaselineCompiler::emit_JSOP_SETALIASEDVA
     }
 
     // Keep rvalue in R0.
     frame.popRegsAndSync(1);
     Register objReg = R2.scratchReg();
 
     getScopeCoordinateObject(objReg);
     Address address = getScopeCoordinateAddressFromObject(objReg, R1.scratchReg());
-    masm.patchableCallPreBarrier(address, MIRType_Value);
+    masm.patchableCallPreBarrier(address, MIRType::Value);
     masm.storeValue(R0, address);
     frame.push(R0);
 
     // Only R0 is live at this point.
     // Scope coordinate object is already in R2.scratchReg().
     Register temp = R1.scratchReg();
 
     Label skipBarrier;
@@ -2900,17 +2900,17 @@ BaselineCompiler::emitFormalArgAccess(ui
     masm.loadPrivate(Address(reg, ArgumentsObject::getDataSlotOffset()), reg);
 
     // Load/store the argument.
     Address argAddr(reg, ArgumentsData::offsetOfArgs() + arg * sizeof(Value));
     if (get) {
         masm.loadValue(argAddr, R0);
         frame.push(R0);
     } else {
-        masm.patchableCallPreBarrier(argAddr, MIRType_Value);
+        masm.patchableCallPreBarrier(argAddr, MIRType::Value);
         masm.loadValue(frame.addressOfStackValue(frame.peek(-1)), R0);
         masm.storeValue(R0, argAddr);
 
         MOZ_ASSERT(frame.numUnsyncedSlots() == 0);
 
         Register temp = R1.scratchReg();
 
         // Reload the arguments object
@@ -3936,17 +3936,17 @@ BaselineCompiler::emit_JSOP_INITIALYIELD
     masm.unboxObject(frame.addressOfStackValue(frame.peek(-1)), genObj);
 
     MOZ_ASSERT(GET_UINT24(pc) == 0);
     masm.storeValue(Int32Value(0), Address(genObj, GeneratorObject::offsetOfYieldIndexSlot()));
 
     Register scopeObj = R0.scratchReg();
     Address scopeChainSlot(genObj, GeneratorObject::offsetOfScopeChainSlot());
     masm.loadPtr(frame.addressOfScopeChain(), scopeObj);
-    masm.patchableCallPreBarrier(scopeChainSlot, MIRType_Value);
+    masm.patchableCallPreBarrier(scopeChainSlot, MIRType::Value);
     masm.storeValue(JSVAL_TYPE_OBJECT, scopeObj, scopeChainSlot);
 
     Register temp = R1.scratchReg();
     Label skipBarrier;
     masm.branchPtrInNurseryRange(Assembler::Equal, genObj, temp, &skipBarrier);
     masm.branchPtrInNurseryRange(Assembler::NotEqual, scopeObj, temp, &skipBarrier);
     masm.push(genObj);
     MOZ_ASSERT(genObj == R2.scratchReg());
@@ -3981,17 +3981,17 @@ BaselineCompiler::emit_JSOP_YIELD()
         // generator is in the closing state, see GeneratorObject::suspend.
 
         masm.storeValue(Int32Value(GET_UINT24(pc)),
                         Address(genObj, GeneratorObject::offsetOfYieldIndexSlot()));
 
         Register scopeObj = R0.scratchReg();
         Address scopeChainSlot(genObj, GeneratorObject::offsetOfScopeChainSlot());
         masm.loadPtr(frame.addressOfScopeChain(), scopeObj);
-        masm.patchableCallPreBarrier(scopeChainSlot, MIRType_Value);
+        masm.patchableCallPreBarrier(scopeChainSlot, MIRType::Value);
         masm.storeValue(JSVAL_TYPE_OBJECT, scopeObj, scopeChainSlot);
 
         Register temp = R1.scratchReg();
         Label skipBarrier;
         masm.branchPtrInNurseryRange(Assembler::Equal, genObj, temp, &skipBarrier);
         masm.branchPtrInNurseryRange(Assembler::NotEqual, scopeObj, temp, &skipBarrier);
         MOZ_ASSERT(genObj == R2.scratchReg());
         masm.call(&postBarrierSlot_);
@@ -4209,17 +4209,17 @@ BaselineCompiler::emit_JSOP_RESUME()
         {
             masm.pushValue(Address(scratch2, 0));
             masm.addPtr(Imm32(sizeof(Value)), scratch2);
             masm.sub32(Imm32(1), initLength);
             masm.jump(&loop);
         }
         masm.bind(&loopDone);
 
-        masm.patchableCallPreBarrier(exprStackSlot, MIRType_Value);
+        masm.patchableCallPreBarrier(exprStackSlot, MIRType::Value);
         masm.storeValue(NullValue(), exprStackSlot);
         regs.add(initLength);
     }
 
     masm.bind(&noExprStack);
     masm.pushValue(retVal);
 
     if (resumeKind == GeneratorObject::NEXT) {
--- a/js/src/jit/BaselineIC.cpp
+++ b/js/src/jit/BaselineIC.cpp
@@ -2732,19 +2732,19 @@ BaselineScript::noteArrayWriteHole(uint3
 // SetElem_DenseOrUnboxedArray
 //
 
 template <typename T>
 void
 EmitUnboxedPreBarrierForBaseline(MacroAssembler &masm, T address, JSValueType type)
 {
     if (type == JSVAL_TYPE_OBJECT)
-        EmitPreBarrier(masm, address, MIRType_Object);
+        EmitPreBarrier(masm, address, MIRType::Object);
     else if (type == JSVAL_TYPE_STRING)
-        EmitPreBarrier(masm, address, MIRType_String);
+        EmitPreBarrier(masm, address, MIRType::String);
     else
         MOZ_ASSERT(!UnboxedTypeNeedsPreBarrier(type));
 }
 
 bool
 ICSetElem_DenseOrUnboxedArray::Compiler::generateStubCode(MacroAssembler& masm)
 {
     MOZ_ASSERT(engine_ == Engine::Baseline);
@@ -2851,17 +2851,17 @@ ICSetElem_DenseOrUnboxedArray::Compiler:
             masm.convertInt32ValueToDouble(valueAddr, regs.getAny(), &noSpecialHandling);
         else
             masm.assumeUnreachable("There shouldn't be double arrays when there is no FP support.");
 
         masm.bind(&noSpecialHandling);
 
         ValueOperand tmpVal = regs.takeAnyValue();
         masm.loadValue(valueAddr, tmpVal);
-        EmitPreBarrier(masm, element, MIRType_Value);
+        EmitPreBarrier(masm, element, MIRType::Value);
         masm.storeValue(tmpVal, element);
     } else {
         // Set element on an unboxed array.
 
         // Bounds check.
         Address initLength(obj, UnboxedArrayObject::offsetOfCapacityIndexAndInitializedLength());
         masm.load32(initLength, scratchReg);
         masm.and32(Imm32(UnboxedArrayObject::InitializedLengthMask), scratchReg);
@@ -4744,17 +4744,17 @@ ICSetProp_Native::Compiler::generateStub
         holderReg = objReg;
     } else {
         holderReg = regs.takeAny();
         masm.loadPtr(Address(objReg, NativeObject::offsetOfSlots()), holderReg);
     }
 
     // Perform the store.
     masm.load32(Address(ICStubReg, ICSetProp_Native::offsetOfOffset()), scratch);
-    EmitPreBarrier(masm, BaseIndex(holderReg, scratch, TimesOne), MIRType_Value);
+    EmitPreBarrier(masm, BaseIndex(holderReg, scratch, TimesOne), MIRType::Value);
     masm.storeValue(R1, BaseIndex(holderReg, scratch, TimesOne));
     if (holderReg != objReg)
         regs.add(holderReg);
     if (cx->runtime()->gc.nursery.exists()) {
         Register scr = regs.takeAny();
         LiveGeneralRegisterSet saveRegs;
         saveRegs.add(R1);
         emitPostWriteBarrierSlot(masm, objReg, R1, scr, saveRegs);
@@ -4862,42 +4862,42 @@ ICSetPropNativeAddCompiler::generateStub
                        ImmWord(0),
                        &noGroupChange);
 
         // Reload the new group from the cache.
         masm.loadPtr(Address(ICStubReg, ICSetProp_NativeAdd::offsetOfNewGroup()), scratch);
 
         // Change the object's group.
         Address groupAddr(objReg, JSObject::offsetOfGroup());
-        EmitPreBarrier(masm, groupAddr, MIRType_ObjectGroup);
+        EmitPreBarrier(masm, groupAddr, MIRType::ObjectGroup);
         masm.storePtr(scratch, groupAddr);
 
         masm.bind(&noGroupChange);
     }
 
     Register holderReg;
     regs.add(R0);
     regs.takeUnchecked(objReg);
 
     if (obj_->is<UnboxedPlainObject>()) {
         holderReg = regs.takeAny();
         masm.loadPtr(Address(objReg, UnboxedPlainObject::offsetOfExpando()), holderReg);
 
         // Write the expando object's new shape.
         Address shapeAddr(holderReg, JSObject::offsetOfShape());
-        EmitPreBarrier(masm, shapeAddr, MIRType_Shape);
+        EmitPreBarrier(masm, shapeAddr, MIRType::Shape);
         masm.loadPtr(Address(ICStubReg, ICSetProp_NativeAdd::offsetOfNewShape()), scratch);
         masm.storePtr(scratch, shapeAddr);
 
         if (!isFixedSlot_)
             masm.loadPtr(Address(holderReg, NativeObject::offsetOfSlots()), holderReg);
     } else {
         // Write the object's new shape.
         Address shapeAddr(objReg, JSObject::offsetOfShape());
-        EmitPreBarrier(masm, shapeAddr, MIRType_Shape);
+        EmitPreBarrier(masm, shapeAddr, MIRType::Shape);
         masm.loadPtr(Address(ICStubReg, ICSetProp_NativeAdd::offsetOfNewShape()), scratch);
         masm.storePtr(scratch, shapeAddr);
 
         if (isFixedSlot_) {
             holderReg = objReg;
         } else {
             holderReg = regs.takeAny();
             masm.loadPtr(Address(objReg, NativeObject::offsetOfSlots()), holderReg);
@@ -5073,35 +5073,35 @@ ICSetProp_TypedObject::Compiler::generat
         masm.popValue(R1);
     } else {
         ReferenceTypeDescr::Type type = fieldDescr_->as<ReferenceTypeDescr>().type();
 
         masm.popValue(R1);
 
         switch (type) {
           case ReferenceTypeDescr::TYPE_ANY:
-            EmitPreBarrier(masm, dest, MIRType_Value);
+            EmitPreBarrier(masm, dest, MIRType::Value);
             masm.storeValue(R1, dest);
             break;
 
           case ReferenceTypeDescr::TYPE_OBJECT: {
-            EmitPreBarrier(masm, dest, MIRType_Object);
+            EmitPreBarrier(masm, dest, MIRType::Object);
             Label notObject;
             masm.branchTestObject(Assembler::NotEqual, R1, &notObject);
             Register rhsObject = masm.extractObject(R1, ExtractTemp0);
             masm.storePtr(rhsObject, dest);
             EmitReturnFromIC(masm);
             masm.bind(&notObject);
             masm.branchTestNull(Assembler::NotEqual, R1, &failure);
             masm.storePtr(ImmWord(0), dest);
             break;
           }
 
           case ReferenceTypeDescr::TYPE_STRING: {
-            EmitPreBarrier(masm, dest, MIRType_String);
+            EmitPreBarrier(masm, dest, MIRType::String);
             masm.branchTestString(Assembler::NotEqual, R1, &failure);
             Register rhsString = masm.extractString(R1, ExtractTemp0);
             masm.storePtr(rhsString, dest);
             break;
           }
 
           default:
             MOZ_CRASH();
--- a/js/src/jit/BaselineInspector.cpp
+++ b/js/src/jit/BaselineInspector.cpp
@@ -249,39 +249,39 @@ BaselineInspector::dimorphicStub(jsbytec
     *psecond = next;
     return true;
 }
 
 MIRType
 BaselineInspector::expectedResultType(jsbytecode* pc)
 {
     // Look at the IC entries for this op to guess what type it will produce,
-    // returning MIRType_None otherwise.
+    // returning MIRType::None otherwise.
 
     ICStub* stub = monomorphicStub(pc);
     if (!stub)
-        return MIRType_None;
+        return MIRType::None;
 
     switch (stub->kind()) {
       case ICStub::BinaryArith_Int32:
         if (stub->toBinaryArith_Int32()->allowDouble())
-            return MIRType_Double;
-        return MIRType_Int32;
+            return MIRType::Double;
+        return MIRType::Int32;
       case ICStub::BinaryArith_BooleanWithInt32:
       case ICStub::UnaryArith_Int32:
       case ICStub::BinaryArith_DoubleWithInt32:
-        return MIRType_Int32;
+        return MIRType::Int32;
       case ICStub::BinaryArith_Double:
       case ICStub::UnaryArith_Double:
-        return MIRType_Double;
+        return MIRType::Double;
       case ICStub::BinaryArith_StringConcat:
       case ICStub::BinaryArith_StringObjectConcat:
-        return MIRType_String;
+        return MIRType::String;
       default:
-        return MIRType_None;
+        return MIRType::None;
     }
 }
 
 // Whether a baseline stub kind is suitable for a double comparison that
 // converts its operands to doubles.
 static bool
 CanUseDoubleCompare(ICStub::Kind kind)
 {
@@ -371,54 +371,54 @@ TryToSpecializeBinaryArithOp(ICStub** st
             break;
         }
     }
 
     if (sawOther)
         return false;
 
     if (sawDouble) {
-        *result = MIRType_Double;
+        *result = MIRType::Double;
         return true;
     }
 
     MOZ_ASSERT(sawInt32);
-    *result = MIRType_Int32;
+    *result = MIRType::Int32;
     return true;
 }
 
 MIRType
 BaselineInspector::expectedBinaryArithSpecialization(jsbytecode* pc)
 {
     if (!hasBaselineScript())
-        return MIRType_None;
+        return MIRType::None;
 
     MIRType result;
     ICStub* stubs[2];
 
     const ICEntry& entry = icEntryFromPC(pc);
     ICStub* stub = entry.fallbackStub();
     if (stub->isBinaryArith_Fallback() &&
         stub->toBinaryArith_Fallback()->hadUnoptimizableOperands())
     {
-        return MIRType_None;
+        return MIRType::None;
     }
 
     stubs[0] = monomorphicStub(pc);
     if (stubs[0]) {
         if (TryToSpecializeBinaryArithOp(stubs, 1, &result))
             return result;
     }
 
     if (dimorphicStub(pc, &stubs[0], &stubs[1])) {
         if (TryToSpecializeBinaryArithOp(stubs, 2, &result))
             return result;
     }
 
-    return MIRType_None;
+    return MIRType::None;
 }
 
 bool
 BaselineInspector::hasSeenNonNativeGetElement(jsbytecode* pc)
 {
     if (!hasBaselineScript())
         return false;
 
@@ -767,48 +767,48 @@ BaselineInspector::commonSetPropFunction
 
 static MIRType
 GetCacheIRExpectedInputType(ICCacheIR_Monitored* stub)
 {
     CacheIRReader reader(stub->stubInfo());
 
     // For now, all CacheIR stubs expect an object.
     MOZ_ALWAYS_TRUE(reader.matchOp(CacheOp::GuardIsObject, ObjOperandId(0)));
-    return MIRType_Object;
+    return MIRType::Object;
 }
 
 MIRType
 BaselineInspector::expectedPropertyAccessInputType(jsbytecode* pc)
 {
     if (!hasBaselineScript())
-        return MIRType_Value;
+        return MIRType::Value;
 
     const ICEntry& entry = icEntryFromPC(pc);
-    MIRType type = MIRType_None;
+    MIRType type = MIRType::None;
 
     for (ICStub* stub = entry.firstStub(); stub; stub = stub->next()) {
         MIRType stubType;
         switch (stub->kind()) {
           case ICStub::GetProp_Fallback:
             if (stub->toGetProp_Fallback()->hadUnoptimizableAccess())
-                return MIRType_Value;
+                return MIRType::Value;
             continue;
 
           case ICStub::GetElem_Fallback:
             if (stub->toGetElem_Fallback()->hadUnoptimizableAccess())
-                return MIRType_Value;
+                return MIRType::Value;
             continue;
 
           case ICStub::GetProp_Generic:
-            return MIRType_Value;
+            return MIRType::Value;
 
           case ICStub::GetProp_ArgumentsLength:
           case ICStub::GetElem_Arguments:
             // Either an object or magic arguments.
-            return MIRType_Value;
+            return MIRType::Value;
 
           case ICStub::GetProp_Unboxed:
           case ICStub::GetProp_TypedObject:
           case ICStub::GetProp_CallScripted:
           case ICStub::GetProp_CallNative:
           case ICStub::GetProp_CallDOMProxyNative:
           case ICStub::GetProp_CallDOMProxyWithGenerationNative:
           case ICStub::GetProp_DOMProxyShadowed:
@@ -820,46 +820,46 @@ BaselineInspector::expectedPropertyAcces
           case ICStub::GetElem_NativePrototypeCallNativeSymbol:
           case ICStub::GetElem_NativePrototypeCallScriptedName:
           case ICStub::GetElem_NativePrototypeCallScriptedSymbol:
           case ICStub::GetElem_UnboxedPropertyName:
           case ICStub::GetElem_String:
           case ICStub::GetElem_Dense:
           case ICStub::GetElem_TypedArray:
           case ICStub::GetElem_UnboxedArray:
-            stubType = MIRType_Object;
+            stubType = MIRType::Object;
             break;
 
           case ICStub::GetProp_Primitive:
             stubType = MIRTypeFromValueType(stub->toGetProp_Primitive()->primitiveType());
             break;
 
           case ICStub::GetProp_StringLength:
-            stubType = MIRType_String;
+            stubType = MIRType::String;
             break;
 
           case ICStub::CacheIR_Monitored:
             stubType = GetCacheIRExpectedInputType(stub->toCacheIR_Monitored());
-            if (stubType == MIRType_Value)
-                return MIRType_Value;
+            if (stubType == MIRType::Value)
+                return MIRType::Value;
             break;
 
           default:
             MOZ_CRASH("Unexpected stub");
         }
 
-        if (type != MIRType_None) {
+        if (type != MIRType::None) {
             if (type != stubType)
-                return MIRType_Value;
+                return MIRType::Value;
         } else {
             type = stubType;
         }
     }
 
-    return (type == MIRType_None) ? MIRType_Value : type;
+    return (type == MIRType::None) ? MIRType::Value : type;
 }
 
 bool
 BaselineInspector::instanceOfData(jsbytecode* pc, Shape** shape, uint32_t* slot,
                                   JSObject** prototypeObject)
 {
     MOZ_ASSERT(*pc == JSOP_INSTANCEOF);
 
--- a/js/src/jit/CodeGenerator.cpp
+++ b/js/src/jit/CodeGenerator.cpp
@@ -192,17 +192,17 @@ CodeGenerator::visitValueToInt32(LValueT
     if (lir->mode() == LValueToInt32::TRUNCATE) {
         OutOfLineCode* oolDouble = oolTruncateDouble(temp, output, lir->mir());
 
         // We can only handle strings in truncation contexts, like bitwise
         // operations.
         Label* stringEntry;
         Label* stringRejoin;
         Register stringReg;
-        if (input->mightBeType(MIRType_String)) {
+        if (input->mightBeType(MIRType::String)) {
             stringReg = ToRegister(lir->temp());
             OutOfLineCode* oolString = oolCallVM(StringToNumberInfo, lir, ArgList(stringReg),
                                                  StoreFloatRegisterTo(temp));
             stringEntry = oolString->entry();
             stringRejoin = oolString->rejoin();
         } else {
             stringReg = InvalidReg;
             stringEntry = nullptr;
@@ -511,24 +511,24 @@ CodeGenerator::testValueTruthyKernel(con
                                      OutOfLineTestObject* ool,
                                      MDefinition* valueMIR)
 {
     // Count the number of possible type tags we might have, so we'll know when
     // we've checked them all and hence can avoid emitting a tag check for the
     // last one.  In particular, whenever tagCount is 1 that means we've tried
     // all but one of them already so we know exactly what's left based on the
     // mightBe* booleans.
-    bool mightBeUndefined = valueMIR->mightBeType(MIRType_Undefined);
-    bool mightBeNull = valueMIR->mightBeType(MIRType_Null);
-    bool mightBeBoolean = valueMIR->mightBeType(MIRType_Boolean);
-    bool mightBeInt32 = valueMIR->mightBeType(MIRType_Int32);
-    bool mightBeObject = valueMIR->mightBeType(MIRType_Object);
-    bool mightBeString = valueMIR->mightBeType(MIRType_String);
-    bool mightBeSymbol = valueMIR->mightBeType(MIRType_Symbol);
-    bool mightBeDouble = valueMIR->mightBeType(MIRType_Double);
+    bool mightBeUndefined = valueMIR->mightBeType(MIRType::Undefined);
+    bool mightBeNull = valueMIR->mightBeType(MIRType::Null);
+    bool mightBeBoolean = valueMIR->mightBeType(MIRType::Boolean);
+    bool mightBeInt32 = valueMIR->mightBeType(MIRType::Int32);
+    bool mightBeObject = valueMIR->mightBeType(MIRType::Object);
+    bool mightBeString = valueMIR->mightBeType(MIRType::String);
+    bool mightBeSymbol = valueMIR->mightBeType(MIRType::Symbol);
+    bool mightBeDouble = valueMIR->mightBeType(MIRType::Double);
     int tagCount = int(mightBeUndefined) + int(mightBeNull) +
         int(mightBeBoolean) + int(mightBeInt32) + int(mightBeObject) +
         int(mightBeString) + int(mightBeSymbol) + int(mightBeDouble);
 
     MOZ_ASSERT_IF(!valueMIR->emptyResultTypeSet(), tagCount > 0);
 
     // If we know we're null or undefined, we're definitely falsy, no
     // need to even check the tag.
@@ -672,47 +672,47 @@ CodeGenerator::getJumpLabelForBranch(MBa
     masm.bind(&after);
     return res;
 }
 
 void
 CodeGenerator::visitTestOAndBranch(LTestOAndBranch* lir)
 {
     MIRType inputType = lir->mir()->input()->type();
-    MOZ_ASSERT(inputType == MIRType_ObjectOrNull || lir->mir()->operandMightEmulateUndefined(),
+    MOZ_ASSERT(inputType == MIRType::ObjectOrNull || lir->mir()->operandMightEmulateUndefined(),
                "If the object couldn't emulate undefined, this should have been folded.");
 
     Label* truthy = getJumpLabelForBranch(lir->ifTruthy());
     Label* falsy = getJumpLabelForBranch(lir->ifFalsy());
     Register input = ToRegister(lir->input());
 
     if (lir->mir()->operandMightEmulateUndefined()) {
-        if (inputType == MIRType_ObjectOrNull)
+        if (inputType == MIRType::ObjectOrNull)
             masm.branchTestPtr(Assembler::Zero, input, input, falsy);
 
         OutOfLineTestObject* ool = new(alloc()) OutOfLineTestObject();
         addOutOfLineCode(ool, lir->mir());
 
         testObjectEmulatesUndefined(input, falsy, truthy, ToRegister(lir->temp()), ool);
     } else {
-        MOZ_ASSERT(inputType == MIRType_ObjectOrNull);
+        MOZ_ASSERT(inputType == MIRType::ObjectOrNull);
         testZeroEmitBranch(Assembler::NotEqual, input, lir->ifTruthy(), lir->ifFalsy());
     }
 }
 
 void
 CodeGenerator::visitTestVAndBranch(LTestVAndBranch* lir)
 {
     OutOfLineTestObject* ool = nullptr;
     MDefinition* input = lir->mir()->input();
     // Unfortunately, it's possible that someone (e.g. phi elimination) switched
     // out our input after we did cacheOperandMightEmulateUndefined.  So we
     // might think it can emulate undefined _and_ know that it can't be an
     // object.
-    if (lir->mir()->operandMightEmulateUndefined() && input->mightBeType(MIRType_Object)) {
+    if (lir->mir()->operandMightEmulateUndefined() && input->mightBeType(MIRType::Object)) {
         ool = new(alloc()) OutOfLineTestObject();
         addOutOfLineCode(ool, lir->mir());
     }
 
     Label* truthy = getJumpLabelForBranch(lir->ifTruthy());
     Label* falsy = getJumpLabelForBranch(lir->ifFalsy());
 
     testValueTruthy(ToValue(lir, LTestVAndBranch::Input),
@@ -900,84 +900,84 @@ CodeGenerator::visitValueToString(LValue
     OutOfLineCode* ool = oolCallVM(PrimitiveToStringInfo, lir, ArgList(input),
                                    StoreRegisterTo(output));
 
     Label done;
     Register tag = masm.splitTagForTest(input);
     const JSAtomState& names = GetJitContext()->runtime->names();
 
     // String
-    if (lir->mir()->input()->mightBeType(MIRType_String)) {
+    if (lir->mir()->input()->mightBeType(MIRType::String)) {
         Label notString;
         masm.branchTestString(Assembler::NotEqual, tag, &notString);
         masm.unboxString(input, output);
         masm.jump(&done);
         masm.bind(&notString);
     }
 
     // Integer
-    if (lir->mir()->input()->mightBeType(MIRType_Int32)) {
+    if (lir->mir()->input()->mightBeType(MIRType::Int32)) {
         Label notInteger;
         masm.branchTestInt32(Assembler::NotEqual, tag, &notInteger);
         Register unboxed = ToTempUnboxRegister(lir->tempToUnbox());
         unboxed = masm.extractInt32(input, unboxed);
         emitIntToString(unboxed, output, ool->entry());
         masm.jump(&done);
         masm.bind(&notInteger);
     }
 
     // Double
-    if (lir->mir()->input()->mightBeType(MIRType_Double)) {
+    if (lir->mir()->input()->mightBeType(MIRType::Double)) {
         // Note: no fastpath. Need two extra registers and can only convert doubles
         // that fit integers and are smaller than StaticStrings::INT_STATIC_LIMIT.
         masm.branchTestDouble(Assembler::Equal, tag, ool->entry());
     }
 
     // Undefined
-    if (lir->mir()->input()->mightBeType(MIRType_Undefined)) {
+    if (lir->mir()->input()->mightBeType(MIRType::Undefined)) {
         Label notUndefined;
         masm.branchTestUndefined(Assembler::NotEqual, tag, &notUndefined);
         masm.movePtr(ImmGCPtr(names.undefined), output);
         masm.jump(&done);
         masm.bind(&notUndefined);
     }
 
     // Null
-    if (lir->mir()->input()->mightBeType(MIRType_Null)) {
+    if (lir->mir()->input()->mightBeType(MIRType::Null)) {
         Label notNull;
         masm.branchTestNull(Assembler::NotEqual, tag, &notNull);
         masm.movePtr(ImmGCPtr(names.null), output);
         masm.jump(&done);
         masm.bind(&notNull);
     }
 
     // Boolean
-    if (lir->mir()->input()->mightBeType(MIRType_Boolean)) {
+    if (lir->mir()->input()->mightBeType(MIRType::Boolean)) {
         Label notBoolean, true_;
         masm.branchTestBoolean(Assembler::NotEqual, tag, &notBoolean);
         masm.branchTestBooleanTruthy(true, input, &true_);
         masm.movePtr(ImmGCPtr(names.false_), output);
         masm.jump(&done);
         masm.bind(&true_);
         masm.movePtr(ImmGCPtr(names.true_), output);
         masm.jump(&done);
         masm.bind(&notBoolean);
     }
 
     // Object
-    if (lir->mir()->input()->mightBeType(MIRType_Object)) {
+    if (lir->mir()->input()->mightBeType(MIRType::Object)) {
         // Bail.
         MOZ_ASSERT(lir->mir()->fallible());
         Label bail;
         masm.branchTestObject(Assembler::Equal, tag, &bail);
         bailoutFrom(&bail, lir->snapshot());
     }
 
     // Symbol
-    if (lir->mir()->input()->mightBeType(MIRType_Symbol))
+    if (lir->mir()->input()->mightBeType(MIRType::Symbol))
         masm.branchTestSymbol(Assembler::Equal, tag, ool->entry());
 
 #ifdef DEBUG
     masm.assumeUnreachable("Unexpected type for MValueToString.");
 #endif
 
     masm.bind(&done);
     masm.bind(ool->rejoin());
@@ -1213,19 +1213,19 @@ PrepareAndExecuteRegExp(JSContext* cx, M
     // Lazily update the RegExpStatics.
     masm.movePtr(ImmPtr(res), temp1);
 
     Address pendingInputAddress(temp1, RegExpStatics::offsetOfPendingInput());
     Address matchesInputAddress(temp1, RegExpStatics::offsetOfMatchesInput());
     Address lazySourceAddress(temp1, RegExpStatics::offsetOfLazySource());
     Address lazyIndexAddress(temp1, RegExpStatics::offsetOfLazyIndex());
 
-    masm.patchableCallPreBarrier(pendingInputAddress, MIRType_String);
-    masm.patchableCallPreBarrier(matchesInputAddress, MIRType_String);
-    masm.patchableCallPreBarrier(lazySourceAddress, MIRType_String);
+    masm.patchableCallPreBarrier(pendingInputAddress, MIRType::String);
+    masm.patchableCallPreBarrier(matchesInputAddress, MIRType::String);
+    masm.patchableCallPreBarrier(lazySourceAddress, MIRType::String);
 
     masm.storePtr(input, pendingInputAddress);
     masm.storePtr(input, matchesInputAddress);
     masm.storePtr(lastIndex, Address(temp1, RegExpStatics::offsetOfLazyIndex()));
     masm.store32(Imm32(1), Address(temp1, RegExpStatics::offsetOfPendingLazyEvaluation()));
 
     masm.loadPtr(Address(regexp, NativeObject::getFixedSlotOffset(RegExpObject::PRIVATE_SLOT)), temp2);
     masm.loadPtr(Address(temp2, RegExpShared::offsetOfSource()), temp3);
@@ -2664,17 +2664,17 @@ CodeGenerator::visitOutOfLineInterruptCh
 
 void
 CodeGenerator::visitTableSwitch(LTableSwitch* ins)
 {
     MTableSwitch* mir = ins->mir();
     Label* defaultcase = skipTrivialBlocks(mir->getDefault())->lir()->label();
     const LAllocation* temp;
 
-    if (mir->getOperand(0)->type() != MIRType_Int32) {
+    if (mir->getOperand(0)->type() != MIRType::Int32) {
         temp = ins->tempInt()->output();
 
         // The input is a double, so try and convert it to an integer.
         // If it does not fit in an integer, take the default case.
         masm.convertDoubleToInt32(ToFloatRegister(ins->index()), ToRegister(temp), defaultcase, false);
     } else {
         temp = ins->index();
     }
@@ -3004,17 +3004,17 @@ CodeGenerator::visitStoreSlotT(LStoreSlo
     int32_t offset = lir->mir()->slot() * sizeof(js::Value);
     Address dest(base, offset);
 
     if (lir->mir()->needsBarrier())
         emitPreBarrier(dest);
 
     MIRType valueType = lir->mir()->value()->type();
 
-    if (valueType == MIRType_ObjectOrNull) {
+    if (valueType == MIRType::ObjectOrNull) {
         masm.storeObjectOrNull(ToRegister(lir->value()), dest);
     } else {
         ConstantOrRegister value;
         if (lir->value()->isConstant())
             value = ConstantOrRegister(lir->value()->toConstant()->toJSValue());
         else
             value = TypedOrValueRegister(valueType, ToAnyRegister(lir->value()));
         masm.storeUnboxedValue(value, valueType, dest, lir->mir()->slotType());
@@ -3112,30 +3112,30 @@ CodeGenerator::visitGetPropertyPolymorph
     emitGetPropertyPolymorphic(ins, obj, output.scratchReg(), output);
 }
 
 void
 CodeGenerator::visitGetPropertyPolymorphicT(LGetPropertyPolymorphicT* ins)
 {
     Register obj = ToRegister(ins->obj());
     TypedOrValueRegister output(ins->mir()->type(), ToAnyRegister(ins->output()));
-    Register temp = (output.type() == MIRType_Double)
+    Register temp = (output.type() == MIRType::Double)
                     ? ToRegister(ins->temp())
                     : output.typedReg().gpr();
     emitGetPropertyPolymorphic(ins, obj, temp, output);
 }
 
 template <typename T>
 static void
 EmitUnboxedPreBarrier(MacroAssembler &masm, T address, JSValueType type)
 {
     if (type == JSVAL_TYPE_OBJECT)
-        masm.patchableCallPreBarrier(address, MIRType_Object);
+        masm.patchableCallPreBarrier(address, MIRType::Object);
     else if (type == JSVAL_TYPE_STRING)
-        masm.patchableCallPreBarrier(address, MIRType_String);
+        masm.patchableCallPreBarrier(address, MIRType::String);
     else
         MOZ_ASSERT(!UnboxedTypeNeedsPreBarrier(type));
 }
 
 void
 CodeGenerator::emitSetPropertyPolymorphic(LInstruction* ins, Register obj, Register scratch,
                                           const ConstantOrRegister& value)
 {
@@ -3371,21 +3371,21 @@ CodeGenerator::visitTypeBarrierV(LTypeBa
 
 void
 CodeGenerator::visitTypeBarrierO(LTypeBarrierO* lir)
 {
     Register obj = ToRegister(lir->object());
     Register scratch = ToTempRegisterOrInvalid(lir->temp());
     Label miss, ok;
 
-    if (lir->mir()->type() == MIRType_ObjectOrNull) {
-        Label* nullTarget = lir->mir()->resultTypeSet()->mightBeMIRType(MIRType_Null) ? &ok : &miss;
+    if (lir->mir()->type() == MIRType::ObjectOrNull) {
+        Label* nullTarget = lir->mir()->resultTypeSet()->mightBeMIRType(MIRType::Null) ? &ok : &miss;
         masm.branchTestPtr(Assembler::Zero, obj, obj, nullTarget);
     } else {
-        MOZ_ASSERT(lir->mir()->type() == MIRType_Object);
+        MOZ_ASSERT(lir->mir()->type() == MIRType::Object);
         MOZ_ASSERT(lir->mir()->barrierKind() != BarrierKind::TypeTagOnly);
     }
 
     if (lir->mir()->barrierKind() != BarrierKind::TypeTagOnly)
         masm.guardObjectType(obj, lir->mir()->resultTypeSet(), scratch, &miss);
 
     bailoutFrom(&miss, lir->snapshot());
     masm.bind(&ok);
@@ -4760,36 +4760,36 @@ CodeGenerator::branchIfInvalidated(Regis
                   Address(temp, IonScript::offsetOfInvalidationCount()),
                   Imm32(0),
                   invalidated);
 }
 
 void
 CodeGenerator::emitAssertObjectOrStringResult(Register input, MIRType type, const TemporaryTypeSet* typeset)
 {
-    MOZ_ASSERT(type == MIRType_Object || type == MIRType_ObjectOrNull ||
-               type == MIRType_String || type == MIRType_Symbol);
+    MOZ_ASSERT(type == MIRType::Object || type == MIRType::ObjectOrNull ||
+               type == MIRType::String || type == MIRType::Symbol);
 
     AllocatableGeneralRegisterSet regs(GeneralRegisterSet::All());
     regs.take(input);
 
     Register temp = regs.takeAny();
     masm.push(temp);
 
     // Don't check if the script has been invalidated. In that case invalid
     // types are expected (until we reach the OsiPoint and bailout).
     Label done;
     branchIfInvalidated(temp, &done);
 
-    if ((type == MIRType_Object || type == MIRType_ObjectOrNull) &&
+    if ((type == MIRType::Object || type == MIRType::ObjectOrNull) &&
         typeset && !typeset->unknownObject())
     {
         // We have a result TypeSet, assert this object is in it.
         Label miss, ok;
-        if (type == MIRType_ObjectOrNull)
+        if (type == MIRType::ObjectOrNull)
             masm.branchPtr(Assembler::Equal, input, ImmWord(0), &ok);
         if (typeset->getObjectCount() > 0)
             masm.guardObjectType(input, typeset, temp, &miss);
         else
             masm.jump(&miss);
         masm.jump(&ok);
 
         masm.bind(&miss);
@@ -4804,26 +4804,26 @@ CodeGenerator::emitAssertObjectOrStringR
     saveVolatile();
     masm.setupUnalignedABICall(temp);
     masm.loadJSContext(temp);
     masm.passABIArg(temp);
     masm.passABIArg(input);
 
     void* callee;
     switch (type) {
-      case MIRType_Object:
+      case MIRType::Object:
         callee = JS_FUNC_TO_DATA_PTR(void*, AssertValidObjectPtr);
         break;
-      case MIRType_ObjectOrNull:
+      case MIRType::ObjectOrNull:
         callee = JS_FUNC_TO_DATA_PTR(void*, AssertValidObjectOrNullPtr);
         break;
-      case MIRType_String:
+      case MIRType::String:
         callee = JS_FUNC_TO_DATA_PTR(void*, AssertValidStringPtr);
         break;
-      case MIRType_Symbol:
+      case MIRType::Symbol:
         callee = JS_FUNC_TO_DATA_PTR(void*, AssertValidSymbolPtr);
         break;
       default:
         MOZ_CRASH();
     }
 
     masm.callWithABI(callee);
     restoreVolatile();
@@ -4921,23 +4921,23 @@ CodeGenerator::emitDebugResultChecks(LIn
 {
     // In debug builds, check that LIR instructions return valid values.
 
     MDefinition* mir = ins->mirRaw();
     if (!mir)
         return;
 
     switch (mir->type()) {
-      case MIRType_Object:
-      case MIRType_ObjectOrNull:
-      case MIRType_String:
-      case MIRType_Symbol:
+      case MIRType::Object:
+      case MIRType::ObjectOrNull:
+      case MIRType::String:
+      case MIRType::Symbol:
         emitObjectOrStringResultChecks(ins, mir);
         break;
-      case MIRType_Value:
+      case MIRType::Value:
         emitValueResultChecks(ins, mir);
         break;
       default:
         break;
     }
 }
 #endif
 
@@ -5503,21 +5503,21 @@ CodeGenerator::visitSimdBox(LSimdBox* li
                                    ArgList(ImmGCPtr(templateObject), Imm32(initialHeap)),
                                    StoreRegisterTo(object));
 
     masm.createGCObject(object, temp, templateObject, initialHeap, ool->entry());
     masm.bind(ool->rejoin());
 
     Address objectData(object, InlineTypedObject::offsetOfDataStart());
     switch (type) {
-      case MIRType_Bool32x4:
-      case MIRType_Int32x4:
+      case MIRType::Bool32x4:
+      case MIRType::Int32x4:
         masm.storeUnalignedInt32x4(in, objectData);
         break;
-      case MIRType_Float32x4:
+      case MIRType::Float32x4:
         masm.storeUnalignedFloat32x4(in, objectData);
         break;
       default:
         MOZ_CRASH("Unknown SIMD kind when generating code for SimdBox.");
     }
 }
 
 void
@@ -5581,21 +5581,21 @@ CodeGenerator::visitSimdUnbox(LSimdUnbox
     Address typeDescrType(temp, NativeObject::getFixedSlotOffset(JS_DESCR_SLOT_TYPE));
     masm.assertTestInt32(Assembler::Equal, typeDescrType,
       "MOZ_ASSERT(obj->type()->typeDescr()->getReservedSlot(JS_DESCR_SLOT_TYPE).isInt32())");
     masm.branch32(Assembler::NotEqual, masm.ToPayload(typeDescrType), Imm32(int32_t(type)), &bail);
 
     // Load the value from the data of the InlineTypedObject.
     Address objectData(object, InlineTypedObject::offsetOfDataStart());
     switch (lir->mir()->type()) {
-      case MIRType_Bool32x4:
-      case MIRType_Int32x4:
+      case MIRType::Bool32x4:
+      case MIRType::Int32x4:
         masm.loadUnalignedInt32x4(objectData, simd);
         break;
-      case MIRType_Float32x4:
+      case MIRType::Float32x4:
         masm.loadUnalignedFloat32x4(objectData, simd);
         break;
       default:
         MOZ_CRASH("The impossible happened!");
     }
 
     bailoutFrom(&bail, lir->snapshot());
 }
@@ -6081,18 +6081,18 @@ CodeGenerator::visitGetNextMapEntryForIt
         ValueMapRangeFront(masm, range, temp, front);
 
         size_t elementsOffset = NativeObject::offsetOfFixedElements();
 
         Address keyAddress(front, ValueMap::Entry::offsetOfKey());
         Address valueAddress(front, ValueMap::Entry::offsetOfValue());
         Address keyElemAddress(result, elementsOffset);
         Address valueElemAddress(result, elementsOffset + sizeof(Value));
-        masm.patchableCallPreBarrier(keyElemAddress, MIRType_Value);
-        masm.patchableCallPreBarrier(valueElemAddress, MIRType_Value);
+        masm.patchableCallPreBarrier(keyElemAddress, MIRType::Value);
+        masm.patchableCallPreBarrier(valueElemAddress, MIRType::Value);
         masm.storeValue(keyAddress, keyElemAddress, temp);
         masm.storeValue(valueAddress, valueElemAddress, temp);
 
         Label keyIsNotObject, valueIsNotNurseryObject, emitBarrier;
         masm.branchTestObject(Assembler::NotEqual, keyAddress, &keyIsNotObject);
         masm.branchValueIsNurseryObject(Assembler::Equal, keyAddress, temp,
                                         &emitBarrier);
         masm.bind(&keyIsNotObject);
@@ -6616,17 +6616,17 @@ CodeGenerator::visitIsNullOrLikeUndefine
     MCompare::CompareType compareType = lir->mir()->compareType();
     MOZ_ASSERT(compareType == MCompare::Compare_Undefined ||
                compareType == MCompare::Compare_Null);
 
     const ValueOperand value = ToValue(lir, LIsNullOrLikeUndefinedV::Value);
     Register output = ToRegister(lir->output());
 
     if (op == JSOP_EQ || op == JSOP_NE) {
-        MOZ_ASSERT(lir->mir()->lhs()->type() != MIRType_Object ||
+        MOZ_ASSERT(lir->mir()->lhs()->type() != MIRType::Object ||
                    lir->mir()->operandMightEmulateUndefined(),
                    "Operands which can't emulate undefined should have been folded");
 
         OutOfLineTestObjectWithLabels* ool = nullptr;
         Maybe<Label> label1, label2;
         Label* nullOrLikeUndefined;
         Label* notNullOrLikeUndefined;
         if (lir->mir()->operandMightEmulateUndefined()) {
@@ -6638,19 +6638,19 @@ CodeGenerator::visitIsNullOrLikeUndefine
             label1.emplace();
             label2.emplace();
             nullOrLikeUndefined = label1.ptr();
             notNullOrLikeUndefined = label2.ptr();
         }
 
         Register tag = masm.splitTagForTest(value);
         MDefinition* input = lir->mir()->lhs();
-        if (input->mightBeType(MIRType_Null))
+        if (input->mightBeType(MIRType::Null))
             masm.branchTestNull(Assembler::Equal, tag, nullOrLikeUndefined);
-        if (input->mightBeType(MIRType_Undefined))
+        if (input->mightBeType(MIRType::Undefined))
             masm.branchTestUndefined(Assembler::Equal, tag, nullOrLikeUndefined);
 
         if (ool) {
             // Check whether it's a truthy object or a falsy object that emulates
             // undefined.
             masm.branchTestObject(Assembler::NotEqual, tag, notNullOrLikeUndefined);
 
             Register objreg = masm.extractObject(value, ToTempUnboxRegister(lir->tempToUnbox()));
@@ -6702,35 +6702,35 @@ CodeGenerator::visitIsNullOrLikeUndefine
             ifFalse = lir->ifFalse();
         } else {
             // Swap branches.
             ifTrue = lir->ifFalse();
             ifFalse = lir->ifTrue();
             op = JSOP_EQ;
         }
 
-        MOZ_ASSERT(lir->cmpMir()->lhs()->type() != MIRType_Object ||
+        MOZ_ASSERT(lir->cmpMir()->lhs()->type() != MIRType::Object ||
                    lir->cmpMir()->operandMightEmulateUndefined(),
                    "Operands which can't emulate undefined should have been folded");
 
         OutOfLineTestObject* ool = nullptr;
         if (lir->cmpMir()->operandMightEmulateUndefined()) {
             ool = new(alloc()) OutOfLineTestObject();
             addOutOfLineCode(ool, lir->cmpMir());
         }
 
         Register tag = masm.splitTagForTest(value);
 
         Label* ifTrueLabel = getJumpLabelForBranch(ifTrue);
         Label* ifFalseLabel = getJumpLabelForBranch(ifFalse);
 
         MDefinition* input = lir->cmpMir()->lhs();
-        if (input->mightBeType(MIRType_Null))
+        if (input->mightBeType(MIRType::Null))
             masm.branchTestNull(Assembler::Equal, tag, ifTrueLabel);
-        if (input->mightBeType(MIRType_Undefined))
+        if (input->mightBeType(MIRType::Undefined))
             masm.branchTestUndefined(Assembler::Equal, tag, ifTrueLabel);
 
         if (ool) {
             masm.branchTestObject(Assembler::NotEqual, tag, ifFalseLabel);
 
             // Objects that emulate undefined are loosely equal to null/undefined.
             Register objreg = masm.extractObject(value, ToTempUnboxRegister(lir->tempToUnbox()));
             Register scratch = ToRegister(lir->temp());
@@ -6752,51 +6752,51 @@ CodeGenerator::visitIsNullOrLikeUndefine
 
 void
 CodeGenerator::visitIsNullOrLikeUndefinedT(LIsNullOrLikeUndefinedT * lir)
 {
     MOZ_ASSERT(lir->mir()->compareType() == MCompare::Compare_Undefined ||
                lir->mir()->compareType() == MCompare::Compare_Null);
 
     MIRType lhsType = lir->mir()->lhs()->type();
-    MOZ_ASSERT(lhsType == MIRType_Object || lhsType == MIRType_ObjectOrNull);
+    MOZ_ASSERT(lhsType == MIRType::Object || lhsType == MIRType::ObjectOrNull);
 
     JSOp op = lir->mir()->jsop();
-    MOZ_ASSERT(lhsType == MIRType_ObjectOrNull || op == JSOP_EQ || op == JSOP_NE,
+    MOZ_ASSERT(lhsType == MIRType::ObjectOrNull || op == JSOP_EQ || op == JSOP_NE,
                "Strict equality should have been folded");
 
-    MOZ_ASSERT(lhsType == MIRType_ObjectOrNull || lir->mir()->operandMightEmulateUndefined(),
+    MOZ_ASSERT(lhsType == MIRType::ObjectOrNull || lir->mir()->operandMightEmulateUndefined(),
                "If the object couldn't emulate undefined, this should have been folded.");
 
     Register objreg = ToRegister(lir->input());
     Register output = ToRegister(lir->output());
 
     if ((op == JSOP_EQ || op == JSOP_NE) && lir->mir()->operandMightEmulateUndefined()) {
         OutOfLineTestObjectWithLabels* ool = new(alloc()) OutOfLineTestObjectWithLabels();
         addOutOfLineCode(ool, lir->mir());
 
         Label* emulatesUndefined = ool->label1();
         Label* doesntEmulateUndefined = ool->label2();
 
-        if (lhsType == MIRType_ObjectOrNull)
+        if (lhsType == MIRType::ObjectOrNull)
             masm.branchTestPtr(Assembler::Zero, objreg, objreg, emulatesUndefined);
 
         branchTestObjectEmulatesUndefined(objreg, emulatesUndefined, doesntEmulateUndefined,
                                           output, ool);
 
         Label done;
 
         masm.move32(Imm32(op == JSOP_NE), output);
         masm.jump(&done);
 
         masm.bind(emulatesUndefined);
         masm.move32(Imm32(op == JSOP_EQ), output);
         masm.bind(&done);
     } else {
-        MOZ_ASSERT(lhsType == MIRType_ObjectOrNull);
+        MOZ_ASSERT(lhsType == MIRType::ObjectOrNull);
 
         Label isNull, done;
 
         masm.branchTestPtr(Assembler::Zero, objreg, objreg, &isNull);
 
         masm.move32(Imm32(op == JSOP_NE || op == JSOP_STRICTNE), output);
         masm.jump(&done);
 
@@ -6810,23 +6810,23 @@ CodeGenerator::visitIsNullOrLikeUndefine
 void
 CodeGenerator::visitIsNullOrLikeUndefinedAndBranchT(LIsNullOrLikeUndefinedAndBranchT* lir)
 {
     DebugOnly<MCompare::CompareType> compareType = lir->cmpMir()->compareType();
     MOZ_ASSERT(compareType == MCompare::Compare_Undefined ||
                compareType == MCompare::Compare_Null);
 
     MIRType lhsType = lir->cmpMir()->lhs()->type();
-    MOZ_ASSERT(lhsType == MIRType_Object || lhsType == MIRType_ObjectOrNull);
+    MOZ_ASSERT(lhsType == MIRType::Object || lhsType == MIRType::ObjectOrNull);
 
     JSOp op = lir->cmpMir()->jsop();
-    MOZ_ASSERT(lhsType == MIRType_ObjectOrNull || op == JSOP_EQ || op == JSOP_NE,
+    MOZ_ASSERT(lhsType == MIRType::ObjectOrNull || op == JSOP_EQ || op == JSOP_NE,
                "Strict equality should have been folded");
 
-    MOZ_ASSERT(lhsType == MIRType_ObjectOrNull || lir->cmpMir()->operandMightEmulateUndefined(),
+    MOZ_ASSERT(lhsType == MIRType::ObjectOrNull || lir->cmpMir()->operandMightEmulateUndefined(),
                "If the object couldn't emulate undefined, this should have been folded.");
 
     MBasicBlock* ifTrue;
     MBasicBlock* ifFalse;
 
     if (op == JSOP_EQ || op == JSOP_STRICTEQ) {
         ifTrue = lir->ifTrue();
         ifFalse = lir->ifFalse();
@@ -6840,24 +6840,24 @@ CodeGenerator::visitIsNullOrLikeUndefine
 
     if ((op == JSOP_EQ || op == JSOP_NE) && lir->cmpMir()->operandMightEmulateUndefined()) {
         OutOfLineTestObject* ool = new(alloc()) OutOfLineTestObject();
         addOutOfLineCode(ool, lir->cmpMir());
 
         Label* ifTrueLabel = getJumpLabelForBranch(ifTrue);
         Label* ifFalseLabel = getJumpLabelForBranch(ifFalse);
 
-        if (lhsType == MIRType_ObjectOrNull)
+        if (lhsType == MIRType::ObjectOrNull)
             masm.branchTestPtr(Assembler::Zero, input, input, ifTrueLabel);
 
         // Objects that emulate undefined are loosely equal to null/undefined.
         Register scratch = ToRegister(lir->temp());
         testObjectEmulatesUndefined(input, ifTrueLabel, ifFalseLabel, scratch, ool);
     } else {
-        MOZ_ASSERT(lhsType == MIRType_ObjectOrNull);
+        MOZ_ASSERT(lhsType == MIRType::ObjectOrNull);
         testZeroEmitBranch(Assembler::Equal, input, ifTrue, ifFalse);
     }
 }
 
 typedef JSString* (*ConcatStringsFn)(ExclusiveContext*, HandleString, HandleString);
 static const VMFunction ConcatStringsInfo = FunctionInfo<ConcatStringsFn>(ConcatStrings<CanGC>);
 
 void
@@ -7549,17 +7549,17 @@ CodeGenerator::visitNotV(LNotV* lir)
     Label* ifFalsy;
 
     OutOfLineTestObjectWithLabels* ool = nullptr;
     MDefinition* operand = lir->mir()->input();
     // Unfortunately, it's possible that someone (e.g. phi elimination) switched
     // out our operand after we did cacheOperandMightEmulateUndefined.  So we
     // might think it can emulate undefined _and_ know that it can't be an
     // object.
-    if (lir->mir()->operandMightEmulateUndefined() && operand->mightBeType(MIRType_Object)) {
+    if (lir->mir()->operandMightEmulateUndefined() && operand->mightBeType(MIRType::Object)) {
         ool = new(alloc()) OutOfLineTestObjectWithLabels();
         addOutOfLineCode(ool, lir->mir());
         ifTruthy = ool->label1();
         ifFalsy = ool->label2();
     } else {
         ifTruthyLabel.emplace();
         ifFalsyLabel.emplace();
         ifTruthy = ifTruthyLabel.ptr();
@@ -7987,21 +7987,21 @@ CodeGenerator::visitOutOfLineStoreElemen
         // Update length if length < initializedLength.
         Address lengthAddr(object, UnboxedArrayObject::offsetOfLength());
         Label dontUpdate;
         masm.branch32(Assembler::Above, lengthAddr, key, &dontUpdate);
         masm.add32(Imm32(1), lengthAddr);
         masm.bind(&dontUpdate);
     }
 
-    if (ins->isStoreElementHoleT() && unboxedType == JSVAL_TYPE_MAGIC && valueType != MIRType_Double) {
+    if (ins->isStoreElementHoleT() && unboxedType == JSVAL_TYPE_MAGIC && valueType != MIRType::Double) {
         // The inline path for StoreElementHoleT does not always store the type tag,
-        // so we do the store on the OOL path. We use MIRType_None for the element type
+        // so we do the store on the OOL path. We use MIRType::None for the element type
         // so that storeElementTyped will always store the type tag.
-        emitStoreElementTyped(ins->toStoreElementHoleT()->value(), valueType, MIRType_None,
+        emitStoreElementTyped(ins->toStoreElementHoleT()->value(), valueType, MIRType::None,
                               elements, index, 0);
         masm.jump(ool->rejoin());
     } else {
         // Jump to the inline path where we will store the value.
         masm.jump(ool->rejoinStore());
     }
 
     masm.bind(&callStub);
@@ -8042,21 +8042,21 @@ StoreUnboxedPointer(MacroAssembler& masm
 
 void
 CodeGenerator::visitStoreUnboxedPointer(LStoreUnboxedPointer* lir)
 {
     MIRType type;
     int32_t offsetAdjustment;
     bool preBarrier;
     if (lir->mir()->isStoreUnboxedObjectOrNull()) {
-        type = MIRType_Object;
+        type = MIRType::Object;
         offsetAdjustment = lir->mir()->toStoreUnboxedObjectOrNull()->offsetAdjustment();
         preBarrier = lir->mir()->toStoreUnboxedObjectOrNull()->preBarrier();
     } else if (lir->mir()->isStoreUnboxedString()) {
-        type = MIRType_String;
+        type = MIRType::String;
         offsetAdjustment = lir->mir()->toStoreUnboxedString()->offsetAdjustment();
         preBarrier = lir->mir()->toStoreUnboxedString()->preBarrier();
     } else {
         MOZ_CRASH();
     }
 
     Register elements = ToRegister(lir->elements());
     const LAllocation* index = lir->index();
@@ -8630,17 +8630,17 @@ CodeGenerator::visitGetFrameArgument(LGe
 void
 CodeGenerator::visitSetFrameArgumentT(LSetFrameArgumentT* lir)
 {
     size_t argOffset = frameSize() + JitFrameLayout::offsetOfActualArgs() +
                        (sizeof(Value) * lir->mir()->argno());
 
     MIRType type = lir->mir()->value()->type();
 
-    if (type == MIRType_Double) {
+    if (type == MIRType::Double) {
         // Store doubles directly.
         FloatRegister input = ToFloatRegister(lir->input());
         masm.storeDouble(input, Address(masm.getStackPointer(), argOffset));
 
     } else {
         Register input = ToRegister(lir->input());
         masm.storeValue(ValueTypeFromMIRType(type), input, Address(masm.getStackPointer(), argOffset));
     }
@@ -9264,17 +9264,17 @@ CodeGenerator::visitUnboxFloatingPoint(L
     // Out-of-line path to convert int32 to double or bailout
     // if this instruction is fallible.
     OutOfLineUnboxFloatingPoint* ool = new(alloc()) OutOfLineUnboxFloatingPoint(lir);
     addOutOfLineCode(ool, lir->mir());
 
     FloatRegister resultReg = ToFloatRegister(result);
     masm.branchTestDouble(Assembler::NotEqual, box, ool->entry());
     masm.unboxDouble(box, resultReg);
-    if (lir->type() == MIRType_Float32)
+    if (lir->type() == MIRType::Float32)
         masm.convertDoubleToFloat32(resultReg, resultReg);
     masm.bind(ool->rejoin());
 }
 
 void
 CodeGenerator::visitOutOfLineUnboxFloatingPoint(OutOfLineUnboxFloatingPoint* ool)
 {
     LUnboxFloatingPoint* ins = ool->unboxFloatingPoint();
@@ -9385,29 +9385,29 @@ CodeGenerator::visitLoadFixedSlotAndUnbo
     const MLoadFixedSlotAndUnbox* mir = ins->mir();
     MIRType type = mir->type();
     const Register input = ToRegister(ins->getOperand(0));
     AnyRegister result = ToAnyRegister(ins->output());
     size_t slot = mir->slot();
 
     Address address(input, NativeObject::getFixedSlotOffset(slot));
     Label bail;
-    if (type == MIRType_Double) {
+    if (type == MIRType::Double) {
         MOZ_ASSERT(result.isFloat());
         masm.ensureDouble(address, result.fpu(), &bail);
         if (mir->fallible())
             bailoutFrom(&bail, ins->snapshot());
         return;
     }
     if (mir->fallible()) {
         switch (type) {
-          case MIRType_Int32:
+          case MIRType::Int32:
             masm.branchTestInt32(Assembler::NotEqual, address, &bail);
             break;
-          case MIRType_Boolean:
+          case MIRType::Boolean:
             masm.branchTestBoolean(Assembler::NotEqual, address, &bail);
             break;
           default:
             MOZ_CRASH("Given MIRType cannot be unboxed.");
         }
         bailoutFrom(&bail, ins->snapshot());
     }
     masm.loadUnboxedValue(address, type, result);
@@ -9436,17 +9436,17 @@ CodeGenerator::visitStoreFixedSlotT(LSto
 
     const LAllocation* value = ins->value();
     MIRType valueType = ins->mir()->value()->type();
 
     Address address(obj, NativeObject::getFixedSlotOffset(slot));
     if (ins->mir()->needsBarrier())
         emitPreBarrier(address);
 
-    if (valueType == MIRType_ObjectOrNull) {
+    if (valueType == MIRType::ObjectOrNull) {
         Register nvalue = ToRegister(value);
         masm.storeObjectOrNull(nvalue, address);
     } else {
         ConstantOrRegister nvalue = value->isConstant()
                                     ? ConstantOrRegister(value->toConstant()->toJSValue())
                                     : TypedOrValueRegister(valueType, ToAnyRegister(value));
         masm.storeConstantOrRegister(nvalue, address);
     }
@@ -9506,17 +9506,17 @@ CodeGenerator::addSetPropertyCache(LInst
                         needsTypeBarrier, guardHoles);
     cache.setProfilerLeavePC(profilerLeavePc);
     addCache(ins, allocateCache(cache));
 }
 
 ConstantOrRegister
 CodeGenerator::toConstantOrRegister(LInstruction* lir, size_t n, MIRType type)
 {
-    if (type == MIRType_Value)
+    if (type == MIRType::Value)
         return TypedOrValueRegister(ToValue(lir, n));
 
     const LAllocation* value = lir->getOperand(n);
     if (value->isConstant())
         return ConstantOrRegister(value->toConstant()->toJSValue());
 
     return TypedOrValueRegister(type, ToAnyRegister(value));
 }
@@ -9784,23 +9784,23 @@ CodeGenerator::visitTypeOfV(LTypeOfV* li
     Register output = ToRegister(lir->output());
     Register tag = masm.splitTagForTest(value);
 
     const JSAtomState& names = GetJitContext()->runtime->names();
     Label done;
 
     MDefinition* input = lir->mir()->input();
 
-    bool testObject = input->mightBeType(MIRType_Object);
-    bool testNumber = input->mightBeType(MIRType_Int32) || input->mightBeType(MIRType_Double);
-    bool testBoolean = input->mightBeType(MIRType_Boolean);
-    bool testUndefined = input->mightBeType(MIRType_Undefined);
-    bool testNull = input->mightBeType(MIRType_Null);
-    bool testString = input->mightBeType(MIRType_String);
-    bool testSymbol = input->mightBeType(MIRType_Symbol);
+    bool testObject = input->mightBeType(MIRType::Object);
+    bool testNumber = input->mightBeType(MIRType::Int32) || input->mightBeType(MIRType::Double);
+    bool testBoolean = input->mightBeType(MIRType::Boolean);
+    bool testUndefined = input->mightBeType(MIRType::Undefined);
+    bool testNull = input->mightBeType(MIRType::Null);
+    bool testString = input->mightBeType(MIRType::String);
+    bool testSymbol = input->mightBeType(MIRType::Symbol);
 
     unsigned numTests = unsigned(testObject) + unsigned(testNumber) + unsigned(testBoolean) +
         unsigned(testUndefined) + unsigned(testNull) + unsigned(testString) + unsigned(testSymbol);
 
     MOZ_ASSERT_IF(!input->emptyResultTypeSet(), numTests > 0);
 
     OutOfLineTypeOfV* ool = nullptr;
     if (testObject) {
@@ -10360,17 +10360,17 @@ CodeGenerator::visitClampVToUint8(LClamp
 {
     ValueOperand operand = ToValue(lir, LClampVToUint8::Input);
     FloatRegister tempFloat = ToFloatRegister(lir->tempFloat());
     Register output = ToRegister(lir->output());
     MDefinition* input = lir->mir()->input();
 
     Label* stringEntry;
     Label* stringRejoin;
-    if (input->mightBeType(MIRType_String)) {
+    if (input->mightBeType(MIRType::String)) {
         OutOfLineCode* oolString = oolCallVM(StringToNumberInfo, lir, ArgList(output),
                                              StoreFloatRegisterTo(tempFloat));
         stringEntry = oolString->entry();
         stringRejoin = oolString->rejoin();
     } else {
         stringEntry = nullptr;
         stringRejoin = nullptr;
     }
--- a/js/src/jit/EagerSimdUnbox.cpp
+++ b/js/src/jit/EagerSimdUnbox.cpp
@@ -13,17 +13,17 @@
 namespace js {
 namespace jit {
 
 // Do not optimize any Phi instruction which has conflicting Unbox operations,
 // as this might imply some intended polymorphism.
 static bool
 CanUnboxSimdPhi(const JitCompartment* jitCompartment, MPhi* phi, SimdType unboxType)
 {
-    MOZ_ASSERT(phi->type() == MIRType_Object);
+    MOZ_ASSERT(phi->type() == MIRType::Object);
 
     // If we are unboxing, we are more than likely to have boxed this SIMD type
     // once in baseline, otherwise, we cannot create a MSimdBox as we have no
     // template object to use.
     if (!jitCompartment->maybeGetSimdTemplateObjectFor(unboxType))
         return false;
 
     MResumePoint* entry = phi->block()->entryResumePoint();
--- a/js/src/jit/EffectiveAddressAnalysis.cpp
+++ b/js/src/jit/EffectiveAddressAnalysis.cpp
@@ -9,47 +9,47 @@
 #include "jit/MIRGraph.h"
 
 using namespace js;
 using namespace jit;
 
 static void
 AnalyzeLsh(TempAllocator& alloc, MLsh* lsh)
 {
-    if (lsh->specialization() != MIRType_Int32)
+    if (lsh->specialization() != MIRType::Int32)
         return;
 
     if (lsh->isRecoveredOnBailout())
         return;
 
     MDefinition* index = lsh->lhs();
-    MOZ_ASSERT(index->type() == MIRType_Int32);
+    MOZ_ASSERT(index->type() == MIRType::Int32);
 
     MConstant* shiftValue = lsh->rhs()->maybeConstantValue();
     if (!shiftValue)
         return;
 
-    if (shiftValue->type() != MIRType_Int32 || !IsShiftInScaleRange(shiftValue->toInt32()))
+    if (shiftValue->type() != MIRType::Int32 || !IsShiftInScaleRange(shiftValue->toInt32()))
         return;
 
     Scale scale = ShiftToScale(shiftValue->toInt32());
 
     int32_t displacement = 0;
     MInstruction* last = lsh;
     MDefinition* base = nullptr;
     while (true) {
         if (!last->hasOneUse())
             break;
 
         MUseIterator use = last->usesBegin();
         if (!use->consumer()->isDefinition() || !use->consumer()->toDefinition()->isAdd())
             break;
 
         MAdd* add = use->consumer()->toDefinition()->toAdd();
-        if (add->specialization() != MIRType_Int32 || !add->isTruncated())
+        if (add->specialization() != MIRType::Int32 || !add->isTruncated())
             break;
 
         MDefinition* other = add->getOperand(1 - add->indexOf(*use));
 
         if (MConstant* otherConst = other->maybeConstantValue()) {
             displacement += otherConst->toInt32();
         } else {
             if (base)
@@ -75,17 +75,17 @@ AnalyzeLsh(TempAllocator& alloc, MLsh* l
             return;
 
         MBitAnd* bitAnd = use->consumer()->toDefinition()->toBitAnd();
         if (bitAnd->isRecoveredOnBailout())
             return;
 
         MDefinition* other = bitAnd->getOperand(1 - bitAnd->indexOf(*use));
         MConstant* otherConst = other->maybeConstantValue();
-        if (!otherConst || otherConst->type() != MIRType_Int32)
+        if (!otherConst || otherConst->type() != MIRType::Int32)
             return;
 
         uint32_t bitsClearedByShift = elemSize - 1;
         uint32_t bitsClearedByMask = ~uint32_t(otherConst->toInt32());
         if ((bitsClearedByShift & bitsClearedByMask) != bitsClearedByMask)
             return;
 
         bitAnd->replaceAllUsesWith(last);
--- a/js/src/jit/Ion.cpp
+++ b/js/src/jit/Ion.cpp
@@ -270,37 +270,37 @@ JitRuntime::initialize(JSContext* cx)
         return false;
 
     JitSpew(JitSpew_Codegen, "# Emitting EnterBaselineJIT sequence");
     enterBaselineJIT_ = generateEnterJIT(cx, EnterJitBaseline);
     if (!enterBaselineJIT_)
         return false;
 
     JitSpew(JitSpew_Codegen, "# Emitting Pre Barrier for Value");
-    valuePreBarrier_ = generatePreBarrier(cx, MIRType_Value);
+    valuePreBarrier_ = generatePreBarrier(cx, MIRType::Value);
     if (!valuePreBarrier_)
         return false;
 
     JitSpew(JitSpew_Codegen, "# Emitting Pre Barrier for String");
-    stringPreBarrier_ = generatePreBarrier(cx, MIRType_String);
+    stringPreBarrier_ = generatePreBarrier(cx, MIRType::String);
     if (!stringPreBarrier_)
         return false;
 
     JitSpew(JitSpew_Codegen, "# Emitting Pre Barrier for Object");
-    objectPreBarrier_ = generatePreBarrier(cx, MIRType_Object);
+    objectPreBarrier_ = generatePreBarrier(cx, MIRType::Object);
     if (!objectPreBarrier_)
         return false;
 
     JitSpew(JitSpew_Codegen, "# Emitting Pre Barrier for Shape");
-    shapePreBarrier_ = generatePreBarrier(cx, MIRType_Shape);
+    shapePreBarrier_ = generatePreBarrier(cx, MIRType::Shape);
     if (!shapePreBarrier_)
         return false;
 
     JitSpew(JitSpew_Codegen, "# Emitting Pre Barrier for ObjectGroup");
-    objectGroupPreBarrier_ = generatePreBarrier(cx, MIRType_ObjectGroup);
+    objectGroupPreBarrier_ = generatePreBarrier(cx, MIRType::ObjectGroup);
     if (!objectGroupPreBarrier_)
         return false;
 
     JitSpew(JitSpew_Codegen, "# Emitting malloc stub");
     mallocStub_ = generateMallocStub(cx);
     if (!mallocStub_)
         return false;
 
@@ -1371,17 +1371,17 @@ OptimizeSinCos(MIRGenerator *mir, MIRGra
             if (!ins->isMathFunction() || ins->isRecoveredOnBailout())
                 continue;
 
             MMathFunction *insFunc = ins->toMathFunction();
             if (insFunc->function() != MMathFunction::Sin && insFunc->function() != MMathFunction::Cos)
                 continue;
 
             // Check if sin/cos is already optimized.
-            if (insFunc->getOperand(0)->type() == MIRType_SinCosDouble)
+            if (insFunc->getOperand(0)->type() == MIRType::SinCosDouble)
                 continue;
 
             // insFunc is either a |sin(x)| or |cos(x)| instruction. The
             // following loop iterates over the uses of |x| to check if both
             // |sin(x)| and |cos(x)| instructions exist.
             bool hasSin = false;
             bool hasCos = false;
             for (MUseDefIterator uses(insFunc->input()); uses; uses++)
--- a/js/src/jit/IonAnalysis.cpp
+++ b/js/src/jit/IonAnalysis.cpp
@@ -1203,83 +1203,83 @@ class TypeAnalyzer
 // Try to specialize this phi based on its non-cyclic inputs.
 static MIRType
 GuessPhiType(MPhi* phi, bool* hasInputsWithEmptyTypes)
 {
 #ifdef DEBUG
     // Check that different magic constants aren't flowing together. Ignore
     // JS_OPTIMIZED_OUT, since an operand could be legitimately optimized
     // away.
-    MIRType magicType = MIRType_None;
+    MIRType magicType = MIRType::None;
     for (size_t i = 0; i < phi->numOperands(); i++) {
         MDefinition* in = phi->getOperand(i);
-        if (in->type() == MIRType_MagicOptimizedArguments ||
-            in->type() == MIRType_MagicHole ||
-            in->type() == MIRType_MagicIsConstructing)
+        if (in->type() == MIRType::MagicOptimizedArguments ||
+            in->type() == MIRType::MagicHole ||
+            in->type() == MIRType::MagicIsConstructing)
         {
-            if (magicType == MIRType_None)
+            if (magicType == MIRType::None)
                 magicType = in->type();
             MOZ_ASSERT(magicType == in->type());
         }
     }
 #endif
 
     *hasInputsWithEmptyTypes = false;
 
-    MIRType type = MIRType_None;
+    MIRType type = MIRType::None;
     bool convertibleToFloat32 = false;
     bool hasPhiInputs = false;
     for (size_t i = 0, e = phi->numOperands(); i < e; i++) {
         MDefinition* in = phi->getOperand(i);
         if (in->isPhi()) {
             hasPhiInputs = true;
             if (!in->toPhi()->triedToSpecialize())
                 continue;
-            if (in->type() == MIRType_None) {
+            if (in->type() == MIRType::None) {
                 // The operand is a phi we tried to specialize, but we were
                 // unable to guess its type. propagateSpecialization will
                 // propagate the type to this phi when it becomes known.
                 continue;
             }
         }
 
         // Ignore operands which we've never observed.
         if (in->resultTypeSet() && in->resultTypeSet()->empty()) {
             *hasInputsWithEmptyTypes = true;
             continue;
         }
 
-        if (type == MIRType_None) {
+        if (type == MIRType::None) {
             type = in->type();
             if (in->canProduceFloat32())
                 convertibleToFloat32 = true;
             continue;
         }
         if (type != in->type()) {
-            if (convertibleToFloat32 && in->type() == MIRType_Float32) {
+            if (convertibleToFloat32 && in->type() == MIRType::Float32) {
                 // If we only saw definitions that can be converted into Float32 before and
                 // encounter a Float32 value, promote previous values to Float32
-                type = MIRType_Float32;
+                type = MIRType::Float32;
             } else if (IsTypeRepresentableAsDouble(type) &&
                        IsTypeRepresentableAsDouble(in->type()))
             {
                 // Specialize phis with int32 and double operands as double.
-                type = MIRType_Double;
+                type = MIRType::Double;
                 convertibleToFloat32 &= in->canProduceFloat32();
             } else {
-                return MIRType_Value;
+                return MIRType::Value;
             }
         }
     }
 
-    if (type == MIRType_None && !hasPhiInputs) {
-        // All inputs are non-phis with empty typesets. Use MIRType_Value
+    if (type == MIRType::None && !hasPhiInputs) {
+        // All inputs are non-phis with empty typesets. Use MIRType::Value
         // in this case, as it's impossible to get better type information.
         MOZ_ASSERT(*hasInputsWithEmptyTypes);
-        type = MIRType_Value;
+        type = MIRType::Value;
     }
 
     return type;
 }
 
 bool
 TypeAnalyzer::respecialize(MPhi* phi, MIRType type)
 {
@@ -1287,54 +1287,54 @@ TypeAnalyzer::respecialize(MPhi* phi, MI
         return true;
     phi->specialize(type);
     return addPhiToWorklist(phi);
 }
 
 bool
 TypeAnalyzer::propagateSpecialization(MPhi* phi)
 {
-    MOZ_ASSERT(phi->type() != MIRType_None);
+    MOZ_ASSERT(phi->type() != MIRType::None);
 
     // Verify that this specialization matches any phis depending on it.
     for (MUseDefIterator iter(phi); iter; iter++) {
         if (!iter.def()->isPhi())
             continue;
         MPhi* use = iter.def()->toPhi();
         if (!use->triedToSpecialize())
             continue;
-        if (use->type() == MIRType_None) {
+        if (use->type() == MIRType::None) {
             // We tried to specialize this phi, but were unable to guess its
             // type. Now that we know the type of one of its operands, we can
             // specialize it.
             if (!respecialize(use, phi->type()))
                 return false;
             continue;
         }
         if (use->type() != phi->type()) {
             // Specialize phis with int32 that can be converted to float and float operands as floats.
-            if ((use->type() == MIRType_Int32 && use->canProduceFloat32() && phi->type() == MIRType_Float32) ||
-                (phi->type() == MIRType_Int32 && phi->canProduceFloat32() && use->type() == MIRType_Float32))
+            if ((use->type() == MIRType::Int32 && use->canProduceFloat32() && phi->type() == MIRType::Float32) ||
+                (phi->type() == MIRType::Int32 && phi->canProduceFloat32() && use->type() == MIRType::Float32))
             {
-                if (!respecialize(use, MIRType_Float32))
+                if (!respecialize(use, MIRType::Float32))
                     return false;
                 continue;
             }
 
             // Specialize phis with int32 and double operands as double.
             if (IsTypeRepresentableAsDouble(use->type()) &&
                 IsTypeRepresentableAsDouble(phi->type()))
             {
-                if (!respecialize(use, MIRType_Double))
+                if (!respecialize(use, MIRType::Double))
                     return false;
                 continue;
             }
 
             // This phi in our use chain can now no longer be specialized.
-            if (!respecialize(use, MIRType_Value))
+            if (!respecialize(use, MIRType::Value))
                 return false;
         }
     }
 
     return true;
 }
 
 bool
@@ -1345,26 +1345,26 @@ TypeAnalyzer::specializePhis()
     for (PostorderIterator block(graph.poBegin()); block != graph.poEnd(); block++) {
         if (mir->shouldCancel("Specialize Phis (main loop)"))
             return false;
 
         for (MPhiIterator phi(block->phisBegin()); phi != block->phisEnd(); phi++) {
             bool hasInputsWithEmptyTypes;
             MIRType type = GuessPhiType(*phi, &hasInputsWithEmptyTypes);
             phi->specialize(type);
-            if (type == MIRType_None) {
+            if (type == MIRType::None) {
                 // We tried to guess the type but failed because all operands are
                 // phis we still have to visit. Set the triedToSpecialize flag but
                 // don't propagate the type to other phis, propagateSpecialization
                 // will do that once we know the type of one of the operands.
 
                 // Edge case: when this phi has a non-phi input with an empty
                 // typeset, it's possible for two phis to have a cyclic
-                // dependency and they will both have MIRType_None. Specialize
-                // such phis to MIRType_Value later on.
+                // dependency and they will both have MIRType::None. Specialize
+                // such phis to MIRType::Value later on.
                 if (hasInputsWithEmptyTypes && !phisWithEmptyInputTypes.append(*phi))
                     return false;
                 continue;
             }
             if (!propagateSpecialization(*phi))
                 return false;
         }
     }
@@ -1376,80 +1376,80 @@ TypeAnalyzer::specializePhis()
 
             MPhi* phi = popPhi();
             if (!propagateSpecialization(phi))
                 return false;
         }
 
         // When two phis have a cyclic dependency and inputs that have an empty
         // typeset (which are ignored by GuessPhiType), we may still have to
-        // specialize these to MIRType_Value.
+        // specialize these to MIRType::Value.
         while (!phisWithEmptyInputTypes.empty()) {
             if (mir->shouldCancel("Specialize Phis (phisWithEmptyInputTypes)"))
                 return false;
 
             MPhi* phi = phisWithEmptyInputTypes.popCopy();
-            if (phi->type() == MIRType_None) {
-                phi->specialize(MIRType_Value);
+            if (phi->type() == MIRType::None) {
+                phi->specialize(MIRType::Value);
                 if (!propagateSpecialization(phi))
                     return false;
             }
         }
     } while (!phiWorklist_.empty());
 
     return true;
 }
 
 bool
 TypeAnalyzer::adjustPhiInputs(MPhi* phi)
 {
     MIRType phiType = phi->type();
-    MOZ_ASSERT(phiType != MIRType_None);
+    MOZ_ASSERT(phiType != MIRType::None);
 
     // If we specialized a type that's not Value, there are 3 cases:
     // 1. Every input is of that type.
     // 2. Every observed input is of that type (i.e., some inputs haven't been executed yet).
     // 3. Inputs were doubles and int32s, and was specialized to double.
-    if (phiType != MIRType_Value) {
+    if (phiType != MIRType::Value) {
         for (size_t i = 0, e = phi->numOperands(); i < e; i++) {
             MDefinition* in = phi->getOperand(i);
             if (in->type() == phiType)
                 continue;
 
             if (!alloc().ensureBallast())
                 return false;
 
             if (in->isBox() && in->toBox()->input()->type() == phiType) {
                 phi->replaceOperand(i, in->toBox()->input());
             } else {
                 MInstruction* replacement;
 
-                if (phiType == MIRType_Double && IsFloatType(in->type())) {
+                if (phiType == MIRType::Double && IsFloatType(in->type())) {
                     // Convert int32 operands to double.
                     replacement = MToDouble::New(alloc(), in);
-                } else if (phiType == MIRType_Float32) {
-                    if (in->type() == MIRType_Int32 || in->type() == MIRType_Double) {
+                } else if (phiType == MIRType::Float32) {
+                    if (in->type() == MIRType::Int32 || in->type() == MIRType::Double) {
                         replacement = MToFloat32::New(alloc(), in);
                     } else {
                         // See comment below
-                        if (in->type() != MIRType_Value) {
+                        if (in->type() != MIRType::Value) {
                             MBox* box = MBox::New(alloc(), in);
                             in->block()->insertBefore(in->block()->lastIns(), box);
                             in = box;
                         }
 
-                        MUnbox* unbox = MUnbox::New(alloc(), in, MIRType_Double, MUnbox::Fallible);
+                        MUnbox* unbox = MUnbox::New(alloc(), in, MIRType::Double, MUnbox::Fallible);
                         in->block()->insertBefore(in->block()->lastIns(), unbox);
                         replacement = MToFloat32::New(alloc(), in);
                     }
                 } else {
                     // If we know this branch will fail to convert to phiType,
                     // insert a box that'll immediately fail in the fallible unbox
                     // below.
-                    if (in->type() != MIRType_Value) {
+                    if (in->type() != MIRType::Value) {
                         MBox* box = MBox::New(alloc(), in);
                         in->block()->insertBefore(in->block()->lastIns(), box);
                         in = box;
                     }
 
                     // Be optimistic and insert unboxes when the operand is a
                     // value.
                     replacement = MUnbox::New(alloc(), in, phiType, MUnbox::Fallible);
@@ -1461,25 +1461,25 @@ TypeAnalyzer::adjustPhiInputs(MPhi* phi)
         }
 
         return true;
     }
 
     // Box every typed input.
     for (size_t i = 0, e = phi->numOperands(); i < e; i++) {
         MDefinition* in = phi->getOperand(i);
-        if (in->type() == MIRType_Value)
+        if (in->type() == MIRType::Value)
             continue;
 
         // The input is being explicitly unboxed, so sneak past and grab
         // the original box.
         if (in->isUnbox() && phi->typeIncludes(in->toUnbox()->input()))
             in = in->toUnbox()->input();
 
-        if (in->type() != MIRType_Value) {
+        if (in->type() != MIRType::Value) {
             if (!alloc().ensureBallast())
                 return false;
 
             MBasicBlock* pred = phi->block()->getPredecessor(i);
             in = AlwaysBoxAt(alloc(), pred->lastIns(), in);
         }
 
         phi->replaceOperand(i, in);
@@ -1503,29 +1503,29 @@ TypeAnalyzer::adjustInputs(MDefinition* 
 }
 
 void
 TypeAnalyzer::replaceRedundantPhi(MPhi* phi)
 {
     MBasicBlock* block = phi->block();
     js::Value v;
     switch (phi->type()) {
-      case MIRType_Undefined:
+      case MIRType::Undefined:
         v = UndefinedValue();
         break;
-      case MIRType_Null:
+      case MIRType::Null:
         v = NullValue();
         break;
-      case MIRType_MagicOptimizedArguments:
+      case MIRType::MagicOptimizedArguments:
         v = MagicValue(JS_OPTIMIZED_ARGUMENTS);
         break;
-      case MIRType_MagicOptimizedOut:
+      case MIRType::MagicOptimizedOut:
         v = MagicValue(JS_OPTIMIZED_OUT);
         break;
-      case MIRType_MagicUninitializedLexical:
+      case MIRType::MagicUninitializedLexical:
         v = MagicValue(JS_UNINITIALIZED_LEXICAL);
         break;
       default:
         MOZ_CRASH("unexpected type");
     }
     MConstant* c = MConstant::New(alloc(), v);
     // The instruction pass will insert the box
     block->insertBefore(*(block->begin()), c);
@@ -1539,21 +1539,21 @@ TypeAnalyzer::insertConversions()
     // seen before uses. This ensures that output adjustment (which may rewrite
     // inputs of uses) does not conflict with input adjustment.
     for (ReversePostorderIterator block(graph.rpoBegin()); block != graph.rpoEnd(); block++) {
         if (mir->shouldCancel("Insert Conversions"))
             return false;
 
         for (MPhiIterator iter(block->phisBegin()), end(block->phisEnd()); iter != end; ) {
             MPhi* phi = *iter++;
-            if (phi->type() == MIRType_Undefined ||
-                phi->type() == MIRType_Null ||
-                phi->type() == MIRType_MagicOptimizedArguments ||
-                phi->type() == MIRType_MagicOptimizedOut ||
-                phi->type() == MIRType_MagicUninitializedLexical)
+            if (phi->type() == MIRType::Undefined ||
+                phi->type() == MIRType::Null ||
+                phi->type() == MIRType::MagicOptimizedArguments ||
+                phi->type() == MIRType::MagicOptimizedOut ||
+                phi->type() == MIRType::MagicUninitializedLexical)
             {
                 replaceRedundantPhi(phi);
                 block->discardPhi(phi);
             } else {
                 if (!adjustPhiInputs(phi))
                     return false;
             }
         }
@@ -1724,17 +1724,17 @@ TypeAnalyzer::specializeValidFloatOps()
     for (ReversePostorderIterator block(graph.rpoBegin()); block != graph.rpoEnd(); ++block) {
         if (mir->shouldCancel("Ensure Float32 commutativity - Instructions"))
             return false;
 
         for (MInstructionIterator ins(block->begin()); ins != block->end(); ++ins) {
             if (!ins->isFloat32Commutative())
                 continue;
 
-            if (ins->type() == MIRType_Float32)
+            if (ins->type() == MIRType::Float32)
                 continue;
 
             // This call will try to specialize the instruction iff all uses are consumers and
             // all inputs are producers.
             ins->trySpecializeFloat32(alloc());
         }
     }
     return true;
@@ -1743,17 +1743,17 @@ TypeAnalyzer::specializeValidFloatOps()
 bool
 TypeAnalyzer::graphContainsFloat32()
 {
     for (ReversePostorderIterator block(graph.rpoBegin()); block != graph.rpoEnd(); ++block) {
         if (mir->shouldCancel("Ensure Float32 commutativity - Graph contains Float32"))
             return false;
 
         for (MDefinitionIterator def(*block); def; def++) {
-            if (def->type() == MIRType_Float32)
+            if (def->type() == MIRType::Float32)
                 return true;
         }
     }
     return false;
 }
 
 bool
 TypeAnalyzer::tryEmitFloatOperations()
@@ -1783,17 +1783,17 @@ TypeAnalyzer::checkFloatCoherency()
 #ifdef DEBUG
     // Asserts that all Float32 instructions are flowing into Float32 consumers or specialized
     // operations
     for (ReversePostorderIterator block(graph.rpoBegin()); block != graph.rpoEnd(); ++block) {
         if (mir->shouldCancel("Check Float32 coherency"))
             return false;
 
         for (MDefinitionIterator def(*block); def; def++) {
-            if (def->type() != MIRType_Float32)
+            if (def->type() != MIRType::Float32)
                 continue;
 
             for (MUseDefIterator use(*def); use; use++) {
                 MDefinition* consumer = use.def();
                 MOZ_ASSERT(consumer->isConsistentFloat32Use(use.use()));
             }
         }
     }
@@ -2347,22 +2347,22 @@ jit::AssertBasicGraphCoherency(MIRGraph&
             // in the InlinePropertyTable.
             MOZ_ASSERT_IF(iter->instruction(), iter->instruction()->block() == *block);
             for (uint32_t i = 0, e = iter->numOperands(); i < e; i++)
                 CheckOperand(*iter, iter->getUseFor(i), &usesBalance);
         }
         for (MPhiIterator phi(block->phisBegin()); phi != block->phisEnd(); phi++) {
             MOZ_ASSERT(phi->numOperands() == block->numPredecessors());
             MOZ_ASSERT(!phi->isRecoveredOnBailout());
-            MOZ_ASSERT(phi->type() != MIRType_None);
+            MOZ_ASSERT(phi->type() != MIRType::None);
             MOZ_ASSERT(phi->dependency() == nullptr);
         }
         for (MDefinitionIterator iter(*block); iter; iter++) {
             MOZ_ASSERT(iter->block() == *block);
-            MOZ_ASSERT_IF(iter->hasUses(), iter->type() != MIRType_None);
+            MOZ_ASSERT_IF(iter->hasUses(), iter->type() != MIRType::None);
             MOZ_ASSERT(!iter->isDiscarded());
             MOZ_ASSERT_IF(iter->isStart(),
                           *block == graph.entryBlock() || *block == graph.osrBlock());
             MOZ_ASSERT_IF(iter->isParameter(),
                           *block == graph.entryBlock() || *block == graph.osrBlock());
             MOZ_ASSERT_IF(iter->isOsrEntry(), *block == graph.osrBlock());
             MOZ_ASSERT_IF(iter->isOsrValue(), *block == graph.osrBlock());
 
@@ -2383,17 +2383,17 @@ jit::AssertBasicGraphCoherency(MIRGraph&
             if (iter->isRecoveredOnBailout())
                 MOZ_ASSERT(!iter->hasLiveDefUses());
         }
 
         // The control instruction is not visited by the MDefinitionIterator.
         MControlInstruction* control = block->lastIns();
         MOZ_ASSERT(control->block() == *block);
         MOZ_ASSERT(!control->hasUses());
-        MOZ_ASSERT(control->type() == MIRType_None);
+        MOZ_ASSERT(control->type() == MIRType::None);
         MOZ_ASSERT(!control->isDiscarded());
         MOZ_ASSERT(!control->isRecoveredOnBailout());
         MOZ_ASSERT(control->resumePoint() == nullptr);
         for (uint32_t i = 0, end = control->numOperands(); i < end; i++)
             CheckOperand(control, control->getUseFor(i), &usesBalance);
         for (size_t i = 0; i < control->numSuccessors(); i++)
             MOZ_ASSERT(control->getSuccessor(i));
     }
@@ -2494,46 +2494,46 @@ jit::AssertGraphCoherency(MIRGraph& grap
 }
 
 #ifdef DEBUG
 static bool
 IsResumableMIRType(MIRType type)
 {
     // see CodeGeneratorShared::encodeAllocation
     switch (type) {
-      case MIRType_Undefined:
-      case MIRType_Null:
-      case MIRType_Boolean:
-      case MIRType_Int32:
-      case MIRType_Double:
-      case MIRType_Float32:
-      case MIRType_String:
-      case MIRType_Symbol:
-      case MIRType_Object:
-      case MIRType_MagicOptimizedArguments:
-      case MIRType_MagicOptimizedOut:
-      case MIRType_MagicUninitializedLexical:
-      case MIRType_Value:
-      case MIRType_Float32x4:
-      case MIRType_Int32x4:
-      case MIRType_Bool32x4:
+      case MIRType::Undefined:
+      case MIRType::Null:
+      case MIRType::Boolean:
+      case MIRType::Int32:
+      case MIRType::Double:
+      case MIRType::Float32:
+      case MIRType::String:
+      case MIRType::Symbol:
+      case MIRType::Object:
+      case MIRType::MagicOptimizedArguments:
+      case MIRType::MagicOptimizedOut:
+      case MIRType::MagicUninitializedLexical:
+      case MIRType::Value:
+      case MIRType::Float32x4:
+      case MIRType::Int32x4:
+      case MIRType::Bool32x4:
         return true;
 
-      case MIRType_MagicHole:
-      case MIRType_MagicIsConstructing:
-      case MIRType_ObjectOrNull:
-      case MIRType_None:
-      case MIRType_Slots:
-      case MIRType_Elements:
-      case MIRType_Pointer:
-      case MIRType_Shape:
-      case MIRType_ObjectGroup:
-      case MIRType_Doublex2: // NYI, see also RSimdBox::recover
-      case MIRType_SinCosDouble:
-      case MIRType_Int64:
+      case MIRType::MagicHole:
+      case MIRType::MagicIsConstructing:
+      case MIRType::ObjectOrNull:
+      case MIRType::None:
+      case MIRType::Slots:
+      case MIRType::Elements:
+      case MIRType::Pointer:
+      case MIRType::Shape:
+      case MIRType::ObjectGroup:
+      case MIRType::Doublex2: // NYI, see also RSimdBox::recover
+      case MIRType::SinCosDouble:
+      case MIRType::Int64:
         return false;
     }
     MOZ_CRASH("Unknown MIRType.");
 }
 
 static void
 AssertResumableOperands(MNode* node)
 {
@@ -2554,17 +2554,17 @@ AssertIfResumableInstruction(MDefinition
     AssertResumableOperands(def);
 }
 
 static void
 AssertResumePointDominatedByOperands(MResumePoint* resume)
 {
     for (size_t i = 0, e = resume->numOperands(); i < e; ++i) {
         MDefinition* op = resume->getOperand(i);
-        if (op->type() == MIRType_MagicOptimizedArguments)
+        if (op->type() == MIRType::MagicOptimizedArguments)
             continue;
         MOZ_ASSERT(op->block()->dominates(resume->block()),
                    "Resume point is not dominated by its operands");
     }
 }
 #endif // DEBUG
 
 void
@@ -2625,17 +2625,17 @@ jit::AssertExtendedGraphCoherency(MIRGra
         // Verify that phi operands dominate the corresponding CFG predecessor
         // edges.
         for (MPhiIterator iter(block->phisBegin()), end(block->phisEnd()); iter != end; ++iter) {
             MPhi* phi = *iter;
             for (size_t i = 0, e = phi->numOperands(); i < e; ++i) {
                 // We sometimes see a phi with a magic-optimized-arguments
                 // operand defined in the normal entry block, while the phi is
                 // also reachable from the OSR entry (auto-regress/bug779818.js)
-                if (phi->getOperand(i)->type() == MIRType_MagicOptimizedArguments)
+                if (phi->getOperand(i)->type() == MIRType::MagicOptimizedArguments)
                     continue;
 
                 MOZ_ASSERT(phi->getOperand(i)->block()->dominates(block->getPredecessor(i)),
                            "Phi input is not dominated by its operand");
             }
         }
 
         // Verify that instructions are dominated by their operands.
@@ -2729,26 +2729,26 @@ FindDominatingBoundsCheck(BoundsCheckMap
 
 // Extract a linear sum from ins, if possible (otherwise giving the sum 'ins + 0').
 SimpleLinearSum
 jit::ExtractLinearSum(MDefinition* ins)
 {
     if (ins->isBeta())
         ins = ins->getOperand(0);
 
-    if (ins->type() != MIRType_Int32)
+    if (ins->type() != MIRType::Int32)
         return SimpleLinearSum(ins, 0);
 
     if (ins->isConstant())
         return SimpleLinearSum(nullptr, ins->toConstant()->toInt32());
 
     if (ins->isAdd() || ins->isSub()) {
         MDefinition* lhs = ins->getOperand(0);
         MDefinition* rhs = ins->getOperand(1);
-        if (lhs->type() == MIRType_Int32 && rhs->type() == MIRType_Int32) {
+        if (lhs->type() == MIRType::Int32 && rhs->type() == MIRType::Int32) {
             SimpleLinearSum lsum = ExtractLinearSum(lhs);
             SimpleLinearSum rsum = ExtractLinearSum(rhs);
 
             if (lsum.term && rsum.term)
                 return SimpleLinearSum(ins, 0);
 
             // Check if this is of the form <SUM> + n, n + <SUM> or <SUM> - n.
             if (ins->isAdd()) {
@@ -2782,18 +2782,18 @@ jit::ExtractLinearInequality(MTest* test
 
     MDefinition* lhs = compare->getOperand(0);
     MDefinition* rhs = compare->getOperand(1);
 
     // TODO: optimize Compare_UInt32
     if (!compare->isInt32Comparison())
         return false;
 
-    MOZ_ASSERT(lhs->type() == MIRType_Int32);
-    MOZ_ASSERT(rhs->type() == MIRType_Int32);
+    MOZ_ASSERT(lhs->type() == MIRType::Int32);
+    MOZ_ASSERT(rhs->type() == MIRType::Int32);
 
     JSOp jsop = compare->jsop();
     if (direction == FALSE_BRANCH)
         jsop = NegateCompareOp(jsop);
 
     SimpleLinearSum lsum = ExtractLinearSum(lhs);
     SimpleLinearSum rsum = ExtractLinearSum(rhs);
 
@@ -2988,17 +2988,17 @@ TryEliminateTypeBarrier(MTypeBarrier* ba
     }
 
     return true;
 }
 
 static bool
 TryOptimizeLoadObjectOrNull(MDefinition* def, MDefinitionVector* peliminateList)
 {
-    if (def->type() != MIRType_Value)
+    if (def->type() != MIRType::Value)
         return true;
 
     // Check if this definition can only produce object or null values.
     TemporaryTypeSet* types = def->resultTypeSet();
     if (!types)
         return true;
     if (types->baseFlags() & ~(TYPE_FLAG_NULL | TYPE_FLAG_ANYOBJECT))
         return true;
@@ -3020,23 +3020,23 @@ TryOptimizeLoadObjectOrNull(MDefinition*
             break;
           case MDefinition::Op_StoreSlot:
             break;
           case MDefinition::Op_ToObjectOrNull:
             if (!eliminateList.append(ndef->toToObjectOrNull()))
                 return false;
             break;
           case MDefinition::Op_Unbox:
-            if (ndef->type() != MIRType_Object)
+            if (ndef->type() != MIRType::Object)
                 return true;
             break;
           case MDefinition::Op_TypeBarrier:
             // For now, only handle type barriers which are not consumed
             // anywhere and only test that the value is null.
-            if (ndef->hasUses() || ndef->resultTypeSet()->getKnownMIRType() != MIRType_Null)
+            if (ndef->hasUses() || ndef->resultTypeSet()->getKnownMIRType() != MIRType::Null)
                 return true;
             break;
           default:
             return true;
         }
     }
 
     // On punboxing systems we are better off leaving the value boxed if it
@@ -3049,23 +3049,23 @@ TryOptimizeLoadObjectOrNull(MDefinition*
             foundUse = true;
             break;
         }
     }
     if (!foundUse)
         return true;
 #endif // JS_PUNBOX64
 
-    def->setResultType(MIRType_ObjectOrNull);
+    def->setResultType(MIRType::ObjectOrNull);
 
     // Fixup the result type of MTypeBarrier uses.
     for (MUseDefIterator iter(def); iter; ++iter) {
         MDefinition* ndef = iter.def();
         if (ndef->isTypeBarrier())
-            ndef->setResultType(MIRType_ObjectOrNull);
+            ndef->setResultType(MIRType::ObjectOrNull);
     }
 
     // Eliminate MToObjectOrNull instruction uses.
     for (size_t i = 0; i < eliminateList.length(); i++) {
         MDefinition* ndef = eliminateList[i];
         ndef->replaceAllUsesWith(def);
         if (!peliminateList->append(ndef))
             return false;
@@ -3178,18 +3178,18 @@ jit::EliminateRedundantChecks(MIRGraph& 
     }
 
     return true;
 }
 
 static bool
 NeedsKeepAlive(MInstruction* slotsOrElements, MInstruction* use)
 {
-    MOZ_ASSERT(slotsOrElements->type() == MIRType_Elements ||
-               slotsOrElements->type() == MIRType_Slots);
+    MOZ_ASSERT(slotsOrElements->type() == MIRType::Elements ||
+               slotsOrElements->type() == MIRType::Slots);
 
     if (slotsOrElements->block() != use->block())
         return true;
 
     MBasicBlock* block = use->block();
     MInstructionIterator iter(block->begin(slotsOrElements));
     MOZ_ASSERT(*iter == slotsOrElements);
     ++iter;
@@ -3225,17 +3225,17 @@ NeedsKeepAlive(MInstruction* slotsOrElem
 bool
 jit::AddKeepAliveInstructions(MIRGraph& graph)
 {
     for (MBasicBlockIterator i(graph.begin()); i != graph.end(); i++) {
         MBasicBlock* block = *i;
 
         for (MInstructionIterator insIter(block->begin()); insIter != block->end(); insIter++) {
             MInstruction* ins = *insIter;
-            if (ins->type() != MIRType_Elements && ins->type() != MIRType_Slots)
+            if (ins->type() != MIRType::Elements && ins->type() != MIRType::Slots)
                 continue;
 
             MDefinition* ownerObject;
             switch (ins->op()) {
               case MDefinition::Op_ConstantElements:
                 continue;
               case MDefinition::Op_ConvertElementsToDoubles:
                 // EliminateRedundantChecks should have replaced all uses.
@@ -3249,17 +3249,17 @@ jit::AddKeepAliveInstructions(MIRGraph& 
                 break;
               case MDefinition::Op_Slots:
                 ownerObject = ins->toSlots()->object();
                 break;
               default:
                 MOZ_CRASH("Unexpected op");
             }
 
-            MOZ_ASSERT(ownerObject->type() == MIRType_Object);
+            MOZ_ASSERT(ownerObject->type() == MIRType::Object);
 
             if (ownerObject->isConstant()) {
                 // Constants are kept alive by other pointers, for instance
                 // ImmGCPtr in JIT code.
                 continue;
             }
 
             for (MUseDefIterator uses(ins); uses; uses++) {
--- a/js/src/jit/IonBuilder.cpp
+++ b/js/src/jit/IonBuilder.cpp
@@ -654,83 +654,83 @@ IonBuilder::analyzeNewLoopTypes(MBasicBl
             if (slot < info().firstStackSlot()) {
                 MPhi* otherPhi = entry->getSlot(slot)->toPhi();
                 if (otherPhi->hasBackedgeType()) {
                     if (!phi->addBackedgeType(otherPhi->type(), otherPhi->resultTypeSet()))
                         return false;
                 }
             }
         } else {
-            MIRType type = MIRType_None;
+            MIRType type = MIRType::None;
             switch (*last) {
               case JSOP_VOID:
               case JSOP_UNDEFINED:
-                type = MIRType_Undefined;
+                type = MIRType::Undefined;
                 break;
               case JSOP_GIMPLICITTHIS:
                 if (!script()->hasNonSyntacticScope())
-                    type = MIRType_Undefined;
+                    type = MIRType::Undefined;
                 break;
               case JSOP_NULL:
-                type = MIRType_Null;
+                type = MIRType::Null;
                 break;
               case JSOP_ZERO:
               case JSOP_ONE:
               case JSOP_INT8:
               case JSOP_INT32:
               case JSOP_UINT16:
               case JSOP_UINT24:
               case JSOP_BITAND:
               case JSOP_BITOR:
               case JSOP_BITXOR:
               case JSOP_BITNOT:
               case JSOP_RSH:
               case JSOP_LSH:
               case JSOP_URSH:
-                type = MIRType_Int32;
+                type = MIRType::Int32;
                 break;
               case JSOP_FALSE:
               case JSOP_TRUE:
               case JSOP_EQ:
               case JSOP_NE:
               case JSOP_LT:
               case JSOP_LE:
               case JSOP_GT:
               case JSOP_GE:
               case JSOP_NOT:
               case JSOP_STRICTEQ:
               case JSOP_STRICTNE:
               case JSOP_IN:
               case JSOP_INSTANCEOF:
-                type = MIRType_Boolean;
+                type = MIRType::Boolean;
                 break;
               case JSOP_DOUBLE:
-                type = MIRType_Double;
+                type = MIRType::Double;
                 break;
               case JSOP_STRING:
               case JSOP_TOSTRING:
               case JSOP_TYPEOF:
               case JSOP_TYPEOFEXPR:
-                type = MIRType_String;
+                type = MIRType::String;
                 break;
               case JSOP_SYMBOL:
-                type = MIRType_Symbol;
+                type = MIRType::Symbol;
                 break;
               case JSOP_ADD:
               case JSOP_SUB:
               case JSOP_MUL:
               case JSOP_DIV:
               case JSOP_MOD:
               case JSOP_NEG:
                 type = inspector->expectedResultType(last);
                 break;
               default:
                 break;
             }
-            if (type != MIRType_None) {
+            if (type != MIRType::None) {
                 if (!phi->addBackedgeType(type, nullptr))
                     return false;
             }
         }
     }
     return true;
 }
 
@@ -893,17 +893,17 @@ IonBuilder::build()
     //       v2 = Unbox(v0, INT32)
     //       v3 = Unbox(v1, INT32)
     //
     // So we attach the initial resume point to each parameter, which the type
     // analysis explicitly checks (this is the same mechanism used for
     // effectful operations).
     for (uint32_t i = 0; i < info().endArgSlot(); i++) {
         MInstruction* ins = current->getEntrySlot(i)->toInstruction();
-        if (ins->type() != MIRType_Value)
+        if (ins->type() != MIRType::Value)
             continue;
 
         MResumePoint* entryRpCopy = MResumePoint::Copy(alloc(), current->entryResumePoint());
         if (!entryRpCopy)
             return false;
         ins->setResumePoint(entryRpCopy);
     }
 
@@ -1278,75 +1278,75 @@ IonBuilder::initArgumentsObject()
 bool
 IonBuilder::addOsrValueTypeBarrier(uint32_t slot, MInstruction** def_,
                                    MIRType type, TemporaryTypeSet* typeSet)
 {
     MInstruction*& def = *def_;
     MBasicBlock* osrBlock = def->block();
 
     // Clear bogus type information added in newOsrPreheader().
-    def->setResultType(MIRType_Value);
+    def->setResultType(MIRType::Value);
     def->setResultTypeSet(nullptr);
 
     if (typeSet && !typeSet->unknown()) {
         MInstruction* barrier = MTypeBarrier::New(alloc(), def, typeSet);
         osrBlock->insertBefore(osrBlock->lastIns(), barrier);
         osrBlock->rewriteSlot(slot, barrier);
         def = barrier;
-    } else if (type == MIRType_Null ||
-               type == MIRType_Undefined ||
-               type == MIRType_MagicOptimizedArguments)
+    } else if (type == MIRType::Null ||
+               type == MIRType::Undefined ||
+               type == MIRType::MagicOptimizedArguments)
     {
         // No unbox instruction will be added below, so check the type by
         // adding a type barrier for a singleton type set.
         TypeSet::Type ntype = TypeSet::PrimitiveType(ValueTypeFromMIRType(type));
         LifoAlloc* lifoAlloc = alloc().lifoAlloc();
         typeSet = lifoAlloc->new_<TemporaryTypeSet>(lifoAlloc, ntype);
         if (!typeSet)
             return false;
         MInstruction* barrier = MTypeBarrier::New(alloc(), def, typeSet);
         osrBlock->insertBefore(osrBlock->lastIns(), barrier);
         osrBlock->rewriteSlot(slot, barrier);
         def = barrier;
     }
 
     switch (type) {
-      case MIRType_Boolean:
-      case MIRType_Int32:
-      case MIRType_Double:
-      case MIRType_String:
-      case MIRType_Symbol:
-      case MIRType_Object:
+      case MIRType::Boolean:
+      case MIRType::Int32:
+      case MIRType::Double:
+      case MIRType::String:
+      case MIRType::Symbol:
+      case MIRType::Object:
         if (type != def->type()) {
             MUnbox* unbox = MUnbox::New(alloc(), def, type, MUnbox::Fallible);
             osrBlock->insertBefore(osrBlock->lastIns(), unbox);
             osrBlock->rewriteSlot(slot, unbox);
             def = unbox;
         }
         break;
 
-      case MIRType_Null:
+      case MIRType::Null:
       {
         MConstant* c = MConstant::New(alloc(), NullValue());
         osrBlock->insertBefore(osrBlock->lastIns(), c);
         osrBlock->rewriteSlot(slot, c);
         def = c;
         break;
       }
 
-      case MIRType_Undefined:
+      case MIRType::Undefined:
       {
         MConstant* c = MConstant::New(alloc(), UndefinedValue());
         osrBlock->insertBefore(osrBlock->lastIns(), c);
         osrBlock->rewriteSlot(slot, c);
         def = c;
         break;
       }
 
-      case MIRType_MagicOptimizedArguments:
+      case MIRType::MagicOptimizedArguments:
         MOZ_ASSERT(lazyArguments_);
         osrBlock->rewriteSlot(slot, lazyArguments_);
         def = lazyArguments_;
         break;
 
       default:
         break;
     }
@@ -2613,17 +2613,17 @@ IonBuilder::processWhileCondEnd(CFGState
     if (ins->isIsNoIter()) {
         MIteratorMore* iterMore = ins->toIsNoIter()->input()->toIteratorMore();
         jsbytecode* iterMorePc = iterMore->resumePoint()->pc();
         MOZ_ASSERT(*iterMorePc == JSOP_MOREITER);
 
         if (!nonStringIteration_ && !inspector->hasSeenNonStringIterMore(iterMorePc)) {
             MDefinition* val = current->peek(-1);
             MOZ_ASSERT(val == iterMore);
-            MInstruction* ins = MUnbox::New(alloc(), val, MIRType_String, MUnbox::Fallible,
+            MInstruction* ins = MUnbox::New(alloc(), val, MIRType::String, MUnbox::Fallible,
                                             Bailout_NonStringInputInvalidate);
             current->add(ins);
             current->rewriteAtDepth(-1, ins);
         }
     }
 
     return ControlStatus_Jumped;
 }
@@ -3565,21 +3565,21 @@ IonBuilder::replaceTypeSet(MDefinition* 
             TemporaryTypeSet* intersect =
                 TypeSet::intersectSets(ins->resultTypeSet(), type, alloc_->lifoAlloc());
             if (!intersect)
                 return false;
 
             ins->toFilterTypeSet()->setResultType(intersect->getKnownMIRType());
             ins->toFilterTypeSet()->setResultTypeSet(intersect);
 
-            if (ins->type() == MIRType_Undefined)
+            if (ins->type() == MIRType::Undefined)
                 current->setSlot(i, constant(UndefinedValue()));
-            else if (ins->type() == MIRType_Null)
+            else if (ins->type() == MIRType::Null)
                 current->setSlot(i, constant(NullValue()));
-            else if (ins->type() == MIRType_MagicOptimizedArguments)
+            else if (ins->type() == MIRType::MagicOptimizedArguments)
                 current->setSlot(i, constant(MagicValue(JS_OPTIMIZED_ARGUMENTS)));
             else
                 MOZ_ASSERT(!IsMagicType(ins->type()));
             continue;
         }
 
         if (ins == subject) {
             if (!replace) {
@@ -3590,21 +3590,21 @@ IonBuilder::replaceTypeSet(MDefinition* 
                 current->add(replace);
 
                 // Make sure we don't hoist it above the MTest, we can use the
                 // 'dependency' of an MInstruction. This is normally used by
                 // Alias Analysis, but won't get overwritten, since this
                 // instruction doesn't have an AliasSet.
                 replace->setDependency(test);
 
-                if (replace->type() == MIRType_Undefined)
+                if (replace->type() == MIRType::Undefined)
                     replace = constant(UndefinedValue());
-                else if (replace->type() == MIRType_Null)
+                else if (replace->type() == MIRType::Null)
                     replace = constant(NullValue());
-                else if (replace->type() == MIRType_MagicOptimizedArguments)
+                else if (replace->type() == MIRType::MagicOptimizedArguments)
                     replace = constant(MagicValue(JS_OPTIMIZED_ARGUMENTS));
                 else
                     MOZ_ASSERT(!IsMagicType(ins->type()));
             }
             current->setSlot(i, replace);
         }
     }
     return true;
@@ -3692,17 +3692,17 @@ IonBuilder::improveTypesAtCompare(MCompa
 }
 
 bool
 IonBuilder::improveTypesAtTypeOfCompare(MCompare* ins, bool trueBranch, MTest* test)
 {
     MTypeOf* typeOf = ins->lhs()->isTypeOf() ? ins->lhs()->toTypeOf() : ins->rhs()->toTypeOf();
     MConstant* constant = ins->lhs()->isConstant() ? ins->lhs()->toConstant() : ins->rhs()->toConstant();
 
-    if (constant->type() != MIRType_String)
+    if (constant->type() != MIRType::String)
         return true;
 
     bool equal = ins->jsop() == JSOP_EQ || ins->jsop() == JSOP_STRICTEQ;
     bool notEqual = ins->jsop() == JSOP_NE || ins->jsop() == JSOP_STRICTNE;
 
     if (notEqual)
         trueBranch = !trueBranch;
 
@@ -3711,17 +3711,17 @@ IonBuilder::improveTypesAtTypeOfCompare(
         return true;
 
     MDefinition* subject = typeOf->input();
     TemporaryTypeSet* inputTypes = subject->resultTypeSet();
 
     // Create temporary typeset equal to the type if there is no resultTypeSet.
     TemporaryTypeSet tmp;
     if (!inputTypes) {
-        if (subject->type() == MIRType_Value)
+        if (subject->type() == MIRType::Value)
             return true;
         inputTypes = &tmp;
         tmp.addType(TypeSet::PrimitiveType(ValueTypeFromMIRType(subject->type())), alloc_->lifoAlloc());
     }
 
     if (inputTypes->unknown())
         return true;
 
@@ -3793,17 +3793,17 @@ IonBuilder::improveTypesAtNullOrUndefine
     MDefinition* subject = ins->lhs();
     TemporaryTypeSet* inputTypes = subject->resultTypeSet();
 
     MOZ_ASSERT(IsNullOrUndefined(ins->rhs()->type()));
 
     // Create temporary typeset equal to the type if there is no resultTypeSet.
     TemporaryTypeSet tmp;
     if (!inputTypes) {
-        if (subject->type() == MIRType_Value)
+        if (subject->type() == MIRType::Value)
             return true;
         inputTypes = &tmp;
         tmp.addType(TypeSet::PrimitiveType(ValueTypeFromMIRType(subject->type())), alloc_->lifoAlloc());
     }
 
     if (inputTypes->unknown())
         return true;
 
@@ -3857,17 +3857,17 @@ IonBuilder::improveTypesAtTest(MDefiniti
         return improveTypesAtTest(ins->toNot()->getOperand(0), !trueBranch, test);
       case MDefinition::Op_IsObject: {
         MDefinition* subject = ins->getOperand(0);
         TemporaryTypeSet* oldType = subject->resultTypeSet();
 
         // Create temporary typeset equal to the type if there is no resultTypeSet.
         TemporaryTypeSet tmp;
         if (!oldType) {
-            if (subject->type() == MIRType_Value)
+            if (subject->type() == MIRType::Value)
                 return true;
             oldType = &tmp;
             tmp.addType(TypeSet::PrimitiveType(ValueTypeFromMIRType(subject->type())), alloc_->lifoAlloc());
         }
 
         if (oldType->unknown())
             return true;
 
@@ -3936,17 +3936,17 @@ IonBuilder::improveTypesAtTest(MDefiniti
     // and objects that emulate undefined.
 
     TemporaryTypeSet* oldType = ins->resultTypeSet();
     TemporaryTypeSet* type;
 
     // Create temporary typeset equal to the type if there is no resultTypeSet.
     TemporaryTypeSet tmp;
     if (!oldType) {
-        if (ins->type() == MIRType_Value)
+        if (ins->type() == MIRType::Value)
             return true;
         oldType = &tmp;
         tmp.addType(TypeSet::PrimitiveType(ValueTypeFromMIRType(ins->type())), alloc_->lifoAlloc());
     }
 
     // If ins does not have a typeset we return as we cannot optimize.
     if (oldType->unknown())
         return true;
@@ -4624,21 +4624,21 @@ IonBuilder::pushConstant(const Value& v)
 bool
 IonBuilder::bitnotTrySpecialized(bool* emitted, MDefinition* input)
 {
     MOZ_ASSERT(*emitted == false);
 
     // Try to emit a specialized bitnot instruction based on the input type
     // of the operand.
 
-    if (input->mightBeType(MIRType_Object) || input->mightBeType(MIRType_Symbol))
+    if (input->mightBeType(MIRType::Object) || input->mightBeType(MIRType::Symbol))
         return true;
 
     MBitNot* ins = MBitNot::New(alloc(), input);
-    ins->setSpecialization(MIRType_Int32);
+    ins->setSpecialization(MIRType::Int32);
 
     current->add(ins);
     current->push(ins);
 
     *emitted = true;
     return true;
 }
 
@@ -4742,28 +4742,28 @@ IonBuilder::binaryArithTryConcat(bool* e
 
     // Only try to replace this with concat when we have an addition.
     if (op != JSOP_ADD)
         return true;
 
     trackOptimizationAttempt(TrackedStrategy::BinaryArith_Concat);
 
     // Make sure one of the inputs is a string.
-    if (left->type() != MIRType_String && right->type() != MIRType_String) {
+    if (left->type() != MIRType::String && right->type() != MIRType::String) {
         trackOptimizationOutcome(TrackedOutcome::OperandNotString);
         return true;
     }
 
     // The none-string input (if present) should be atleast a numerical type.
     // Which we can easily coerce to string.
-    if (right->type() != MIRType_String && !IsNumberType(right->type())) {
+    if (right->type() != MIRType::String && !IsNumberType(right->type())) {
         trackOptimizationOutcome(TrackedOutcome::OperandNotStringOrNumber);
         return true;
     }
-    if (left->type() != MIRType_String && !IsNumberType(left->type())) {
+    if (left->type() != MIRType::String && !IsNumberType(left->type())) {
         trackOptimizationOutcome(TrackedOutcome::OperandNotStringOrNumber);
         return true;
     }
 
     MConcat* ins = MConcat::New(alloc(), left, right);
     current->add(ins);
     current->push(ins);
 
@@ -4779,56 +4779,56 @@ bool
 IonBuilder::powTrySpecialized(bool* emitted, MDefinition* base, MDefinition* power,
                               MIRType outputType)
 {
     // Typechecking.
     MDefinition* output = nullptr;
     MIRType baseType = base->type();
     MIRType powerType = power->type();
 
-    if (outputType != MIRType_Int32 && outputType != MIRType_Double)
+    if (outputType != MIRType::Int32 && outputType != MIRType::Double)
         return true;
     if (!IsNumberType(baseType))
         return true;
     if (!IsNumberType(powerType))
         return true;
 
-    if (powerType == MIRType_Float32)
-        powerType = MIRType_Double;
+    if (powerType == MIRType::Float32)
+        powerType = MIRType::Double;
 
     MPow* pow = MPow::New(alloc(), base, power, powerType);
     current->add(pow);
     output = pow;
 
     // Cast to the right type
-    if (outputType == MIRType_Int32 && output->type() != MIRType_Int32) {
+    if (outputType == MIRType::Int32 && output->type() != MIRType::Int32) {
         MToInt32* toInt = MToInt32::New(alloc(), output);
         current->add(toInt);
         output = toInt;
     }
-    if (outputType == MIRType_Double && output->type() != MIRType_Double) {
+    if (outputType == MIRType::Double && output->type() != MIRType::Double) {
         MToDouble* toDouble = MToDouble::New(alloc(), output);
         current->add(toDouble);
         output = toDouble;
     }
 
     current->push(output);
     *emitted = true;
     return true;
 }
 
 static inline bool
 SimpleArithOperand(MDefinition* op)
 {
-    return !op->mightBeType(MIRType_Object)
-        && !op->mightBeType(MIRType_String)
-        && !op->mightBeType(MIRType_Symbol)
-        && !op->mightBeType(MIRType_MagicOptimizedArguments)
-        && !op->mightBeType(MIRType_MagicHole)
-        && !op->mightBeType(MIRType_MagicIsConstructing);
+    return !op->mightBeType(MIRType::Object)
+        && !op->mightBeType(MIRType::String)
+        && !op->mightBeType(MIRType::Symbol)
+        && !op->mightBeType(MIRType::MagicOptimizedArguments)
+        && !op->mightBeType(MIRType::MagicHole)
+        && !op->mightBeType(MIRType::MagicIsConstructing);
 }
 
 bool
 IonBuilder::binaryArithTrySpecialized(bool* emitted, JSOp op, MDefinition* left, MDefinition* right)
 {
     MOZ_ASSERT(*emitted == false);
 
     // Try to emit a specialized binary instruction based on the input types
@@ -4874,17 +4874,17 @@ IonBuilder::binaryArithTrySpecializedOnB
     MOZ_ASSERT(*emitted == false);
 
     // Try to emit a specialized binary instruction speculating the
     // type using the baseline caches.
 
     trackOptimizationAttempt(TrackedStrategy::BinaryArith_SpecializedOnBaselineTypes);
 
     MIRType specialization = inspector->expectedBinaryArithSpecialization(pc);
-    if (specialization == MIRType_None) {
+    if (specialization == MIRType::None) {
         trackOptimizationOutcome(TrackedOutcome::NoTypeInfo);
         return true;
     }
 
     MDefinition::Opcode def_op = JSOpToMDefinition(op);
     MBinaryArithInstruction* ins = MBinaryArithInstruction::New(alloc(), def_op, left, right);
     ins->setSpecialization(specialization);
 
@@ -5013,25 +5013,25 @@ bool
 IonBuilder::jsop_pow()
 {
     MDefinition* exponent = current->pop();
     MDefinition* base = current->pop();
 
     bool emitted = false;
 
     if (!forceInlineCaches()) {
-        if (!powTrySpecialized(&emitted, base, exponent, MIRType_Double) || emitted)
+        if (!powTrySpecialized(&emitted, base, exponent, MIRType::Double) || emitted)
             return emitted;
     }
 
     if (!arithTrySharedStub(&emitted, JSOP_POW, base, exponent) || emitted)
         return emitted;
 
-    // For now, use MIRType_Double, as a safe cover-all. See bug 1188079.
-    MPow* pow = MPow::New(alloc(), base, exponent, MIRType_Double);
+    // For now, use MIRType::Double, as a safe cover-all. See bug 1188079.
+    MPow* pow = MPow::New(alloc(), base, exponent, MIRType::Double);
     current->add(pow);
     current->push(pow);
     return true;
 }
 
 bool
 IonBuilder::jsop_pos()
 {
@@ -5062,17 +5062,17 @@ IonBuilder::jsop_neg()
     MDefinition* right = current->pop();
 
     return jsop_binary_arith(JSOP_MUL, negator, right);
 }
 
 bool
 IonBuilder::jsop_tostring()
 {
-    if (current->peek(-1)->type() == MIRType_String)
+    if (current->peek(-1)->type() == MIRType::String)
         return true;
 
     MDefinition* value = current->pop();
     MToString* ins = MToString::New(alloc(), value);
     current->add(ins);
     current->push(ins);
     MOZ_ASSERT(!ins->isEffectful());
     return true;
@@ -5140,19 +5140,19 @@ IonBuilder::inlineScriptedCall(CallInfo&
     {
         StackTypeSet* types = TypeScript::ThisTypes(calleeScript);
         if (types && !types->unknown()) {
             TemporaryTypeSet* clonedTypes = types->clone(alloc_->lifoAlloc());
             if (!clonedTypes)
                 return false;
             MTypeBarrier* barrier = MTypeBarrier::New(alloc(), callInfo.thisArg(), clonedTypes);
             current->add(barrier);
-            if (barrier->type() == MIRType_Undefined)
+            if (barrier->type() == MIRType::Undefined)
                 callInfo.setThis(constant(UndefinedValue()));
-            else if (barrier->type() == MIRType_Null)
+            else if (barrier->type() == MIRType::Null)
                 callInfo.setThis(constant(NullValue()));
             else
                 callInfo.setThis(barrier);
         }
     }
 
     // Start inlining.
     LifoAlloc* lifoAlloc = alloc_->lifoAlloc();
@@ -5236,22 +5236,22 @@ MDefinition*
 IonBuilder::patchInlinedReturn(CallInfo& callInfo, MBasicBlock* exit, MBasicBlock* bottom)
 {
     // Replaces the MReturn in the exit block with an MGoto.
     MDefinition* rdef = exit->lastIns()->toReturn()->input();
     exit->discardLastIns();
 
     // Constructors must be patched by the caller to always return an object.
     if (callInfo.constructing()) {
-        if (rdef->type() == MIRType_Value) {
+        if (rdef->type() == MIRType::Value) {
             // Unknown return: dynamically detect objects.
             MReturnFromCtor* filter = MReturnFromCtor::New(alloc(), rdef, callInfo.thisArg());
             exit->add(filter);
             rdef = filter;
-        } else if (rdef->type() != MIRType_Object) {
+        } else if (rdef->type() != MIRType::Object) {
             // Known non-object return: force |this|.
             rdef = callInfo.thisArg();
         }
     } else if (callInfo.isSetter()) {
         // Setters return their argument, not whatever value is returned.
         rdef = callInfo.getArg(0);
     }
 
@@ -5282,27 +5282,27 @@ IonBuilder::specializeInlinedReturn(MDef
     if (rdef->resultTypeSet()) {
         // Don't specialize if return typeset is a subset of the
         // observed typeset. The return typeset is already more specific.
         if (rdef->resultTypeSet()->isSubset(types))
             return rdef;
     } else {
         MIRType observedType = types->getKnownMIRType();
 
-        // Don't specialize if type is MIRType_Float32 and TI reports
-        // MIRType_Double. Float is more specific than double.
-        if (observedType == MIRType_Double && rdef->type() == MIRType_Float32)
+        // Don't specialize if type is MIRType::Float32 and TI reports
+        // MIRType::Double. Float is more specific than double.
+        if (observedType == MIRType::Double && rdef->type() == MIRType::Float32)
             return rdef;
 
-        // Don't specialize if types are inaccordance, except for MIRType_Value
-        // and MIRType_Object (when not unknown object), since the typeset
+        // Don't specialize if types are inaccordance, except for MIRType::Value
+        // and MIRType::Object (when not unknown object), since the typeset
         // contains more specific information.
         if (observedType == rdef->type() &&
-            observedType != MIRType_Value &&
-            (observedType != MIRType_Object || types->unknownObject()))
+            observedType != MIRType::Value &&
+            (observedType != MIRType::Object || types->unknownObject()))
         {
             return rdef;
         }
     }
 
     setCurrent(exit);
 
     MTypeBarrier* barrier = nullptr;
@@ -5547,17 +5547,17 @@ IonBuilder::selectInliningTargets(const 
 
     MOZ_ASSERT(choiceSet.length() == targets.length());
     return true;
 }
 
 static bool
 CanInlineGetPropertyCache(MGetPropertyCache* cache, MDefinition* thisDef)
 {
-    MOZ_ASSERT(cache->object()->type() == MIRType_Object);
+    MOZ_ASSERT(cache->object()->type() == MIRType::Object);
     if (cache->object() != thisDef)
         return false;
 
     InlinePropertyTable* table = cache->propTable();
     if (!table)
         return false;
     if (table->numEntries() == 0)
         return false;
@@ -5628,36 +5628,36 @@ class WrapMGetPropertyCache
 
 MGetPropertyCache*
 IonBuilder::getInlineableGetPropertyCache(CallInfo& callInfo)
 {
     if (callInfo.constructing())
         return nullptr;
 
     MDefinition* thisDef = callInfo.thisArg();
-    if (thisDef->type() != MIRType_Object)
+    if (thisDef->type() != MIRType::Object)
         return nullptr;
 
     MDefinition* funcDef = callInfo.fun();
-    if (funcDef->type() != MIRType_Object)
+    if (funcDef->type() != MIRType::Object)
         return nullptr;
 
     // MGetPropertyCache with no uses may be optimized away.
     if (funcDef->isGetPropertyCache()) {
         WrapMGetPropertyCache cache(funcDef->toGetPropertyCache());
         return cache.moveableCache(/* hasTypeBarrier = */ false, thisDef);
     }
 
     // Optimize away the following common pattern:
-    // MTypeBarrier[MIRType_Object] <- MGetPropertyCache
+    // MTypeBarrier[MIRType::Object] <- MGetPropertyCache
     if (funcDef->isTypeBarrier()) {
         MTypeBarrier* barrier = funcDef->toTypeBarrier();
         if (barrier->hasUses())
             return nullptr;
-        if (barrier->type() != MIRType_Object)
+        if (barrier->type() != MIRType::Object)
             return nullptr;
         if (!barrier->input()->isGetPropertyCache())
             return nullptr;
 
         WrapMGetPropertyCache cache(barrier->input()->toGetPropertyCache());
         return cache.moveableCache(/* hasTypeBarrier = */ true, thisDef);
     }
 
@@ -5849,17 +5849,17 @@ IonBuilder::inlineObjectGroupFallback(Ca
 
     // Move the MGetPropertyCache and friends into the getPropBlock.
     if (fallbackInfo.fun()->isGetPropertyCache()) {
         MOZ_ASSERT(fallbackInfo.fun()->toGetPropertyCache() == cache);
         getPropBlock->addFromElsewhere(cache);
         getPropBlock->push(cache);
     } else {
         MTypeBarrier* barrier = callInfo.fun()->toTypeBarrier();
-        MOZ_ASSERT(barrier->type() == MIRType_Object);
+        MOZ_ASSERT(barrier->type() == MIRType::Object);
         MOZ_ASSERT(barrier->input()->isGetPropertyCache());
         MOZ_ASSERT(barrier->input()->toGetPropertyCache() == cache);
 
         getPropBlock->addFromElsewhere(cache);
         getPropBlock->addFromElsewhere(barrier);
         getPropBlock->push(barrier);
     }
 
@@ -6068,17 +6068,17 @@ IonBuilder::inlineCalls(CallInfo& callIn
                 // The object group dispatch handles all possible incoming
                 // objects, so the cache and barrier will not be reached and
                 // can be eliminated.
                 if (callInfo.fun()->isGetPropertyCache()) {
                     MOZ_ASSERT(callInfo.fun() == maybeCache);
                 } else {
                     MTypeBarrier* barrier = callInfo.fun()->toTypeBarrier();
                     MOZ_ASSERT(!barrier->hasUses());
-                    MOZ_ASSERT(barrier->type() == MIRType_Object);
+                    MOZ_ASSERT(barrier->type() == MIRType::Object);
                     MOZ_ASSERT(barrier->input()->isGetPropertyCache());
                     MOZ_ASSERT(barrier->input()->toGetPropertyCache() == maybeCache);
                     barrier->block()->discard(barrier);
                 }
 
                 MOZ_ASSERT(!maybeCache->hasUses());
                 maybeCache->block()->discard(maybeCache);
             }
@@ -6475,24 +6475,24 @@ IonBuilder::jsop_funapply(uint32_t argc)
             return false;
         return makeCall(native, callInfo);
     }
 
     // Disable compilation if the second argument to |apply| cannot be guaranteed
     // to be either definitely |arguments| or definitely not |arguments|.
     MDefinition* argument = current->peek(-1);
     if (script()->argumentsHasVarBinding() &&
-        argument->mightBeType(MIRType_MagicOptimizedArguments) &&
-        argument->type() != MIRType_MagicOptimizedArguments)
+        argument->mightBeType(MIRType::MagicOptimizedArguments) &&
+        argument->type() != MIRType::MagicOptimizedArguments)
     {
         return abort("fun.apply with MaybeArguments");
     }
 
     // Fallback to regular call if arg 2 is not definitely |arguments|.
-    if (argument->type() != MIRType_MagicOptimizedArguments) {
+    if (argument->type() != MIRType::MagicOptimizedArguments) {
         // Optimize fun.apply(self, array) if the length is sane and there are no holes.
         TemporaryTypeSet* objTypes = argument->resultTypeSet();
         if (native && native->isNative() && native->native() == fun_apply &&
             objTypes &&
             objTypes->getKnownClass(constraints()) == &ArrayObject::class_ &&
             !objTypes->hasObjectFlags(constraints(), OBJECT_FLAG_LENGTH_OVERFLOW) &&
             ElementAccessIsPacked(constraints(), argument))
         {
@@ -6733,24 +6733,24 @@ IonBuilder::testShouldDOMCall(TypeSet* i
 
 static bool
 ArgumentTypesMatch(MDefinition* def, StackTypeSet* calleeTypes)
 {
     if (!calleeTypes)
         return false;
 
     if (def->resultTypeSet()) {
-        MOZ_ASSERT(def->type() == MIRType_Value || def->mightBeType(def->type()));
+        MOZ_ASSERT(def->type() == MIRType::Value || def->mightBeType(def->type()));
         return def->resultTypeSet()->isSubset(calleeTypes);
     }
 
-    if (def->type() == MIRType_Value)
-        return false;
-
-    if (def->type() == MIRType_Object)
+    if (def->type() == MIRType::Value)
+        return false;
+
+    if (def->type() == MIRType::Object)
         return calleeTypes->unknownObject();
 
     return calleeTypes->mightBeMIRType(def->type());
 }
 
 bool
 IonBuilder::testNeedsArgumentCheck(JSFunction* target, CallInfo& callInfo)
 {
@@ -6765,17 +6765,17 @@ IonBuilder::testNeedsArgumentCheck(JSFun
     if (!ArgumentTypesMatch(callInfo.thisArg(), TypeScript::ThisTypes(targetScript)))
         return true;
     uint32_t expected_args = Min<uint32_t>(callInfo.argc(), target->nargs());
     for (size_t i = 0; i < expected_args; i++) {
         if (!ArgumentTypesMatch(callInfo.getArg(i), TypeScript::ArgTypes(targetScript, i)))
             return true;
     }
     for (size_t i = callInfo.argc(); i < target->nargs(); i++) {
-        if (!TypeScript::ArgTypes(targetScript, i)->mightBeMIRType(MIRType_Undefined))
+        if (!TypeScript::ArgTypes(targetScript, i)->mightBeMIRType(MIRType::Undefined))
             return true;
     }
 
     return false;
 }
 
 MCall*
 IonBuilder::makeCallHelper(JSFunction* target, CallInfo& callInfo)
@@ -6792,17 +6792,17 @@ IonBuilder::makeCallHelper(JSFunction* t
 
     bool isDOMCall = false;
     if (target && !callInfo.constructing()) {
         // We know we have a single call target.  Check whether the "this" types
         // are DOM types and our function a DOM function, and if so flag the
         // MCall accordingly.
         TemporaryTypeSet* thisTypes = callInfo.thisArg()->resultTypeSet();
         if (thisTypes &&
-            thisTypes->getKnownMIRType() == MIRType_Object &&
+            thisTypes->getKnownMIRType() == MIRType::Object &&
             thisTypes->isDOMClass(constraints()) &&
             testShouldDOMCall(thisTypes, target, JSJitInfo::Method))
         {
             isDOMCall = true;
         }
     }
 
     MCall* call = MCall::New(alloc(), target, targetArgs + 1 + callInfo.constructing(),
@@ -6928,31 +6928,31 @@ IonBuilder::jsop_eval(uint32_t argc)
 
         callInfo.fun()->setImplicitlyUsedUnchecked();
 
         MDefinition* scopeChain = current->scopeChain();
         MDefinition* string = callInfo.getArg(0);
 
         // Direct eval acts as identity on non-string types according to
         // ES5 15.1.2.1 step 1.
-        if (!string->mightBeType(MIRType_String)) {
+        if (!string->mightBeType(MIRType::String)) {
             current->push(string);
             TemporaryTypeSet* types = bytecodeTypes(pc);
             return pushTypeBarrier(string, types, BarrierKind::TypeSet);
         }
 
         if (!jsop_newtarget())
             return false;
         MDefinition* newTargetValue = current->pop();
 
         // Try to pattern match 'eval(v + "()")'. In this case v is likely a
         // name on the scope chain and the eval is performing a call on that
         // value. Use a dynamic scope chain lookup rather than a full eval.
         if (string->isConcat() &&
-            string->getOperand(1)->type() == MIRType_String &&
+            string->getOperand(1)->type() == MIRType::String &&
             string->getOperand(1)->maybeConstantValue())
         {
             JSAtom* atom = &string->getOperand(1)->maybeConstantValue()->toString()->asAtom();
 
             if (StringEqualsAscii(atom, "()")) {
                 MDefinition* name = string->getOperand(0);
                 MInstruction* dynamicName = MGetDynamicName::New(alloc(), scopeChain, name);
                 current->add(dynamicName);
@@ -7016,23 +7016,23 @@ IonBuilder::jsop_compare(JSOp op, MDefin
         return false;
     return true;
 }
 
 static bool
 ObjectOrSimplePrimitive(MDefinition* op)
 {
     // Return true if op is either undefined/null/boolean/int32 or an object.
-    return !op->mightBeType(MIRType_String)
-        && !op->mightBeType(MIRType_Symbol)
-        && !op->mightBeType(MIRType_Double)
-        && !op->mightBeType(MIRType_Float32)
-        && !op->mightBeType(MIRType_MagicOptimizedArguments)
-        && !op->mightBeType(MIRType_MagicHole)
-        && !op->mightBeType(MIRType_MagicIsConstructing);
+    return !op->mightBeType(MIRType::String)
+        && !op->mightBeType(MIRType::Symbol)
+        && !op->mightBeType(MIRType::Double)
+        && !op->mightBeType(MIRType::Float32)
+        && !op->mightBeType(MIRType::MagicOptimizedArguments)
+        && !op->mightBeType(MIRType::MagicHole)
+        && !op->mightBeType(MIRType::MagicIsConstructing);
 }
 
 bool
 IonBuilder::compareTrySpecialized(bool* emitted, JSOp op, MDefinition* left, MDefinition* right)
 {
     MOZ_ASSERT(*emitted == false);
 
     // Try to emit an compare based on the input types.
@@ -7042,23 +7042,23 @@ IonBuilder::compareTrySpecialized(bool* 
         return true;
 
     MCompare* ins = MCompare::New(alloc(), left, right, op);
     ins->setCompareType(type);
     ins->cacheOperandMightEmulateUndefined(constraints());
 
     // Some compare types need to have the specific type in the rhs.
     // Swap operands if that is not the case.
-    if (type == MCompare::Compare_StrictString && right->type() != MIRType_String)
+    if (type == MCompare::Compare_StrictString && right->type() != MIRType::String)
         ins->swapOperands();
-    else if (type == MCompare::Compare_Null && right->type() != MIRType_Null)
+    else if (type == MCompare::Compare_Null && right->type() != MIRType::Null)
         ins->swapOperands();
-    else if (type == MCompare::Compare_Undefined && right->type() != MIRType_Undefined)
+    else if (type == MCompare::Compare_Undefined && right->type() != MIRType::Undefined)
         ins->swapOperands();
-    else if (type == MCompare::Compare_Boolean && right->type() != MIRType_Boolean)
+    else if (type == MCompare::Compare_Boolean && right->type() != MIRType::Boolean)
         ins->swapOperands();
 
     // Replace inputs with unsigned variants if needed.
     if (type == MCompare::Compare_UInt32)
         ins->replaceWithUnsignedOperands();
 
     current->add(ins);
     current->push(ins);
@@ -7090,36 +7090,36 @@ IonBuilder::compareTryBitwise(bool* emit
         return true;
 
     // In the loose comparison more values could be the same,
     // but value comparison reporting otherwise.
     if (op == JSOP_EQ || op == JSOP_NE) {
 
         // Undefined compared loosy to Null is not supported,
         // because tag is different, but value can be the same (undefined == null).
-        if ((left->mightBeType(MIRType_Undefined) && right->mightBeType(MIRType_Null)) ||
-            (left->mightBeType(MIRType_Null) && right->mightBeType(MIRType_Undefined)))
+        if ((left->mightBeType(MIRType::Undefined) && right->mightBeType(MIRType::Null)) ||
+            (left->mightBeType(MIRType::Null) && right->mightBeType(MIRType::Undefined)))
         {
             return true;
         }
 
         // Int32 compared loosy to Boolean is not supported,
         // because tag is different, but value can be the same (1 == true).
-        if ((left->mightBeType(MIRType_Int32) && right->mightBeType(MIRType_Boolean)) ||
-            (left->mightBeType(MIRType_Boolean) && right->mightBeType(MIRType_Int32)))
+        if ((left->mightBeType(MIRType::Int32) && right->mightBeType(MIRType::Boolean)) ||
+            (left->mightBeType(MIRType::Boolean) && right->mightBeType(MIRType::Int32)))
         {
             return true;
         }
 
         // For loosy comparison of an object with a Boolean/Number/String
         // the valueOf the object is taken. Therefore not supported.
-        bool simpleLHS = left->mightBeType(MIRType_Boolean) || left->mightBeType(MIRType_Int32);
-        bool simpleRHS = right->mightBeType(MIRType_Boolean) || right->mightBeType(MIRType_Int32);
-        if ((left->mightBeType(MIRType_Object) && simpleRHS) ||
-            (right->mightBeType(MIRType_Object) && simpleLHS))
+        bool simpleLHS = left->mightBeType(MIRType::Boolean) || left->mightBeType(MIRType::Int32);
+        bool simpleRHS = right->mightBeType(MIRType::Boolean) || right->mightBeType(MIRType::Int32);
+        if ((left->mightBeType(MIRType::Object) && simpleRHS) ||
+            (right->mightBeType(MIRType::Object) && simpleLHS))
         {
             return true;
         }
     }
 
     MCompare* ins = MCompare::New(alloc(), left, right, op);
     ins->setCompareType(MCompare::Compare_Bitwise);
     ins->cacheOperandMightEmulateUndefined(constraints());
@@ -7176,17 +7176,17 @@ IonBuilder::compareTrySharedStub(bool* e
         return true;
 
     MBinarySharedStub* stub = MBinarySharedStub::New(alloc(), left, right);
     current->add(stub);
     current->push(stub);
     if (!resumeAfter(stub))
         return false;
 
-    MUnbox* unbox = MUnbox::New(alloc(), current->pop(), MIRType_Boolean, MUnbox::Infallible);
+    MUnbox* unbox = MUnbox::New(alloc(), current->pop(), MIRType::Boolean, MUnbox::Infallible);
     current->add(unbox);
     current->push(unbox);
 
     *emitted = true;
     return true;
 }
 
 bool
@@ -7456,17 +7456,17 @@ IonBuilder::jsop_initelem_array()
         MOZ_ASSERT(obj->resultTypeSet()->getObjectCount() == 1);
         TypeSet::ObjectKey* initializer = obj->resultTypeSet()->getObject(0);
         if (initializer->clasp() == &UnboxedArrayObject::class_) {
             if (initializer->group()->unboxedLayout().nativeGroup())
                 needStub = true;
             else
                 unboxedType = initializer->group()->unboxedLayout().elementType();
         }
-        if (value->type() == MIRType_MagicHole) {
+        if (value->type() == MIRType::MagicHole) {
             if (!initializer->hasFlags(constraints(), OBJECT_FLAG_NON_PACKED))
                 needStub = true;
         } else if (!initializer->unknownProperties()) {
             HeapTypeSetKey elemTypes = initializer->property(JSID_VOID);
             if (!TypeSetIncludes(elemTypes.maybeTypes(), value->type(), value->resultTypeSet())) {
                 elemTypes.freeze(constraints());
                 needStub = true;
             }
@@ -7829,17 +7829,17 @@ IonBuilder::newOsrPreheader(MBasicBlock*
 
     // Treat the OSR values as having the same type as the existing values
     // coming in to the loop. These will be fixed up with appropriate
     // unboxing and type barriers in finishLoop, once the possible types
     // at the loop header are known.
     for (uint32_t i = info().startArgSlot(); i < osrBlock->stackDepth(); i++) {
         MDefinition* existing = current->getSlot(i);
         MDefinition* def = osrBlock->getSlot(i);
-        MOZ_ASSERT_IF(!needsArgsObj || !info().isSlotAliasedAtOsr(i), def->type() == MIRType_Value);
+        MOZ_ASSERT_IF(!needsArgsObj || !info().isSlotAliasedAtOsr(i), def->type() == MIRType::Value);
 
         // Aliased slots are never accessed, since they need to go through
         // the callobject. No need to type them here.
         if (info().isSlotAliasedAtOsr(i))
             continue;
 
         def->setResultType(existing->type());
         def->setResultTypeSet(existing->resultTypeSet());
@@ -7994,17 +7994,17 @@ IonBuilder::maybeInsertResume()
     current->add(ins);
 
     return resumeAfter(ins);
 }
 
 void
 IonBuilder::maybeMarkEmpty(MDefinition* ins)
 {
-    MOZ_ASSERT(ins->type() == MIRType_Value);
+    MOZ_ASSERT(ins->type() == MIRType::Value);
 
     // When one of the operands has no type information, mark the output
     // as having no possible types too. This is to avoid degrading
     // subsequent analysis.
     for (size_t i = 0; i < ins->numOperands(); i++) {
         if (!ins->emptyResultTypeSet())
             continue;
 
@@ -8122,39 +8122,39 @@ IonBuilder::testSingletonPropertyTypes(M
     if (types && types->unknownObject())
         return nullptr;
 
     JSObject* objectSingleton = types ? types->maybeSingleton() : nullptr;
     if (objectSingleton)
         return testSingletonProperty(objectSingleton, id);
 
     MIRType objType = obj->type();
-    if (objType == MIRType_Value && types)
+    if (objType == MIRType::Value && types)
         objType = types->getKnownMIRType();
 
     JSProtoKey key;
     switch (objType) {
-      case MIRType_String:
+      case MIRType::String:
         key = JSProto_String;
         break;
 
-      case MIRType_Symbol:
+      case MIRType::Symbol:
         key = JSProto_Symbol;
         break;
 
-      case MIRType_Int32:
-      case MIRType_Double:
+      case MIRType::Int32:
+      case MIRType::Double:
         key = JSProto_Number;
         break;
 
-      case MIRType_Boolean:
+      case MIRType::Boolean:
         key = JSProto_Boolean;
         break;
 
-      case MIRType_Object: {
+      case MIRType::Object: {
         if (!types)
             return nullptr;
 
         // For property accesses which may be on many objects, we just need to
         // find a prototype common to all the objects; if that prototype
         // has the singleton property, the access will not be on a missing property.
         JSObject* singleton = nullptr;
         for (unsigned i = 0; i < types->getObjectCount(); i++) {
@@ -8201,17 +8201,17 @@ IonBuilder::testSingletonPropertyTypes(M
 
     return nullptr;
 }
 
 bool
 IonBuilder::testNotDefinedProperty(MDefinition* obj, jsid id)
 {
     TemporaryTypeSet* types = obj->resultTypeSet();
-    if (!types || types->unknownObject() || types->getKnownMIRType() != MIRType_Object)
+    if (!types || types->unknownObject() || types->getKnownMIRType() != MIRType::Object)
         return false;
 
     for (unsigned i = 0, count = types->getObjectCount(); i < count; i++) {
         TypeSet::ObjectKey* key = types->getObject(i);
         if (!key)
             continue;
 
         while (true) {
@@ -8289,41 +8289,41 @@ IonBuilder::addTypeBarrier(MDefinition* 
         return def;
 
     MTypeBarrier* barrier = MTypeBarrier::New(alloc(), def, observed, kind);
     current->add(barrier);
 
     if (pbarrier)
         *pbarrier = barrier;
 
-    if (barrier->type() == MIRType_Undefined)
+    if (barrier->type() == MIRType::Undefined)
         return constant(UndefinedValue());
-    if (barrier->type() == MIRType_Null)
+    if (barrier->type() == MIRType::Null)
         return constant(NullValue());
 
     return barrier;
 }
 
 bool
 IonBuilder::pushDOMTypeBarrier(MInstruction* ins, TemporaryTypeSet* observed, JSFunction* func)
 {
     MOZ_ASSERT(func && func->isNative() && func->jitInfo());
 
     const JSJitInfo* jitinfo = func->jitInfo();
     bool barrier = DOMCallNeedsBarrier(jitinfo, observed);
     // Need to be a bit careful: if jitinfo->returnType is JSVAL_TYPE_DOUBLE but
-    // types->getKnownMIRType() is MIRType_Int32, then don't unconditionally
+    // types->getKnownMIRType() is MIRType::Int32, then don't unconditionally
     // unbox as a double.  Instead, go ahead and barrier on having an int type,
     // since we know we need a barrier anyway due to the type mismatch.  This is
     // the only situation in which TI actually has more information about the
     // JSValueType than codegen can, short of jitinfo->returnType just being
     // JSVAL_TYPE_UNKNOWN.
     MDefinition* replace = ins;
     if (jitinfo->returnType() != JSVAL_TYPE_DOUBLE ||
-        observed->getKnownMIRType() != MIRType_Int32) {
+        observed->getKnownMIRType() != MIRType::Int32) {
         replace = ensureDefiniteType(ins, MIRTypeFromValueType(jitinfo->returnType()));
         if (replace != ins) {
             current->pop();
             current->push(replace);
         }
     } else {
         MOZ_ASSERT(barrier);
     }
@@ -8332,32 +8332,32 @@ IonBuilder::pushDOMTypeBarrier(MInstruct
                            barrier ? BarrierKind::TypeSet : BarrierKind::NoBarrier);
 }
 
 MDefinition*
 IonBuilder::ensureDefiniteType(MDefinition* def, MIRType definiteType)
 {
     MInstruction* replace;
     switch (definiteType) {
-      case MIRType_Undefined:
+      case MIRType::Undefined:
         def->setImplicitlyUsedUnchecked();
         replace = MConstant::New(alloc(), UndefinedValue());
         break;
 
-      case MIRType_Null:
+      case MIRType::Null:
         def->setImplicitlyUsedUnchecked();
         replace = MConstant::New(alloc(), NullValue());
         break;
 
-      case MIRType_Value:
+      case MIRType::Value:
         return def;
 
       default: {
-        if (def->type() != MIRType_Value) {
-            if (def->type() == MIRType_Int32 && definiteType == MIRType_Double) {
+        if (def->type() != MIRType::Value) {
+            if (def->type() == MIRType::Int32 && definiteType == MIRType::Double) {
                 replace = MToDouble::New(alloc(), def);
                 break;
             }
             MOZ_ASSERT(def->type() == definiteType);
             return def;
         }
         replace = MUnbox::New(alloc(), def, definiteType, MUnbox::Infallible);
         break;
@@ -8379,17 +8379,17 @@ IonBuilder::ensureDefiniteTypeSet(MDefin
     MDefinition* replace = ensureDefiniteType(def, types->getKnownMIRType());
     if (replace != def) {
         replace->setResultTypeSet(types);
         return replace;
     }
 
     // Don't replace if input type is more accurate than given typeset.
     if (def->type() != types->getKnownMIRType()) {
-        MOZ_ASSERT(types->getKnownMIRType() == MIRType_Value);
+        MOZ_ASSERT(types->getKnownMIRType() == MIRType::Value);
         return def;
     }
 
     // Create a NOP mir instruction to filter the typeset.
     MFilterTypeSet* filter = MFilterTypeSet::New(alloc(), def, types);
     current->add(filter);
     return filter;
 }
@@ -8510,38 +8510,38 @@ IonBuilder::getStaticName(JSObject* stat
 
 bool
 IonBuilder::loadStaticSlot(JSObject* staticObject, BarrierKind barrier, TemporaryTypeSet* types,
                            uint32_t slot)
 {
     if (barrier == BarrierKind::NoBarrier) {
         // Try to inline properties that can only have one value.
         MIRType knownType = types->getKnownMIRType();
-        if (knownType == MIRType_Undefined)
+        if (knownType == MIRType::Undefined)
             return pushConstant(UndefinedValue());
-        if (knownType == MIRType_Null)
+        if (knownType == MIRType::Null)
             return pushConstant(NullValue());
     }
 
     MInstruction* obj = constant(ObjectValue(*staticObject));
 
     MIRType rvalType = types->getKnownMIRType();
     if (barrier != BarrierKind::NoBarrier)
-        rvalType = MIRType_Value;
+        rvalType = MIRType::Value;
 
     return loadSlot(obj, slot, NumFixedSlots(staticObject), rvalType, barrier, types);
 }
 
 // Whether a write of the given value may need a post-write barrier for GC purposes.
 bool
 jit::NeedsPostBarrier(MDefinition* value)
 {
     if (!GetJitContext()->runtime->gcNursery().exists())
         return false;
-    return value->mightBeType(MIRType_Object);
+    return value->mightBeType(MIRType::Object);
 }
 
 bool
 IonBuilder::setStaticName(JSObject* staticObject, PropertyName* name)
 {
     jsid id = NameToId(name);
 
     bool isGlobalLexical = staticObject->is<ClonedBlockObject>() &&
@@ -8581,19 +8581,19 @@ IonBuilder::setStaticName(JSObject* stat
     MDefinition* obj = current->pop();
     MOZ_ASSERT(&obj->toConstant()->toObject() == staticObject);
 
     if (NeedsPostBarrier(value))
         current->add(MPostWriteBarrier::New(alloc(), obj, value));
 
     // If the property has a known type, we may be able to optimize typed stores by not
     // storing the type tag.
-    MIRType slotType = MIRType_None;
+    MIRType slotType = MIRType::None;
     MIRType knownType = property.knownMIRType(constraints());
-    if (knownType != MIRType_Value)
+    if (knownType != MIRType::Value)
         slotType = knownType;
 
     bool needsBarrier = property.needsBarrier(constraints());
     return storeSlot(obj, property.maybeTypes()->definiteSlot(), NumFixedSlots(staticObject),
                      value, needsBarrier, slotType);
 }
 
 JSObject*
@@ -8796,23 +8796,23 @@ GetElemKnownType(bool needsHoleCheck, Te
 {
     MIRType knownType = types->getKnownMIRType();
 
     // Null and undefined have no payload so they can't be specialized.
     // Since folding null/undefined while building SSA is not safe (see the
     // comment in IsPhiObservable), we just add an untyped load instruction
     // and rely on pushTypeBarrier and DCE to replace it with a null/undefined
     // constant.
-    if (knownType == MIRType_Undefined || knownType == MIRType_Null)
-        knownType = MIRType_Value;
+    if (knownType == MIRType::Undefined || knownType == MIRType::Null)
+        knownType = MIRType::Value;
 
     // Different architectures may want typed element reads which require
     // hole checks to be done as either value or typed reads.
     if (needsHoleCheck && !LIRGenerator::allowTypedElementHoleCheck())
-        knownType = MIRType_Value;
+        knownType = MIRType::Value;
 
     return knownType;
 }
 
 bool
 IonBuilder::jsop_getelem()
 {
     startTrackingOptimizations();
@@ -8834,17 +8834,17 @@ IonBuilder::jsop_getelem()
         if (!resumeAfter(ins))
             return false;
 
         TemporaryTypeSet* types = bytecodeTypes(pc);
         return pushTypeBarrier(ins, types, BarrierKind::TypeSet);
     }
 
     obj = maybeUnboxForPropertyAccess(obj);
-    if (obj->type() == MIRType_Object)
+    if (obj->type() == MIRType::Object)
         obj = convertUnboxedObjects(obj);
 
     bool emitted = false;
 
     if (!forceInlineCaches()) {
         trackOptimizationAttempt(TrackedStrategy::GetElem_TypedObject);
         if (!getElemTryTypedObject(&emitted, obj, index) || emitted)
             return emitted;
@@ -8874,17 +8874,17 @@ IonBuilder::jsop_getelem()
         if (!getElemTryArguments(&emitted, obj, index) || emitted)
             return emitted;
 
         trackOptimizationAttempt(TrackedStrategy::GetElem_ArgumentsInlined);
         if (!getElemTryArgumentsInlined(&emitted, obj, index) || emitted)
             return emitted;
     }
 
-    if (script()->argumentsHasVarBinding() && obj->mightBeType(MIRType_MagicOptimizedArguments))
+    if (script()->argumentsHasVarBinding() && obj->mightBeType(MIRType::MagicOptimizedArguments))
         return abort("Type is not definitely lazy arguments.");
 
     trackOptimizationAttempt(TrackedStrategy::GetElem_InlineCache);
     if (!getElemTryCache(&emitted, obj, index) || emitted)
         return emitted;
 
     // Emit call.
     MInstruction* ins = MCallGetElement::New(alloc(), obj, index);
@@ -8928,17 +8928,17 @@ IonBuilder::getElemTryTypedObject(bool* 
         return true;
 
     int32_t elemSize;
     if (!elemPrediction.hasKnownSize(&elemSize))
         return true;
 
     switch (elemPrediction.kind()) {
       case type::Simd:
-        // FIXME (bug 894105): load into a MIRType_float32x4 etc
+        // FIXME (bug 894105): load into a MIRType::float32x4 etc
         trackOptimizationOutcome(TrackedOutcome::GenericFailure);
         return true;
 
       case type::Struct:
       case type::Array:
         return getElemTryComplexElemOfTypedObject(emitted,
                                                   obj,
                                                   index,
@@ -9431,17 +9431,17 @@ IonBuilder::getElemTryTypedArray(bool* e
     return true;
 }
 
 bool
 IonBuilder::getElemTryString(bool* emitted, MDefinition* obj, MDefinition* index)
 {
     MOZ_ASSERT(*emitted == false);
 
-    if (obj->type() != MIRType_String || !IsNumberType(index->type())) {
+    if (obj->type() != MIRType::String || !IsNumberType(index->type())) {
         trackOptimizationOutcome(TrackedOutcome::AccessNotString);
         return true;
     }
 
     // If the index is expected to be out-of-bounds, don't optimize to avoid
     // frequent bailouts.
     if (bytecodeTypes(pc)->hasType(TypeSet::UndefinedType())) {
         trackOptimizationOutcome(TrackedOutcome::OutOfBounds);
@@ -9473,17 +9473,17 @@ IonBuilder::getElemTryString(bool* emitt
 bool
 IonBuilder::getElemTryArguments(bool* emitted, MDefinition* obj, MDefinition* index)
 {
     MOZ_ASSERT(*emitted == false);
 
     if (inliningDepth_ > 0)
         return true;
 
-    if (obj->type() != MIRType_MagicOptimizedArguments)
+    if (obj->type() != MIRType::MagicOptimizedArguments)
         return true;
 
     // Emit GetFrameArgument.
 
     MOZ_ASSERT(!info().argsObjAliasesFormals());
 
     // Type Inference has guaranteed this is an optimized arguments object.
     obj->setImplicitlyUsedUnchecked();
@@ -9517,27 +9517,27 @@ IonBuilder::getElemTryArguments(bool* em
 bool
 IonBuilder::getElemTryArgumentsInlined(bool* emitted, MDefinition* obj, MDefinition* index)
 {
     MOZ_ASSERT(*emitted == false);
 
     if (inliningDepth_ == 0)
         return true;
 
-    if (obj->type() != MIRType_MagicOptimizedArguments)
+    if (obj->type() != MIRType::MagicOptimizedArguments)
         return true;
 
     // Emit inlined arguments.
     obj->setImplicitlyUsedUnchecked();
 
     MOZ_ASSERT(!info().argsObjAliasesFormals());
 
     // When the id is constant, we can just return the corresponding inlined argument
     MConstant* indexConst = index->maybeConstantValue();
-    if (indexConst && indexConst->type() == MIRType_Int32) {
+    if (indexConst && indexConst->type() == MIRType::Int32) {
         MOZ_ASSERT(inliningDepth_ > 0);
 
         int32_t id = indexConst->toInt32();
         index->setImplicitlyUsedUnchecked();
 
         if (id < (int32_t)inlineCallInfo_->argc() && id >= 0)
             current->push(inlineCallInfo_->getArg(id));
         else
@@ -9553,69 +9553,69 @@ IonBuilder::getElemTryArgumentsInlined(b
 }
 
 bool
 IonBuilder::getElemTryCache(bool* emitted, MDefinition* obj, MDefinition* index)
 {
     MOZ_ASSERT(*emitted == false);
 
     // Make sure we have at least an object.
-    if (!obj->mightBeType(MIRType_Object)) {
+    if (!obj->mightBeType(MIRType::Object)) {
         trackOptimizationOutcome(TrackedOutcome::NotObject);
         return true;
     }
 
     // Don't cache for strings.
-    if (obj->mightBeType(MIRType_String)) {
+    if (obj->mightBeType(MIRType::String)) {
         trackOptimizationOutcome(TrackedOutcome::GetElemStringNotCached);
         return true;
     }
 
     // Index should be integer, string, or symbol
-    if (!index->mightBeType(MIRType_Int32) &&
-        !index->mightBeType(MIRType_String) &&
-        !index->mightBeType(MIRType_Symbol))
+    if (!index->mightBeType(MIRType::Int32) &&
+        !index->mightBeType(MIRType::String) &&
+        !index->mightBeType(MIRType::Symbol))
     {
         trackOptimizationOutcome(TrackedOutcome::IndexType);
         return true;
     }
 
     // Turn off cacheing if the element is int32 and we've seen non-native objects as the target
     // of this getelem.
     bool nonNativeGetElement = inspector->hasSeenNonNativeGetElement(pc);
-    if (index->mightBeType(MIRType_Int32) && nonNativeGetElement) {
+    if (index->mightBeType(MIRType::Int32) && nonNativeGetElement) {
         trackOptimizationOutcome(TrackedOutcome::NonNativeReceiver);
         return true;
     }
 
     // Emit GetElementCache.
 
     TemporaryTypeSet* types = bytecodeTypes(pc);
     BarrierKind barrier = PropertyReadNeedsTypeBarrier(analysisContext, constraints(), obj,
                                                        nullptr, types);
 
     // Always add a barrier if the index might be a string or symbol, so that
     // the cache can attach stubs for particular properties.
-    if (index->mightBeType(MIRType_String) || index->mightBeType(MIRType_Symbol))
+    if (index->mightBeType(MIRType::String) || index->mightBeType(MIRType::Symbol))
         barrier = BarrierKind::TypeSet;
 
     MGetPropertyCache* ins = MGetPropertyCache::New(alloc(), obj, index,
                                                     barrier == BarrierKind::TypeSet);
     current->add(ins);
     current->push(ins);
 
     if (!resumeAfter(ins))
         return false;
 
     // Spice up type information.
-    if (index->type() == MIRType_Int32 && barrier == BarrierKind::NoBarrier) {
+    if (index->type() == MIRType::Int32 && barrier == BarrierKind::NoBarrier) {
         bool needHoleCheck = !ElementAccessIsPacked(constraints(), obj);
         MIRType knownType = GetElemKnownType(needHoleCheck, types);
 
-        if (knownType != MIRType_Value && knownType != MIRType_Double)
+        if (knownType != MIRType::Value && knownType != MIRType::Double)
             ins->setResultType(knownType);
     }
 
     if (!pushTypeBarrier(ins, types, barrier))
         return false;
 
     trackOptimizationSuccess();
     *emitted = true;
@@ -9661,17 +9661,17 @@ IonBuilder::computeHeapType(const Tempor
     return acc;
 }
 
 bool
 IonBuilder::jsop_getelem_dense(MDefinition* obj, MDefinition* index, JSValueType unboxedType)
 {
     TemporaryTypeSet* types = bytecodeTypes(pc);
 
-    MOZ_ASSERT(index->type() == MIRType_Int32 || index->type() == MIRType_Double);
+    MOZ_ASSERT(index->type() == MIRType::Int32 || index->type() == MIRType::Double);
     if (JSOp(*pc) == JSOP_CALLELEM) {
         // Indexed call on an element of an array. Populate the observed types
         // with any objects that could be in the array, to avoid extraneous
         // type barriers.
         AddObjectsForPropertyRead(obj, nullptr, types);
     }
 
     BarrierKind barrier = PropertyReadNeedsTypeBarrier(analysisContext, constraints(), obj,
@@ -9680,17 +9680,17 @@ IonBuilder::jsop_getelem_dense(MDefiniti
 
     // Reads which are on holes in the object do not have to bail out if
     // undefined values have been observed at this access site and the access
     // cannot hit another indexed property on the object or its prototypes.
     bool readOutOfBounds =
         types->hasType(TypeSet::UndefinedType()) &&
         !ElementAccessHasExtraIndexedProperty(this, obj);
 
-    MIRType knownType = MIRType_Value;
+    MIRType knownType = MIRType::Value;
     if (unboxedType == JSVAL_TYPE_MAGIC && barrier == BarrierKind::NoBarrier)
         knownType = GetElemKnownType(needsHoleCheck, types);
 
     // Ensure index is an integer.
     MInstruction* idInt32 = MToInt32::New(alloc(), index);
     current->add(idInt32);
     index = idInt32;
 
@@ -9716,17 +9716,17 @@ IonBuilder::jsop_getelem_dense(MDefiniti
         }
     }
 
     bool loadDouble =
         unboxedType == JSVAL_TYPE_MAGIC &&
         barrier == BarrierKind::NoBarrier &&
         loopDepth_ &&
         inBounds &&
-        knownType == MIRType_Double &&
+        knownType == MIRType::Double &&
         objTypes &&
         objTypes->convertDoubleElements(constraints()) == TemporaryTypeSet::AlwaysConvertToDoubles;
     if (loadDouble)
         elements = addConvertElementsToDoubles(elements);
 
     MInstruction* load;
 
     if (!readOutOfBounds) {
@@ -9748,49 +9748,49 @@ IonBuilder::jsop_getelem_dense(MDefiniti
         // check is part of the opcode.
         load = MLoadElementHole::New(alloc(), elements, index, initLength,
                                      unboxedType, needsHoleCheck);
         current->add(load);
 
         // If maybeUndefined was true, the typeset must have undefined, and
         // then either additional types or a barrier. This means we should
         // never have a typed version of LoadElementHole.
-        MOZ_ASSERT(knownType == MIRType_Value);
-    }
-
-    if (knownType != MIRType_Value) {
+        MOZ_ASSERT(knownType == MIRType::Value);
+    }
+
+    if (knownType != MIRType::Value) {
         load->setResultType(knownType);
         load->setResultTypeSet(types);
     }
 
     current->push(load);
     return pushTypeBarrier(load, types, barrier);
 }
 
 MInstruction*
 IonBuilder::addArrayBufferByteLength(MDefinition* obj)
 {
     MLoadFixedSlot* ins = MLoadFixedSlot::New(alloc(), obj, ArrayBufferObject::BYTE_LENGTH_SLOT);
     current->add(ins);
-    ins->setResultType(MIRType_Int32);
+    ins->setResultType(MIRType::Int32);
     return ins;
 }
 
 void
 IonBuilder::addTypedArrayLengthAndData(MDefinition* obj,
                                        BoundsChecking checking,
                                        MDefinition** index,
                                        MInstruction** length, MInstruction** elements)
 {
     MOZ_ASSERT((index != nullptr) == (elements != nullptr));
 
     JSObject* tarr = nullptr;
 
     if (MConstant* objConst = obj->maybeConstantValue()) {
-        if (objConst->type() == MIRType_Object)
+        if (objConst->type() == MIRType::Object)
             tarr = &objConst->toObject();
     } else if (TemporaryTypeSet* types = obj->resultTypeSet()) {
         tarr = types->maybeSingleton();
     }
 
     if (tarr) {
         SharedMem<void*> data = tarr->as<TypedArrayObject>().viewDataEither();
         // Bug 979449 - Optimistically embed the elements and use TI to
@@ -9842,29 +9842,29 @@ IonBuilder::convertShiftToMaskForStaticT
 
     // No shifting is necessary if the typed array has single byte elements.
     if (TypedArrayShift(viewType) == 0)
         return id;
 
     // If the index is an already shifted constant, undo the shift to get the
     // absolute offset being accessed.
     if (MConstant* idConst = id->maybeConstantValue()) {
-        if (idConst->type() == MIRType_Int32) {
+        if (idConst->type() == MIRType::Int32) {
             int32_t index = idConst->toInt32();
             MConstant* offset = MConstant::New(alloc(), Int32Value(index << TypedArrayShift(viewType)));
             current->add(offset);
             return offset;
         }
     }
 
     if (!id->isRsh() || id->isEffectful())
         return nullptr;
 
     MConstant* shiftAmount = id->toRsh()->rhs()->maybeConstantValue();
-    if (!shiftAmount || shiftAmount->type() != MIRType_Int32)
+    if (!shiftAmount || shiftAmount->type() != MIRType::Int32)
         return nullptr;
     if (uint32_t(shiftAmount->toInt32()) != TypedArrayShift(viewType))
         return nullptr;
 
     // Instead of shifting, mask off the low bits of the index so that
     // a non-scaled access on the typed array can be performed.
     MConstant* mask = MConstant::New(alloc(), Int32Value(~((1 << shiftAmount->toInt32()) - 1)));
     MBitAnd* ptr = MBitAnd::New(alloc(), id->getOperand(0), mask);
@@ -9883,23 +9883,23 @@ MIRTypeForTypedArrayRead(Scalar::Type ar
 {
     switch (arrayType) {
       case Scalar::Int8:
       case Scalar::Uint8:
       case Scalar::Uint8Clamped:
       case Scalar::Int16:
       case Scalar::Uint16:
       case Scalar::Int32:
-        return MIRType_Int32;
+        return MIRType::Int32;
       case Scalar::Uint32:
-        return observedDouble ? MIRType_Double : MIRType_Int32;
+        return observedDouble ? MIRType::Double : MIRType::Int32;
       case Scalar::Float32:
-        return MIRType_Float32;
+        return MIRType::Float32;
       case Scalar::Float64:
-        return MIRType_Double;
+        return MIRType::Double;
       default:
         break;
     }
     MOZ_CRASH("Unknown typed array type");
 }
 
 bool
 IonBuilder::jsop_getelem_typed(MDefinition* obj, MDefinition* index,
@@ -10022,17 +10022,17 @@ IonBuilder::jsop_setelem()
             return emitted;
 
         trackOptimizationAttempt(TrackedStrategy::SetElem_Arguments);
         if (!setElemTryArguments(&emitted, object, index, value) || emitted)
             return emitted;
     }
 
     if (script()->argumentsHasVarBinding() &&
-        object->mightBeType(MIRType_MagicOptimizedArguments) &&
+        object->mightBeType(MIRType::MagicOptimizedArguments) &&
         info().analysisMode() != Analysis_ArgumentsUsage)
     {
         return abort("Type is not definitely lazy arguments.");
     }
 
     trackOptimizationAttempt(TrackedStrategy::SetElem_InlineCache);
     if (!setElemTryCache(&emitted, object, index, value) || emitted)
         return emitted;
@@ -10067,17 +10067,17 @@ IonBuilder::setElemTryTypedObject(bool* 
         return true;
 
     int32_t elemSize;
     if (!elemPrediction.hasKnownSize(&elemSize))
         return true;
 
     switch (elemPrediction.kind()) {
       case type::Simd:
-        // FIXME (bug 894105): store a MIRType_float32x4 etc
+        // FIXME (bug 894105): store a MIRType::float32x4 etc
         trackOptimizationOutcome(TrackedOutcome::GenericFailure);
         return true;
 
       case type::Reference:
         return setElemTryReferenceElemOfTypedObject(emitted, obj, index,
                                                     objPrediction, value, elemPrediction);
 
       case type::Scalar:
@@ -10247,17 +10247,17 @@ IonBuilder::setElemTryDense(bool* emitte
         return true;
     }
 
     TemporaryTypeSet::DoubleConversion conversion =
         object->resultTypeSet()->convertDoubleElements(constraints());
 
     // If AmbiguousDoubleConversion, only handle int32 values for now.
     if (conversion == TemporaryTypeSet::AmbiguousDoubleConversion &&
-        value->type() != MIRType_Int32)
+        value->type() != MIRType::Int32)
     {
         trackOptimizationOutcome(TrackedOutcome::ArrayDoubleConversion);
         return true;
     }
 
     // Don't generate a fast path if there have been bounds check failures
     // and this access might be on a sparse property.
     if (ElementAccessHasExtraIndexedProperty(this, object) && failedBoundsCheck_) {
@@ -10275,44 +10275,44 @@ IonBuilder::setElemTryDense(bool* emitte
 }
 
 bool
 IonBuilder::setElemTryArguments(bool* emitted, MDefinition* object,
                                 MDefinition* index, MDefinition* value)
 {
     MOZ_ASSERT(*emitted == false);
 
-    if (object->type() != MIRType_MagicOptimizedArguments)
+    if (object->type() != MIRType::MagicOptimizedArguments)
         return true;
 
     // Arguments are not supported yet.
     return abort("NYI arguments[]=");
 }
 
 bool
 IonBuilder::setElemTryCache(bool* emitted, MDefinition* object,
                             MDefinition* index, MDefinition* value)
 {
     MOZ_ASSERT(*emitted == false);
 
-    if (!object->mightBeType(MIRType_Object)) {
+    if (!object->mightBeType(MIRType::Object)) {
         trackOptimizationOutcome(TrackedOutcome::NotObject);
         return true;
     }
 
-    if (!index->mightBeType(MIRType_Int32) &&
-        !index->mightBeType(MIRType_String) &&
-        !index->mightBeType(MIRType_Symbol))
+    if (!index->mightBeType(MIRType::Int32) &&
+        !index->mightBeType(MIRType::String) &&
+        !index->mightBeType(MIRType::Symbol))
     {
         trackOptimizationOutcome(TrackedOutcome::IndexType);
         return true;
     }
 
     bool barrier = true;
-    bool indexIsInt32 = index->type() == MIRType_Int32;
+    bool indexIsInt32 = index->type() == MIRType::Int32;
 
     if (indexIsInt32 &&
         !PropertyWriteNeedsTypeBarrier(alloc(), constraints(), current,
                                        &object, nullptr, &value, /* canModify = */ true))
     {
         barrier = false;
     }
 
@@ -10349,17 +10349,17 @@ IonBuilder::setElemTryCache(bool* emitte
     return true;
 }
 
 bool
 IonBuilder::jsop_setelem_dense(TemporaryTypeSet::DoubleConversion conversion,
                                MDefinition* obj, MDefinition* id, MDefinition* value,
                                JSValueType unboxedType, bool writeHole)
 {
-    MIRType elementType = MIRType_None;
+    MIRType elementType = MIRType::None;
     if (unboxedType == JSVAL_TYPE_MAGIC)
         elementType = DenseNativeElementType(constraints(), obj);
     bool packed = ElementAccessIsPacked(constraints(), obj);
 
     // Writes which are on holes in the object do not have to bail out if they
     // cannot hit another indexed property on the object or its prototypes.
     bool writeOutOfBounds = !ElementAccessHasExtraIndexedProperty(this, obj);
 
@@ -10385,17 +10385,17 @@ IonBuilder::jsop_setelem_dense(Temporary
       case TemporaryTypeSet::MaybeConvertToDoubles: {
         MInstruction* valueDouble = MToDouble::New(alloc(), value);
         current->add(valueDouble);
         newValue = valueDouble;
         break;
       }
 
       case TemporaryTypeSet::AmbiguousDoubleConversion: {
-        MOZ_ASSERT(value->type() == MIRType_Int32);
+        MOZ_ASSERT(value->type() == MIRType::Int32);
         MInstruction* maybeDouble = MMaybeToDoubleElement::New(alloc(), elements, value);
         current->add(maybeDouble);
         newValue = maybeDouble;
         break;
       }
 
       case TemporaryTypeSet::DontConvertToDoubles:
         break;
@@ -10438,17 +10438,17 @@ IonBuilder::jsop_setelem_dense(Temporary
     if (!resumeAfter(store))
         return false;
 
     if (common) {
         // Determine whether a write barrier is required.
         if (obj->resultTypeSet()->propertyNeedsBarrier(constraints(), JSID_VOID))
             common->setNeedsBarrier();
 
-        if (elementType != MIRType_None && packed)
+        if (elementType != MIRType::None && packed)
             common->setElementType(elementType);
     }
 
     return true;
 }
 
 
 bool
@@ -10506,35 +10506,35 @@ IonBuilder::jsop_length()
     return jsop_getprop(name);
 }
 
 bool
 IonBuilder::jsop_length_fastPath()
 {
     TemporaryTypeSet* types = bytecodeTypes(pc);
 
-    if (types->getKnownMIRType() != MIRType_Int32)
+    if (types->getKnownMIRType() != MIRType::Int32)
         return false;
 
     MDefinition* obj = current->peek(-1);
 
     if (shouldAbortOnPreliminaryGroups(obj))
         return false;
 
-    if (obj->mightBeType(MIRType_String)) {
-        if (obj->mightBeType(MIRType_Object))
+    if (obj->mightBeType(MIRType::String)) {
+        if (obj->mightBeType(MIRType::Object))
             return false;
         current->pop();
         MStringLength* ins = MStringLength::New(alloc(), obj);
         current->add(ins);
         current->push(ins);
         return true;
     }
 
-    if (obj->mightBeType(MIRType_Object)) {
+    if (obj->mightBeType(MIRType::Object)) {
         TemporaryTypeSet* objTypes = obj->resultTypeSet();
 
         // Compute the length for array objects.
         if (objTypes &&
             objTypes->getKnownClass(constraints()) == &ArrayObject::class_ &&
             !objTypes->hasObjectFlags(constraints(), OBJECT_FLAG_LENGTH_OVERFLOW))
         {
             current->pop();
@@ -10708,26 +10708,26 @@ IonBuilder::jsop_rest()
     return true;
 }
 
 bool
 IonBuilder::jsop_checkobjcoercible()
 {
     MDefinition* toCheck = current->peek(-1);
 
-    if (!toCheck->mightBeType(MIRType_Undefined) &&
-        !toCheck->mightBeType(MIRType_Null))
+    if (!toCheck->mightBeType(MIRType::Undefined) &&
+        !toCheck->mightBeType(MIRType::Null))
     {
         toCheck->setImplicitlyUsedUnchecked();
         return true;
     }
 
-    MOZ_ASSERT(toCheck->type() == MIRType_Value ||
-               toCheck->type() == MIRType_Null  ||
-               toCheck->type() == MIRType_Undefined);
+    MOZ_ASSERT(toCheck->type() == MIRType::Value ||
+               toCheck->type() == MIRType::Null  ||
+               toCheck->type() == MIRType::Undefined);
 
     // If we want to squeeze more perf here, we can throw without checking,
     // if IsNullOrUndefined(toCheck->type()). Since this is a failure case,
     // it should be OK.
     MCheckObjCoercible* check = MCheckObjCoercible::New(alloc(), current->pop());
     current->add(check);
     current->push(check);
     return resumeAfter(check);
@@ -11162,17 +11162,17 @@ IonBuilder::loadSlot(MDefinition* obj, S
                      BarrierKind barrier, TemporaryTypeSet* types)
 {
     return loadSlot(obj, shape->slot(), shape->numFixedSlots(), rvalType, barrier, types);
 }
 
 bool
 IonBuilder::storeSlot(MDefinition* obj, size_t slot, size_t nfixed,
                       MDefinition* value, bool needsBarrier,
-                      MIRType slotType /* = MIRType_None */)
+                      MIRType slotType /* = MIRType::None */)
 {
     if (slot < nfixed) {
         MStoreFixedSlot* store = MStoreFixedSlot::New(alloc(), obj, slot, value);
         current->add(store);
         current->push(value);
         if (needsBarrier)
             store->setNeedsBarrier();
         return resumeAfter(store);
@@ -11181,24 +11181,24 @@ IonBuilder::storeSlot(MDefinition* obj, 
     MSlots* slots = MSlots::New(alloc(), obj);
     current->add(slots);
 
     MStoreSlot* store = MStoreSlot::New(alloc(), slots, slot - nfixed, value);
     current->add(store);
     current->push(value);
     if (needsBarrier)
         store->setNeedsBarrier();
-    if (slotType != MIRType_None)
+    if (slotType != MIRType::None)
         store->setSlotType(slotType);
     return resumeAfter(store);
 }
 
 bool
 IonBuilder::storeSlot(MDefinition* obj, Shape* shape, MDefinition* value, bool needsBarrier,
-                      MIRType slotType /* = MIRType_None */)
+                      MIRType slotType /* = MIRType::None */)
 {
     MOZ_ASSERT(shape->writable());
     return storeSlot(obj, shape->slot(), shape->numFixedSlots(), value, needsBarrier, slotType);
 }
 
 bool
 IonBuilder::shouldAbortOnPreliminaryGroups(MDefinition *obj)
 {
@@ -11228,21 +11228,21 @@ IonBuilder::shouldAbortOnPreliminaryGrou
     }
 
     return preliminary;
 }
 
 MDefinition*
 IonBuilder::maybeUnboxForPropertyAccess(MDefinition* def)
 {
-    if (def->type() != MIRType_Value)
+    if (def->type() != MIRType::Value)
         return def;
 
     MIRType type = inspector->expectedPropertyAccessInputType(pc);
-    if (type == MIRType_Value || !def->mightBeType(type))
+    if (type == MIRType::Value || !def->mightBeType(type))
         return def;
 
     MUnbox* unbox = MUnbox::New(alloc(), def, type, MUnbox::Fallible);
     current->add(unbox);
 
     // Fixup type information for a common case where a property call
     // is converted to the following bytecodes
     //
@@ -11287,17 +11287,17 @@ IonBuilder::jsop_getprop(PropertyName* n
 
         // Try to optimize arguments.callee.
         trackOptimizationAttempt(TrackedStrategy::GetProp_ArgumentsCallee);
         if (!getPropTryArgumentsCallee(&emitted, obj, name) || emitted)
             return emitted;
     }
 
     obj = maybeUnboxForPropertyAccess(obj);
-    if (obj->type() == MIRType_Object)
+    if (obj->type() == MIRType::Object)
         obj = convertUnboxedObjects(obj);
 
     BarrierKind barrier = PropertyReadNeedsTypeBarrier(analysisContext, constraints(),
                                                        obj, name, types);
 
     // Try to optimize to a specific constant.
     trackOptimizationAttempt(TrackedStrategy::GetProp_InferredConstant);
     if (barrier == BarrierKind::NoBarrier) {
@@ -11425,18 +11425,18 @@ IonBuilder::improveThisTypesForCall()
     // If obj is null or undefined, obj.prop would have thrown an exception so
     // at this point we can remove null and undefined from obj's TypeSet, to
     // improve type information for the call that will follow.
 
     MOZ_ASSERT(*pc == JSOP_CALLPROP || *pc == JSOP_CALLELEM);
 
     // Ensure |this| has types {object, null/undefined}.
     MDefinition* thisDef = current->peek(-2);
-    if (thisDef->type() != MIRType_Value ||
-        !thisDef->mightBeType(MIRType_Object) ||
+    if (thisDef->type() != MIRType::Value ||
+        !thisDef->mightBeType(MIRType::Object) ||
         !thisDef->resultTypeSet() ||
         !thisDef->resultTypeSet()->objectOrSentinel())
     {
         return true;
     }
 
     // Remove null/undefined from the TypeSet.
     TemporaryTypeSet* types = thisDef->resultTypeSet()->cloneObjectsOnly(alloc_->lifoAlloc());
@@ -11452,19 +11452,19 @@ IonBuilder::improveThisTypesForCall()
     // operation.
     filter->setDependency(current->peek(-1)->toInstruction());
     return true;
 }
 
 bool
 IonBuilder::checkIsDefinitelyOptimizedArguments(MDefinition* obj, bool* isOptimizedArgs)
 {
-    if (obj->type() != MIRType_MagicOptimizedArguments) {
+    if (obj->type() != MIRType::MagicOptimizedArguments) {
         if (script()->argumentsHasVarBinding() &&
-            obj->mightBeType(MIRType_MagicOptimizedArguments))
+            obj->mightBeType(MIRType::MagicOptimizedArguments))
         {
             return abort("Type is not definitely lazy arguments.");
         }
 
         *isOptimizedArgs = false;
         return true;
     }
 
@@ -11568,17 +11568,17 @@ IonBuilder::getPropTryArgumentsCallee(bo
     return true;
 }
 
 bool
 IonBuilder::getPropTryConstant(bool* emitted, MDefinition* obj, jsid id, TemporaryTypeSet* types)
 {
     MOZ_ASSERT(*emitted == false);
 
-    if (!types->mightBeMIRType(MIRType_Object)) {
+    if (!types->mightBeMIRType(MIRType::Object)) {
         // If we have not observed an object result here, don't look for a
         // singleton constant.
         trackOptimizationOutcome(TrackedOutcome::NotObject);
         return true;
     }
 
     JSObject* singleton = testSingletonPropertyTypes(obj, id);
     if (!singleton) {
@@ -11596,17 +11596,17 @@ IonBuilder::getPropTryConstant(bool* emi
     return true;
 }
 
 bool
 IonBuilder::getPropTryNotDefined(bool* emitted, MDefinition* obj, jsid id, TemporaryTypeSet* types)
 {
     MOZ_ASSERT(*emitted == false);
 
-    if (!types->mightBeMIRType(MIRType_Undefined)) {
+    if (!types->mightBeMIRType(MIRType::Undefined)) {
         // Only optimize if we expect this property access to return undefined.
         trackOptimizationOutcome(TrackedOutcome::NotUndefined);
         return true;
     }
 
     if (!testNotDefinedProperty(obj, id)) {
         trackOptimizationOutcome(TrackedOutcome::GenericFailure);
         return true;
@@ -11628,17 +11628,17 @@ IonBuilder::getPropTryTypedObject(bool* 
     TypedObjectPrediction fieldPrediction;
     size_t fieldOffset;
     size_t fieldIndex;
     if (!typedObjectHasField(obj, name, &fieldOffset, &fieldPrediction, &fieldIndex))
         return true;
 
     switch (fieldPrediction.kind()) {
       case type::Simd:
-        // FIXME (bug 894104): load into a MIRType_float32x4 etc
+        // FIXME (bug 894104): load into a MIRType::float32x4 etc
         return true;
 
       case type::Struct:
       case type::Array:
         return getPropTryComplexPropOfTypedObject(emitted,
                                                   obj,
                                                   fieldOffset,
                                                   fieldPrediction,
@@ -11781,17 +11781,17 @@ IonBuilder::getPropTryDefiniteSlot(bool*
 {
     MOZ_ASSERT(*emitted == false);
 
     uint32_t nfixed;
     uint32_t slot = getDefiniteSlot(obj->resultTypeSet(), name, &nfixed);
     if (slot == UINT32_MAX)
         return true;
 
-    if (obj->type() != MIRType_Object) {
+    if (obj->type() != MIRType::Object) {
         MGuardObject* guard = MGuardObject::New(alloc(), obj);
         current->add(guard);
         obj = guard;
     }
 
     MInstruction* load;
     if (slot < nfixed) {
         load = MLoadFixedSlot::New(alloc(), obj, slot);
@@ -11879,30 +11879,30 @@ IonBuilder::loadUnboxedValue(MDefinition
                              MDefinition* index, JSValueType unboxedType,
                              BarrierKind barrier, TemporaryTypeSet* types)
 {
     MInstruction* load;
     switch (unboxedType) {
       case JSVAL_TYPE_BOOLEAN:
         load = MLoadUnboxedScalar::New(alloc(), elements, index, Scalar::Uint8,
                                        DoesNotRequireMemoryBarrier, elementsOffset);
-        load->setResultType(MIRType_Boolean);
+        load->setResultType(MIRType::Boolean);
         break;
 
       case JSVAL_TYPE_INT32:
         load = MLoadUnboxedScalar::New(alloc(), elements, index, Scalar::Int32,
                                        DoesNotRequireMemoryBarrier, elementsOffset);
-        load->setResultType(MIRType_Int32);
+        load->setResultType(MIRType::Int32);
         break;
 
       case JSVAL_TYPE_DOUBLE:
         load = MLoadUnboxedScalar::New(alloc(), elements, index, Scalar::Float64,
                                        DoesNotRequireMemoryBarrier, elementsOffset,
                                        /* canonicalizeDoubles = */ false);
-        load->setResultType(MIRType_Double);
+        load->setResultType(MIRType::Double);
         break;
 
       case JSVAL_TYPE_STRING:
         load = MLoadUnboxedString::New(alloc(), elements, index, elementsOffset);
         break;
 
       case JSVAL_TYPE_OBJECT: {
         MLoadUnboxedObjectOrNull::NullBehavior nullBehavior;
@@ -11929,17 +11929,17 @@ IonBuilder::getPropTryUnboxed(bool* emit
 {
     MOZ_ASSERT(*emitted == false);
 
     JSValueType unboxedType;
     uint32_t offset = getUnboxedOffset(obj->resultTypeSet(), name, &unboxedType);
     if (offset == UINT32_MAX)
         return true;
 
-    if (obj->type() != MIRType_Object) {
+    if (obj->type() != MIRType::Object) {
         MGuardObject* guard = MGuardObject::New(alloc(), obj);
         current->add(guard);
         obj = guard;
     }
 
     MInstruction* load = loadUnboxedProperty(obj, offset, unboxedType, barrier, types);
     current->push(load);
 
@@ -12045,17 +12045,17 @@ IonBuilder::getPropTryCommonGetter(bool*
             return false;
 
         trackOptimizationOutcome(TrackedOutcome::DOM);
         *emitted = true;
         return true;
     }
 
     // Don't call the getter with a primitive value.
-    if (obj->type() != MIRType_Object) {
+    if (obj->type() != MIRType::Object) {
         MGuardObject* guardObj = MGuardObject::New(alloc(), obj);
         current->add(guardObj);
         obj = guardObj;
     }
 
     // Spoof stack to expected state for call.
 
     // Make sure there's enough room
@@ -12172,17 +12172,17 @@ IonBuilder::getPropTryInlineAccess(bool*
 
     if (!canInlinePropertyOpShapes(receivers))
         return true;
 
     obj = convertUnboxedObjects(obj, convertUnboxedGroups);
 
     MIRType rvalType = types->getKnownMIRType();
     if (barrier != BarrierKind::NoBarrier || IsNullOrUndefined(rvalType))
-        rvalType = MIRType_Value;
+        rvalType = MIRType::Value;
 
     if (receivers.length() == 1) {
         if (!receivers[0].group) {
             // Monomorphic load from a native object.
             spew("Inlining monomorphic native GETPROP");
 
             obj = addShapeGuard(obj, receivers[0].shape, Bailout_ShapeGuard);
 
@@ -12284,17 +12284,17 @@ IonBuilder::getPropTryInlineAccess(bool*
 bool
 IonBuilder::getPropTryCache(bool* emitted, MDefinition* obj, PropertyName* name,
                             BarrierKind barrier, TemporaryTypeSet* types)
 {
     MOZ_ASSERT(*emitted == false);
 
     // The input value must either be an object, or we should have strong suspicions
     // that it can be safely unboxed to an object.
-    if (obj->type() != MIRType_Object) {
+    if (obj->type() != MIRType::Object) {
         TemporaryTypeSet* types = obj->resultTypeSet();
         if (!types || !types->objectOrSentinel()) {
             trackOptimizationOutcome(TrackedOutcome::NoTypeInfo);
             return true;
         }
     }
 
     // Since getters have no guaranteed return values, we must barrier in order to be
@@ -12313,17 +12313,17 @@ IonBuilder::getPropTryCache(bool* emitte
         }
     }
 
     MConstant* id = constant(StringValue(name));
     MGetPropertyCache* load = MGetPropertyCache::New(alloc(), obj, id,
                                                      barrier == BarrierKind::TypeSet);
 
     // Try to mark the cache as idempotent.
-    if (obj->type() == MIRType_Object && !invalidatedIdempotentCache()) {
+    if (obj->type() == MIRType::Object && !invalidatedIdempotentCache()) {
         if (PropertyReadIsIdempotent(constraints(), obj, name))
             load->setIdempotent();
     }
 
     // When we are in the context of making a call from the value returned from
     // a property, we query the typeObject for the given property name to fill
     // the InlinePropertyTable of the GetPropertyCache.  This information is
     // then used in inlineCallsite and inlineCalls, if the "this" definition is
@@ -12344,17 +12344,17 @@ IonBuilder::getPropTryCache(bool* emitte
     current->add(load);
     current->push(load);
 
     if (load->isEffectful() && !resumeAfter(load))
         return false;
 
     MIRType rvalType = types->getKnownMIRType();
     if (barrier != BarrierKind::NoBarrier || IsNullOrUndefined(rvalType))
-        rvalType = MIRType_Value;
+        rvalType = MIRType::Value;
     load->setResultType(rvalType);
 
     if (!pushTypeBarrier(load, types, barrier))
         return false;
 
     trackOptimizationSuccess();
     *emitted = true;
     return true;
@@ -12394,17 +12394,17 @@ MDefinition*
 IonBuilder::tryInnerizeWindow(MDefinition* obj)
 {
     // Try to optimize accesses on outer window proxies (window.foo, for
     // example) to go directly to the inner window, the global.
     //
     // Callers should be careful not to pass the inner object to getters or
     // setters that require outerization.
 
-    if (obj->type() != MIRType_Object)
+    if (obj->type() != MIRType::Object)
         return obj;
 
     TemporaryTypeSet* types = obj->resultTypeSet();
     if (!types)
         return obj;
 
     JSObject* singleton = types->maybeSingleton();
     if (!singleton)
@@ -12583,17 +12583,17 @@ IonBuilder::setPropTryCommonSetter(bool*
         return false;
 
     if (*emitted) {
         trackOptimizationOutcome(TrackedOutcome::DOM);
         return true;
     }
 
     // Don't call the setter with a primitive value.
-    if (obj->type() != MIRType_Object) {
+    if (obj->type() != MIRType::Object) {
         MGuardObject* guardObj = MGuardObject::New(alloc(), obj);
         current->add(guardObj);
         obj = guardObj;
     }
 
     // Dummy up the stack, as in getprop. We are pushing an extra value, so
     // ensure there is enough space.
     if (!current->ensureHasSlots(3))
@@ -12681,17 +12681,17 @@ IonBuilder::setPropTryTypedObject(bool* 
     TypedObjectPrediction fieldPrediction;
     size_t fieldOffset;
     size_t fieldIndex;
     if (!typedObjectHasField(obj, name, &fieldOffset, &fieldPrediction, &fieldIndex))
         return true;
 
     switch (fieldPrediction.kind()) {
       case type::Simd:
-        // FIXME (bug 894104): store into a MIRType_float32x4 etc
+        // FIXME (bug 894104): store into a MIRType::float32x4 etc
         return true;
 
       case type::Reference:
         return setPropTryReferencePropOfTypedObject(emitted, obj, fieldOffset,
                                                     value, fieldPrediction, name);
 
       case type::Scalar:
         return setPropTryScalarPropOfTypedObject(emitted, obj, fieldOffset,
@@ -12856,20 +12856,20 @@ IonBuilder::storeUnboxedValue(MDefinitio
         break;
 
       case JSVAL_TYPE_STRING:
         store = MStoreUnboxedString::New(alloc(), elements, scaledOffset, value,
                                          elementsOffset, preBarrier);
         break;
 
       case JSVAL_TYPE_OBJECT:
-        MOZ_ASSERT(value->type() == MIRType_Object ||
-                   value->type() == MIRType_Null ||
-                   value->type() == MIRType_Value);
-        MOZ_ASSERT(!value->mightBeType(MIRType_Undefined),
+        MOZ_ASSERT(value->type() == MIRType::Object ||
+                   value->type() == MIRType::Null ||
+                   value->type() == MIRType::Value);
+        MOZ_ASSERT(!value->mightBeType(MIRType::Undefined),
                    "MToObjectOrNull slow path is invalid for unboxed objects");
         store = MStoreUnboxedObjectOrNull::New(alloc(), elements, scaledOffset, value, obj,
                                                elementsOffset, preBarrier);
         break;
 
       default:
         MOZ_CRASH();
     }
@@ -12890,17 +12890,17 @@ IonBuilder::setPropTryUnboxed(bool* emit
         return true;
     }
 
     JSValueType unboxedType;
     uint32_t offset = getUnboxedOffset(obj->resultTypeSet(), name, &unboxedType);
     if (offset == UINT32_MAX)
         return true;
 
-    if (obj->type() != MIRType_Object) {
+    if (obj->type() != MIRType::Object) {
         MGuardObject* guard = MGuardObject::New(alloc(), obj);
         current->add(guard);
         obj = guard;
     }
 
     MInstruction* store = storeUnboxedProperty(obj, offset, unboxedType, value);
 
     current->push(value);
@@ -13223,20 +13223,20 @@ IonBuilder::jsop_setarg(uint32_t arg)
                     if (def == val)
                         continue;
                     otherUses = true;
                 }
                 if (!otherUses) {
                     MOZ_ASSERT(op->resultTypeSet() == &argTypes[arg]);
                     argTypes[arg].addType(TypeSet::UnknownType(), alloc_->lifoAlloc());
                     if (val->isMul()) {
-                        val->setResultType(MIRType_Double);
-                        val->toMul()->setSpecialization(MIRType_Double);
+                        val->setResultType(MIRType::Double);
+                        val->toMul()->setSpecialization(MIRType::Double);
                     } else {
-                        MOZ_ASSERT(val->type() == MIRType_Int32);
+                        MOZ_ASSERT(val->type() == MIRType::Int32);
                     }
                     val->setResultTypeSet(nullptr);
                 }
             }
         }
     }
 
     current->setArg(arg);
@@ -13344,17 +13344,17 @@ IonBuilder::jsop_functionthis()
     MOZ_ASSERT(!info().funMaybeLazy()->isArrow());
 
     if (script()->strict() || info().funMaybeLazy()->isSelfHostedBuiltin()) {
         // No need to wrap primitive |this| in strict mode or self-hosted code.
         current->pushSlot(info().thisSlot());
         return true;
     }
 
-    if (thisTypes && (thisTypes->getKnownMIRType() == MIRType_Object ||
+    if (thisTypes && (thisTypes->getKnownMIRType() == MIRType::Object ||
         (thisTypes->empty() && baselineFrame_ && baselineFrame_->thisType.isSomeObject())))
     {
         // This is safe, because if the entry type of |this| is an object, it
         // will necessarily be an object throughout the entire function. OSR
         // can introduce a phi, but this phi will be specialized.
         current->pushSlot(info().thisSlot());
         return true;
     }
@@ -13365,17 +13365,17 @@ IonBuilder::jsop_functionthis()
     if (info().isAnalysis()) {
         current->pushSlot(info().thisSlot());
         return true;
     }
 
     // Hard case: |this| may be a primitive we have to wrap.
     MDefinition* def = current->getSlot(info().thisSlot());
 
-    if (def->type() == MIRType_Object) {
+    if (def->type() == MIRType::Object) {
         current->push(def);
         return true;
     }
 
     if (IsNullOrUndefined(def->type()))
         return pushConstant(GetThisValue(&script()->global()));
 
     MComputeThis* thisObj = MComputeThis::New(alloc(), def);
@@ -13412,17 +13412,17 @@ IonBuilder::jsop_typeof()
 
     return true;
 }
 
 bool
 IonBuilder::jsop_toid()
 {
     // No-op if the index is an integer.
-    if (current->peek(-1)->type() == MIRType_Int32)
+    if (current->peek(-1)->type() == MIRType::Int32)
         return true;
 
     MDefinition* index = current->pop();
     MToId* ins = MToId::New(alloc(), index);
 
     current->add(ins);
     current->push(ins);
 
@@ -13770,17 +13770,17 @@ IonBuilder::hasOnProtoChain(TypeSet::Obj
     MOZ_CRASH("Unreachable");
 }
 
 bool
 IonBuilder::tryFoldInstanceOf(MDefinition* lhs, JSObject* protoObject)
 {
     // Try to fold the js::IsDelegate part of the instanceof operation.
 
-    if (!lhs->mightBeType(MIRType_Object)) {
+    if (!lhs->mightBeType(MIRType::Object)) {
         // If the lhs is a primitive, the result is false.
         lhs->setImplicitlyUsedUnchecked();
         pushConstant(BooleanValue(false));
         return true;
     }
 
     TemporaryTypeSet* lhsTypes = lhs->resultTypeSet();
     if (!lhsTypes || lhsTypes->unknownObject())
@@ -13805,17 +13805,17 @@ IonBuilder::tryFoldInstanceOf(MDefinitio
             isFirst = false;
         } else if (knownIsInstance != isInstance) {
             // Some of the objects have protoObject on their proto chain and
             // others don't, so we can't optimize this.
             return false;
         }
     }
 
-    if (knownIsInstance && lhsTypes->getKnownMIRType() != MIRType_Object) {
+    if (knownIsInstance && lhsTypes->getKnownMIRType() != MIRType::Object) {
         // The result is true for all objects, but the lhs might be a primitive.
         // We can't fold this completely but we can use a much faster IsObject
         // test.
         MIsObject* isObject = MIsObject::New(alloc(), lhs);
         current->add(isObject);
         current->push(isObject);
         return true;
     }
@@ -14048,17 +14048,17 @@ IonBuilder::typedObjectPrediction(MDefin
     TemporaryTypeSet* types = typedObj->resultTypeSet();
     return typedObjectPrediction(types);
 }
 
 TypedObjectPrediction
 IonBuilder::typedObjectPrediction(TemporaryTypeSet* types)
 {
     // Type set must be known to be an object.
-    if (!types || types->getKnownMIRType() != MIRType_Object)
+    if (!types || types->getKnownMIRType() != MIRType::Object)
         return TypedObjectPrediction();
 
     // And only known objects.
     if (types->unknownObject())
         return TypedObjectPrediction();
 
     TypedObjectPrediction out;
     for (uint32_t i = 0; i < types->getObjectCount(); i++) {
@@ -14098,17 +14098,17 @@ IonBuilder::loadTypedObjectType(MDefinit
 // objects have been created, the return values will remove
 // intermediate layers (often rendering those derived type objects
 // into dead code).
 void
 IonBuilder::loadTypedObjectData(MDefinition* typedObj,
                                 MDefinition** owner,
                                 LinearSum* ownerOffset)
 {
-    MOZ_ASSERT(typedObj->type() == MIRType_Object);
+    MOZ_ASSERT(typedObj->type() == MIRType::Object);
 
     // Shortcircuit derived type objects, meaning the intermediate
     // objects created to represent `a.b` in an expression like
     // `a.b.c`. In that case, the owned and a base offset can be
     // pulled from the operands of the instruction and combined with
     // `offset`.
     if (typedObj->isNewDerivedTypedObject()) {
         MNewDerivedTypedObject* ins = typedObj->toNewDerivedTypedObject();
@@ -14171,17 +14171,17 @@ IonBuilder::loadTypedObjectElements(MDef
     // 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);
+                                            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.
@@ -14216,45 +14216,45 @@ IonBuilder::typedObjectHasField(MDefinit
 }
 
 MDefinition*
 IonBuilder::typeObjectForElementFromArrayStructType(MDefinition* typeObj)
 {
     MInstruction* elemType = MLoadFixedSlot::New(alloc(), typeObj, JS_DESCR_SLOT_ARRAY_ELEM_TYPE);
     current->add(elemType);
 
-    MInstruction* unboxElemType = MUnbox::New(alloc(), elemType, MIRType_Object, MUnbox::Infallible);
+    MInstruction* unboxElemType = MUnbox::New(alloc(), elemType, MIRType::Object, MUnbox::Infallible);
     current->add(unboxElemType);
 
     return unboxElemType;
 }
 
 MDefinition*
 IonBuilder::typeObjectForFieldFromStructType(MDefinition* typeObj,
                                              size_t fieldIndex)
 {
     // Load list of field type objects.
 
     MInstruction* fieldTypes = MLoadFixedSlot::New(alloc(), typeObj, JS_DESCR_SLOT_STRUCT_FIELD_TYPES);
     current->add(fieldTypes);
 
-    MInstruction* unboxFieldTypes = MUnbox::New(alloc(), fieldTypes, MIRType_Object, MUnbox::Infallible);
+    MInstruction* unboxFieldTypes = MUnbox::New(alloc(), fieldTypes, MIRType::Object, MUnbox::Infallible);
     current->add(unboxFieldTypes);
 
     // Index into list with index of field.
 
     MInstruction* fieldTypesElements = MElements::New(alloc(), unboxFieldTypes);
     current->add(fieldTypesElements);
 
     MConstant* fieldIndexDef = constantInt(fieldIndex);
 
     MInstruction* fieldType = MLoadElement::New(alloc(), fieldTypesElements, fieldIndexDef, false, false);
     current->add(fieldType);
 
-    MInstruction* unboxFieldType = MUnbox::New(alloc(), fieldType, MIRType_Object, MUnbox::Infallible);
+    MInstruction* unboxFieldType = MUnbox::New(alloc(), fieldType, MIRType::Object, MUnbox::Infallible);
     current->add(unboxFieldType);
 
     return unboxFieldType;
 }
 
 bool
 IonBuilder::storeScalarTypedObjectValue(MDefinition* typedObj,
                                         const LinearSum& byteOffset,
@@ -14292,17 +14292,17 @@ IonBuilder::storeReferenceTypedObjectVal
                                            PropertyName* name)
 {
     // Make sure we aren't adding new type information for writes of object and value
     // references.
     if (type != ReferenceTypeDescr::TYPE_STRING) {
         MOZ_ASSERT(type == ReferenceTypeDescr::TYPE_ANY ||
                    type == ReferenceTypeDescr::TYPE_OBJECT);
         MIRType implicitType =
-            (type == ReferenceTypeDescr::TYPE_ANY) ? MIRType_Undefined : MIRType_Null;
+            (type == ReferenceTypeDescr::TYPE_ANY) ? MIRType::Undefined : MIRType::Null;
 
         if (PropertyWriteNeedsTypeBarrier(alloc(), constraints(), current, &typedObj, name, &value,
                                           /* canModify = */ true, implicitType))
         {
             trackOptimizationOutcome(TrackedOutcome::NeedsTypeBarrier);
             return false;
         }
     }
@@ -14427,28 +14427,28 @@ IonBuilder::addLexicalCheck(MDefinition*
 {
     MOZ_ASSERT(JSOp(*pc) == JSOP_CHECKLEXICAL ||
                JSOp(*pc) == JSOP_CHECKALIASEDLEXICAL ||
                JSOp(*pc) == JSOP_GETIMPORT);
 
     MInstruction* lexicalCheck;
 
     // If we're guaranteed to not be JS_UNINITIALIZED_LEXICAL, no need to check.
-    if (input->type() == MIRType_MagicUninitializedLexical) {
+    if (input->type() == MIRType::MagicUninitializedLexical) {
         // Mark the input as implicitly used so the JS_UNINITIALIZED_LEXICAL
         // magic value will be preserved on bailout.
         input->setImplicitlyUsedUnchecked();
         lexicalCheck = MThrowRuntimeLexicalError::New(alloc(), JSMSG_UNINITIALIZED_LEXICAL);
         current->add(lexicalCheck);
         if (!resumeAfter(lexicalCheck))
             return nullptr;
         return constant(UndefinedValue());
     }
 
-    if (input->type() == MIRType_Value) {
+    if (input->type() == MIRType::Value) {
         lexicalCheck = MLexicalCheck::New(alloc(), input);
         current->add(lexicalCheck);
         if (failedLexicalCheck_)
             lexicalCheck->setNotMovableUnchecked();
         return lexicalCheck;
     }
 
     return input;
--- a/js/src/jit/IonBuilder.h
+++ b/js/src/jit/IonBuilder.h
@@ -411,19 +411,19 @@ class IonBuilder
 
     bool hasStaticScopeObject(ScopeCoordinate sc, JSObject** pcall);
     bool loadSlot(MDefinition* obj, size_t slot, size_t nfixed, MIRType rvalType,
                   BarrierKind barrier, TemporaryTypeSet* types);
     bool loadSlot(MDefinition* obj, Shape* shape, MIRType rvalType,
                   BarrierKind barrier, TemporaryTypeSet* types);
     bool storeSlot(MDefinition* obj, size_t slot, size_t nfixed,
                    MDefinition* value, bool needsBarrier,
-                   MIRType slotType = MIRType_None);
+                   MIRType slotType = MIRType::None);
     bool storeSlot(MDefinition* obj, Shape* shape, MDefinition* value, bool needsBarrier,
-                   MIRType slotType = MIRType_None);
+                   MIRType slotType = MIRType::None);
     bool shouldAbortOnPreliminaryGroups(MDefinition *obj);
 
     MDefinition* tryInnerizeWindow(MDefinition* obj);
     MDefinition* maybeUnboxForPropertyAccess(MDefinition* def);
 
     // jsop_getprop() helpers.
     bool checkIsDefinitelyOptimizedArguments(MDefinition* obj, bool* isOptimizedArgs);
     bool getPropTryInferredConstant(bool* emitted, MDefinition* obj, PropertyName* name,
--- a/js/src/jit/IonCaches.cpp
+++ b/js/src/jit/IonCaches.cpp
@@ -777,17 +777,17 @@ GenerateReadSlot(JSContext* cx, IonScrip
     Register scratchReg = Register::FromCode(0); // Quell compiler warning.
 
     if (obj != holder ||
         obj->is<UnboxedPlainObject>() ||
         !holder->as<NativeObject>().isFixedSlot(shape->slot()))
     {
         if (output.hasValue()) {
             scratchReg = output.valueReg().scratchReg();
-        } else if (output.type() == MIRType_Double) {
+        } else if (output.type() == MIRType::Double) {
             scratchReg = object;
             masm.push(scratchReg);
             restoreScratch = true;
         } else {
             scratchReg = output.typedReg().gpr();
         }
     }
 
@@ -928,17 +928,17 @@ EmitGetterCall(JSContext* cx, MacroAssem
 
         // Native functions have the signature:
         //  bool (*)(JSContext*, unsigned, Value* vp)
         // Where vp[0] is space for an outparam, vp[1] is |this|, and vp[2] onward
         // are the function arguments.
 
         // Construct vp array:
         // Push object value for |this|
-        masm.Push(TypedOrValueRegister(MIRType_Object, AnyRegister(object)));
+        masm.Push(TypedOrValueRegister(MIRType::Object, AnyRegister(object)));
         // Push callee/outparam.
         masm.Push(ObjectValue(*target));
 
         // Preload arguments into registers.
         masm.loadJSContext(argJSContextReg);
         masm.move32(Imm32(0), argUintNReg);
         masm.moveStackPtrTo(argVpReg);
 
@@ -1044,17 +1044,17 @@ EmitGetterCall(JSContext* cx, MacroAssem
         uint32_t argSize = (target->nargs() + 1) * sizeof(Value);
         uint32_t padding = ComputeByteAlignment(masm.framePushed() + argSize, JitStackAlignment);
         MOZ_ASSERT(padding % sizeof(uintptr_t) == 0);
         MOZ_ASSERT(padding < JitStackAlignment);
         masm.reserveStack(padding);
 
         for (size_t i = 0; i < target->nargs(); i++)
             masm.Push(UndefinedValue());
-        masm.Push(TypedOrValueRegister(MIRType_Object, AnyRegister(object)));
+        masm.Push(TypedOrValueRegister(MIRType::Object, AnyRegister(object)));
 
         masm.movePtr(ImmGCPtr(target), scratchReg);
 
         descriptor = MakeFrameDescriptor(argSize + padding, JitFrame_IonAccessorIC,
                                          JitFrameLayout::Size());
         masm.Push(Imm32(0)); // argc
         masm.Push(scratchReg);
         masm.Push(Imm32(descriptor));
@@ -1155,17 +1155,17 @@ GenerateArrayLength(JSContext* cx, Macro
         return false;
     masm.branchTestObjShape(Assembler::NotEqual, object, shape, failures);
 
     // Load length.
     Register outReg;
     if (output.hasValue()) {
         outReg = output.valueReg().scratchReg();
     } else {
-        MOZ_ASSERT(output.type() == MIRType_Int32);
+        MOZ_ASSERT(output.type() == MIRType::Int32);
         outReg = output.typedReg().gpr();
     }
 
     masm.loadPtr(Address(object, NativeObject::offsetOfElements()), outReg);
     masm.load32(Address(outReg, ObjectElements::offsetOfLength()), outReg);
 
     // The length is an unsigned int, but the value encodes a signed int.
     MOZ_ASSERT(object != outReg);
@@ -1188,17 +1188,17 @@ static void
 GenerateUnboxedArrayLength(JSContext* cx, MacroAssembler& masm, IonCache::StubAttacher& attacher,
                            JSObject* array, Register object, TypedOrValueRegister output,
                            Label* failures)
 {
     Register outReg;
     if (output.hasValue()) {
         outReg = output.valueReg().scratchReg();
     } else {
-        MOZ_ASSERT(output.type() == MIRType_Int32);
+        MOZ_ASSERT(output.type() == MIRType::Int32);
         outReg = output.typedReg().gpr();
     }
     MOZ_ASSERT(object != outReg);
 
     TestMatchingReceiver(masm, attacher, object, array, failures);
 
     // Load length.
     masm.load32(Address(object, UnboxedArrayObject::offsetOfLength()), outReg);
@@ -1223,17 +1223,17 @@ GenerateUnboxedArrayLength(JSContext* cx
 static void
 GenerateTypedArrayLength(JSContext* cx, MacroAssembler& masm, IonCache::StubAttacher& attacher,
                          Register object, TypedOrValueRegister output, Label* failures)
 {
     Register tmpReg;
     if (output.hasValue()) {
         tmpReg = output.valueReg().scratchReg();
     } else {
-        MOZ_ASSERT(output.type() == MIRType_Int32);
+        MOZ_ASSERT(output.type() == MIRType::Int32);
         tmpReg = output.typedReg().gpr();
     }
     MOZ_ASSERT(object != tmpReg);
 
     // Implement the negated version of JSObject::isTypedArray predicate.
     masm.loadObjClass(object, tmpReg);
     masm.branchPtr(Assembler::Below, tmpReg, ImmPtr(&TypedArrayObject::classes[0]),
                    failures);
@@ -1253,17 +1253,17 @@ GenerateTypedArrayLength(JSContext* cx, 
 }
 
 static bool
 IsCacheableArrayLength(JSContext* cx, HandleObject obj, TypedOrValueRegister output)
 {
     if (!obj->is<ArrayObject>())
         return false;
 
-    if (output.type() != MIRType_Value && output.type() != MIRType_Int32) {
+    if (output.type() != MIRType::Value && output.type() != MIRType::Int32) {
         // The stub assumes that we always output Int32, so make sure our output
         // is equipped to handle that.
         return false;
     }
 
     // The emitted stub can only handle int32 lengths. If the length of the
     // actual object does not fit in an int32 then don't attach a stub, as if
     // the cache is idempotent we won't end up invalidating the compiled script
@@ -1360,22 +1360,22 @@ EqualStringsHelper(JSString* str1, JSStr
 }
 
 static void
 EmitIdGuard(MacroAssembler& masm, jsid id, TypedOrValueRegister idReg, Register objReg,
             Register scratchReg, Label* failures)
 {
     MOZ_ASSERT(JSID_IS_STRING(id) || JSID_IS_SYMBOL(id));
 
-    MOZ_ASSERT(idReg.type() == MIRType_String ||
-               idReg.type() == MIRType_Symbol ||
-               idReg.type() == MIRType_Value);
+    MOZ_ASSERT(idReg.type() == MIRType::String ||
+               idReg.type() == MIRType::Symbol ||
+               idReg.type() == MIRType::Value);
 
     Register payloadReg;
-    if (idReg.type() == MIRType_Value) {
+    if (idReg.type() == MIRType::Value) {
         ValueOperand val = idReg.valueReg();
         if (JSID_IS_SYMBOL(id)) {
             masm.branchTestSymbol(Assembler::NotEqual, val, failures);
         } else {
             MOZ_ASSERT(JSID_IS_STRING(id));
             masm.branchTestString(Assembler::NotEqual, val, failures);
         }
         masm.unboxNonDouble(val, scratchReg);
@@ -1635,17 +1635,17 @@ GetPropertyIC::tryAttachTypedArrayLength
         return true;
 
     if (!JSID_IS_ATOM(id, cx->names().length))
         return true;
 
     if (hasTypedArrayLengthStub(obj))
         return true;
 
-    if (output().type() != MIRType_Value && output().type() != MIRType_Int32) {
+    if (output().type() != MIRType::Value && output().type() != MIRType::Int32) {
         // The next execution should cause an invalidation because the type
         // does not fit.
         return true;
     }
 
     if (idempotent())
         return true;
 
@@ -1988,17 +1988,17 @@ GetPropertyIC::tryAttachArgumentsLength(
     MOZ_ASSERT(!*emitted);
 
     if (!JSID_IS_ATOM(id, cx->names().length))
         return true;
     if (!IsOptimizableArgumentsObjectForLength(obj))
         return true;
 
     MIRType outputType = output().type();
-    if (!(outputType == MIRType_Value || outputType == MIRType_Int32))
+    if (!(outputType == MIRType::Value || outputType == MIRType::Int32))
         return true;
 
     if (hasArgumentsLengthStub(obj->is<MappedArgumentsObject>()))
         return true;
 
     *emitted = true;
 
     MOZ_ASSERT(!idempotent());
@@ -2008,17 +2008,17 @@ GetPropertyIC::tryAttachArgumentsLength(
     StubAttacher attacher(*this);
 
     emitIdGuard(masm, id, &failures);
 
     Register tmpReg;
     if (output().hasValue()) {
         tmpReg = output().valueReg().scratchReg();
     } else {
-        MOZ_ASSERT(output().type() == MIRType_Int32);
+        MOZ_ASSERT(output().type() == MIRType::Int32);
         tmpReg = output().typedReg().gpr();
     }
     MOZ_ASSERT(object() != tmpReg);
 
     masm.branchTestObjClass(Assembler::NotEqual, object(), tmpReg, obj->getClass(), &failures);
 
     // Get initial ArgsObj length value, test if length has been overridden.
     masm.unboxInt32(Address(object(), ArgumentsObject::getInitialLengthSlotOffset()), tmpReg);
@@ -2071,17 +2071,17 @@ GenerateReadModuleNamespace(JSContext* c
 
     // If we need a scratch register, use either an output register or the
     // object register.
     bool restoreScratch = false;
     Register scratchReg = InvalidReg; // Quell compiler warning.
 
     if (output.hasValue()) {
         scratchReg = output.valueReg().scratchReg();
-    } else if (output.type() == MIRType_Double) {
+    } else if (output.type() == MIRType::Double) {
         masm.push(object);
         scratchReg = object;
         restoreScratch = true;
     } else {
         scratchReg = output.typedReg().gpr();
     }
 
     // Slot access.
@@ -2385,26 +2385,26 @@ GenerateSetSlot(JSContext* cx, MacroAsse
         masm.loadPtr(Address(object, UnboxedPlainObject::offsetOfExpando()), tempReg);
         object = tempReg;
     }
 
     if (obj->as<NativeObject>().isFixedSlot(shape->slot())) {
         Address addr(object, NativeObject::getFixedSlotOffset(shape->slot()));
 
         if (cx->zone()->needsIncrementalBarrier())
-            masm.callPreBarrier(addr, MIRType_Value);
+            masm.callPreBarrier(addr, MIRType::Value);
 
         masm.storeConstantOrRegister(value, addr);
     } else {
         masm.loadPtr(Address(object, NativeObject::offsetOfSlots()), tempReg);
 
         Address addr(tempReg, obj->as<NativeObject>().dynamicSlotIndex(shape->slot()) * sizeof(Value));
 
         if (cx->zone()->needsIncrementalBarrier())
-            masm.callPreBarrier(addr, MIRType_Value);
+            masm.callPreBarrier(addr, MIRType::Value);
 
         masm.storeConstantOrRegister(value, addr);
     }
 
     attacher.jumpRejoin(masm);
 
     masm.bind(failures);
     attacher.jumpNextStub(masm);
@@ -2739,17 +2739,17 @@ GenerateCallSetter(JSContext* cx, IonScr
         // Set up the call:
         //  bool (*)(JSContext*, unsigned, Value* vp)
         // vp[0] is callee/outparam
         // vp[1] is |this|
         // vp[2] is the value
 
         // Build vp and move the base into argVpReg.
         masm.Push(value);
-        masm.Push(TypedOrValueRegister(MIRType_Object, AnyRegister(object)));
+        masm.Push(TypedOrValueRegister(MIRType::Object, AnyRegister(object)));
         masm.Push(ObjectValue(*target));
         masm.moveStackPtrTo(argVpReg);
 
         // Preload other regs
         masm.loadJSContext(argJSContextReg);
         masm.move32(Imm32(1), argUintNReg);
 
         // Push data for GC marking
@@ -2867,17 +2867,17 @@ GenerateCallSetter(JSContext* cx, IonScr
         uint32_t padding = ComputeByteAlignment(masm.framePushed() + argSize, JitStackAlignment);
         MOZ_ASSERT(padding % sizeof(uintptr_t) == 0);
         MOZ_ASSERT(padding < JitStackAlignment);
         masm.reserveStack(padding);
 
         for (size_t i = 1; i < target->nargs(); i++)
             masm.Push(UndefinedValue());
         masm.Push(value);
-        masm.Push(TypedOrValueRegister(MIRType_Object, AnyRegister(object)));
+        masm.Push(TypedOrValueRegister(MIRType::Object, AnyRegister(object)));
 
         masm.movePtr(ImmGCPtr(target), tempReg);
 
         descriptor = MakeFrameDescriptor(argSize + padding, JitFrame_IonAccessorIC,
                                          JitFrameLayout::Size());
         masm.Push(Imm32(1)); // argc
         masm.Push(tempReg);
         masm.Push(Imm32(descriptor));
@@ -3100,17 +3100,17 @@ GenerateAddSlot(JSContext* cx, MacroAsse
         popObject = true;
         obj = obj->as<UnboxedPlainObject>().maybeExpando();
         masm.loadPtr(Address(object, UnboxedPlainObject::offsetOfExpando()), object);
     }
 
     // Write the object or expando object's new shape.
     Address shapeAddr(object, JSObject::offsetOfShape());
     if (cx->zone()->needsIncrementalBarrier())
-        masm.callPreBarrier(shapeAddr, MIRType_Shape);
+        masm.callPreBarrier(shapeAddr, MIRType::Shape);
     masm.storePtr(ImmGCPtr(newShape), shapeAddr);
 
     if (oldGroup != obj->group()) {
         MOZ_ASSERT(!obj->is<UnboxedPlainObject>());
 
         // Changing object's group from a partially to fully initialized group,
         // per the acquired properties analysis. Only change the group if the
         // old group still has a newScript.
@@ -3119,17 +3119,17 @@ GenerateAddSlot(JSContext* cx, MacroAsse
         masm.loadPtr(Address(object, JSObject::offsetOfGroup()), tempReg);
         masm.branchPtr(Assembler::Equal,
                        Address(tempReg, ObjectGroup::offsetOfAddendum()),
                        ImmWord(0),
                        &noTypeChange);
 
         Address groupAddr(object, JSObject::offsetOfGroup());
         if (cx->zone()->needsIncrementalBarrier())
-            masm.callPreBarrier(groupAddr, MIRType_ObjectGroup);
+            masm.callPreBarrier(groupAddr, MIRType::ObjectGroup);
         masm.storePtr(ImmGCPtr(obj->group()), groupAddr);
 
         masm.bind(&noTypeChange);
     }
 
     // Set the value on the object. Since this is an add, obj->lastProperty()
     // must be the shape of the property we are adding.
     NativeObject::slotsSizeMustNotOverflow();
@@ -3193,17 +3193,17 @@ CanInlineSetPropTypeCheck(JSObject* obj,
                     return false;
                 shouldCheck = false;
             } else {
                 TypedOrValueRegister reg = val.reg();
                 // We can do the same trick as above for primitive types of specialized registers.
                 // TIs handling of objects is complicated enough to warrant a runtime
                 // check, as we can't statically handle the case where the typeset
                 // contains the specific object, but doesn't have ANYOBJECT set.
-                if (reg.hasTyped() && reg.type() != MIRType_Object) {
+                if (reg.hasTyped() && reg.type() != MIRType::Object) {
                     JSValueType valType = ValueTypeFromMIRType(reg.type());
                     if (!propTypes->hasType(TypeSet::PrimitiveType(valType)))
                         return false;
                     shouldCheck = false;
                 }
             }
         }
     }
@@ -3364,19 +3364,19 @@ GenerateSetUnboxed(JSContext* cx, MacroA
 
     if (checkTypeset)
         CheckTypeSetForWrite(masm, obj, id, tempReg, value, failures);
 
     Address address(object, UnboxedPlainObject::offsetOfData() + unboxedOffset);
 
     if (cx->zone()->needsIncrementalBarrier()) {
         if (unboxedType == JSVAL_TYPE_OBJECT)
-            masm.callPreBarrier(address, MIRType_Object);
+            masm.callPreBarrier(address, MIRType::Object);
         else if (unboxedType == JSVAL_TYPE_STRING)
-            masm.callPreBarrier(address, MIRType_String);
+            masm.callPreBarrier(address, MIRType::String);
         else
             MOZ_ASSERT(!UnboxedTypeNeedsPreBarrier(unboxedType));
     }
 
     masm.storeUnboxedProperty(address, unboxedType, value, failures);
 
     attacher.jumpRejoin(masm);
 
@@ -3921,17 +3921,17 @@ GenerateDenseElementHole(JSContext* cx, 
     Register indexReg;
     if (index.hasValue()) {
         // Unbox the index.
         ValueOperand val = index.valueReg();
         masm.branchTestInt32(Assembler::NotEqual, val, &failures);
         indexReg = scratchReg;
         masm.unboxInt32(val, indexReg);
     } else {
-        MOZ_ASSERT(index.type() == MIRType_Int32);
+        MOZ_ASSERT(index.type() == MIRType::Int32);
         indexReg = index.typedReg().gpr();
     }
 
     // Make sure index is nonnegative.
     masm.branch32(Assembler::LessThan, indexReg, Imm32(0), &failures);
 
     // Save the object register.
     Register elementsReg = object;
@@ -4193,17 +4193,17 @@ GetPropertyIC::tryAttachArgumentsElement
         return true;
 
     MOZ_ASSERT(obj->is<ArgumentsObject>());
 
     if (hasArgumentsElementStub(obj->is<MappedArgumentsObject>()))
         return true;
 
     TypedOrValueRegister index = id().reg();
-    if (index.type() != MIRType_Value && index.type() != MIRType_Int32)
+    if (index.type() != MIRType::Value && index.type() != MIRType::Int32)
         return true;
 
     MOZ_ASSERT(output().hasValue());
 
     *emitted = true;
 
     Label failures;
     MacroAssembler masm(cx, ion, outerScript, profilerLeavePc_);
@@ -4231,17 +4231,17 @@ GetPropertyIC::tryAttachArgumentsElement
     if (index.hasValue()) {
         ValueOperand val = index.valueReg();
         masm.branchTestInt32(Assembler::NotEqual, val, &failures);
         indexReg = val.scratchReg();
 
         masm.unboxInt32(val, indexReg);
         masm.branch32(Assembler::AboveOrEqual, indexReg, tmpReg, &failureRestoreIndex);
     } else {
-        MOZ_ASSERT(index.type() == MIRType_Int32);
+        MOZ_ASSERT(index.type() == MIRType::Int32);
         indexReg = index.typedReg().gpr();
         masm.branch32(Assembler::AboveOrEqual, indexReg, tmpReg, &failures);
     }
     // Save indexReg because it needs to be clobbered to check deleted bit.
     Label failurePopIndex;
     masm.push(indexReg);
 
     // Check if property was deleted on arguments object.
@@ -4366,17 +4366,17 @@ StoreDenseElement(MacroAssembler& masm, 
             masm.bind(&dontConvert);
         }
         masm.storeValue(v, target);
         masm.bind(&done);
         return;
     }
 
     TypedOrValueRegister reg = value.reg();
-    if (reg.hasTyped() && reg.type() != MIRType_Int32) {
+    if (reg.hasTyped() && reg.type() != MIRType::Int32) {
         masm.storeTypedOrValue(reg, target);
         return;
     }
 
     Label convert, storeValue, done;
     masm.branchTest32(Assembler::NonZero, elementsFlags,
                       Imm32(ObjectElements::CONVERT_DOUBLE_ELEMENTS),
                       &convert);
@@ -4385,17 +4385,17 @@ StoreDenseElement(MacroAssembler& masm, 
     masm.jump(&done);
 
     masm.bind(&convert);
     if (reg.hasValue()) {
         masm.branchTestInt32(Assembler::NotEqual, reg.valueReg(), &storeValue);
         masm.int32ValueToDouble(reg.valueReg(), ScratchDoubleReg);
         masm.storeDouble(ScratchDoubleReg, target);
     } else {
-        MOZ_ASSERT(reg.type() == MIRType_Int32);
+        MOZ_ASSERT(reg.type() == MIRType::Int32);
         masm.convertInt32ToDouble(reg.typedReg().gpr(), ScratchDoubleReg);
         masm.storeDouble(ScratchDoubleReg, target);
     }
 
     masm.bind(&done);
 }
 
 static bool
@@ -4481,17 +4481,17 @@ GenerateSetDenseElement(JSContext* cx, M
                 masm.add32(Imm32(-1), newLength);
                 masm.jump(&storeElement);
             }
             // else
             masm.bind(&inBounds);
         }
 
         if (cx->zone()->needsIncrementalBarrier())
-            masm.callPreBarrier(target, MIRType_Value);
+            masm.callPreBarrier(target, MIRType::Value);
 
         // Store the value.
         if (guardHoles)
             masm.branchTestMagic(Assembler::Equal, target, &failures);
         else
             masm.bind(&storeElement);
         StoreDenseElement(masm, value, elements, target);
     }
--- a/js/src/jit/IonTypes.h
+++ b/js/src/jit/IonTypes.h
@@ -383,281 +383,281 @@ class SimdConstant {
     static bool match(const SimdConstant& lhs, const SimdConstant& rhs) {
         return lhs == rhs;
     }
 };
 
 // The ordering of this enumeration is important: Anything < Value is a
 // specialized type. Furthermore, anything < String has trivial conversion to
 // a number.
-enum MIRType
+enum class MIRType
 {
-    MIRType_Undefined,
-    MIRType_Null,
-    MIRType_Boolean,
-    MIRType_Int32,
-    MIRType_Int64,
-    MIRType_Double,
-    MIRType_Float32,
+    Undefined,
+    Null,
+    Boolean,
+    Int32,
+    Int64,
+    Double,
+    Float32,
     // Types above have trivial conversion to a number.
-    MIRType_String,
-    MIRType_Symbol,
+    String,
+    Symbol,
     // Types above are primitive (including undefined and null).
-    MIRType_Object,
-    MIRType_MagicOptimizedArguments,   // JS_OPTIMIZED_ARGUMENTS magic value.
-    MIRType_MagicOptimizedOut,         // JS_OPTIMIZED_OUT magic value.
-    MIRType_MagicHole,                 // JS_ELEMENTS_HOLE magic value.
-    MIRType_MagicIsConstructing,       // JS_IS_CONSTRUCTING magic value.
-    MIRType_MagicUninitializedLexical, // JS_UNINITIALIZED_LEXICAL magic value.
+    Object,
+    MagicOptimizedArguments,   // JS_OPTIMIZED_ARGUMENTS magic value.
+    MagicOptimizedOut,         // JS_OPTIMIZED_OUT magic value.
+    MagicHole,                 // JS_ELEMENTS_HOLE magic value.
+    MagicIsConstructing,       // JS_IS_CONSTRUCTING magic value.
+    MagicUninitializedLexical, // JS_UNINITIALIZED_LEXICAL magic value.
     // Types above are specialized.
-    MIRType_Value,
-    MIRType_SinCosDouble,              // Optimizing a sin/cos to sincos.
-    MIRType_ObjectOrNull,
-    MIRType_None,                      // Invalid, used as a placeholder.
-    MIRType_Slots,                     // A slots vector
-    MIRType_Elements,                  // An elements vector
-    MIRType_Pointer,                   // An opaque pointer that receives no special treatment
-    MIRType_Shape,                     // A Shape pointer.
-    MIRType_ObjectGroup,               // An ObjectGroup pointer.
-    MIRType_Last = MIRType_ObjectGroup,
-    MIRType_Float32x4 = MIRType_Float32 | (2 << VECTOR_SCALE_SHIFT),
+    Value,
+    SinCosDouble,              // Optimizing a sin/cos to sincos.
+    ObjectOrNull,
+    None,                      // Invalid, used as a placeholder.
+    Slots,                     // A slots vector
+    Elements,                  // An elements vector
+    Pointer,                   // An opaque pointer that receives no special treatment
+    Shape,                     // A Shape pointer.
+    ObjectGroup,               // An ObjectGroup pointer.
+    Last = ObjectGroup,
+    Float32x4 = Float32 | (2 << VECTOR_SCALE_SHIFT),
     // Representing both SIMD.Int32x4 and SIMD.Uint32x4.
-    MIRType_Int32x4   = MIRType_Int32   | (2 << VECTOR_SCALE_SHIFT),
-    MIRType_Bool32x4  = MIRType_Boolean | (2 << VECTOR_SCALE_SHIFT),
-    MIRType_Doublex2  = MIRType_Double  | (1 << VECTOR_SCALE_SHIFT)
+    Int32x4   = Int32   | (2 << VECTOR_SCALE_SHIFT),
+    Bool32x4  = Boolean | (2 << VECTOR_SCALE_SHIFT),
+    Doublex2  = Double  | (1 << VECTOR_SCALE_SHIFT)
 };
 
 static inline MIRType
 MIRTypeFromValueType(JSValueType type)
 {
     // This function does not deal with magic types. Magic constants should be
     // filtered out in MIRTypeFromValue.
     switch (type) {
       case JSVAL_TYPE_DOUBLE:
-        return MIRType_Double;
+        return MIRType::Double;
       case JSVAL_TYPE_INT32:
-        return MIRType_Int32;
+        return MIRType::Int32;
       case JSVAL_TYPE_UNDEFINED:
-        return MIRType_Undefined;
+        return MIRType::Undefined;
       case JSVAL_TYPE_STRING:
-        return MIRType_String;
+        return MIRType::String;
       case JSVAL_TYPE_SYMBOL:
-        return MIRType_Symbol;
+        return MIRType::Symbol;
       case JSVAL_TYPE_BOOLEAN:
-        return MIRType_Boolean;
+        return MIRType::Boolean;
       case JSVAL_TYPE_NULL:
-        return MIRType_Null;
+        return MIRType::Null;
       case JSVAL_TYPE_OBJECT:
-        return MIRType_Object;
+        return MIRType::Object;
       case JSVAL_TYPE_UNKNOWN:
-        return MIRType_Value;
+        return MIRType::Value;
       default:
         MOZ_CRASH("unexpected jsval type");
     }
 }
 
 static inline JSValueType
 ValueTypeFromMIRType(MIRType type)
 {
   switch (type) {
-    case MIRType_Undefined:
+    case MIRType::Undefined:
       return JSVAL_TYPE_UNDEFINED;
-    case MIRType_Null:
+    case MIRType::Null:
       return JSVAL_TYPE_NULL;
-    case MIRType_Boolean:
+    case MIRType::Boolean:
       return JSVAL_TYPE_BOOLEAN;
-    case MIRType_Int32:
+    case MIRType::Int32:
       return JSVAL_TYPE_INT32;
-    case MIRType_Float32: // Fall through, there's no JSVAL for Float32
-    case MIRType_Double:
+    case MIRType::Float32: // Fall through, there's no JSVAL for Float32
+    case MIRType::Double:
       return JSVAL_TYPE_DOUBLE;
-    case MIRType_String:
+    case MIRType::String:
       return JSVAL_TYPE_STRING;
-    case MIRType_Symbol:
+    case MIRType::Symbol:
       return JSVAL_TYPE_SYMBOL;
-    case MIRType_MagicOptimizedArguments:
-    case MIRType_MagicOptimizedOut:
-    case MIRType_MagicHole:
-    case MIRType_MagicIsConstructing:
-    case MIRType_MagicUninitializedLexical:
+    case MIRType::MagicOptimizedArguments:
+    case MIRType::MagicOptimizedOut:
+    case MIRType::MagicHole:
+    case MIRType::MagicIsConstructing:
+    case MIRType::MagicUninitializedLexical:
       return JSVAL_TYPE_MAGIC;
     default:
-      MOZ_ASSERT(type == MIRType_Object);
+      MOZ_ASSERT(type == MIRType::Object);
       return JSVAL_TYPE_OBJECT;
   }
 }
 
 static inline JSValueTag
 MIRTypeToTag(MIRType type)
 {
     return JSVAL_TYPE_TO_TAG(ValueTypeFromMIRType(type));
 }
 
 static inline const char*
 StringFromMIRType(MIRType type)
 {
   switch (type) {
-    case MIRType_Undefined:
+    case MIRType::Undefined:
       return "Undefined";
-    case MIRType_Null:
+    case MIRType::Null:
       return "Null";
-    case MIRType_Boolean:
+    case MIRType::Boolean:
       return "Bool";
-    case MIRType_Int32:
+    case MIRType::Int32:
       return "Int32";
-    case MIRType_Int64:
+    case MIRType::Int64:
       return "Int64";
-    case MIRType_Double:
+    case MIRType::Double:
       return "Double";
-    case MIRType_Float32:
+    case MIRType::Float32:
       return "Float32";
-    case MIRType_String:
+    case MIRType::String:
       return "String";
-    case MIRType_Symbol:
+    case MIRType::Symbol:
       return "Symbol";
-    case MIRType_Object:
+    case MIRType::Object:
       return "Object";
-    case MIRType_MagicOptimizedArguments:
+    case MIRType::MagicOptimizedArguments:
       return "MagicOptimizedArguments";
-    case MIRType_MagicOptimizedOut:
+    case MIRType::MagicOptimizedOut:
       return "MagicOptimizedOut";
-    case MIRType_MagicHole:
+    case MIRType::MagicHole:
       return "MagicHole";
-    case MIRType_MagicIsConstructing:
+    case MIRType::MagicIsConstructing:
       return "MagicIsConstructing";
-    case MIRType_MagicUninitializedLexical:
+    case MIRType::MagicUninitializedLexical:
       return "MagicUninitializedLexical";
-    case MIRType_Value:
+    case MIRType::Value:
       return "Value";
-    case MIRType_SinCosDouble:
+    case MIRType::SinCosDouble:
       return "SinCosDouble";
-    case MIRType_ObjectOrNull:
+    case MIRType::ObjectOrNull:
       return "ObjectOrNull";
-    case MIRType_None:
+    case MIRType::None:
       return "None";
-    case MIRType_Slots:
+    case MIRType::Slots:
       return "Slots";
-    case MIRType_Elements:
+    case MIRType::Elements:
       return "Elements";
-    case MIRType_Pointer:
+    case MIRType::Pointer:
       return "Pointer";
-    case MIRType_Shape:
+    case MIRType::Shape:
       return "Shape";
-    case MIRType_ObjectGroup:
+    case MIRType::ObjectGroup:
       return "ObjectGroup";
-    case MIRType_Float32x4:
+    case MIRType::Float32x4:
       return "Float32x4";
-    case MIRType_Int32x4:
+    case MIRType::Int32x4:
       return "Int32x4";
-    case MIRType_Bool32x4:
+    case MIRType::Bool32x4:
       return "Bool32x4";
-    case MIRType_Doublex2:
+    case MIRType::Doublex2:
       return "Doublex2";
   }
   MOZ_CRASH("Unknown MIRType.");
 }
 
 static inline bool
 IsNumberType(MIRType type)
 {
-    return type == MIRType_Int32 ||
-           type == MIRType_Double ||
-           type == MIRType_Float32 ||
-           type == MIRType_Int64;
+    return type == MIRType::Int32 ||
+           type == MIRType::Double ||
+           type == MIRType::Float32 ||
+           type == MIRType::Int64;
 }
 
 static inline bool
 IsTypeRepresentableAsDouble(MIRType type)
 {
-    return type == MIRType_Int32 ||
-           type == MIRType_Double ||
-           type == MIRType_Float32;
+    return type == MIRType::Int32 ||
+           type == MIRType::Double ||
+           type == MIRType::Float32;
 }
 
 static inline bool
 IsFloatType(MIRType type)
 {
-    return type == MIRType_Int32 || type == MIRType_Float32;
+    return type == MIRType::Int32 || type == MIRType::Float32;
 }
 
 static inline bool
 IsFloatingPointType(MIRType type)
 {
-    return type == MIRType_Double || type == MIRType_Float32;
+    return type == MIRType::Double || type == MIRType::Float32;
 }
 
 static inline bool
 IsNullOrUndefined(MIRType type)
 {
-    return type == MIRType_Null || type == MIRType_Undefined;
+    return type == MIRType::Null || type == MIRType::Undefined;
 }
 
 static inline bool
 IsSimdType(MIRType type)
 {
-    return type == MIRType_Int32x4 || type == MIRType_Float32x4 || type == MIRType_Bool32x4;
+    return type == MIRType::Int32x4 || type == MIRType::Float32x4 || type == MIRType::Bool32x4;
 }
 
 static inline bool
 IsFloatingPointSimdType(MIRType type)
 {
-    return type == MIRType_Float32x4;
+    return type == MIRType::Float32x4;
 }
 
 static inline bool
 IsIntegerSimdType(MIRType type)
 {
-    return type == MIRType_Int32x4;
+    return type == MIRType::Int32x4;
 }
 
 static inline bool
 IsBooleanSimdType(MIRType type)
 {
-    return type == MIRType_Bool32x4;
+    return type == MIRType::Bool32x4;
 }
 
 static inline bool
 IsMagicType(MIRType type)
 {
-    return type == MIRType_MagicHole ||
-           type == MIRType_MagicOptimizedOut ||
-           type == MIRType_MagicIsConstructing ||
-           type == MIRType_MagicOptimizedArguments ||
-           type == MIRType_MagicUninitializedLexical;
+    return type == MIRType::MagicHole ||
+           type == MIRType::MagicOptimizedOut ||
+           type == MIRType::MagicIsConstructing ||
+           type == MIRType::MagicOptimizedArguments ||
+           type == MIRType::MagicUninitializedLexical;
 }
 
 // Returns the number of vector elements (hereby called "length") for a given
 // SIMD kind. It is the Y part of the name "Foo x Y".
 static inline unsigned
 SimdTypeToLength(MIRType type)
 {
     MOZ_ASSERT(IsSimdType(type));
-    return 1 << ((type >> VECTOR_SCALE_SHIFT) & VECTOR_SCALE_MASK);
+    return 1 << ((unsigned(type) >> VECTOR_SCALE_SHIFT) & VECTOR_SCALE_MASK);
 }
 
 static inline MIRType
 ScalarTypeToMIRType(Scalar::Type type)
 {
     switch (type) {
       case Scalar::Int8:
       case Scalar::Uint8:
       case Scalar::Int16:
       case Scalar::Uint16:
       case Scalar::Int32:
       case Scalar::Uint32:
       case Scalar::Uint8Clamped:
-        return MIRType_Int32;
+        return MIRType::Int32;
       case Scalar::Float32:
-        return MIRType_Float32;
+        return MIRType::Float32;
       case Scalar::Float64:
-        return MIRType_Double;
+        return MIRType::Double;
       case Scalar::Float32x4:
-        return MIRType_Float32x4;
+        return MIRType::Float32x4;
       case Scalar::Int32x4:
-        return MIRType_Int32x4;
+        return MIRType::Int32x4;
       case Scalar::MaxTypedArrayViewType:
         break;
     }
     MOZ_CRASH("unexpected SIMD kind");
 }
 
 static inline unsigned
 ScalarTypeToLength(Scalar::Type type)
@@ -683,32 +683,32 @@ ScalarTypeToLength(Scalar::Type type)
 }
 
 // Get the type of the individual lanes in a SIMD type.
 // For example, Int32x4 -> Int32, Float32x4 -> Float32 etc.
 static inline MIRType
 SimdTypeToLaneType(MIRType type)
 {
     MOZ_ASSERT(IsSimdType(type));
-    static_assert(MIRType_Last <= ELEMENT_TYPE_MASK,
+    static_assert(unsigned(MIRType::Last) <= ELEMENT_TYPE_MASK,
                   "ELEMENT_TYPE_MASK should be larger than the last MIRType");
-    return MIRType((type >> ELEMENT_TYPE_SHIFT) & ELEMENT_TYPE_MASK);
+    return MIRType((unsigned(type) >> ELEMENT_TYPE_SHIFT) & ELEMENT_TYPE_MASK);
 }
 
 // Get the type expected when inserting a lane into a SIMD type.
 // This is the argument type expected by the MSimdValue constructors as well as
 // MSimdSplat and MSimdInsertElement.
 static inline MIRType
 SimdTypeToLaneArgumentType(MIRType type)
 {
     MIRType laneType = SimdTypeToLaneType(type);
 
     // Boolean lanes should be pre-converted to an Int32 with the values 0 or -1.
     // All other lane types are inserted directly.
-    return laneType == MIRType_Boolean ? MIRType_Int32 : laneType;
+    return laneType == MIRType::Boolean ? MIRType::Int32 : laneType;
 }
 
 // Indicates a lane in a SIMD register: X for the first lane, Y for the second,
 // Z for the third (if any), W for the fourth (if any).
 enum SimdLane {
     LaneX = 0x0,
     LaneY = 0x1,
     LaneZ = 0x2,
--- a/js/src/jit/JSONSpewer.cpp
+++ b/js/src/jit/JSONSpewer.cpp
@@ -229,17 +229,17 @@ JSONSpewer::spewMDef(MDefinition* def)
             integerValue(def->dependency()->id());
         endList();
     }
 
     bool isTruncated = false;
     if (def->isAdd() || def->isSub() || def->isMod() || def->isMul() || def->isDiv())
         isTruncated = static_cast<MBinaryArithInstruction*>(def)->isTruncated();
 
-    if (def->type() != MIRType_None && def->range()) {
+    if (def->type() != MIRType::None && def->range()) {
         beginStringProperty("type");
         def->range()->dump(out_);
         out_.printf(" : %s%s", StringFromMIRType(def->type()), (isTruncated ? " (t)" : ""));
         endStringProperty();
     } else {
         stringProperty("type", "%s%s", StringFromMIRType(def->type()), (isTruncated ? " (t)" : ""));
     }
 
--- a/js/src/jit/JitCompartment.h
+++ b/js/src/jit/JitCompartment.h
@@ -313,21 +313,21 @@ class JitRuntime
     }
 
     EnterJitCode enterBaseline() const {
         return enterBaselineJIT_->as<EnterJitCode>();
     }
 
     JitCode* preBarrier(MIRType type) const {
         switch (type) {
-          case MIRType_Value: return valuePreBarrier_;
-          case MIRType_String: return stringPreBarrier_;
-          case MIRType_Object: return objectPreBarrier_;
-          case MIRType_Shape: return shapePreBarrier_;
-          case MIRType_ObjectGroup: return objectGroupPreBarrier_;
+          case MIRType::Value: return valuePreBarrier_;
+          case MIRType::String: return stringPreBarrier_;
+          case MIRType::Object: return objectPreBarrier_;
+          case MIRType::Shape: return shapePreBarrier_;
+          case MIRType::ObjectGroup: return objectGroupPreBarrier_;
           default: MOZ_CRASH();
         }
     }
 
     JitCode* mallocStub() const {
         return mallocStub_;
     }
 
--- a/js/src/jit/JitFrames.cpp
+++ b/js/src/jit/JitFrames.cpp
@@ -1677,17 +1677,17 @@ uintptr_t
 SnapshotIterator::fromStack(int32_t offset) const
 {
     return ReadFrameSlot(fp_, offset);
 }
 
 static Value
 FromObjectPayload(uintptr_t payload)
 {
-    // Note: Both MIRType_Object and MIRType_ObjectOrNull are encoded in
+    // Note: Both MIRType::Object and MIRType::ObjectOrNull are encoded in
     // snapshots using JSVAL_TYPE_OBJECT.
     return ObjectOrNullValue(reinterpret_cast<JSObject*>(payload));
 }
 
 static Value
 FromStringPayload(uintptr_t payload)
 {
     return StringValue(reinterpret_cast<JSString*>(payload));
--- a/js/src/jit/LIR.cpp
+++ b/js/src/jit/LIR.cpp
@@ -84,33 +84,33 @@ LBlock::LBlock(MBasicBlock* from)
 
 bool
 LBlock::init(TempAllocator& alloc)
 {
     // Count the number of LPhis we'll need.
     size_t numLPhis = 0;
     for (MPhiIterator i(block_->phisBegin()), e(block_->phisEnd()); i != e; ++i) {
         MPhi* phi = *i;
-        numLPhis += (phi->type() == MIRType_Value) ? BOX_PIECES : 1;
+        numLPhis += (phi->type() == MIRType::Value) ? BOX_PIECES : 1;
     }
 
     // Allocate space for the LPhis.
     if (!phis_.init(alloc, numLPhis))
         return false;
 
     // For each MIR phi, set up LIR phis as appropriate. We'll fill in their
     // operands on each incoming edge, and set their definitions at the start of
     // their defining block.
     size_t phiIndex = 0;
     size_t numPreds = block_->numPredecessors();
     for (MPhiIterator i(block_->phisBegin()), e(block_->phisEnd()); i != e; ++i) {
         MPhi* phi = *i;
         MOZ_ASSERT(phi->numOperands() == numPreds);
 
-        int numPhis = (phi->type() == MIRType_Value) ? BOX_PIECES : 1;
+        int numPhis = (phi->type() == MIRType::Value) ? BOX_PIECES : 1;
         for (int i = 0; i < numPhis; i++) {
             LAllocation* inputs = alloc.allocateArray<LAllocation>(numPreds);
             if (!inputs)
                 return false;
 
             void* addr = &phis_[phiIndex++];
             LPhi* lphi = new (addr) LPhi(phi, inputs);
             lphi->setBlock(this);
--- a/js/src/jit/LIR.h
+++ b/js/src/jit/LIR.h
@@ -583,49 +583,49 @@ class LDefinition
     }
     uint32_t getReusedInput() const {
         MOZ_ASSERT(policy() == LDefinition::MUST_REUSE_INPUT);
         return output_.toConstantIndex()->index();
     }
 
     static inline Type TypeFrom(MIRType type) {
         switch (type) {
-          case MIRType_Boolean:
-          case MIRType_Int32:
+          case MIRType::Boolean:
+          case MIRType::Int32:
             // The stack slot allocator doesn't currently support allocating
-            // 1-byte slots, so for now we lower MIRType_Boolean into INT32.
+            // 1-byte slots, so for now we lower MIRType::Boolean into INT32.
             static_assert(sizeof(bool) <= sizeof(int32_t), "bool doesn't fit in an int32 slot");
             return LDefinition::INT32;
-          case MIRType_String:
-          case MIRType_Symbol:
-          case MIRType_Object:
-          case MIRType_ObjectOrNull:
+          case MIRType::String:
+          case MIRType::Symbol:
+          case MIRType::Object:
+          case MIRType::ObjectOrNull:
             return LDefinition::OBJECT;
-          case MIRType_Double:
+          case MIRType::Double:
             return LDefinition::DOUBLE;
-          case MIRType_Float32:
+          case MIRType::Float32:
             return LDefinition::FLOAT32;
 #if defined(JS_PUNBOX64)
-          case MIRType_Value:
+          case MIRType::Value:
             return LDefinition::BOX;
 #endif
-          case MIRType_SinCosDouble:
+          case MIRType::SinCosDouble:
             return LDefinition::SINCOS;
-          case MIRType_Slots:
-          case MIRType_Elements:
+          case MIRType::Slots:
+          case MIRType::Elements:
             return LDefinition::SLOTS;
-          case MIRType_Pointer:
+          case MIRType::Pointer:
 #if JS_BITS_PER_WORD == 64
-          case MIRType_Int64:
+          case MIRType::Int64:
 #endif
             return LDefinition::GENERAL;
-          case MIRType_Bool32x4:
-          case MIRType_Int32x4:
+          case MIRType::Bool32x4:
+          case MIRType::Int32x4:
             return LDefinition::INT32X4;
-          case MIRType_Float32x4:
+          case MIRType::Float32x4:
             return LDefinition::FLOAT32X4;
           default:
             MOZ_CRASH("unexpected type");
         }
     }
 
     UniqueChars toString() const;
 
--- a/js/src/jit/Lowering.cpp
+++ b/js/src/jit/Lowering.cpp
@@ -38,18 +38,18 @@ LBoxAllocation
 LIRGenerator::useBoxAtStart(MDefinition* mir, LUse::Policy policy)
 {
     return useBox(mir, policy, /* useAtStart = */ true);
 }
 
 void
 LIRGenerator::visitCloneLiteral(MCloneLiteral* ins)
 {
-    MOZ_ASSERT(ins->type() == MIRType_Object);
-    MOZ_ASSERT(ins->input()->type() == MIRType_Object);
+    MOZ_ASSERT(ins->type() == MIRType::Object);
+    MOZ_ASSERT(ins->input()->type() == MIRType::Object);
 
     LCloneLiteral* lir = new(alloc()) LCloneLiteral(useRegisterAtStart(ins->input()));
     defineReturn(lir, ins);
     assignSafepoint(lir, ins);
 }
 
 void
 LIRGenerator::visitParameter(MParameter* param)
@@ -148,33 +148,33 @@ LIRGenerator::visitTableSwitch(MTableSwi
 
     // If there are no cases, the default case is always taken.
     if (tableswitch->numSuccessors() == 1) {
         add(new(alloc()) LGoto(tableswitch->getDefault()));
         return;
     }
 
     // If we don't know the type.
-    if (opd->type() == MIRType_Value) {
+    if (opd->type() == MIRType::Value) {
         LTableSwitchV* lir = newLTableSwitchV(tableswitch);
         add(lir);
         return;
     }
 
     // Case indices are numeric, so other types will always go to the default case.
-    if (opd->type() != MIRType_Int32 && opd->type() != MIRType_Double) {
+    if (opd->type() != MIRType::Int32 && opd->type() != MIRType::Double) {
         add(new(alloc()) LGoto(tableswitch->getDefault()));
         return;
     }
 
     // Return an LTableSwitch, capable of handling either an integer or
     // floating-point index.
     LAllocation index;
     LDefinition tempInt;
-    if (opd->type() == MIRType_Int32) {
+    if (opd->type() == MIRType::Int32) {
         index = useRegisterAtStart(opd);
         tempInt = tempCopy(opd, 0);
     } else {
         index = useRegister(opd);
         tempInt = temp(LDefinition::GENERAL);
     }
     add(newLTableSwitch(index, tempInt, tableswitch));
 }
@@ -226,17 +226,17 @@ LIRGenerator::visitNewArrayCopyOnWrite(M
     define(lir, ins);
     assignSafepoint(lir, ins);
 }
 
 void
 LIRGenerator::visitNewArrayDynamicLength(MNewArrayDynamicLength* ins)
 {
     MDefinition* length = ins->length();
-    MOZ_ASSERT(length->type() == MIRType_Int32);
+    MOZ_ASSERT(length->type() == MIRType::Int32);
 
     LNewArrayDynamicLength* lir = new(alloc()) LNewArrayDynamicLength(useRegister(length), temp());
     define(lir, ins);
     assignSafepoint(lir, ins);
 }
 
 void
 LIRGenerator::visitNewObject(MNewObject* ins)
@@ -296,17 +296,17 @@ LIRGenerator::visitNewDerivedTypedObject
                                             useRegisterAtStart(ins->offset()));
     defineReturn(lir, ins);
     assignSafepoint(lir, ins);
 }
 
 void
 LIRGenerator::visitNewStringObject(MNewStringObject* ins)
 {
-    MOZ_ASSERT(ins->input()->type() == MIRType_String);
+    MOZ_ASSERT(ins->input()->type() == MIRType::String);
 
     LNewStringObject* lir = new(alloc()) LNewStringObject(useRegister(ins->input()), temp());
     define(lir, ins);
     assignSafepoint(lir, ins);
 }
 
 void
 LIRGenerator::visitInitElem(MInitElem* ins)
@@ -418,32 +418,32 @@ LIRGenerator::visitReturnFromCtor(MRetur
     LReturnFromCtor* lir = new(alloc()) LReturnFromCtor(useBox(ins->getValue()),
                                                         useRegister(ins->getObject()));
     define(lir, ins);
 }
 
 void
 LIRGenerator::visitComputeThis(MComputeThis* ins)
 {
-    MOZ_ASSERT(ins->type() == MIRType_Value);
-    MOZ_ASSERT(ins->input()->type() == MIRType_Value);
+    MOZ_ASSERT(ins->type() == MIRType::Value);
+    MOZ_ASSERT(ins->input()->type() == MIRType::Value);
 
     // Don't use useBoxAtStart because ComputeThis has a safepoint and needs to
     // have its inputs in different registers than its return value so that
     // they aren't clobbered.
     LComputeThis* lir = new(alloc()) LComputeThis(useBox(ins->input()));
     defineBox(lir, ins);
     assignSafepoint(lir, ins);
 }
 
 void
 LIRGenerator::visitArrowNewTarget(MArrowNewTarget* ins)
 {
-    MOZ_ASSERT(ins->type() == MIRType_Value);
-    MOZ_ASSERT(ins->callee()->type() == MIRType_Object);
+    MOZ_ASSERT(ins->type() == MIRType::Value);
+    MOZ_ASSERT(ins->callee()->type() == MIRType::Object);
 
     LArrowNewTarget* lir = new(alloc()) LArrowNewTarget(useRegister(ins->callee()));
     defineBox(lir, ins);
 }
 
 void
 LIRGenerator::lowerCallArguments(MCall* call)
 {
@@ -462,34 +462,34 @@ LIRGenerator::lowerCallArguments(MCall* 
     if (baseSlot > maxargslots_)
         maxargslots_ = baseSlot;
 
     for (size_t i = 0; i < argc; i++) {
         MDefinition* arg = call->getArg(i);
         uint32_t argslot = baseSlot - i;
 
         // Values take a slow path.
-        if (arg->type() == MIRType_Value) {
+        if (arg->type() == MIRType::Value) {
             LStackArgV* stack = new(alloc()) LStackArgV(argslot, useBox(arg));
             add(stack);
         } else {
             // Known types can move constant types and/or payloads.
             LStackArgT* stack = new(alloc()) LStackArgT(argslot, arg->type(), useRegisterOrConstant(arg));
             add(stack);
         }
     }
 }
 
 void
 LIRGenerator::visitCall(MCall* call)
 {
     MOZ_ASSERT(CallTempReg0 != CallTempReg1);
     MOZ_ASSERT(CallTempReg0 != ArgumentsRectifierReg);
     MOZ_ASSERT(CallTempReg1 != ArgumentsRectifierReg);
-    MOZ_ASSERT(call->getFunction()->type() == MIRType_Object);
+    MOZ_ASSERT(call->getFunction()->type() == MIRType::Object);
 
     lowerCallArguments(call);
 
     // Height of the current argument vector.
     JSFunction* target = call->getSingleTarget();
 
     LInstruction* lir;
 
@@ -531,17 +531,17 @@ LIRGenerator::visitCall(MCall* call)
     }
     defineReturn(lir, call);
     assignSafepoint(lir, call);
 }
 
 void
 LIRGenerator::visitApplyArgs(MApplyArgs* apply)
 {
-    MOZ_ASSERT(apply->getFunction()->type() == MIRType_Object);
+    MOZ_ASSERT(apply->getFunction()->type() == MIRType::Object);
 
     // Assert if we cannot build a rectifier frame.
     MOZ_ASSERT(CallTempReg0 != ArgumentsRectifierReg);
     MOZ_ASSERT(CallTempReg1 != ArgumentsRectifierReg);
 
     // Assert if the return value is already erased.
     MOZ_ASSERT(CallTempReg2 != JSReturnReg_Type);
     MOZ_ASSERT(CallTempReg2 != JSReturnReg_Data);
@@ -559,17 +559,17 @@ LIRGenerator::visitApplyArgs(MApplyArgs*
 
     defineReturn(lir, apply);
     assignSafepoint(lir, apply);
 }
 
 void
 LIRGenerator::visitApplyArray(MApplyArray* apply)
 {
-    MOZ_ASSERT(apply->getFunction()->type() == MIRType_Object);
+    MOZ_ASSERT(apply->getFunction()->type() == MIRType::Object);
 
     // Assert if we cannot build a rectifier frame.
     MOZ_ASSERT(CallTempReg0 != ArgumentsRectifierReg);
     MOZ_ASSERT(CallTempReg1 != ArgumentsRectifierReg);
 
     // Assert if the return value is already erased.
     MOZ_ASSERT(CallTempReg2 != JSReturnReg_Type);
     MOZ_ASSERT(CallTempReg2 != JSReturnReg_Data);
@@ -615,19 +615,19 @@ LIRGenerator::visitEncodeSnapshot(MEncod
 }
 
 void
 LIRGenerator::visitAssertFloat32(MAssertFloat32* assertion)
 {
     MIRType type = assertion->input()->type();
     DebugOnly<bool> checkIsFloat32 = assertion->mustBeFloat32();
 
-    if (type != MIRType_Value && !JitOptions.eagerCompilation) {
-        MOZ_ASSERT_IF(checkIsFloat32, type == MIRType_Float32);
-        MOZ_ASSERT_IF(!checkIsFloat32, type != MIRType_Float32);
+    if (type != MIRType::Value && !JitOptions.eagerCompilation) {
+        MOZ_ASSERT_IF(checkIsFloat32, type == MIRType::Float32);
+        MOZ_ASSERT_IF(!checkIsFloat32, type != MIRType::Float32);
     }
 }
 
 void
 LIRGenerator::visitAssertRecoveredOnBailout(MAssertRecoveredOnBailout* assertion)
 {
     MOZ_CRASH("AssertRecoveredOnBailout nodes are always recovered on bailouts.");
 }
@@ -641,39 +641,39 @@ LIRGenerator::visitArraySplice(MArraySpl
     add(lir, ins);
     assignSafepoint(lir, ins);
 }
 
 void
 LIRGenerator::visitGetDynamicName(MGetDynamicName* ins)
 {
     MDefinition* scopeChain = ins->getScopeChain();
-    MOZ_ASSERT(scopeChain->type() == MIRType_Object);
+    MOZ_ASSERT(scopeChain->type() == MIRType::Object);
 
     MDefinition* name = ins->getName();
-    MOZ_ASSERT(name->type() == MIRType_String);
+    MOZ_ASSERT(name->type() == MIRType::String);
 
     LGetDynamicName* lir = new(alloc()) LGetDynamicName(useFixed(scopeChain, CallTempReg0),
                                                         useFixed(name, CallTempReg1),
                                                         tempFixed(CallTempReg2),
                                                         tempFixed(CallTempReg3),
                                                         tempFixed(CallTempReg4));
 
     assignSnapshot(lir, Bailout_DynamicNameNotFound);
     defineReturn(lir, ins);
 }
 
 void
 LIRGenerator::visitCallDirectEval(MCallDirectEval* ins)
 {
     MDefinition* scopeChain = ins->getScopeChain();
-    MOZ_ASSERT(scopeChain->type() == MIRType_Object);
+    MOZ_ASSERT(scopeChain->type() == MIRType::Object);
 
     MDefinition* string = ins->getString();
-    MOZ_ASSERT(string->type() == MIRType_String);
+    MOZ_ASSERT(string->type() == MIRType::String);
 
     MDefinition* newTargetValue = ins->getNewTargetValue();
 
     LInstruction* lir = new(alloc()) LCallDirectEval(useRegisterAtStart(scopeChain),
                                                      useRegisterAtStart(string),
                                                      useBoxAtStart(newTargetValue));
     defineReturn(lir, ins);
     assignSafepoint(lir, ins);
@@ -697,66 +697,66 @@ void
 LIRGenerator::visitTest(MTest* test)
 {
     MDefinition* opd = test->getOperand(0);
     MBasicBlock* ifTrue = test->ifTrue();
     MBasicBlock* ifFalse = test->ifFalse();
 
     // String is converted to length of string in the type analysis phase (see
     // TestPolicy).
-    MOZ_ASSERT(opd->type() != MIRType_String);
+    MOZ_ASSERT(opd->type() != MIRType::String);
 
     // Testing a constant.
     if (MConstant* constant = opd->maybeConstantValue()) {
         bool b;
         if (constant->valueToBoolean(&b)) {
             add(new(alloc()) LGoto(b ? ifTrue : ifFalse));
             return;
         }
     }
 
-    if (opd->type() == MIRType_Value) {
+    if (opd->type() == MIRType::Value) {
         LDefinition temp0, temp1;
         if (test->operandMightEmulateUndefined()) {
             temp0 = temp();
             temp1 = temp();
         } else {
             temp0 = LDefinition::BogusTemp();
             temp1 = LDefinition::BogusTemp();
         }
         LTestVAndBranch* lir =
             new(alloc()) LTestVAndBranch(ifTrue, ifFalse, useBox(opd), tempDouble(), temp0, temp1);
         add(lir, test);
         return;
     }
 
-    if (opd->type() == MIRType_ObjectOrNull) {
+    if (opd->type() == MIRType::ObjectOrNull) {
         LDefinition temp0 = test->operandMightEmulateUndefined() ? temp() : LDefinition::BogusTemp();
         add(new(alloc()) LTestOAndBranch(useRegister(opd), ifTrue, ifFalse, temp0), test);
         return;
     }
 
     // Objects are truthy, except if it might emulate undefined.
-    if (opd->type() == MIRType_Object) {
+    if (opd->type() == MIRType::Object) {
         if (test->operandMightEmulateUndefined())
             add(new(alloc()) LTestOAndBranch(useRegister(opd), ifTrue, ifFalse, temp()), test);
         else
             add(new(alloc()) LGoto(ifTrue));
         return;
     }
 
     // These must be explicitly sniffed out since they are constants and have
     // no payload.
-    if (opd->type() == MIRType_Undefined || opd->type() == MIRType_Null) {
+    if (opd->type() == MIRType::Undefined || opd->type() == MIRType::Null) {
         add(new(alloc()) LGoto(ifFalse));
         return;
     }
 
     // All symbols are truthy.
-    if (opd->type() == MIRType_Symbol) {
+    if (opd->type() == MIRType::Symbol) {
         add(new(alloc()) LGoto(ifTrue));
         return;
     }
 
     // Check if the operand for this test is a compare operation. If it is, we want
     // to emit an LCompare*AndBranch rather than an LTest*AndBranch, to fuse the
     // compare and jump instructions.
     if (opd->isCompare() && opd->isEmittedAtUses()) {
@@ -774,18 +774,18 @@ LIRGenerator::visitTest(MTest* test)
         // Emit LCompare*AndBranch.
 
         // Compare and branch null/undefined.
         // The second operand has known null/undefined type,
         // so just test the first operand.
         if (comp->compareType() == MCompare::Compare_Null ||
             comp->compareType() == MCompare::Compare_Undefined)
         {
-            if (left->type() == MIRType_Object || left->type() == MIRType_ObjectOrNull) {
-                MOZ_ASSERT(left->type() == MIRType_ObjectOrNull ||
+            if (left->type() == MIRType::Object || left->type() == MIRType::ObjectOrNull) {
+                MOZ_ASSERT(left->type() == MIRType::ObjectOrNull ||
                            comp->operandMightEmulateUndefined(),
                            "MCompare::tryFold should handle the never-emulates-undefined case");
 
                 LDefinition tmp =
                     comp->operandMightEmulateUndefined() ? temp() : LDefinition::BogusTemp();
                 LIsNullOrLikeUndefinedAndBranchT* lir =
                     new(alloc()) LIsNullOrLikeUndefinedAndBranchT(comp, useRegister(left),
                                                                   ifTrue, ifFalse, tmp);
@@ -806,18 +806,18 @@ LIRGenerator::visitTest(MTest* test)
                 new(alloc()) LIsNullOrLikeUndefinedAndBranchV(comp, ifTrue, ifFalse, useBox(left),
                                                               tmp, tmpToUnbox);
             add(lir, test);
             return;
         }
 
         // Compare and branch booleans.
         if (comp->compareType() == MCompare::Compare_Boolean) {
-            MOZ_ASSERT(left->type() == MIRType_Value);
-            MOZ_ASSERT(right->type() == MIRType_Boolean);
+            MOZ_ASSERT(left->type() == MIRType::Value);
+            MOZ_ASSERT(right->type() == MIRType::Boolean);
 
             LCompareBAndBranch* lir = new(alloc()) LCompareBAndBranch(comp, useBox(left),
                                                                       useRegisterOrConstant(right),
                                                                       ifTrue, ifFalse);
             add(lir, test);
             return;
         }
 
@@ -883,54 +883,54 @@ LIRGenerator::visitTest(MTest* test)
         }
     }
 
     // Check if the operand for this test is a bitand operation. If it is, we want
     // to emit an LBitAndAndBranch rather than an LTest*AndBranch.
     if (opd->isBitAnd() && opd->isEmittedAtUses()) {
         MDefinition* lhs = opd->getOperand(0);
         MDefinition* rhs = opd->getOperand(1);
-        if (lhs->type() == MIRType_Int32 && rhs->type() == MIRType_Int32) {
+        if (lhs->type() == MIRType::Int32 && rhs->type() == MIRType::Int32) {
             ReorderCommutative(&lhs, &rhs, test);
             lowerForBitAndAndBranch(new(alloc()) LBitAndAndBranch(ifTrue, ifFalse), test, lhs, rhs);
             return;
         }
     }
 
     if (opd->isIsObject() && opd->isEmittedAtUses()) {
         MDefinition* input = opd->toIsObject()->input();
-        MOZ_ASSERT(input->type() == MIRType_Value);
+        MOZ_ASSERT(input->type() == MIRType::Value);
 
         LIsObjectAndBranch* lir = new(alloc()) LIsObjectAndBranch(ifTrue, ifFalse,
                                                                   useBoxAtStart(input));
         add(lir, test);
         return;
     }
 
     if (opd->isIsNoIter()) {
         MOZ_ASSERT(opd->isEmittedAtUses());
 
         MDefinition* input = opd->toIsNoIter()->input();
-        MOZ_ASSERT(input->type() == MIRType_Value);
+        MOZ_ASSERT(input->type() == MIRType::Value);
 
         LIsNoIterAndBranch* lir = new(alloc()) LIsNoIterAndBranch(ifTrue, ifFalse,
                                                                   useBox(input));
         add(lir, test);
         return;
     }
 
     switch (opd->type()) {
-      case MIRType_Double:
+      case MIRType::Double:
         add(new(alloc()) LTestDAndBranch(useRegister(opd), ifTrue, ifFalse));
         break;
-      case MIRType_Float32:
+      case MIRType::Float32:
         add(new(alloc()) LTestFAndBranch(useRegister(opd), ifTrue, ifFalse));
         break;
-      case MIRType_Int32:
-      case MIRType_Boolean:
+      case MIRType::Int32:
+      case MIRType::Boolean:
         add(new(alloc()) LTestIAndBranch(useRegister(opd), ifTrue, ifFalse));
         break;
       default:
         MOZ_CRASH("Bad type");
     }
 }
 
 void
@@ -993,18 +993,18 @@ LIRGenerator::visitCompare(MCompare* com
         LCompareS* lir = new(alloc()) LCompareS(useRegister(left), useRegister(right));
         define(lir, comp);
         assignSafepoint(lir, comp);
         return;
     }
 
     // Strict compare between value and string
     if (comp->compareType() == MCompare::Compare_StrictString) {
-        MOZ_ASSERT(left->type() == MIRType_Value);
-        MOZ_ASSERT(right->type() == MIRType_String);
+        MOZ_ASSERT(left->type() == MIRType::Value);
+        MOZ_ASSERT(right->type() == MIRType::String);
 
         LCompareStrictS* lir = new(alloc()) LCompareStrictS(useBox(left), useRegister(right),
                                                             tempToUnbox());
         define(lir, comp);
         assignSafepoint(lir, comp);
         return;
     }
 
@@ -1024,18 +1024,18 @@ LIRGenerator::visitCompare(MCompare* com
         emitAtUses(comp);
         return;
     }
 
     // Compare Null and Undefined.
     if (comp->compareType() == MCompare::Compare_Null ||
         comp->compareType() == MCompare::Compare_Undefined)
     {
-        if (left->type() == MIRType_Object || left->type() == MIRType_ObjectOrNull) {
-            MOZ_ASSERT(left->type() == MIRType_ObjectOrNull ||
+        if (left->type() == MIRType::Object || left->type() == MIRType::ObjectOrNull) {
+            MOZ_ASSERT(left->type() == MIRType::ObjectOrNull ||
                        comp->operandMightEmulateUndefined(),
                        "MCompare::tryFold should have folded this away");
 
             define(new(alloc()) LIsNullOrLikeUndefinedT(useRegister(left)), comp);
             return;
         }
 
         LDefinition tmp, tmpToUnbox;
@@ -1050,18 +1050,18 @@ LIRGenerator::visitCompare(MCompare* com
         LIsNullOrLikeUndefinedV* lir = new(alloc()) LIsNullOrLikeUndefinedV(useBox(left),
                                                                             tmp, tmpToUnbox);
         define(lir, comp);
         return;
     }
 
     // Compare booleans.
     if (comp->compareType() == MCompare::Compare_Boolean) {
-        MOZ_ASSERT(left->type() == MIRType_Value);
-        MOZ_ASSERT(right->type() == MIRType_Boolean);
+        MOZ_ASSERT(left->type() == MIRType::Value);
+        MOZ_ASSERT(right->type() == MIRType::Boolean);
 
         LCompareB* lir = new(alloc()) LCompareB(useBox(left), useRegisterOrConstant(right));
         define(lir, comp);
         return;
     }
 
     // Compare Int32 or Object pointers.
     if (comp->isInt32Comparison() ||
@@ -1116,40 +1116,40 @@ LIRGenerator::visitCompare(MCompare* com
 }
 
 void
 LIRGenerator::lowerBitOp(JSOp op, MInstruction* ins)
 {
     MDefinition* lhs = ins->getOperand(0);
     MDefinition* rhs = ins->getOperand(1);
 
-    if (lhs->type() == MIRType_Int32) {
-        MOZ_ASSERT(rhs->type() == MIRType_Int32);
+    if (lhs->type() == MIRType::Int32) {
+        MOZ_ASSERT(rhs->type() == MIRType::Int32);
         ReorderCommutative(&lhs, &rhs, ins);
         lowerForALU(new(alloc()) LBitOpI(op), ins, lhs, rhs);
         return;
     }
 
-    if (lhs->type() == MIRType_Int64) {
-        MOZ_ASSERT(rhs->type() == MIRType_Int64);
+    if (lhs->type() == MIRType::Int64) {
+        MOZ_ASSERT(rhs->type() == MIRType::Int64);
         ReorderCommutative(&lhs, &rhs, ins);
         lowerForALUInt64(new(alloc()) LBitOpI64(op), ins, lhs, rhs);
         return;
     }
 
     LBitOpV* lir = new(alloc()) LBitOpV(op, useBoxAtStart(lhs), useBoxAtStart(rhs));
     defineReturn(lir, ins);
     assignSafepoint(lir, ins);
 }
 
 void
 LIRGenerator::visitTypeOf(MTypeOf* ins)
 {
     MDefinition* opd = ins->input();
-    MOZ_ASSERT(opd->type() == MIRType_Value);
+    MOZ_ASSERT(opd->type() == MIRType::Value);
 
     LTypeOfV* lir = new(alloc()) LTypeOfV(useBox(opd), tempToUnbox());
     define(lir, ins);
 }
 
 void
 LIRGenerator::visitToId(MToId* ins)
 {
@@ -1158,33 +1158,33 @@ LIRGenerator::visitToId(MToId* ins)
     assignSafepoint(lir, ins);
 }
 
 void
 LIRGenerator::visitBitNot(MBitNot* ins)
 {
     MDefinition* input = ins->getOperand(0);
 
-    if (input->type() == MIRType_Int32) {
+    if (input->type() == MIRType::Int32) {
         lowerForALU(new(alloc()) LBitNotI(), ins, input);
         return;
     }
 
     LBitNotV* lir = new(alloc()) LBitNotV(useBoxAtStart(input));
     defineReturn(lir, ins);
     assignSafepoint(lir, ins);
 }
 
 static bool
 CanEmitBitAndAtUses(MInstruction* ins)
 {
     if (!ins->canEmitAtUses())
         return false;
 
-    if (ins->getOperand(0)->type() != MIRType_Int32 || ins->getOperand(1)->type() != MIRType_Int32)
+    if (ins->getOperand(0)->type() != MIRType::Int32 || ins->getOperand(1)->type() != MIRType::Int32)
         return false;
 
     MUseIterator iter(ins->usesBegin());
     if (iter == ins->usesEnd())
         return false;
 
     MNode* node = iter->consumer();
     if (!node->isDefinition())
@@ -1223,41 +1223,41 @@ LIRGenerator::visitBitXor(MBitXor* ins)
 }
 
 void
 LIRGenerator::lowerShiftOp(JSOp op, MShiftInstruction* ins)
 {
     MDefinition* lhs = ins->getOperand(0);
     MDefinition* rhs = ins->getOperand(1);
 
-    if (lhs->type() == MIRType_Int32) {
-        MOZ_ASSERT(rhs->type() == MIRType_Int32);
-
-        if (ins->type() == MIRType_Double) {
+    if (lhs->type() == MIRType::Int32) {
+        MOZ_ASSERT(rhs->type() == MIRType::Int32);
+
+        if (ins->type() == MIRType::Double) {
             MOZ_ASSERT(op == JSOP_URSH);
             lowerUrshD(ins->toUrsh());
             return;
         }
 
         LShiftI* lir = new(alloc()) LShiftI(op);
         if (op == JSOP_URSH) {
             if (ins->toUrsh()->fallible())
                 assignSnapshot(lir, Bailout_OverflowInvalidate);
         }
         lowerForShift(lir, ins, lhs, rhs);
         return;
     }
 
-    if (lhs->type() == MIRType_Int64) {
-        MOZ_ASSERT(rhs->type() == MIRType_Int64);
+    if (lhs->type() == MIRType::Int64) {
+        MOZ_ASSERT(rhs->type() == MIRType::Int64);
         lowerForShiftInt64(new(alloc()) LShiftI64(op), ins, lhs, rhs);
         return;
     }
 
-    MOZ_ASSERT(ins->specialization() == MIRType_None);
+    MOZ_ASSERT(ins->specialization() == MIRType::None);
 
     if (op == JSOP_URSH) {
         // Result is either int32 or double so we have to use BinaryV.
         lowerBinaryV(JSOP_URSH, ins);
         return;
     }
 
     LBitOpV* lir = new(alloc()) LBitOpV(op, useBoxAtStart(lhs), useBoxAtStart(rhs));
@@ -1285,49 +1285,49 @@ LIRGenerator::visitUrsh(MUrsh* ins)
 
 void
 LIRGenerator::visitFloor(MFloor* ins)
 {
     MIRType type = ins->input()->type();
     MOZ_ASSERT(IsFloatingPointType(type));
 
     LInstructionHelper<1, 1, 0>* lir;
-    if (type == MIRType_Double)
+    if (type == MIRType::Double)
         lir = new(alloc()) LFloor(useRegister(ins->input()));
     else
         lir = new(alloc()) LFloorF(useRegister(ins->input()));
 
     assignSnapshot(lir, Bailout_Round);
     define(lir, ins);
 }
 
 void
 LIRGenerator::visitCeil(MCeil* ins)
 {
     MIRType type = ins->input()->type();
     MOZ_ASSERT(IsFloatingPointType(type));
 
     LInstructionHelper<1, 1, 0>* lir;
-    if (type == MIRType_Double)
+    if (type == MIRType::Double)
         lir = new(alloc()) LCeil(useRegister(ins->input()));
     else
         lir = new(alloc()) LCeilF(useRegister(ins->input()));
 
     assignSnapshot(lir, Bailout_Round);
     define(lir, ins);
 }
 
 void
 LIRGenerator::visitRound(MRound* ins)
 {
     MIRType type = ins->input()->type();
     MOZ_ASSERT(IsFloatingPointType(type));
 
     LInstructionHelper<1, 1, 1>* lir;
-    if (type == MIRType_Double)
+    if (type == MIRType::Double)
         lir = new (alloc()) LRound(useRegister(ins->input()), tempDouble());
     else
         lir = new (alloc()) LRoundF(useRegister(ins->input()), tempFloat32());
 
     assignSnapshot(lir, Bailout_Round);
     define(lir, ins);
 }
 
@@ -1336,23 +1336,23 @@ LIRGenerator::visitMinMax(MMinMax* ins)
 {
     MDefinition* first = ins->getOperand(0);
     MDefinition* second = ins->getOperand(1);
 
     ReorderCommutative(&first, &second, ins);
 
     LMinMaxBase* lir;
     switch (ins->specialization()) {
-      case MIRType_Int32:
+      case MIRType::Int32:
         lir = new(alloc()) LMinMaxI(useRegisterAtStart(first), useRegisterOrConstant(second));
         break;
-      case MIRType_Float32:
+      case MIRType::Float32:
         lir = new(alloc()) LMinMaxF(useRegisterAtStart(first), useRegister(second));
         break;
-      case MIRType_Double:
+      case MIRType::Double:
         lir = new(alloc()) LMinMaxD(useRegisterAtStart(first), useRegister(second));
         break;
       default:
         MOZ_CRASH();
     }
 
     defineReuseInput(lir, ins, 0);
 }
@@ -1360,26 +1360,26 @@ LIRGenerator::visitMinMax(MMinMax* ins)
 void
 LIRGenerator::visitAbs(MAbs* ins)
 {
     MDefinition* num = ins->input();
     MOZ_ASSERT(IsNumberType(num->type()));
 
     LInstructionHelper<1, 1, 0>* lir;
     switch (num->type()) {
-      case MIRType_Int32:
+      case MIRType::Int32:
         lir = new(alloc()) LAbsI(useRegisterAtStart(num));
         // needed to handle abs(INT32_MIN)
         if (ins->fallible())
             assignSnapshot(lir, Bailout_Overflow);
         break;
-      case MIRType_Float32:
+      case MIRType::Float32:
         lir = new(alloc()) LAbsF(useRegisterAtStart(num));
         break;
-      case MIRType_Double:
+      case MIRType::Double:
         lir = new(alloc()) LAbsD(useRegisterAtStart(num));
         break;
       default:
         MOZ_CRASH();
     }
 
     defineReuseInput(lir, ins, 0);
 }
@@ -1413,44 +1413,44 @@ LIRGenerator::visitPopcnt(MPopcnt* ins)
 
 void
 LIRGenerator::visitSqrt(MSqrt* ins)
 {
     MDefinition* num = ins->input();
     MOZ_ASSERT(IsFloatingPointType(num->type()));
 
     LInstructionHelper<1, 1, 0>* lir;
-    if (num->type() == MIRType_Double)
+    if (num->type() == MIRType::Double)
         lir = new(alloc()) LSqrtD(useRegisterAtStart(num));
     else
         lir = new(alloc()) LSqrtF(useRegisterAtStart(num));
     define(lir, ins);
 }
 
 void
 LIRGenerator::visitAtan2(MAtan2* ins)
 {
     MDefinition* y = ins->y();
-    MOZ_ASSERT(y->type() == MIRType_Double);
+    MOZ_ASSERT(y->type() == MIRType::Double);
 
     MDefinition* x = ins->x();
-    MOZ_ASSERT(x->type() == MIRType_Double);
+    MOZ_ASSERT(x->type() == MIRType::Double);
 
     LAtan2D* lir = new(alloc()) LAtan2D(useRegisterAtStart(y), useRegisterAtStart(x),
                                         tempFixed(CallTempReg0));
     defineReturn(lir, ins);
 }
 
 void
 LIRGenerator::visitHypot(MHypot* ins)
 {
     LHypot* lir = nullptr;
     uint32_t length = ins->numOperands();
     for (uint32_t i = 0; i < length; ++i)
-        MOZ_ASSERT(ins->getOperand(i)->type() == MIRType_Double);
+        MOZ_ASSERT(ins->getOperand(i)->type() == MIRType::Double);
 
     switch(length) {
       case 2:
         lir = new(alloc()) LHypot(useRegisterAtStart(ins->getOperand(0)),
                                   useRegisterAtStart(ins->getOperand(1)),
                                   tempFixed(CallTempReg0));
         break;
       case 3:
@@ -1472,49 +1472,49 @@ LIRGenerator::visitHypot(MHypot* ins)
 
     defineReturn(lir, ins);
 }
 
 void
 LIRGenerator::visitPow(MPow* ins)
 {
     MDefinition* input = ins->input();
-    MOZ_ASSERT(input->type() == MIRType_Double);
+    MOZ_ASSERT(input->type() == MIRType::Double);
 
     MDefinition* power = ins->power();
-    MOZ_ASSERT(power->type() == MIRType_Int32 || power->type() == MIRType_Double);
+    MOZ_ASSERT(power->type() == MIRType::Int32 || power->type() == MIRType::Double);
 
     LInstruction* lir;
-    if (power->type() == MIRType_Int32) {
+    if (power->type() == MIRType::Int32) {
         // Note: useRegisterAtStart here is safe, the temp is a GP register so
         // it will never get the same register.
         lir = new(alloc()) LPowI(useRegisterAtStart(input), useFixed(power, CallTempReg1),
                                  tempFixed(CallTempReg0));
     } else {
         lir = new(alloc()) LPowD(useRegisterAtStart(input), useRegisterAtStart(power),
                                  tempFixed(CallTempReg0));
     }
     defineReturn(lir, ins);
 }
 
 void
 LIRGenerator::visitMathFunction(MMathFunction* ins)
 {
     MOZ_ASSERT(IsFloatingPointType(ins->type()));
-    MOZ_ASSERT_IF(ins->input()->type() != MIRType_SinCosDouble,
+    MOZ_ASSERT_IF(ins->input()->type() != MIRType::SinCosDouble,
                   ins->type() == ins->input()->type());
 
-    if (ins->input()->type() == MIRType_SinCosDouble) {
-        MOZ_ASSERT(ins->type() == MIRType_Double);
+    if (ins->input()->type() == MIRType::SinCosDouble) {
+        MOZ_ASSERT(ins->type() == MIRType::Double);
         redefine(ins, ins->input(), ins->function());
         return;
     }
 
     LInstruction* lir;
-    if (ins->type() == MIRType_Double) {
+    if (ins->type() == MIRType::Double) {
         // Note: useRegisterAtStart is safe here, the temp is not a FP register.
         lir = new(alloc()) LMathFunctionD(useRegisterAtStart(ins->input()),
                                           tempFixed(CallTempReg0));
     } else {
         lir = new(alloc()) LMathFunctionF(useRegisterAtStart(ins->input()),
                                           tempFixed(CallTempReg0));
     }
     defineReturn(lir, ins);
@@ -1555,139 +1555,139 @@ MaybeSetRecoversInput(S* mir, T* lir)
 void
 LIRGenerator::visitAdd(MAdd* ins)
 {
     MDefinition* lhs = ins->getOperand(0);
     MDefinition* rhs = ins->getOperand(1);
 
     MOZ_ASSERT(lhs->type() == rhs->type());
 
-    if (ins->specialization() == MIRType_Int32) {
-        MOZ_ASSERT(lhs->type() == MIRType_Int32);
+    if (ins->specialization() == MIRType::Int32) {
+        MOZ_ASSERT(lhs->type() == MIRType::Int32);
         ReorderCommutative(&lhs, &rhs, ins);
         LAddI* lir = new(alloc()) LAddI;
 
         if (ins->fallible())
             assignSnapshot(lir, Bailout_OverflowInvalidate);
 
         lowerForALU(lir, ins, lhs, rhs);
         MaybeSetRecoversInput(ins, lir);
         return;
     }
 
-    if (ins->specialization() == MIRType_Int64) {
-        MOZ_ASSERT(lhs->type() == MIRType_Int64);
+    if (ins->specialization() == MIRType::Int64) {
+        MOZ_ASSERT(lhs->type() == MIRType::Int64);
         ReorderCommutative(&lhs, &rhs, ins);
         LAddI64* lir = new(alloc()) LAddI64;
         lowerForALUInt64(lir, ins, lhs, rhs);
         return;
     }
 
-    if (ins->specialization() == MIRType_Double) {
-        MOZ_ASSERT(lhs->type() == MIRType_Double);
+    if (ins->specialization() == MIRType::Double) {
+        MOZ_ASSERT(lhs->type() == MIRType::Double);
         ReorderCommutative(&lhs, &rhs, ins);
         lowerForFPU(new(alloc()) LMathD(JSOP_ADD), ins, lhs, rhs);
         return;
     }
 
-    if (ins->specialization() == MIRType_Float32) {
-        MOZ_ASSERT(lhs->type() == MIRType_Float32);
+    if (ins->specialization() == MIRType::Float32) {
+        MOZ_ASSERT(lhs->type() == MIRType::Float32);
         ReorderCommutative(&lhs, &rhs, ins);
         lowerForFPU(new(alloc()) LMathF(JSOP_ADD), ins, lhs, rhs);
         return;
     }
 
     lowerBinaryV(JSOP_ADD, ins);
 }
 
 void
 LIRGenerator::visitSub(MSub* ins)
 {
     MDefinition* lhs = ins->lhs();
     MDefinition* rhs = ins->rhs();
 
     MOZ_ASSERT(lhs->type() == rhs->type());
 
-    if (ins->specialization() == MIRType_Int32) {
-        MOZ_ASSERT(lhs->type() == MIRType_Int32);
+    if (ins->specialization() == MIRType::Int32) {
+        MOZ_ASSERT(lhs->type() == MIRType::Int32);
 
         LSubI* lir = new(alloc()) LSubI;
         if (ins->fallible())
             assignSnapshot(lir, Bailout_Overflow);
 
         lowerForALU(lir, ins, lhs, rhs);
         MaybeSetRecoversInput(ins, lir);
         return;
     }
 
-    if (ins->specialization() == MIRType_Int64) {
-        MOZ_ASSERT(lhs->type() == MIRType_Int64);
+    if (ins->specialization() == MIRType::Int64) {
+        MOZ_ASSERT(lhs->type() == MIRType::Int64);
         ReorderCommutative(&lhs, &rhs, ins);
         LSubI64* lir = new(alloc()) LSubI64;
         lowerForALUInt64(lir, ins, lhs, rhs);
         return;
     }
 
-    if (ins->specialization() == MIRType_Double) {
-        MOZ_ASSERT(lhs->type() == MIRType_Double);
+    if (ins->specialization() == MIRType::Double) {
+        MOZ_ASSERT(lhs->type() == MIRType::Double);
         lowerForFPU(new(alloc()) LMathD(JSOP_SUB), ins, lhs, rhs);
         return;
     }
 
-    if (ins->specialization() == MIRType_Float32) {
-        MOZ_ASSERT(lhs->type() == MIRType_Float32);
+    if (ins->specialization() == MIRType::Float32) {
+        MOZ_ASSERT(lhs->type() == MIRType::Float32);
         lowerForFPU(new(alloc()) LMathF(JSOP_SUB), ins, lhs, rhs);
         return;
     }
 
     lowerBinaryV(JSOP_SUB, ins);
 }
 
 void
 LIRGenerator::visitMul(MMul* ins)
 {
     MDefinition* lhs = ins->lhs();
     MDefinition* rhs = ins->rhs();
     MOZ_ASSERT(lhs->type() == rhs->type());
 
-    if (ins->specialization() == MIRType_Int32) {
-        MOZ_ASSERT(lhs->type() == MIRType_Int32);
+    if (ins->specialization() == MIRType::Int32) {
+        MOZ_ASSERT(lhs->type() == MIRType::Int32);
         ReorderCommutative(&lhs, &rhs, ins);
 
         // If our RHS is a constant -1 and we don't have to worry about
         // overflow, we can optimize to an LNegI.
         if (!ins->fallible() && rhs->isConstant() && rhs->toConstant()->toInt32() == -1)
             defineReuseInput(new(alloc()) LNegI(useRegisterAtStart(lhs)), ins, 0);
         else
             lowerMulI(ins, lhs, rhs);
         return;
     }
 
-    if (ins->specialization() == MIRType_Int64) {
-        MOZ_ASSERT(lhs->type() == MIRType_Int64);
+    if (ins->specialization() == MIRType::Int64) {
+        MOZ_ASSERT(lhs->type() == MIRType::Int64);
         ReorderCommutative(&lhs, &rhs, ins);
         LMulI64* lir = new(alloc()) LMulI64;
         lowerForALUInt64(lir, ins, lhs, rhs);
         return;
     }
 
-    if (ins->specialization() == MIRType_Double) {
-        MOZ_ASSERT(lhs->type() == MIRType_Double);
+    if (ins->specialization() == MIRType::Double) {
+        MOZ_ASSERT(lhs->type() == MIRType::Double);
         ReorderCommutative(&lhs, &rhs, ins);
 
         // If our RHS is a constant -1.0, we can optimize to an LNegD.
         if (rhs->isConstant() && rhs->toConstant()->toDouble() == -1.0)
             defineReuseInput(new(alloc()) LNegD(useRegisterAtStart(lhs)), ins, 0);
         else
             lowerForFPU(new(alloc()) LMathD(JSOP_MUL), ins, lhs, rhs);
         return;
     }
 
-    if (ins->specialization() == MIRType_Float32) {
-        MOZ_ASSERT(lhs->type() == MIRType_Float32);
+    if (ins->specialization() == MIRType::Float32) {
+        MOZ_ASSERT(lhs->type() == MIRType::Float32);
         ReorderCommutative(&lhs, &rhs, ins);
 
         // We apply the same optimizations as for doubles
         if (rhs->isConstant() && rhs->toConstant()->toFloat32() == -1.0f)
             defineReuseInput(new(alloc()) LNegF(useRegisterAtStart(lhs)), ins, 0);
         else
             lowerForFPU(new(alloc()) LMathF(JSOP_MUL), ins, lhs, rhs);
         return;
@@ -1698,66 +1698,66 @@ LIRGenerator::visitMul(MMul* ins)
 
 void
 LIRGenerator::visitDiv(MDiv* ins)
 {
     MDefinition* lhs = ins->lhs();
     MDefinition* rhs = ins->rhs();
     MOZ_ASSERT(lhs->type() == rhs->type());
 
-    if (ins->specialization() == MIRType_Int32) {
-        MOZ_ASSERT(lhs->type() == MIRType_Int32);
+    if (ins->specialization() == MIRType::Int32) {
+        MOZ_ASSERT(lhs->type() == MIRType::Int32);
         lowerDivI(ins);
         return;
     }
 
-    if (ins->specialization() == MIRType_Int64) {
-        MOZ_ASSERT(lhs->type() == MIRType_Int64);
+    if (ins->specialization() == MIRType::Int64) {
+        MOZ_ASSERT(lhs->type() == MIRType::Int64);
         lowerDivI64(ins);
         return;
     }
 
-    if (ins->specialization() == MIRType_Double) {
-        MOZ_ASSERT(lhs->type() == MIRType_Double);
+    if (ins->specialization() == MIRType::Double) {
+        MOZ_ASSERT(lhs->type() == MIRType::Double);
         lowerForFPU(new(alloc()) LMathD(JSOP_DIV), ins, lhs, rhs);
         return;
     }
 
-    if (ins->specialization() == MIRType_Float32) {
-        MOZ_ASSERT(lhs->type() == MIRType_Float32);
+    if (ins->specialization() == MIRType::Float32) {
+        MOZ_ASSERT(lhs->type() == MIRType::Float32);
         lowerForFPU(new(alloc()) LMathF(JSOP_DIV), ins, lhs, rhs);
         return;
     }
 
     lowerBinaryV(JSOP_DIV, ins);
 }
 
 void
 LIRGenerator::visitMod(MMod* ins)
 {
     MOZ_ASSERT(ins->lhs()->type() == ins->rhs()->type());
 
-    if (ins->specialization() == MIRType_Int32) {
-        MOZ_ASSERT(ins->type() == MIRType_Int32);
-        MOZ_ASSERT(ins->lhs()->type() == MIRType_Int32);
+    if (ins->specialization() == MIRType::Int32) {
+        MOZ_ASSERT(ins->type() == MIRType::Int32);
+        MOZ_ASSERT(ins->lhs()->type() == MIRType::Int32);
         lowerModI(ins);
         return;
     }
 
-    if (ins->specialization() == MIRType_Int64) {
-        MOZ_ASSERT(ins->type() == MIRType_Int64);
-        MOZ_ASSERT(ins->lhs()->type() == MIRType_Int64);
+    if (ins->specialization() == MIRType::Int64) {
+        MOZ_ASSERT(ins->type() == MIRType::Int64);
+        MOZ_ASSERT(ins->lhs()->type() == MIRType::Int64);
         lowerModI64(ins);
         return;
     }
 
-    if (ins->specialization() == MIRType_Double) {
-        MOZ_ASSERT(ins->type() == MIRType_Double);
-        MOZ_ASSERT(ins->lhs()->type() == MIRType_Double);
-        MOZ_ASSERT(ins->rhs()->type() == MIRType_Double);
+    if (ins->specialization() == MIRType::Double) {
+        MOZ_ASSERT(ins->type() == MIRType::Double);
+        MOZ_ASSERT(ins->lhs()->type() == MIRType::Double);
+        MOZ_ASSERT(ins->rhs()->type() == MIRType::Double);
 
         // Note: useRegisterAtStart is safe here, the temp is not a FP register.
         LModD* lir = new(alloc()) LModD(useRegisterAtStart(ins->lhs()), useRegisterAtStart(ins->rhs()),
                                         tempFixed(CallTempReg0));
         defineReturn(lir, ins);
         return;
     }
 
@@ -1765,33 +1765,33 @@ LIRGenerator::visitMod(MMod* ins)
 }
 
 void
 LIRGenerator::lowerBinaryV(JSOp op, MBinaryInstruction* ins)
 {
     MDefinition* lhs = ins->getOperand(0);
     MDefinition* rhs = ins->getOperand(1);
 
-    MOZ_ASSERT(lhs->type() == MIRType_Value);
-    MOZ_ASSERT(rhs->type() == MIRType_Value);
+    MOZ_ASSERT(lhs->type() == MIRType::Value);
+    MOZ_ASSERT(rhs->type() == MIRType::Value);
 
     LBinaryV* lir = new(alloc()) LBinaryV(op, useBoxAtStart(lhs), useBoxAtStart(rhs));
     defineReturn(lir, ins);
     assignSafepoint(lir, ins);
 }
 
 void
 LIRGenerator::visitConcat(MConcat* ins)
 {
     MDefinition* lhs = ins->getOperand(0);
     MDefinition* rhs = ins->getOperand(1);
 
-    MOZ_ASSERT(lhs->type() == MIRType_String);
-    MOZ_ASSERT(rhs->type() == MIRType_String);
-    MOZ_ASSERT(ins->type() == MIRType_String);
+    MOZ_ASSERT(lhs->type() == MIRType::String);
+    MOZ_ASSERT(rhs->type() == MIRType::String);
+    MOZ_ASSERT(ins->type() == MIRType::String);
 
     LConcat* lir = new(alloc()) LConcat(useFixedAtStart(lhs, CallTempReg0),
                                         useFixedAtStart(rhs, CallTempReg1),
                                         tempFixed(CallTempReg0),
                                         tempFixed(CallTempReg1),
                                         tempFixed(CallTempReg2),
                                         tempFixed(CallTempReg3),
                                         tempFixed(CallTempReg4));
@@ -1800,30 +1800,30 @@ LIRGenerator::visitConcat(MConcat* ins)
 }
 
 void
 LIRGenerator::visitCharCodeAt(MCharCodeAt* ins)
 {
     MDefinition* str = ins->getOperand(0);
     MDefinition* idx = ins->getOperand(1);
 
-    MOZ_ASSERT(str->type() == MIRType_String);
-    MOZ_ASSERT(idx->type() == MIRType_Int32);
+    MOZ_ASSERT(str->type() == MIRType::String);
+    MOZ_ASSERT(idx->type() == MIRType::Int32);
 
     LCharCodeAt* lir = new(alloc()) LCharCodeAt(useRegister(str), useRegister(idx));
     define(lir, ins);
     assignSafepoint(lir, ins);
 }
 
 void
 LIRGenerator::visitFromCharCode(MFromCharCode* ins)
 {
     MDefinition* code = ins->getOperand(0);
 
-    MOZ_ASSERT(code->type() == MIRType_Int32);
+    MOZ_ASSERT(code->type() == MIRType::Int32);
 
     LFromCharCode* lir = new(alloc()) LFromCharCode(useRegister(code));
     define(lir, ins);
     assignSafepoint(lir, ins);
 }
 
 void
 LIRGenerator::visitStart(MStart* start)
@@ -1886,54 +1886,54 @@ LIRGenerator::visitOsrArgumentsObject(MO
 
 void
 LIRGenerator::visitToDouble(MToDouble* convert)
 {
     MDefinition* opd = convert->input();
     mozilla::DebugOnly<MToFPInstruction::ConversionKind> conversion = convert->conversion();
 
     switch (opd->type()) {
-      case MIRType_Value:
+      case MIRType::Value:
       {
         LValueToDouble* lir = new(alloc()) LValueToDouble(useBox(opd));
         assignSnapshot(lir, Bailout_NonPrimitiveInput);
         define(lir, convert);
         break;
       }
 
-      case MIRType_Null:
+      case MIRType::Null:
         MOZ_ASSERT(conversion != MToFPInstruction::NumbersOnly &&
                    conversion != MToFPInstruction::NonNullNonStringPrimitives);
         lowerConstantDouble(0, convert);
         break;
 
-      case MIRType_Undefined:
+      case MIRType::Undefined:
         MOZ_ASSERT(conversion != MToFPInstruction::NumbersOnly);
         lowerConstantDouble(GenericNaN(), convert);
         break;
 
-      case MIRType_Boolean:
+      case MIRType::Boolean:
         MOZ_ASSERT(conversion != MToFPInstruction::NumbersOnly);
         MOZ_FALLTHROUGH;
 
-      case MIRType_Int32:
+      case MIRType::Int32:
       {
         LInt32ToDouble* lir = new(alloc()) LInt32ToDouble(useRegisterAtStart(opd));
         define(lir, convert);
         break;
       }
 
-      case MIRType_Float32:
+      case MIRType::Float32:
       {
         LFloat32ToDouble* lir = new (alloc()) LFloat32ToDouble(useRegisterAtStart(opd));
         define(lir, convert);
         break;
       }
 
-      case MIRType_Double:
+      case MIRType::Double:
         redefine(convert, opd);
         break;
 
       default:
         // Objects might be effectful. Symbols will throw.
         // Strings are complicated - we don't handle them yet.
         MOZ_CRASH("unexpected type");
     }
@@ -1941,154 +1941,154 @@ LIRGenerator::visitToDouble(MToDouble* c
 
 void
 LIRGenerator::visitToFloat32(MToFloat32* convert)
 {
     MDefinition* opd = convert->input();
     mozilla::DebugOnly<MToFloat32::ConversionKind> conversion = convert->conversion();
 
     switch (opd->type()) {
-      case MIRType_Value:
+      case MIRType::Value:
       {
         LValueToFloat32* lir = new(alloc()) LValueToFloat32(useBox(opd));
         assignSnapshot(lir, Bailout_NonPrimitiveInput);
         define(lir, convert);
         break;
       }
 
-      case MIRType_Null:
+      case MIRType::Null:
         MOZ_ASSERT(conversion != MToFPInstruction::NumbersOnly &&
                    conversion != MToFPInstruction::NonNullNonStringPrimitives);
         lowerConstantFloat32(0, convert);
         break;
 
-      case MIRType_Undefined:
+      case MIRType::Undefined:
         MOZ_ASSERT(conversion != MToFPInstruction::NumbersOnly);
         lowerConstantFloat32(GenericNaN(), convert);
         break;
 
-      case MIRType_Boolean:
+      case MIRType::Boolean:
         MOZ_ASSERT(conversion != MToFPInstruction::NumbersOnly);
         MOZ_FALLTHROUGH;
 
-      case MIRType_Int32:
+      case MIRType::Int32:
       {
         LInt32ToFloat32* lir = new(alloc()) LInt32ToFloat32(useRegisterAtStart(opd));
         define(lir, convert);
         break;
       }
 
-      case MIRType_Double:
+      case MIRType::Double:
       {
         LDoubleToFloat32* lir = new(alloc()) LDoubleToFloat32(useRegisterAtStart(opd));
         define(lir, convert);
         break;
       }
 
-      case MIRType_Float32:
+      case MIRType::Float32:
         redefine(convert, opd);
         break;
 
       default:
         // Objects might be effectful. Symbols will throw.
         // Strings are complicated - we don't handle them yet.
         MOZ_CRASH("unexpected type");
     }
 }
 
 void
 LIRGenerator::visitToInt32(MToInt32* convert)
 {
     MDefinition* opd = convert->input();
 
     switch (opd->type()) {
-      case MIRType_Value:
+      case MIRType::Value:
       {
         LValueToInt32* lir =
             new(alloc()) LValueToInt32(useBox(opd), tempDouble(), temp(), LValueToInt32::NORMAL);
         assignSnapshot(lir, Bailout_NonPrimitiveInput);
         define(lir, convert);
         assignSafepoint(lir, convert);
         break;
       }
 
-      case MIRType_Null:
+      case MIRType::Null:
         MOZ_ASSERT(convert->conversion() == MacroAssembler::IntConversion_Any);
         define(new(alloc()) LInteger(0), convert);
         break;
 
-      case MIRType_Boolean:
+      case MIRType::Boolean:
         MOZ_ASSERT(convert->conversion() == MacroAssembler::IntConversion_Any ||
                    convert->conversion() == MacroAssembler::IntConversion_NumbersOrBoolsOnly);
         redefine(convert, opd);
         break;
 
-      case MIRType_Int32:
+      case MIRType::Int32:
         redefine(convert, opd);
         break;
 
-      case MIRType_Float32:
+      case MIRType::Float32:
       {
         LFloat32ToInt32* lir = new(alloc()) LFloat32ToInt32(useRegister(opd));
         assignSnapshot(lir, Bailout_PrecisionLoss);
         define(lir, convert);
         break;
       }
 
-      case MIRType_Double:
+      case MIRType::Double:
       {
         LDoubleToInt32* lir = new(alloc()) LDoubleToInt32(useRegister(opd));
         assignSnapshot(lir, Bailout_PrecisionLoss);
         define(lir, convert);
         break;
       }
 
-      case MIRType_String:
-      case MIRType_Symbol:
-      case MIRType_Object:
-      case MIRType_Undefined:
+      case MIRType::String:
+      case MIRType::Symbol:
+      case MIRType::Object:
+      case MIRType::Undefined:
         // Objects might be effectful. Symbols throw. Undefined coerces to NaN, not int32.
         MOZ_CRASH("ToInt32 invalid input type");
 
       default:
         MOZ_CRASH("unexpected type");
     }
 }
 
 void
 LIRGenerator::visitTruncateToInt32(MTruncateToInt32* truncate)
 {
     MDefinition* opd = truncate->input();
 
     switch (opd->type()) {
-      case MIRType_Value:
+      case MIRType::Value:
       {
         LValueToInt32* lir = new(alloc()) LValueToInt32(useBox(opd), tempDouble(), temp(),
                                                         LValueToInt32::TRUNCATE);
         assignSnapshot(lir, Bailout_NonPrimitiveInput);
         define(lir, truncate);
         assignSafepoint(lir, truncate);
         break;
       }
 
-      case MIRType_Null:
-      case MIRType_Undefined:
+      case MIRType::Null:
+      case MIRType::Undefined:
         define(new(alloc()) LInteger(0), truncate);
         break;
 
-      case MIRType_Int32:
-      case MIRType_Boolean:
+      case MIRType::Int32:
+      case MIRType::Boolean:
         redefine(truncate, opd);
         break;
 
-      case MIRType_Double:
+      case MIRType::Double:
         lowerTruncateDToInt32(truncate);
         break;
 
-      case MIRType_Float32:
+      case MIRType::Float32:
         lowerTruncateFToInt32(truncate);
         break;
 
       default:
         // Objects might be effectful. Symbols throw.
         // Strings are complicated - we don't handle them yet.
         MOZ_CRASH("unexpected type");
     }
@@ -2107,57 +2107,57 @@ LIRGenerator::visitExtendInt32ToInt64(ME
 }
 
 void
 LIRGenerator::visitToString(MToString* ins)
 {
     MDefinition* opd = ins->input();
 
     switch (opd->type()) {
-      case MIRType_Null: {
+      case MIRType::Null: {
         const JSAtomState& names = GetJitContext()->runtime->names();
         LPointer* lir = new(alloc()) LPointer(names.null);
         define(lir, ins);
         break;
       }
 
-      case MIRType_Undefined: {
+      case MIRType::Undefined: {
         const JSAtomState& names = GetJitContext()->runtime->names();
         LPointer* lir = new(alloc()) LPointer(names.undefined);
         define(lir, ins);
         break;
       }
 
-      case MIRType_Boolean: {
+      case MIRType::Boolean: {
         LBooleanToString* lir = new(alloc()) LBooleanToString(useRegister(opd));
         define(lir, ins);
         break;
       }
 
-      case MIRType_Double: {
+      case MIRType::Double: {
         LDoubleToString* lir = new(alloc()) LDoubleToString(useRegister(opd), temp());
 
         define(lir, ins);
         assignSafepoint(lir, ins);
         break;
       }
 
-      case MIRType_Int32: {
+      case MIRType::Int32: {
         LIntToString* lir = new(alloc()) LIntToString(useRegister(opd));
 
         define(lir, ins);
         assignSafepoint(lir, ins);
         break;
       }
 
-      case MIRType_String:
+      case MIRType::String:
         redefine(ins, ins->input());
         break;
 
-      case MIRType_Value: {
+      case MIRType::Value: {
         LValueToString* lir = new(alloc()) LValueToString(useBox(opd), tempToUnbox());
         if (ins->fallible())
             assignSnapshot(lir, Bailout_NonPrimitiveInput);
         define(lir, ins);
         assignSafepoint(lir, ins);
         break;
       }
 
@@ -2165,17 +2165,17 @@ LIRGenerator::visitToString(MToString* i
         // Float32, symbols, and objects are not supported.
         MOZ_CRASH("unexpected type");
     }
 }
 
 void
 LIRGenerator::visitToObjectOrNull(MToObjectOrNull* ins)
 {
-    MOZ_ASSERT(ins->input()->type() == MIRType_Value);
+    MOZ_ASSERT(ins->input()->type() == MIRType::Value);
 
     LValueToObjectOrNull* lir = new(alloc()) LValueToObjectOrNull(useBox(ins->input()));
     define(lir, ins);
     assignSafepoint(lir, ins);
 }
 
 static bool
 MustCloneRegExpForCall(MCall* call, uint32_t useIndex)
@@ -2249,132 +2249,132 @@ LIRGenerator::visitRegExp(MRegExp* ins)
         defineReturn(lir, ins);
         assignSafepoint(lir, ins);
     }
 }
 
 void
 LIRGenerator::visitRegExpMatcher(MRegExpMatcher* ins)
 {
-    MOZ_ASSERT(ins->regexp()->type() == MIRType_Object);
-    MOZ_ASSERT(ins->string()->type() == MIRType_String);
-    MOZ_ASSERT(ins->lastIndex()->type() == MIRType_Int32);
+    MOZ_ASSERT(ins->regexp()->type() == MIRType::Object);
+    MOZ_ASSERT(ins->string()->type() == MIRType::String);
+    MOZ_ASSERT(ins->lastIndex()->type() == MIRType::Int32);
 
     LRegExpMatcher* lir = new(alloc()) LRegExpMatcher(useFixedAtStart(ins->regexp(), RegExpMatcherRegExpReg),
                                                       useFixedAtStart(ins->string(), RegExpMatcherStringReg),
                                                       useFixedAtStart(ins->lastIndex(), RegExpMatcherLastIndexReg));
     defineReturn(lir, ins);
     assignSafepoint(lir, ins);
 }
 
 void
 LIRGenerator::visitRegExpSearcher(MRegExpSearcher* ins)
 {
-    MOZ_ASSERT(ins->regexp()->type() == MIRType_Object);
-    MOZ_ASSERT(ins->string()->type() == MIRType_String);
-    MOZ_ASSERT(ins->lastIndex()->type() == MIRType_Int32);
+    MOZ_ASSERT(ins->regexp()->type() == MIRType::Object);
+    MOZ_ASSERT(ins->string()->type() == MIRType::String);
+    MOZ_ASSERT(ins->lastIndex()->type() == MIRType::Int32);
 
     LRegExpSearcher* lir = new(alloc()) LRegExpSearcher(useFixedAtStart(ins->regexp(), RegExpTesterRegExpReg),
                                                         useFixedAtStart(ins->string(), RegExpTesterStringReg),
                                                         useFixedAtStart(ins->lastIndex(), RegExpTesterLastIndexReg));
     defineReturn(lir, ins);
     assignSafepoint(lir, ins);
 }
 
 void
 LIRGenerator::visitRegExpTester(MRegExpTester* ins)
 {
-    MOZ_ASSERT(ins->regexp()->type() == MIRType_Object);
-    MOZ_ASSERT(ins->string()->type() == MIRType_String);
-    MOZ_ASSERT(ins->lastIndex()->type() == MIRType_Int32);
+    MOZ_ASSERT(ins->regexp()->type() == MIRType::Object);
+    MOZ_ASSERT(ins->string()->type() == MIRType::String);
+    MOZ_ASSERT(ins->lastIndex()->type() == MIRType::Int32);
 
     LRegExpTester* lir = new(alloc()) LRegExpTester(useFixedAtStart(ins->regexp(), RegExpTesterRegExpReg),
                                                     useFixedAtStart(ins->string(), RegExpTesterStringReg),
                                                     useFixedAtStart(ins->lastIndex(), RegExpTesterLastIndexReg));
     defineReturn(lir, ins);
     assignSafepoint(lir, ins);
 }
 
 void
 LIRGenerator::visitRegExpPrototypeOptimizable(MRegExpPrototypeOptimizable* ins)
 {
-    MOZ_ASSERT(ins->object()->type() == MIRType_Object);
-    MOZ_ASSERT(ins->type() == MIRType_Boolean);
+    MOZ_ASSERT(ins->object()->type() == MIRType::Object);
+    MOZ_ASSERT(ins->type() == MIRType::Boolean);
     LRegExpPrototypeOptimizable* lir = new(alloc()) LRegExpPrototypeOptimizable(useRegister(ins->object()),
                                                                                 temp());
     define(lir, ins);
 }
 
 void
 LIRGenerator::visitRegExpInstanceOptimizable(MRegExpInstanceOptimizable* ins)
 {
-    MOZ_ASSERT(ins->object()->type() == MIRType_Object);
-    MOZ_ASSERT(ins->proto()->type() == MIRType_Object);
-    MOZ_ASSERT(ins->type() == MIRType_Boolean);
+    MOZ_ASSERT(ins->object()->type() == MIRType::Object);
+    MOZ_ASSERT(ins->proto()->type() == MIRType::Object);
+    MOZ_ASSERT(ins->type() == MIRType::Boolean);
     LRegExpInstanceOptimizable* lir = new(alloc()) LRegExpInstanceOptimizable(useRegister(ins->object()),
                                                                               useRegister(ins->proto()),
                                                                               temp());
     define(lir, ins);
 }
 
 void
 LIRGenerator::visitGetFirstDollarIndex(MGetFirstDollarIndex* ins)
 {
-    MOZ_ASSERT(ins->str()->type() == MIRType_String);
-    MOZ_ASSERT(ins->type() == MIRType_Int32);
+    MOZ_ASSERT(ins->str()->type() == MIRType::String);
+    MOZ_ASSERT(ins->type() == MIRType::Int32);
     LGetFirstDollarIndex* lir = new(alloc()) LGetFirstDollarIndex(useRegister(ins->str()),
                                                                   temp(), temp(), temp());
     define(lir, ins);
     assignSafepoint(lir, ins);
 }
 
 void
 LIRGenerator::visitStringReplace(MStringReplace* ins)
 {
-    MOZ_ASSERT(ins->pattern()->type() == MIRType_String);
-    MOZ_ASSERT(ins->string()->type() == MIRType_String);
-    MOZ_ASSERT(ins->replacement()->type() == MIRType_String);
+    MOZ_ASSERT(ins->pattern()->type() == MIRType::String);
+    MOZ_ASSERT(ins->string()->type() == MIRType::String);
+    MOZ_ASSERT(ins->replacement()->type() == MIRType::String);
 
     LStringReplace* lir = new(alloc()) LStringReplace(useRegisterOrConstantAtStart(ins->string()),
                                                       useRegisterAtStart(ins->pattern()),
                                                       useRegisterOrConstantAtStart(ins->replacement()));
     defineReturn(lir, ins);
     assignSafepoint(lir, ins);
 }
 
 void
 LIRGenerator::visitBinarySharedStub(MBinarySharedStub* ins)
 {
     MDefinition* lhs = ins->getOperand(0);
     MDefinition* rhs = ins->getOperand(1);
 
-    MOZ_ASSERT(ins->type() == MIRType_Value);
-    MOZ_ASSERT(ins->type() == MIRType_Value);
+    MOZ_ASSERT(ins->type() == MIRType::Value);
+    MOZ_ASSERT(ins->type() == MIRType::Value);
 
     LBinarySharedStub* lir = new(alloc()) LBinarySharedStub(useBoxFixedAtStart(lhs, R0),
                                                             useBoxFixedAtStart(rhs, R1));
     defineSharedStubReturn(lir, ins);
     assignSafepoint(lir, ins);
 }
 
 void
 LIRGenerator::visitUnarySharedStub(MUnarySharedStub* ins)
 {
     MDefinition* input = ins->getOperand(0);
-    MOZ_ASSERT(ins->type() == MIRType_Value);
+    MOZ_ASSERT(ins->type() == MIRType::Value);
 
     LUnarySharedStub* lir = new(alloc()) LUnarySharedStub(useBoxFixedAtStart(input, R0));
     defineSharedStubReturn(lir, ins);
     assignSafepoint(lir, ins);
 }
 
 void
 LIRGenerator::visitNullarySharedStub(MNullarySharedStub* ins)
 {
-    MOZ_ASSERT(ins->type() == MIRType_Value);
+    MOZ_ASSERT(ins->type() == MIRType::Value);
 
     LNullarySharedStub* lir = new(alloc()) LNullarySharedStub();
 
     defineSharedStubReturn(lir, ins);
     assignSafepoint(lir, ins);
 }
 
 void
@@ -2394,30 +2394,30 @@ LIRGenerator::visitLambda(MLambda* ins)
         define(lir, ins);
         assignSafepoint(lir, ins);
     }
 }
 
 void
 LIRGenerator::visitLambdaArrow(MLambdaArrow* ins)
 {
-    MOZ_ASSERT(ins->scopeChain()->type() == MIRType_Object);
-    MOZ_ASSERT(ins->newTargetDef()->type() == MIRType_Value);
+    MOZ_ASSERT(ins->scopeChain()->type() == MIRType::Object);
+    MOZ_ASSERT(ins->newTargetDef()->type() == MIRType::Value);
 
     LLambdaArrow* lir = new(alloc()) LLambdaArrow(useRegister(ins->scopeChain()),
                                                   useBox(ins->newTargetDef()));
     define(lir, ins);
     assignSafepoint(lir, ins);
 }
 
 void
 LIRGenerator::visitKeepAliveObject(MKeepAliveObject* ins)
 {
     MDefinition* obj = ins->object();
-    MOZ_ASSERT(obj->type() == MIRType_Object);
+    MOZ_ASSERT(obj->type() == MIRType::Object);
 
     add(new(alloc()) LKeepAliveObject(useKeepalive(obj)), ins);
 }
 
 void
 LIRGenerator::visitSlots(MSlots* ins)
 {
     define(new(alloc()) LSlots(useRegisterAtStart(ins->object())), ins);
@@ -2443,18 +2443,18 @@ LIRGenerator::visitConvertElementsToDoub
     LInstruction* check = new(alloc()) LConvertElementsToDoubles(useRegister(ins->elements()));
     add(check, ins);
     assignSafepoint(check, ins);
 }
 
 void
 LIRGenerator::visitMaybeToDoubleElement(MMaybeToDoubleElement* ins)
 {
-    MOZ_ASSERT(ins->elements()->type() == MIRType_Elements);
-    MOZ_ASSERT(ins->value()->type() == MIRType_Int32);
+    MOZ_ASSERT(ins->elements()->type() == MIRType::Elements);
+    MOZ_ASSERT(ins->value()->type() == MIRType::Int32);
 
     LMaybeToDoubleElement* lir = new(alloc()) LMaybeToDoubleElement(useRegisterAtStart(ins->elements()),
                                                                     useRegisterAtStart(ins->value()),
                                                                     tempDouble());
     defineBox(lir, ins);
 }
 
 void
@@ -2464,22 +2464,22 @@ LIRGenerator::visitMaybeCopyElementsForW
     add(check, ins);
     assignSafepoint(check, ins);
 }
 
 void
 LIRGenerator::visitLoadSlot(MLoadSlot* ins)
 {
     switch (ins->type()) {
-      case MIRType_Value:
+      case MIRType::Value:
         defineBox(new(alloc()) LLoadSlotV(useRegisterAtStart(ins->slots())), ins);
         break;
 
-      case MIRType_Undefined:
-      case MIRType_Null:
+      case MIRType::Undefined:
+      case MIRType::Null:
         MOZ_CRASH("typed load must have a payload");
 
       default:
         define(new(alloc()) LLoadSlotT(useRegisterForTypedLoad(ins->slots(), ins->type())), ins);
         break;
     }
 }
 
@@ -2508,40 +2508,40 @@ void
 LIRGenerator::visitAsmThrowUnreachable(MAsmThrowUnreachable* ins)
 {
     add(new(alloc()) LAsmThrowUnreachable, ins);
 }
 
 void
 LIRGenerator::visitAsmReinterpret(MAsmReinterpret* ins)
 {
-    if (ins->type() == MIRType_Int64)
+    if (ins->type() == MIRType::Int64)
         defineInt64(new(alloc()) LAsmReinterpretToI64(useRegisterAtStart(ins->input())), ins);
-    else if (ins->input()->type() == MIRType_Int64)
+    else if (ins->input()->type() == MIRType::Int64)
         define(new(alloc()) LAsmReinterpretFromI64(useInt64RegisterAtStart(ins->input())), ins);
     else
         define(new(alloc()) LAsmReinterpret(useRegisterAtStart(ins->input())), ins);
 }
 
 void
 LIRGenerator::visitStoreSlot(MStoreSlot* ins)
 {
     LInstruction* lir;
 
     switch (ins->value()->type()) {
-      case MIRType_Value:
+      case MIRType::Value:
         lir = new(alloc()) LStoreSlotV(useRegister(ins->slots()), useBox(ins->value()));
         add(lir, ins);
         break;
 
-      case MIRType_Double:
+      case MIRType::Double:
         add(new(alloc()) LStoreSlotT(useRegister(ins->slots()), useRegister(ins->value())), ins);
         break;
 
-      case MIRType_Float32:
+      case MIRType::Float32:
         MOZ_CRASH("Float32 shouldn't be stored in a slot.");
 
       default:
         add(new(alloc()) LStoreSlotT(useRegister(ins->slots()),
                                      useRegisterOrConstant(ins->value())), ins);
         break;
     }
 }
@@ -2557,46 +2557,44 @@ LIRGenerator::visitTypeBarrier(MTypeBarr
 {
     // Requesting a non-GC pointer is safe here since we never re-enter C++
     // from inside a type barrier test.
 
     const TemporaryTypeSet* types = ins->resultTypeSet();
     bool needTemp = !types->unknownObject() && types->getObjectCount() > 0;
 
     MIRType inputType = ins->getOperand(0)->type();
-    DebugOnly<MIRType> outputType = ins->type();
-
-    MOZ_ASSERT(inputType == outputType);
+    MOZ_ASSERT(inputType == ins->type());
 
     // Handle typebarrier that will always bail.
     // (Emit LBail for visibility).
     if (ins->alwaysBails()) {
         LBail* bail = new(alloc()) LBail();
         assignSnapshot(bail, Bailout_Inevitable);
         add(bail, ins);
         redefine(ins, ins->input());
         return;
     }
 
     // Handle typebarrier with Value as input.
-    if (inputType == MIRType_Value) {
+    if (inputType == MIRType::Value) {
         LDefinition tmp = needTemp ? temp() : tempToUnbox();
         LTypeBarrierV* barrier = new(alloc()) LTypeBarrierV(useBox(ins->input()), tmp);
         assignSnapshot(barrier, Bailout_TypeBarrierV);
         add(barrier, ins);
         redefine(ins, ins->input());
         return;
     }
 
     // The payload needs to be tested if it either might be null or might have
     // an object that should be excluded from the barrier.
     bool needsObjectBarrier = false;
-    if (inputType == MIRType_ObjectOrNull)
+    if (inputType == MIRType::ObjectOrNull)
         needsObjectBarrier = true;
-    if (inputType == MIRType_Object && !types->hasType(TypeSet::AnyObjectType()) &&
+    if (inputType == MIRType::Object && !types->hasType(TypeSet::AnyObjectType()) &&
         ins->barrierKind() != BarrierKind::TypeTagOnly)
     {
         needsObjectBarrier = true;
     }
 
     if (needsObjectBarrier) {
         LDefinition tmp = needTemp ? temp() : LDefinition::BogusTemp();
         LTypeBarrierO* barrier = new(alloc()) LTypeBarrierO(useRegister(ins->getOperand(0)), tmp);
@@ -2634,38 +2632,38 @@ IsNonNurseryConstant(MDefinition* def)
         return false;
     Value v = def->toConstant()->toJSValue();
     return !v.isMarkable() || !IsInsideNursery(v.toGCThing());
 }
 
 void
 LIRGenerator::visitPostWriteBarrier(MPostWriteBarrier* ins)
 {
-    MOZ_ASSERT(ins->object()->type() == MIRType_Object);
+    MOZ_ASSERT(ins->object()->type() == MIRType::Object);
 
     // LPostWriteBarrier assumes that if it has a constant object then that
     // object is tenured, and does not need to be tested for being in the
     // nursery. Ensure that assumption holds by lowering constant nursery
     // objects to a register.
     bool useConstantObject = IsNonNurseryConstant(ins->object());
 
     switch (ins->value()->type()) {
-      case MIRType_Object:
-      case MIRType_ObjectOrNull: {
+      case MIRType::Object:
+      case MIRType::ObjectOrNull: {
         LDefinition tmp = needTempForPostBarrier() ? temp() : LDefinition::BogusTemp();
         LPostWriteBarrierO* lir =
             new(alloc()) LPostWriteBarrierO(useConstantObject
                                             ? useOrConstant(ins->object())
                                             : useRegister(ins->object()),
                                             useRegister(ins->value()), tmp);
         add(lir, ins);
         assignSafepoint(lir, ins);
         break;
       }
-      case MIRType_Value: {
+      case MIRType::Value: {
         LDefinition tmp = needTempForPostBarrier() ? temp() : LDefinition::BogusTemp();
         LPostWriteBarrierV* lir =
             new(alloc()) LPostWriteBarrierV(useConstantObject
                                             ? useOrConstant(ins->object())
                                             : useRegister(ins->object()),
                                             useBox(ins->value()),
                                             tmp);
         add(lir, ins);
@@ -2677,43 +2675,43 @@ LIRGenerator::visitPostWriteBarrier(MPos
         // types cannot hold nursery pointers.
         break;
     }
 }
 
 void
 LIRGenerator::visitPostWriteElementBarrier(MPostWriteElementBarrier* ins)
 {
-    MOZ_ASSERT(ins->object()->type() == MIRType_Object);
-    MOZ_ASSERT(ins->index()->type() == MIRType_Int32);
+    MOZ_ASSERT(ins->object()->type() == MIRType::Object);
+    MOZ_ASSERT(ins->index()->type() == MIRType::Int32);
 
     // LPostWriteElementBarrier assumes that if it has a constant object then that
     // object is tenured, and does not need to be tested for being in the
     // nursery. Ensure that assumption holds by lowering constant nursery
     // objects to a register.
     bool useConstantObject =
         ins->object()->isConstant() &&
         !IsInsideNursery(&ins->object()->toConstant()->toObject());
 
     switch (ins->value()->type()) {
-      case MIRType_Object:
-      case MIRType_ObjectOrNull: {
+      case MIRType::Object:
+      case MIRType::ObjectOrNull: {
         LDefinition tmp = needTempForPostBarrier() ? temp() : LDefinition::BogusTemp();
         LPostWriteElementBarrierO* lir =
             new(alloc()) LPostWriteElementBarrierO(useConstantObject
                                                    ? useOrConstant(ins->object())
                                                    : useRegister(ins->object()),
                                                    useRegister(ins->value()),
                                                    useRegister(ins->index()),
                                                    tmp);
         add(lir, ins);
         assignSafepoint(lir, ins);
         break;
       }
-      case MIRType_Value: {
+      case MIRType::Value: {
         LDefinition tmp = needTempForPostBarrier() ? temp() : LDefinition::BogusTemp();
         LPostWriteElementBarrierV* lir =
             new(alloc()) LPostWriteElementBarrierV(useConstantObject
                                                    ? useOrConstant(ins->object())
                                                    : useRegister(ins->object()),
                                                    useRegister(ins->index()),
                                                    useBox(ins->value()),
                                                    tmp);
@@ -2726,113 +2724,113 @@ LIRGenerator::visitPostWriteElementBarri
         // types cannot hold nursery pointers.
         break;
     }
 }
 
 void
 LIRGenerator::visitArrayLength(MArrayLength* ins)
 {
-    MOZ_ASSERT(ins->elements()->type() == MIRType_Elements);
+    MOZ_ASSERT(ins->elements()->type() == MIRType::Elements);
     define(new(alloc()) LArrayLength(useRegisterAtStart(ins->elements())), ins);
 }
 
 void
 LIRGenerator::visitSetArrayLength(MSetArrayLength* ins)
 {
-    MOZ_ASSERT(ins->elements()->type() == MIRType_Elements);
-    MOZ_ASSERT(ins->index()->type() == MIRType_Int32);
+    MOZ_ASSERT(ins->elements()->type() == MIRType::Elements);
+    MOZ_ASSERT(ins->index()->type() == MIRType::Int32);
 
     MOZ_ASSERT(ins->index()->isConstant());
     add(new(alloc()) LSetArrayLength(useRegister(ins->elements()),
                                      useRegisterOrConstant(ins->index())), ins);
 }
 
 void
 LIRGenerator::visitGetNextMapEntryForIterator(MGetNextMapEntryForIterator* ins)
 {
-    MOZ_ASSERT(ins->iter()->type() == MIRType_Object);
-    MOZ_ASSERT(ins->result()->type() == MIRType_Object);
+    MOZ_ASSERT(ins->iter()->type() == MIRType::Object);
+    MOZ_ASSERT(ins->result()->type() == MIRType::Object);
     auto lir = new(alloc()) LGetNextMapEntryForIterator(useRegister(ins->iter()),
                                                         useRegister(ins->result()),
                                                         temp(), temp(), temp());
     define(lir, ins);
     assignSafepoint(lir, ins);
 }
 
 void
 LIRGenerator::visitTypedArrayLength(MTypedArrayLength* ins)
 {
-    MOZ_ASSERT(ins->object()->type() == MIRType_Object);
+    MOZ_ASSERT(ins->object()->type() == MIRType::Object);
     define(new(alloc()) LTypedArrayLength(useRegisterAtStart(ins->object())), ins);
 }
 
 void
 LIRGenerator::visitTypedArrayElements(MTypedArrayElements* ins)
 {
-    MOZ_ASSERT(ins->type() == MIRType_Elements);
+    MOZ_ASSERT(ins->type() == MIRType::Elements);
     define(new(alloc()) LTypedArrayElements(useRegisterAtStart(ins->object())), ins);
 }
 
 void
 LIRGenerator::visitSetDisjointTypedElements(MSetDisjointTypedElements* ins)
 {
-    MOZ_ASSERT(ins->type() == MIRType_None);
+    MOZ_ASSERT(ins->type() == MIRType::None);
 
     MDefinition* target = ins->target();
-    MOZ_ASSERT(target->type() == MIRType_Object);
+    MOZ_ASSERT(target->type() == MIRType::Object);
 
     MDefinition* targetOffset = ins->targetOffset();
-    MOZ_ASSERT(targetOffset->type() == MIRType_Int32);
+    MOZ_ASSERT(targetOffset->type() == MIRType::Int32);
 
     MDefinition* source = ins->source();
-    MOZ_ASSERT(source->type() == MIRType_Object);
+    MOZ_ASSERT(source->type() == MIRType::Object);
 
     auto lir = new(alloc()) LSetDisjointTypedElements(useRegister(target),
                                                       useRegister(targetOffset),
                                                       useRegister(source),
                                                       temp());
     add(lir, ins);
 }
 
 void
 LIRGenerator::visitTypedObjectDescr(MTypedObjectDescr* ins)
 {
-    MOZ_ASSERT(ins->type() == MIRType_Object);
+    MOZ_ASSERT(ins->type() == MIRType::Object);
     define(new(alloc()) LTypedObjectDescr(useRegisterAtStart(ins->object())), ins);
 }
 
 void
 LIRGenerator::visitTypedObjectElements(MTypedObjectElements* ins)
 {
-    MOZ_ASSERT(ins->type() == MIRType_Elements);
+    MOZ_ASSERT(ins->type() == MIRType::Elements);
     define(new(alloc()) LTypedObjectElements(useRegister(ins->object())), ins);
 }
 
 void
 LIRGenerator::visitSetTypedObjectOffset(MSetTypedObjectOffset* ins)
 {
     add(new(alloc()) LSetTypedObjectOffset(useRegister(ins->object()),
                                            useRegister(ins->offset()),
                                            temp(), temp()),
         ins);
 }
 
 void
 LIRGenerator::visitInitializedLength(MInitializedLength* ins)
 {
-    MOZ_ASSERT(ins->elements()->type() == MIRType_Elements);
+    MOZ_ASSERT(ins->elements()->type() == MIRType::Elements);
     define(new(alloc()) LInitializedLength(useRegisterAtStart(ins->elements())), ins);
 }
 
 void
 LIRGenerator::visitSetInitializedLength(MSetInitializedLength* ins)
 {
-    MOZ_ASSERT(ins->elements()->type() == MIRType_Elements);
-    MOZ_ASSERT(ins->index()->type() == MIRType_Int32);
+    MOZ_ASSERT(ins->elements()->type() == MIRType::Elements);
+    MOZ_ASSERT(ins->index()->type() == MIRType::Int32);
 
     MOZ_ASSERT(ins->index()->isConstant());
     add(new(alloc()) LSetInitializedLength(useRegister(ins->elements()),
                                            useRegisterOrConstant(ins->index())), ins);
 }
 
 void
 LIRGenerator::visitUnboxedArrayLength(MUnboxedArrayLength* ins)
@@ -2862,56 +2860,56 @@ LIRGenerator::visitSetUnboxedArrayInitia
 
 void
 LIRGenerator::visitNot(MNot* ins)
 {
     MDefinition* op = ins->input();
 
     // String is converted to length of string in the type analysis phase (see
     // TestPolicy).
-    MOZ_ASSERT(op->type() != MIRType_String);
+    MOZ_ASSERT(op->type() != MIRType::String);
 
     // - boolean: x xor 1
     // - int32: LCompare(x, 0)
     // - double: LCompare(x, 0)
     // - null or undefined: true
     // - object: false if it never emulates undefined, else LNotO(x)
     switch (op->type()) {
-      case MIRType_Boolean: {
+      case MIRType::Boolean: {
         MConstant* cons = MConstant::New(alloc(), Int32Value(1));
         ins->block()->insertBefore(ins, cons);
         lowerForALU(new(alloc()) LBitOpI(JSOP_BITXOR), ins, op, cons);
         break;
       }
-      case MIRType_Int32:
+      case MIRType::Int32:
         define(new(alloc()) LNotI(useRegisterAtStart(op)), ins);
         break;
-      case MIRType_Double:
+      case MIRType::Double:
         define(new(alloc()) LNotD(useRegister(op)), ins);
         break;
-      case MIRType_Float32:
+      case MIRType::Float32:
         define(new(alloc()) LNotF(useRegister(op)), ins);
         break;
-      case MIRType_Undefined:
-      case MIRType_Null:
+      case MIRType::Undefined:
+      case MIRType::Null:
         define(new(alloc()) LInteger(1), ins);
         break;
-      case MIRType_Symbol:
+      case MIRType::Symbol:
         define(new(alloc()) LInteger(0), ins);
         break;
-      case MIRType_Object:
+      case MIRType::Object:
         if (!ins->operandMightEmulateUndefined()) {
             // Objects that don't emulate undefined can be constant-folded.
             define(new(alloc()) LInteger(0), ins);
         } else {
             // All others require further work.
             define(new(alloc()) LNotO(useRegister(op)), ins);
         }
         break;
-      case MIRType_Value: {
+      case MIRType::Value: {
         LDefinition temp0, temp1;
         if (ins->operandMightEmulateUndefined()) {
             temp0 = temp();
             temp1 = temp();
         } else {
             temp0 = LDefinition::BogusTemp();
             temp1 = LDefinition::BogusTemp();
         }
@@ -2954,21 +2952,21 @@ LIRGenerator::visitBoundsCheckLower(MBou
     LInstruction* check = new(alloc()) LBoundsCheckLower(useRegister(ins->index()));
     assignSnapshot(check, Bailout_BoundsCheck);
     add(check, ins);
 }
 
 void
 LIRGenerator::visitInArray(MInArray* ins)
 {
-    MOZ_ASSERT(ins->elements()->type() == MIRType_Elements);
-    MOZ_ASSERT(ins->index()->type() == MIRType_Int32);
-    MOZ_ASSERT(ins->initLength()->type() == MIRType_Int32);
-    MOZ_ASSERT(ins->object()->type() == MIRType_Object);
-    MOZ_ASSERT(ins->type() == MIRType_Boolean);
+    MOZ_ASSERT(ins->elements()->type() == MIRType::Elements);
+    MOZ_ASSERT(ins->index()->type() == MIRType::Int32);
+    MOZ_ASSERT(ins->initLength()->type() == MIRType::Int32);
+    MOZ_ASSERT(ins->object()->type() == MIRType::Object);
+    MOZ_ASSERT(ins->type() == MIRType::Boolean);
 
     LAllocation object;
     if (ins->needsNegativeIntCheck())
         object = useRegister(ins->object());
 
     LInArray* lir = new(alloc()) LInArray(useRegister(ins->elements()),
                                           useRegisterOrConstant(ins->index()),
                                           useRegister(ins->initLength()),
@@ -2976,30 +2974,30 @@ LIRGenerator::visitInArray(MInArray* ins
     define(lir, ins);
     assignSafepoint(lir, ins);
 }
 
 void
 LIRGenerator::visitLoadElement(MLoadElement* ins)
 {
     MOZ_ASSERT(IsValidElementsType(ins->elements(), ins->offsetAdjustment()));
-    MOZ_ASSERT(ins->index()->type() == MIRType_Int32);
+    MOZ_ASSERT(ins->index()->type() == MIRType::Int32);
 
     switch (ins->type()) {
-      case MIRType_Value:
+      case MIRType::Value:
       {
         LLoadElementV* lir = new(alloc()) LLoadElementV(useRegister(ins->elements()),
                                                         useRegisterOrConstant(ins->index()));
         if (ins->fallible())
             assignSnapshot(lir, Bailout_Hole);
         defineBox(lir, ins);
         break;
       }
-      case MIRType_Undefined:
-      case MIRType_Null:
+      case MIRType::Undefined:
+      case MIRType::Null:
         MOZ_CRASH("typed load must have a payload");
 
       default:
       {
         LLoadElementT* lir = new(alloc()) LLoadElementT(useRegister(ins->elements()),
                                                         useRegisterOrConstant(ins->index()));
         if (ins->fallible())
             assignSnapshot(lir, Bailout_Hole);
@@ -3007,74 +3005,74 @@ LIRGenerator::visitLoadElement(MLoadElem
         break;
       }
     }
 }
 
 void
 LIRGenerator::visitLoadElementHole(MLoadElementHole* ins)
 {
-    MOZ_ASSERT(ins->elements()->type() == MIRType_Elements);
-    MOZ_ASSERT(ins->index()->type() == MIRType_Int32);
-    MOZ_ASSERT(ins->initLength()->type() == MIRType_Int32);
-    MOZ_ASSERT(ins->type() == MIRType_Value);
+    MOZ_ASSERT(ins->elements()->type() == MIRType::Elements);
+    MOZ_ASSERT(ins->index()->type() == MIRType::Int32);
+    MOZ_ASSERT(ins->initLength()->type() == MIRType::Int32);
+    MOZ_ASSERT(ins->type() == MIRType::Value);
 
     LLoadElementHole* lir = new(alloc()) LLoadElementHole(useRegister(ins->elements()),
                                                           useRegisterOrConstant(ins->index()),
                                                           useRegister(ins->initLength()));
     if (ins->needsNegativeIntCheck())
         assignSnapshot(lir, Bailout_NegativeIndex);
     defineBox(lir, ins);
 }
 
 void
 LIRGenerator::visitLoadUnboxedObjectOrNull(MLoadUnboxedObjectOrNull* ins)
 {
     MOZ_ASSERT(IsValidElementsType(ins->elements(), ins->offsetAdjustment()));
-    MOZ_ASSERT(ins->index()->type() == MIRType_Int32);
-
-    if (ins->type() == MIRType_Object || ins->type() == MIRType_ObjectOrNull) {
+    MOZ_ASSERT(ins->index()->type() == MIRType::Int32);
+
+    if (ins->type() == MIRType::Object || ins->type() == MIRType::ObjectOrNull) {
         LLoadUnboxedPointerT* lir = new(alloc()) LLoadUnboxedPointerT(useRegister(ins->elements()),
                                                                       useRegisterOrConstant(ins->index()));
         if (ins->nullBehavior() == MLoadUnboxedObjectOrNull::BailOnNull)
             assignSnapshot(lir, Bailout_TypeBarrierO);
         define(lir, ins);
     } else {
-        MOZ_ASSERT(ins->type() == MIRType_Value);
+        MOZ_ASSERT(ins->type() == MIRType::Value);
         MOZ_ASSERT(ins->nullBehavior() != MLoadUnboxedObjectOrNull::BailOnNull);
 
         LLoadUnboxedPointerV* lir = new(alloc()) LLoadUnboxedPointerV(useRegister(ins->elements()),
                                                                       useRegisterOrConstant(ins->index()));
         defineBox(lir, ins);
     }
 }
 
 void
 LIRGenerator::visitLoadUnboxedString(MLoadUnboxedString* ins)
 {
     MOZ_ASSERT(IsValidElementsType(ins->elements(), ins->offsetAdjustment()));
-    MOZ_ASSERT(ins->index()->type() == MIRType_Int32);
-    MOZ_ASSERT(ins->type() == MIRType_String);
+    MOZ_ASSERT(ins->index()->type() == MIRType::Int32);
+    MOZ_ASSERT(ins->type() == MIRType::String);
 
     LLoadUnboxedPointerT* lir = new(alloc()) LLoadUnboxedPointerT(useRegister(ins->elements()),
                                                                   useRegisterOrConstant(ins->index()));
     define(lir, ins);
 }
 
 void
 LIRGenerator::visitStoreElement(MStoreElement* ins)
 {
     MOZ_ASSERT(IsValidElementsType(ins->elements(), ins->offsetAdjustment()));
-    MOZ_ASSERT(ins->index()->type() == MIRType_Int32);
+    MOZ_ASSERT(ins->index()->type() == MIRType::Int32);
 
     const LUse elements = useRegister(ins->elements());
     const LAllocation index = useRegisterOrConstant(ins->index());
 
     switch (ins->value()->type()) {
-      case MIRType_Value:
+      case MIRType::Value:
       {
         LInstruction* lir = new(alloc()) LStoreElementV(elements, index, useBox(ins->value()));
         if (ins->fallible())
             assignSnapshot(lir, Bailout_Hole);
         add(lir, ins);
         break;
       }
 
@@ -3088,31 +3086,31 @@ LIRGenerator::visitStoreElement(MStoreEl
         break;
       }
     }
 }
 
 void
 LIRGenerator::visitStoreElementHole(MStoreElementHole* ins)
 {
-    MOZ_ASSERT(ins->elements()->type() == MIRType_Elements);
-    MOZ_ASSERT(ins->index()->type() == MIRType_Int32);
+    MOZ_ASSERT(ins->elements()->type() == MIRType::Elements);
+    MOZ_ASSERT(ins->index()->type() == MIRType::Int32);
 
     const LUse object = useRegister(ins->object());
     const LUse elements = useRegister(ins->elements());
     const LAllocation index = useRegisterOrConstant(ins->index());
 
     // Use a temp register when adding new elements to unboxed arrays.
     LDefinition tempDef = LDefinition::BogusTemp();
     if (ins->unboxedType() != JSVAL_TYPE_MAGIC)
         tempDef = temp();
 
     LInstruction* lir;
     switch (ins->value()->type()) {
-      case MIRType_Value:
+      case MIRType::Value:
         lir = new(alloc()) LStoreElementHoleV(object, elements, index, useBox(ins->value()),
                                               tempDef);
         break;
 
       default:
       {
         const LAllocation value = useRegisterOrNonDoubleConstant(ins->value());
         lir = new(alloc()) LStoreElementHoleT(object, elements, index, value, tempDef);
@@ -3123,35 +3121,35 @@ LIRGenerator::visitStoreElementHole(MSto
     add(lir, ins);
     assignSafepoint(lir, ins);
 }
 
 void
 LIRGenerator::visitStoreUnboxedObjectOrNull(MStoreUnboxedObjectOrNull* ins)
 {
     MOZ_ASSERT(IsValidElementsType(ins->elements(), ins->offsetAdjustment()));
-    MOZ_ASSERT(ins->index()->type() == MIRType_Int32);
-    MOZ_ASSERT(ins->value()->type() == MIRType_Object ||
-               ins->value()->type() == MIRType_Null ||
-               ins->value()->type() == MIRType_ObjectOrNull);
+    MOZ_ASSERT(ins->index()->type() == MIRType::Int32);
+    MOZ_ASSERT(ins->value()->type() == MIRType::Object ||
+               ins->value()->type() == MIRType::Null ||
+               ins->value()->type() == MIRType::ObjectOrNull);
 
     const LUse elements = useRegister(ins->elements());
     const LAllocation index = useRegisterOrNonDoubleConstant(ins->index());
     const LAllocation value = useRegisterOrNonDoubleConstant(ins->value());
 
     LInstruction* lir = new(alloc()) LStoreUnboxedPointer(elements, index, value);
     add(lir, ins);
 }
 
 void
 LIRGenerator::visitStoreUnboxedString(MStoreUnboxedString* ins)
 {
     MOZ_ASSERT(IsValidElementsType(ins->elements(), ins->offsetAdjustment()));
-    MOZ_ASSERT(ins->index()->type() == MIRType_Int32);
-    MOZ_ASSERT(ins->value()->type() == MIRType_String);
+    MOZ_ASSERT(ins->index()->type() == MIRType::Int32);
+    MOZ_ASSERT(ins->value()->type() == MIRType::String);
 
     const LUse elements = useRegister(ins->elements());
     const LAllocation index = useRegisterOrConstant(ins->index());
     const LAllocation value = useRegisterOrNonDoubleConstant(ins->value());
 
     LInstruction* lir = new(alloc()) LStoreUnboxedPointer(elements, index, value);
     add(lir, ins);
 }
@@ -3171,46 +3169,46 @@ LIRGenerator::visitEffectiveAddress(MEff
 }
 
 void
 LIRGenerator::visitArrayPopShift(MArrayPopShift* ins)
 {
     LUse object = useRegister(ins->object());
 
     switch (ins->type()) {
-      case MIRType_Value:
+      case MIRType::Value:
       {
         LArrayPopShiftV* lir = new(alloc()) LArrayPopShiftV(object, temp(), temp());
         defineBox(lir, ins);
         assignSafepoint(lir, ins);
         break;
       }
-      case MIRType_Undefined:
-      case MIRType_Null:
+      case MIRType::Undefined:
+      case MIRType::Null:
         MOZ_CRASH("typed load must have a payload");
 
       default:
       {
         LArrayPopShiftT* lir = new(alloc()) LArrayPopShiftT(object, temp(), temp());
         define(lir, ins);
         assignSafepoint(lir, ins);
         break;
       }
     }
 }
 
 void
 LIRGenerator::visitArrayPush(MArrayPush* ins)
 {
-    MOZ_ASSERT(ins->type() == MIRType_Int32);
+    MOZ_ASSERT(ins->type() == MIRType::Int32);
 
     LUse object = useRegister(ins->object());
 
     switch (ins->value()->type()) {
-      case MIRType_Value:
+      case MIRType::Value:
       {
         LArrayPushV* lir = new(alloc()) LArrayPushV(object, useBox(ins->value()), temp());
         define(lir, ins);
         assignSafepoint(lir, ins);
         break;
       }
 
       default:
@@ -3222,81 +3220,81 @@ LIRGenerator::visitArrayPush(MArrayPush*
         break;
       }
     }
 }
 
 void
 LIRGenerator::visitArraySlice(MArraySlice* ins)
 {
-    MOZ_ASSERT(ins->type() == MIRType_Object);
-    MOZ_ASSERT(ins->object()->type() == MIRType_Object);
-    MOZ_ASSERT(ins->begin()->type() == MIRType_Int32);
-    MOZ_ASSERT(ins->end()->type() == MIRType_Int32);
+    MOZ_ASSERT(ins->type() == MIRType::Object);
+    MOZ_ASSERT(ins->object()->type() == MIRType::Object);
+    MOZ_ASSERT(ins->begin()->type() == MIRType::Int32);
+    MOZ_ASSERT(ins->end()->type() == MIRType::Int32);
 
     LArraySlice* lir = new(alloc()) LArraySlice(useFixed(ins->object(), CallTempReg0),
                                                 useFixed(ins->begin(), CallTempReg1),
                                                 useFixed(ins->end(), CallTempReg2),
                                                 tempFixed(CallTempReg3),
                                                 tempFixed(CallTempReg4));
     defineReturn(lir, ins);
     assignSafepoint(lir, ins);
 }
 
 void
 LIRGenerator::visitArrayJoin(MArrayJoin* ins)
 {
-    MOZ_ASSERT(ins->type() == MIRType_String);
-    MOZ_ASSERT(ins->array()->type() == MIRType_Object);
-    MOZ_ASSERT(ins->sep()->type() == MIRType_String);
+    MOZ_ASSERT(ins->type() == MIRType::String);
+    MOZ_ASSERT(ins->array()->type() == MIRType::Object);
+    MOZ_ASSERT(ins->sep()->type() == MIRType::String);
 
     LArrayJoin* lir = new(alloc()) LArrayJoin(useRegisterAtStart(ins->array()),
                                               useRegisterAtStart(ins->sep()));
     defineReturn(lir, ins);
     assignSafepoint(lir, ins);
 }
 
 void
 LIRGenerator::visitSinCos(MSinCos *ins)
 {
-    MOZ_ASSERT(ins->type() == MIRType_SinCosDouble);
-    MOZ_ASSERT(ins->input()->type() == MIRType_Double  ||
-               ins->input()->type() == MIRType_Float32 ||
-               ins->input()->type() == MIRType_Int32);
+    MOZ_ASSERT(ins->type() == MIRType::SinCosDouble);
+    MOZ_ASSERT(ins->input()->type() == MIRType::Double  ||
+               ins->input()->type() == MIRType::Float32 ||
+               ins->input()->type() == MIRType::Int32);
 
     LSinCos *lir = new (alloc()) LSinCos(useRegisterAtStart(ins->input()),
                                          tempFixed(CallTempReg0),
                                          temp());
     defineSinCos(lir, ins);
 }
 
 void
 LIRGenerator::visitStringSplit(MStringSplit* ins)
 {
-    MOZ_ASSERT(ins->type() == MIRType_Object);
-    MOZ_ASSERT(ins->string()->type() == MIRType_String);
-    MOZ_ASSERT(ins->separator()->type() == MIRType_String);
+    MOZ_ASSERT(ins->type() == MIRType::Object);
+    MOZ_ASSERT(ins->string()->type() == MIRType::String);
+    MOZ_ASSERT(ins->separator()->type() == MIRType::String);
 
     LStringSplit* lir = new(alloc()) LStringSplit(useRegisterAtStart(ins->string()),
                                                   useRegisterAtStart(ins->separator()));
     defineReturn(lir, ins);
     assignSafepoint(lir, ins);
 }
 
 void
 LIRGenerator::visitLoadUnboxedScalar(MLoadUnboxedScalar* ins)
 {
     MOZ_ASSERT(IsValidElementsType(ins->elements(), ins->offsetAdjustment()));
-    MOZ_ASSERT(ins->index()->type() == MIRType_Int32);
+    MOZ_ASSERT(ins->index()->type() == MIRType::Int32);
 
     const LUse elements = useRegister(ins->elements());
     const LAllocation index = useRegisterOrConstant(ins->index());
 
     MOZ_ASSERT(IsNumberType(ins->type()) || IsSimdType(ins->type()) ||
-               ins->type() == MIRType_Boolean);
+               ins->type() == MIRType::Boolean);
 
     // We need a temp register for Uint32Array with known double result.
     LDefinition tempDef = LDefinition::BogusTemp();
     if (ins->readType() == Scalar::Uint32 && IsFloatingPointType(ins->type()))
         tempDef = temp();
 
     if (ins->requiresMemoryBarrier()) {
         LMemoryBarrier* fence = new(alloc()) LMemoryBarrier(MembarBeforeLoad);
@@ -3313,51 +3311,51 @@ LIRGenerator::visitLoadUnboxedScalar(MLo
 }
 
 void
 LIRGenerator::visitClampToUint8(MClampToUint8* ins)
 {
     MDefinition* in = ins->input();
 
     switch (in->type()) {
-      case MIRType_Boolean:
+      case MIRType::Boolean:
         redefine(ins, in);
         break;
 
-      case MIRType_Int32:
+      case MIRType::Int32:
         defineReuseInput(new(alloc()) LClampIToUint8(useRegisterAtStart(in)), ins, 0);
         break;
 
-      case MIRType_Double:
+      case MIRType::Double:
         // LClampDToUint8 clobbers its input register. Making it available as
         // a temp copy describes this behavior to the register allocator.
         define(new(alloc()) LClampDToUint8(useRegisterAtStart(in), tempCopy(in, 0)), ins);
         break;
 
-      case MIRType_Value:
+      case MIRType::Value:
       {
         LClampVToUint8* lir = new(alloc()) LClampVToUint8(useBox(in), tempDouble());
         assignSnapshot(lir, Bailout_NonPrimitiveInput);
         define(lir, ins);
         assignSafepoint(lir, ins);
         break;
       }
 
       default:
         MOZ_CRASH("unexpected type");
     }
 }
 
 void
 LIRGenerator::visitLoadTypedArrayElementHole(MLoadTypedArrayElementHole* ins)
 {
-    MOZ_ASSERT(ins->object()->type() == MIRType_Object);
-    MOZ_ASSERT(ins->index()->type() == MIRType_Int32);
-
-    MOZ_ASSERT(ins->type() == MIRType_Value);
+    MOZ_ASSERT(ins->object()->type() == MIRType::Object);
+    MOZ_ASSERT(ins->index()->type() == MIRType::Int32);
+
+    MOZ_ASSERT(ins->type() == MIRType::Value);
 
     const LUse object = useRegister(ins->object());
     const LAllocation index = useRegisterOrConstant(ins->index());
 
     LLoadTypedArrayElementHole* lir = new(alloc()) LLoadTypedArrayElementHole(object, index);
     if (ins->fallible())
         assignSnapshot(lir, Bailout_Overflow);
     defineBox(lir, ins);
@@ -3375,26 +3373,26 @@ LIRGenerator::visitLoadTypedArrayElement
         assignSnapshot(lir, Bailout_BoundsCheck);
     define(lir, ins);
 }
 
 void
 LIRGenerator::visitStoreUnboxedScalar(MStoreUnboxedScalar* ins)
 {
     MOZ_ASSERT(IsValidElementsType(ins->elements(), ins->offsetAdjustment()));
-    MOZ_ASSERT(ins->index()->type() == MIRType_Int32);
+    MOZ_ASSERT(ins->index()->type() == MIRType::Int32);
 
     if (ins->isSimdWrite()) {
-        MOZ_ASSERT_IF(ins->writeType() == Scalar::Float32x4, ins->value()->type() == MIRType_Float32x4);
-        MOZ_ASSERT_IF(ins->writeType() == Scalar::Int32x4, ins->value()->type() == MIRType_Int32x4);
+        MOZ_ASSERT_IF(ins->writeType() == Scalar::Float32x4, ins->value()->type() == MIRType::Float32x4);
+        MOZ_ASSERT_IF(ins->writeType() == Scalar::Int32x4, ins->value()->type() == MIRType::Int32x4);
     } else if (ins->isFloatWrite()) {
-        MOZ_ASSERT_IF(ins->writeType() == Scalar::Float32, ins->value()->type() == MIRType_Float32);
-        MOZ_ASSERT_IF(ins->writeType() == Scalar::Float64, ins->value()->type() == MIRType_Double);
+        MOZ_ASSERT_IF(ins->writeType() == Scalar::Float32, ins->value()->type() == MIRType::Float32);
+        MOZ_ASSERT_IF(ins->writeType() == Scalar::Float64, ins->value()->type() == MIRType::Double);
     } else {
-        MOZ_ASSERT(ins->value()->type() == MIRType_Int32);
+        MOZ_ASSERT(ins->value()->type() == MIRType::Int32);
     }
 
     LUse elements = useRegister(ins->elements());
     LAllocation index = useRegisterOrConstant(ins->index());
     LAllocation value;
 
     // For byte arrays, the value has to be in a byte register on x86.
     if (ins->isByteWrite())
@@ -3415,25 +3413,25 @@ LIRGenerator::visitStoreUnboxedScalar(MS
         LMemoryBarrier* fence = new(alloc()) LMemoryBarrier(MembarAfterStore);
         add(fence, ins);
     }
 }
 
 void
 LIRGenerator::visitStoreTypedArrayElementHole(MStoreTypedArrayElementHole* ins)
 {
-    MOZ_ASSERT(ins->elements()->type() == MIRType_Elements);
-    MOZ_ASSERT(ins->index()->type() == MIRType_Int32);
-    MOZ_ASSERT(ins->length()->type() == MIRType_Int32);
+    MOZ_ASSERT(ins->elements()->type() == MIRType::Elements);
+    MOZ_ASSERT(ins->index()->type() == MIRType::Int32);
+    MOZ_ASSERT(ins->length()->type() == MIRType::Int32);
 
     if (ins->isFloatWrite()) {
-        MOZ_ASSERT_IF(ins->arrayType() == Scalar::Float32, ins->value()->type() == MIRType_Float32);
-        MOZ_ASSERT_IF(ins->arrayType() == Scalar::Float64, ins->value()->type() == MIRType_Double);
+        MOZ_ASSERT_IF(ins->arrayType() == Scalar::Float32, ins->value()->type() == MIRType::Float32);
+        MOZ_ASSERT_IF(ins->arrayType() == Scalar::Float64, ins->value()->type() == MIRType::Double);
     } else {
-        MOZ_ASSERT(ins->value()->type() == MIRType_Int32);
+        MOZ_ASSERT(ins->value()->type() == MIRType::Int32);
     }
 
     LUse elements = useRegister(ins->elements());
     LAllocation length = useAnyOrConstant(ins->length());
     LAllocation index = useRegisterOrConstant(ins->index());
     LAllocation value;
 
     // For byte arrays, the value has to be in a byte register on x86.
@@ -3443,62 +3441,62 @@ LIRGenerator::visitStoreTypedArrayElemen
         value = useRegisterOrNonDoubleConstant(ins->value());
     add(new(alloc()) LStoreTypedArrayElementHole(elements, length, index, value), ins);
 }
 
 void
 LIRGenerator::visitLoadFixedSlot(MLoadFixedSlot* ins)
 {
     MDefinition* obj = ins->object();
-    MOZ_ASSERT(obj->type() == MIRType_Object);
+    MOZ_ASSERT(obj->type() == MIRType::Object);
 
     MIRType type = ins->type();
 
-    if (type == MIRType_Value) {
+    if (type == MIRType::Value) {
         LLoadFixedSlotV* lir = new(alloc()) LLoadFixedSlotV(useRegisterAtStart(obj));
         defineBox(lir, ins);
     } else {
         LLoadFixedSlotT* lir = new(alloc()) LLoadFixedSlotT(useRegisterForTypedLoad(obj, type));
         define(lir, ins);
     }
 }
 
 void
 LIRGenerator::visitLoadFixedSlotAndUnbox(MLoadFixedSlotAndUnbox* ins)
 {
     MDefinition* obj = ins->object();
-    MOZ_ASSERT(obj->type() == MIRType_Object);
+    MOZ_ASSERT(obj->type() == MIRType::Object);
 
     LLoadFixedSlotAndUnbox* lir = new(alloc()) LLoadFixedSlotAndUnbox(useRegisterAtStart(obj));
     if (ins->fallible())
         assignSnapshot(lir, ins->bailoutKind());
 
     define(lir, ins);
 }
 
 void
 LIRGenerator::visitStoreFixedSlot(MStoreFixedSlot* ins)
 {
-    MOZ_ASSERT(ins->object()->type() == MIRType_Object);
-
-    if (ins->value()->type() == MIRType_Value) {
+    MOZ_ASSERT(ins->object()->type() == MIRType::Object);
+
+    if (ins->value()->type() == MIRType::Value) {
         LStoreFixedSlotV* lir = new(alloc()) LStoreFixedSlotV(useRegister(ins->object()),
                                                               useBox(ins->value()));
         add(lir, ins);
     } else {
         LStoreFixedSlotT* lir = new(alloc()) LStoreFixedSlotT(useRegister(ins->object()),
                                                               useRegisterOrConstant(ins->value()));
         add(lir, ins);
     }
 }
 
 void
 LIRGenerator::visitGetNameCache(MGetNameCache* ins)
 {
-    MOZ_ASSERT(ins->scopeObj()->type() == MIRType_Object);
+    MOZ_ASSERT(ins->scopeObj()->type() == MIRType::Object);
 
     // Set the performs-call flag so that we don't omit the overrecursed check.
     // This is necessary because the cache can attach a scripted getter stub
     // that calls this script recursively.
     gen->setPerformsCall();
 
     LGetNameCache* lir = new(alloc()) LGetNameCache(useRegister(ins->scopeObj()));
     defineBox(lir, ins);
@@ -3511,36 +3509,36 @@ LIRGenerator::visitCallGetIntrinsicValue
     LCallGetIntrinsicValue* lir = new(alloc()) LCallGetIntrinsicValue();
     defineReturn(lir, ins);
     assignSafepoint(lir, ins);
 }
 
 void
 LIRGenerator::visitGetPropertyCache(MGetPropertyCache* ins)
 {
-    MOZ_ASSERT(ins->object()->type() == MIRType_Object);
+    MOZ_ASSERT(ins->object()->type() == MIRType::Object);
 
     MDefinition* id = ins->idval();
-    MOZ_ASSERT(id->type() == MIRType_String ||
-               id->type() == MIRType_Symbol ||
-               id->type() == MIRType_Int32 ||
-               id->type() == MIRType_Value);
+    MOZ_ASSERT(id->type() == MIRType::String ||
+               id->type() == MIRType::Symbol ||
+               id->type() == MIRType::Int32 ||
+               id->type() == MIRType::Value);
 
     if (ins->monitoredResult()) {
         // Set the performs-call flag so that we don't omit the overrecursed
         // check. This is necessary because the cache can attach a scripted
         // getter stub that calls this script recursively.
         gen->setPerformsCall();
     }
 
     // If this is a GETPROP, the id is a constant string. Allow passing it as a
     // constant to reduce register allocation pressure.
-    bool useConstId = id->type() == MIRType_String || id->type() == MIRType_Symbol;
-
-    if (ins->type() == MIRType_Value) {
+    bool useConstId = id->type() == MIRType::String || id->type() == MIRType::Symbol;
+
+    if (ins->type() == MIRType::Value) {
         LGetPropertyCacheV* lir =
             new(alloc()) LGetPropertyCacheV(useRegister(ins->object()),
                                             useBoxOrTypedOrConstant(id, useConstId));
         defineBox(lir, ins);
         assignSafepoint(lir, ins);
     } else {
         LGetPropertyCacheT* lir =
             new(alloc()) LGetPropertyCacheT(useRegister(ins->object()),
@@ -3548,38 +3546,38 @@ LIRGenerator::visitGetPropertyCache(MGet
         define(lir, ins);
         assignSafepoint(lir, ins);
     }
 }
 
 void
 LIRGenerator::visitGetPropertyPolymorphic(MGetPropertyPolymorphic* ins)
 {
-    MOZ_ASSERT(ins->obj()->type() == MIRType_Object);
-
-    if (ins->type() == MIRType_Value) {
+    MOZ_ASSERT(ins->obj()->type() == MIRType::Object);
+
+    if (ins->type() == MIRType::Value) {
         LGetPropertyPolymorphicV* lir =
             new(alloc()) LGetPropertyPolymorphicV(useRegister(ins->obj()));
         assignSnapshot(lir, Bailout_ShapeGuard);
         defineBox(lir, ins);
     } else {
-        LDefinition maybeTemp = (ins->type() == MIRType_Double) ? temp() : LDefinition::BogusTemp();
+        LDefinition maybeTemp = (ins->type() == MIRType::Double) ? temp() : LDefinition::BogusTemp();
         LGetPropertyPolymorphicT* lir =
             new(alloc()) LGetPropertyPolymorphicT(useRegister(ins->obj()), maybeTemp);
         assignSnapshot(lir, Bailout_ShapeGuard);
         define(lir, ins);
     }
 }
 
 void
 LIRGenerator::visitSetPropertyPolymorphic(MSetPropertyPolymorphic* ins)
 {
-    MOZ_ASSERT(ins->obj()->type() == MIRType_Object);
-
-    if (ins->value()->type() == MIRType_Value) {
+    MOZ_ASSERT(ins->obj()->type() == MIRType::Object);
+
+    if (ins->value()->type() == MIRType::Value) {
         LSetPropertyPolymorphicV* lir =
             new(alloc()) LSetPropertyPolymorphicV(useRegister(ins->obj()),
                                                   useBox(ins->value()),
                                                   temp());
         assignSnapshot(lir, Bailout_ShapeGuard);
         add(lir, ins);
     } else {
         LAllocation value = useRegisterOrConstant(ins->value());
@@ -3589,29 +3587,29 @@ LIRGenerator::visitSetPropertyPolymorphi
         assignSnapshot(lir, Bailout_ShapeGuard);
         add(lir, ins);
     }
 }
 
 void
 LIRGenerator::visitBindNameCache(MBindNameCache* ins)
 {
-    MOZ_ASSERT(ins->scopeChain()->type() == MIRType_Object);
-    MOZ_ASSERT(ins->type() == MIRType_Object);
+    MOZ_ASSERT(ins->scopeChain()->type() == MIRType::Object);
+    MOZ_ASSERT(ins->type() == MIRType::Object);
 
     LBindNameCache* lir = new(alloc()) LBindNameCache(useRegister(ins->scopeChain()));
     define(lir, ins);
     assignSafepoint(lir, ins);
 }
 
 void
 LIRGenerator::visitCallBindVar(MCallBindVar* ins)
 {
-    MOZ_ASSERT(ins->scopeChain()->type() == MIRType_Object);
-    MOZ_ASSERT(ins->type() == MIRType_Object);
+    MOZ_ASSERT(ins->scopeChain()->type() == MIRType::Object);
+    MOZ_ASSERT(ins->type() == MIRType::Object);
 
     LCallBindVar* lir = new(alloc()) LCallBindVar(useRegister(ins->scopeChain()));
     define(lir, ins);
 }
 
 void
 LIRGenerator::visitGuardObjectIdentity(MGuardObjectIdentity* ins)
 {
@@ -3631,51 +3629,51 @@ LIRGenerator::visitGuardClass(MGuardClas
     add(guard, ins);
 }
 
 void
 LIRGenerator::visitGuardObject(MGuardObject* ins)
 {
     // The type policy does all the work, so at this point the input
     // is guaranteed to be an object.
-    MOZ_ASSERT(ins->input()->type() == MIRType_Object);
+    MOZ_ASSERT(ins->input()->type() == MIRType::Object);
     redefine(ins, ins->input());
 }
 
 void
 LIRGenerator::visitGuardString(MGuardString* ins)
 {
     // The type policy does all the work, so at this point the input
     // is guaranteed to be a string.
-    MOZ_ASSERT(ins->input()->type() == MIRType_String);
+    MOZ_ASSERT(ins->input()->type() == MIRType::String);
     redefine(ins, ins->input());
 }
 
 void
 LIRGenerator::visitGuardSharedTypedArray(MGuardSharedTypedArray* ins)
 {
-    MOZ_ASSERT(ins->input()->type() == MIRType_Object);
+    MOZ_ASSERT(ins->input()->type() == MIRType::Object);
     LGuardSharedTypedArray* guard =
         new(alloc()) LGuardSharedTypedArray(useRegister(ins->obj()), temp());
     assignSnapshot(guard, Bailout_NonSharedTypedArrayInput);
     add(guard, ins);
 }
 
 void
 LIRGenerator::visitPolyInlineGuard(MPolyInlineGuard* ins)
 {
-    MOZ_ASSERT(ins->input()->type() == MIRType_Object);
+    MOZ_ASSERT(ins->input()->type() == MIRType::Object);
     redefine(ins, ins->input());
 }
 
 void
 LIRGenerator::visitGuardReceiverPolymorphic(MGuardReceiverPolymorphic* ins)
 {
-    MOZ_ASSERT(ins->obj()->type() == MIRType_Object);
-    MOZ_ASSERT(ins->type() == MIRType_Object);
+    MOZ_ASSERT(ins->obj()->type() == MIRType::Object);
+    MOZ_ASSERT(ins->type() == MIRType::Object);
 
     LGuardReceiverPolymorphic* guard =
         new(alloc()) LGuardReceiverPolymorphic(useRegister(ins->obj()), temp());
     assignSnapshot(guard, Bailout_ShapeGuard);
     add(guard, ins);
     redefine(ins, ins->obj());
 }
 
@@ -3699,31 +3697,31 @@ LIRGenerator::visitLoadUnboxedExpando(ML
 
 void
 LIRGenerator::visitAssertRange(MAssertRange* ins)
 {
     MDefinition* input = ins->input();
     LInstruction* lir = nullptr;
 
     switch (input->type()) {
-      case MIRType_Boolean:
-      case MIRType_Int32:
+      case MIRType::Boolean:
+      case MIRType::Int32:
         lir = new(alloc()) LAssertRangeI(useRegisterAtStart(input));
         break;
 
-      case MIRType_Double:
+      case MIRType::Double:
         lir = new(alloc()) LAssertRangeD(useRegister(input), tempDouble());
         break;
 
-      case MIRType_Float32: {
+      case MIRType::Float32: {
         LDefinition armtemp = hasMultiAlias() ? tempDouble() : LDefinition::BogusTemp();
         lir = new(alloc()) LAssertRangeF(useRegister(input), tempDouble(), armtemp);
         break;
       }
-      case MIRType_Value:
+      case MIRType::Value:
         lir = new(alloc()) LAssertRangeV(useBox(input), tempToUnbox(), tempDouble(), tempDouble());
         break;
 
       default:
         MOZ_CRASH("Unexpected Range for MIRType");
         break;
     }
 
@@ -3737,18 +3735,18 @@ LIRGenerator::visitCallGetProperty(MCall
     LCallGetProperty* lir = new(alloc()) LCallGetProperty(useBoxAtStart(ins->value()));
     defineReturn(lir, ins);
     assignSafepoint(lir, ins);
 }
 
 void
 LIRGenerator::visitCallGetElement(MCallGetElement* ins)
 {
-    MOZ_ASSERT(ins->lhs()->type() == MIRType_Value);
-    MOZ_ASSERT(ins->rhs()->type() == MIRType_Value);
+    MOZ_ASSERT(ins->lhs()->type() == MIRType::Value);
+    MOZ_ASSERT(ins->rhs()->type() == MIRType::Value);
 
     LCallGetElement* lir = new(alloc()) LCallGetElement(useBoxAtStart(ins->lhs()),
                                                         useBoxAtStart(ins->rhs()));
     defineReturn(lir, ins);
     assignSafepoint(lir, ins);
 }
 
 void
@@ -3775,42 +3773,42 @@ LIRGenerator::visitDeleteElement(MDelete
                                                               useBoxAtStart(ins->index()));
     defineReturn(lir, ins);
     assignSafepoint(lir, ins);
 }
 
 void
 LIRGenerator::visitSetPropertyCache(MSetPropertyCache* ins)
 {
-    MOZ_ASSERT(ins->object()->type() == MIRType_Object);
+    MOZ_ASSERT(ins->object()->type() == MIRType::Object);
 
     MDefinition* id = ins->idval();
-    MOZ_ASSERT(id->type() == MIRType_String ||
-               id->type() == MIRType_Symbol ||
-               id->type() == MIRType_Int32 ||
-               id->type() == MIRType_Value);
+    MOZ_ASSERT(id->type() == MIRType::String ||
+               id->type() == MIRType::Symbol ||
+               id->type() == MIRType::Int32 ||
+               id->type() == MIRType::Value);
 
     // If this is a SETPROP, the id is a constant string. Allow passing it as a
     // constant to reduce register allocation pressure.
-    bool useConstId = id->type() == MIRType_String || id->type() == MIRType_Symbol;
+    bool useConstId = id->type() == MIRType::String || id->type() == MIRType::Symbol;
     bool useConstValue = IsNonNurseryConstant(ins->value());
 
     // Set the performs-call flag so that we don't omit the overrecursed check.
     // This is necessary because the cache can attach a scripted setter stub
     // that calls this script recursively.
     gen->setPerformsCall();
 
     // If the index might be an integer, we need some extra temp registers for
     // the dense and typed array element stubs.
     LDefinition tempToUnboxIndex = LDefinition::BogusTemp();
     LDefinition tempD = LDefinition::BogusTemp();
     LDefinition tempF32 = LDefinition::BogusTemp();
 
-    if (id->mightBeType(MIRType_Int32)) {
-        if (id->type() != MIRType_Int32)
+    if (id->mightBeType(MIRType::Int32)) {
+        if (id->type() != MIRType::Int32)
             tempToUnboxIndex = tempToUnbox();
         tempD = tempDouble();
         tempF32 = hasUnaliasedDouble() ? tempFloat32() : LDefinition::BogusTemp();
     }
 
     LInstruction* lir =
         new(alloc()) LSetPropertyCache(useRegister(ins->object()),
                                        useBoxOrTypedOrConstant(id, useConstId),
@@ -3819,19 +3817,19 @@ LIRGenerator::visitSetPropertyCache(MSet
                                        tempToUnboxIndex, tempD, tempF32);
     add(lir, ins);
     assignSafepoint(lir, ins);
 }
 
 void
 LIRGenerator::visitCallSetElement(MCallSetElement* ins)
 {
-    MOZ_ASSERT(ins->object()->type() == MIRType_Object);
-    MOZ_ASSERT(ins->index()->type() == MIRType_Value);
-    MOZ_ASSERT(ins->value()->type() == MIRType_Value);
+    MOZ_ASSERT(ins->object()->type() == MIRType::Object);
+    MOZ_ASSERT(ins->index()->type() == MIRType::Value);
+    MOZ_ASSERT(ins->value()->type() == MIRType::Value);
 
     LCallSetElement* lir = new(alloc()) LCallSetElement(useRegisterAtStart(ins->object()),
                                                         useBoxAtStart(ins->index()),
                                                         useBoxAtStart(ins->value()));
     add(lir, ins);
     assignSafepoint(lir, ins);
 }
 
@@ -3880,17 +3878,17 @@ LIRGenerator::visitIteratorEnd(MIterator
     LIteratorEnd* lir = new(alloc()) LIteratorEnd(useRegister(ins->iterator()), temp(), temp(), temp());
     add(lir, ins);
     assignSafepoint(lir, ins);
 }
 
 void
 LIRGenerator::visitStringLength(MStringLength* ins)
 {
-    MOZ_ASSERT(ins->string()->type() == MIRType_String);
+    MOZ_ASSERT(ins->string()->type() == MIRType::String);
     define(new(alloc()) LStringLength(useRegisterAtStart(ins->string())), ins);
 }
 
 void
 LIRGenerator::visitArgumentsLength(MArgumentsLength* ins)
 {
     define(new(alloc()) LArgumentsLength(), ins);
 }
@@ -3909,21 +3907,21 @@ LIRGenerator::visitNewTarget(MNewTarget*
     defineBox(lir, ins);
 }
 
 void
 LIRGenerator::visitSetFrameArgument(MSetFrameArgument* ins)
 {
     MDefinition* input = ins->input();
 
-    if (input->type() == MIRType_Value) {
+    if (input->type() == MIRType::Value) {
         LSetFrameArgumentV* lir = new(alloc()) LSetFrameArgumentV(useBox(input));
         add(lir, ins);
-    } else if (input->type() == MIRType_Undefined || input->type() == MIRType_Null) {
-        Value val = input->type() == MIRType_Undefined ? UndefinedValue() : NullValue();
+    } else if (input->type() == MIRType::Undefined || input->type() == MIRType::Null) {
+        Value val = input->type() == MIRType::Undefined ? UndefinedValue() : NullValue();
         LSetFrameArgumentC* lir = new(alloc()) LSetFrameArgumentC(val);
         add(lir, ins);
     } else {
         LSetFrameArgumentT* lir = new(alloc()) LSetFrameArgumentT(useRegister(input));
         add(lir, ins);
     }
 }
 
@@ -3933,97 +3931,97 @@ LIRGenerator::visitRunOncePrologue(MRunO
     LRunOncePrologue* lir = new(alloc()) LRunOncePrologue;
     add(lir, ins);
     assignSafepoint(lir, ins);
 }
 
 void
 LIRGenerator::visitRest(MRest* ins)
 {
-    MOZ_ASSERT(ins->numActuals()->type() == MIRType_Int32);
+    MOZ_ASSERT(ins->numActuals()->type() == MIRType::Int32);
 
     LRest* lir = new(alloc()) LRest(useFixed(ins->numActuals(), CallTempReg0),
                                     tempFixed(CallTempReg1),
                                     tempFixed(CallTempReg2),
                                     tempFixed(CallTempReg3));
     defineReturn(lir, ins);
     assignSafepoint(lir, ins);
 }
 
 void
 LIRGenerator::visitThrow(MThrow* ins)
 {
     MDefinition* value = ins->getOperand(0);
-    MOZ_ASSERT(value->type() == MIRType_Value);
+    MOZ_ASSERT(value->type() == MIRType::Value);
 
     LThrow* lir = new(alloc()) LThrow(useBoxAtStart(value));
     add(lir, ins);
     assignSafepoint(lir, ins);
 }
 
 void
 LIRGenerator::visitIn(MIn* ins)
 {
     MDefinition* lhs = ins->lhs();
     MDefinition* rhs = ins->rhs();
 
-    MOZ_ASSERT(lhs->type() == MIRType_Value);
-    MOZ_ASSERT(rhs->type() == MIRType_Object);
+    MOZ_ASSERT(lhs->type() == MIRType::Value);
+    MOZ_ASSERT(rhs->type() == MIRType::Object);
 
     LIn* lir = new(alloc()) LIn(useBoxAtStart(lhs), useRegisterAtStart(rhs));
     defineReturn(lir, ins);
     assignSafepoint(lir, ins);
 }
 
 void
 LIRGenerator::visitInstanceOf(MInstanceOf* ins)
 {
     MDefinition* lhs = ins->getOperand(0);
 
-    MOZ_ASSERT(lhs->type() == MIRType_Value || lhs->type() == MIRType_Object);
-
-    if (lhs->type() == MIRType_Object) {
+    MOZ_ASSERT(lhs->type() == MIRType::Value || lhs->type() == MIRType::Object);
+
+    if (lhs->type() == MIRType::Object) {
         LInstanceOfO* lir = new(alloc()) LInstanceOfO(useRegister(lhs));
         define(lir, ins);
         assignSafepoint(lir, ins);
     } else {
         LInstanceOfV* lir = new(alloc()) LInstanceOfV(useBox(lhs));
         define(lir, ins);
         assignSafepoint(lir, ins);
     }
 }
 
 void
 LIRGenerator::visitCallInstanceOf(MCallInstanceOf* ins)
 {
     MDefinition* lhs = ins->lhs();
     MDefinition* rhs = ins->rhs();
 
-    MOZ_ASSERT(lhs->type() == MIRType_Value);
-    MOZ_ASSERT(rhs->type() == MIRType_Object);
+    MOZ_ASSERT(lhs->type() == MIRType::Value);
+    MOZ_ASSERT(rhs->type() == MIRType::Object);
 
     LCallInstanceOf* lir = new(alloc()) LCallInstanceOf(useBoxAtStart(lhs),
                                                         useRegisterAtStart(rhs));
     defineReturn(lir, ins);
     assignSafepoint(lir, ins);
 }
 
 void
 LIRGenerator::visitIsCallable(MIsCallable* ins)
 {
-    MOZ_ASSERT(ins->object()->type() == MIRType_Object);
-    MOZ_ASSERT(ins->type() == MIRType_Boolean);
+    MOZ_ASSERT(ins->object()->type() == MIRType::Object);
+    MOZ_ASSERT(ins->type() == MIRType::Boolean);
     define(new(alloc()) LIsCallable(useRegister(ins->object())), ins);
 }
 
 void
 LIRGenerator::visitIsConstructor(MIsConstructor* ins)
 {
-    MOZ_ASSERT(ins->object()->type() == MIRType_Object);
-    MOZ_ASSERT(ins->type() == MIRType_Boolean);
+    MOZ_ASSERT(ins->object()->type() == MIRType::Object);
+    MOZ_ASSERT(ins->type() == MIRType::Boolean);
     define(new(alloc()) LIsConstructor(useRegister(ins->object())), ins);
 }
 
 static bool
 CanEmitIsObjectAtUses(MInstruction* ins)
 {
     if (!ins->canEmitAtUses())
         return false;
@@ -4047,26 +4045,26 @@ void
 LIRGenerator::visitIsObject(MIsObject* ins)
 {
     if (CanEmitIsObjectAtUses(ins)) {
         emitAtUses(ins);
         return;
     }
 
     MDefinition* opd = ins->input();
-    MOZ_ASSERT(opd->type() == MIRType_Value);
+    MOZ_ASSERT(opd->type() == MIRType::Value);
     LIsObject* lir = new(alloc()) LIsObject(useBoxAtStart(opd));
     define(lir, ins);
 }
 
 void
 LIRGenerator::visitHasClass(MHasClass* ins)
 {
-    MOZ_ASSERT(ins->object()->type() == MIRType_Object);
-    MOZ_ASSERT(ins->type() == MIRType_Boolean);
+    MOZ_ASSERT(ins->object()->type() == MIRType::Object);
+    MOZ_ASSERT(ins->type() == MIRType::Boolean);
     define(new(alloc()) LHasClass(useRegister(ins->object())), ins);
 }
 
 void
 LIRGenerator::visitAsmJSLoadGlobalVar(MAsmJSLoadGlobalVar* ins)
 {
     define(new(alloc()) LAsmJSLoadGlobalVar, ins);
 }
@@ -4095,26 +4093,26 @@ LIRGenerator::visitAsmJSParameter(MAsmJS
     }
 }
 
 void
 LIRGenerator::visitAsmJSReturn(MAsmJSReturn* ins)
 {
     MDefinition* rval = ins->getOperand(0);
     LAsmJSReturn* lir = new(alloc()) LAsmJSReturn;
-    if (rval->type() == MIRType_Float32)
+    if (rval->type() == MIRType::Float32)
         lir->setOperand(0, useFixed(rval, ReturnFloat32Reg));
-    else if (rval->type() == MIRType_Double)
+    else if (rval->type() == MIRType::Double)
         lir->setOperand(0, useFixed(rval, ReturnDoubleReg));
     else if (IsSimdType(rval->type()))
         lir->setOperand(0, useFixed(rval, ReturnSimd128Reg));
-    else if (rval->type() == MIRType_Int32)
+    else if (rval->type() == MIRType::Int32)
         lir->setOperand(0, useFixed(rval, ReturnReg));
 #if JS_BITS_PER_WORD == 64
-    else if (rval->type() == MIRType_Int64)
+    else if (rval->type() == MIRType::Int64)
         lir->setOperand(0, useFixed(rval, ReturnReg));
 #endif
     else
         MOZ_CRASH("Unexpected asm.js return type");
     add(lir);
 }
 
 void
@@ -4147,17 +4145,17 @@ LIRGenerator::visitAsmJSCall(MAsmJSCall*
 
     for (unsigned i = 0; i < ins->numArgs(); i++)
         args[i] = useFixed(ins->getOperand(i), ins->registerForArg(i));
 
     if (ins->callee().which() == MAsmJSCall::Callee::Dynamic)
         args[ins->dynamicCalleeOperandIndex()] = useFixed(ins->callee().dynamic(), CallTempReg0);
 
     LInstruction* lir = new(alloc()) LAsmJSCall(args, ins->numOperands());
-    if (ins->type() == MIRType_None)
+    if (ins->type() == MIRType::None)
         add(lir, ins);
     else
         defineReturn(lir, ins);
 }
 
 void
 LIRGenerator::visitSetDOMProperty(MSetDOMProperty* ins)
 {
@@ -4209,21 +4207,21 @@ LIRGenerator::visitGetDOMMember(MGetDOMM
     MOZ_ASSERT(ins->isDomMovable(), "Members had better be movable");
     // We wish we could assert that ins->domAliasSet() == JSJitInfo::AliasNone,
     // but some MGetDOMMembers are for [Pure], not [Constant] properties, whose
     // value can in fact change as a result of DOM setters and method calls.
     MOZ_ASSERT(ins->domAliasSet() != JSJitInfo::AliasEverything,
                "Member gets had better not alias the world");
 
     MDefinition* obj = ins->object();
-    MOZ_ASSERT(obj->type() == MIRType_Object);
+    MOZ_ASSERT(obj->type() == MIRType::Object);
 
     MIRType type = ins->type();
 
-    if (type == MIRType_Value) {
+    if (type == MIRType::Value) {
         LGetDOMMemberV* lir = new(alloc()) LGetDOMMemberV(useRegisterAtStart(obj));
         defineBox(lir, ins);
     } else {
         LGetDOMMemberT* lir = new(alloc()) LGetDOMMemberT(useRegisterForTypedLoad(obj, type));
         define(lir, ins);
     }
 }
 
@@ -4243,29 +4241,29 @@ LIRGenerator::visitSimdBox(MSimdBox* ins
     LSimdBox* lir = new(alloc()) LSimdBox(in, temp());
     define(lir, ins);
     assignSafepoint(lir, ins);
 }
 
 void
 LIRGenerator::visitSimdUnbox(MSimdUnbox* ins)
 {
-    MOZ_ASSERT(ins->input()->type() == MIRType_Object);
+    MOZ_ASSERT(ins->input()->type() == MIRType::Object);
     MOZ_ASSERT(IsSimdType(ins->type()));
     LUse in = useRegister(ins->input());
 
     BailoutKind kind;
     switch (ins->type()) {
-      case MIRType_Bool32x4:
+      case MIRType::Bool32x4:
         kind = Bailout_NonSimdBool32x4Input;
         break;
-      case MIRType_Int32x4:
+      case MIRType::Int32x4:
         kind = Bailout_NonSimdInt32x4Input;
         break;
-      case MIRType_Float32x4:
+      case MIRType::Float32x4:
         kind = Bailout_NonSimdFloat32x4Input;
         break;
       default:
         MOZ_CRASH("Unexpected SIMD Type.");
     }
 
     LSimdUnbox* lir = new(alloc()) LSimdUnbox(in, temp());
     assignSnapshot(lir, kind);
@@ -4273,36 +4271,36 @@ LIRGenerator::visitSimdUnbox(MSimdUnbox*
 }
 
 void
 LIRGenerator::visitSimdConstant(MSimdConstant* ins)
 {
     MOZ_ASSERT(IsSimdType(ins->type()));
 
     switch (ins->type()) {
-      case MIRType_Bool32x4:
-      case MIRType_Int32x4:
+      case MIRType::Bool32x4:
+      case MIRType::Int32x4:
         define(new(alloc()) LInt32x4(), ins);
         break;
-      case MIRType_Float32x4:
+      case MIRType::Float32x4:
         define(new(alloc()) LFloat32x4(), ins);
         break;
       default:
         MOZ_CRASH("Unknown SIMD kind when generating constant");
     }
 }
 
 void
 LIRGenerator::visitSimdConvert(MSimdConvert* ins)
 {
     MOZ_ASSERT(IsSimdType(ins->type()));
     MDefinition* input = ins->input();
     LUse use = useRegister(input);
-    if (ins->type() == MIRType_Int32x4) {
-        MOZ_ASSERT(input->type() == MIRType_Float32x4);
+    if (ins->type() == MIRType::Int32x4) {
+        MOZ_ASSERT(input->type() == MIRType::Float32x4);
         switch (ins->signedness()) {
           case SimdSign::Signed: {
               LFloat32x4ToInt32x4* lir = new(alloc()) LFloat32x4ToInt32x4(use, temp());
               if (!gen->compilingAsmJS())
                   assignSnapshot(lir, Bailout_BoundsCheck);
               define(lir, ins);
               break;
           }
@@ -4312,18 +4310,18 @@ LIRGenerator::visitSimdConvert(MSimdConv
               if (!gen->compilingAsmJS())
                   assignSnapshot(lir, Bailout_BoundsCheck);
               define(lir, ins);
               break;
           }
           default:
             MOZ_CRASH("Unexpected SimdConvert sign");
         }
-    } else if (ins->type() == MIRType_Float32x4) {
-        MOZ_ASSERT(input->type() == MIRType_Int32x4);
+    } else if (ins->type() == MIRType::Float32x4) {
+        MOZ_ASSERT(input->type() == MIRType::Int32x4);
         MOZ_ASSERT(ins->signedness() == SimdSign::Signed, "Unexpected SimdConvert sign");
         define(new(alloc()) LInt32x4ToFloat32x4(use), ins);
     } else {
         MOZ_CRASH("Unknown SIMD kind when generating constant");
     }
 }
 
 void
@@ -4340,37 +4338,37 @@ LIRGenerator::visitSimdReinterpretCast(M
 
 void
 LIRGenerator::visitSimdExtractElement(MSimdExtractElement* ins)
 {
     MOZ_ASSERT(IsSimdType(ins->input()->type()));
     MOZ_ASSERT(!IsSimdType(ins->type()));
 
     switch (ins->input()->type()) {
-      case MIRType_Int32x4: {
+      case MIRType::Int32x4: {
         MOZ_ASSERT(ins->signedness() != SimdSign::NotApplicable);
         // Note: there could be int16x8 in the future, which doesn't use the
         // same instruction. We either need to pass the arity or create new LIns.
         LUse use = useRegisterAtStart(ins->input());
-        if (ins->type() == MIRType_Double) {
+        if (ins->type() == MIRType::Double) {
             // Extract an Uint32 lane into a double.
             MOZ_ASSERT(ins->signedness() == SimdSign::Unsigned);
             define(new (alloc()) LSimdExtractElementU2D(use, temp()), ins);
         } else {
             define(new (alloc()) LSimdExtractElementI(use), ins);
         }
         break;
       }
-      case MIRType_Float32x4: {
+      case MIRType::Float32x4: {
         MOZ_ASSERT(ins->signedness() == SimdSign::NotApplicable);
         LUse use = useRegisterAtStart(ins->input());
         define(new(alloc()) LSimdExtractElementF(use), ins);
         break;
       }
-      case MIRType_Bool32x4: {
+      case MIRType::Bool32x4: {
         MOZ_ASSERT(ins->signedness() == SimdSign::NotApplicable);
         LUse use = useRegisterAtStart(ins->input());
         define(new(alloc()) LSimdExtractElementB(use), ins);
         break;
       }
       default:
         MOZ_CRASH("Unknown SIMD kind when extracting element");
     }
@@ -4379,21 +4377,21 @@ LIRGenerator::visitSimdExtractElement(MS
 void
 LIRGenerator::visitSimdInsertElement(MSimdInsertElement* ins)
 {
     MOZ_ASSERT(IsSimdType(ins->type()));
 
     LUse vec = useRegisterAtStart(ins->vector());
     LUse val = useRegister(ins->value());
     switch (ins->type()) {
-      case MIRType_Int32x4:
-      case MIRType_Bool32x4:
+      case MIRType::Int32x4:
+      case MIRType::Bool32x4:
         defineReuseInput(new(alloc()) LSimdInsertElementI(vec, val), ins, 0);
         break;
-      case MIRType_Float32x4:
+      case MIRType::Float32x4:
         defineReuseInput(new(alloc()) LSimdInsertElementF(vec, val), ins, 0);
         break;
       default:
         MOZ_CRASH("Unknown SIMD kind when generating constant");
     }
 }
 
 void
@@ -4417,66 +4415,66 @@ LIRGenerator::visitSimdAnyTrue(MSimdAnyT
 }
 
 void
 LIRGenerator::visitSimdSwizzle(MSimdSwizzle* ins)
 {
     MOZ_ASSERT(IsSimdType(ins->input()->type()));
     MOZ_ASSERT(IsSimdType(ins->type()));
 
-    if (ins->input()->type() == MIRType_Int32x4) {
+    if (ins->input()->type() == MIRType::Int32x4) {
         LUse use = useRegisterAtStart(ins->input());
         LSimdSwizzleI* lir = new (alloc()) LSimdSwizzleI(use);
         define(lir, ins);
-    } else if (ins->input()->type() == MIRType_Float32x4) {
+    } else if (ins->input()->type() == MIRType::Float32x4) {
         LUse use = useRegisterAtStart(ins->input());
         LSimdSwizzleF* lir = new (alloc()) LSimdSwizzleF(use);
         define(lir, ins);
     } else {
         MOZ_CRASH("Unknown SIMD kind when getting lane");
     }
 }
 
 void
 LIRGenerator::visitSimdGeneralShuffle(MSimdGeneralShuffle*ins)
 {
     MOZ_ASSERT(IsSimdType(ins->type()));
 
     LSimdGeneralShuffleBase* lir;
-    if (ins->type() == MIRType_Int32x4)
+    if (ins->type() == MIRType::Int32x4)
         lir = new (alloc()) LSimdGeneralShuffleI(temp());
-    else if (ins->type() == MIRType_Float32x4)
+    else if (ins->type() == MIRType::Float32x4)
         lir = new (alloc()) LSimdGeneralShuffleF(temp());
     else
         MOZ_CRASH("Unknown SIMD kind when doing a shuffle");
 
     if (!lir->init(alloc(), ins->numVectors() + ins->numLanes()))
         return;
 
     for (unsigned i = 0; i < ins->numVectors(); i++) {
         MOZ_ASSERT(IsSimdType(ins->vector(i)->type()));
         lir->setOperand(i, useRegister(ins->vector(i)));
     }
 
     for (unsigned i = 0; i < ins->numLanes(); i++) {
-        MOZ_ASSERT(ins->lane(i)->type() == MIRType_Int32);
+        MOZ_ASSERT(ins->lane(i)->type() == MIRType::Int32);
         lir->setOperand(i + ins->numVectors(), useRegister(ins->lane(i)));
     }
 
     assignSnapshot(lir, Bailout_BoundsCheck);
     define(lir, ins);
 }
 
 void
 LIRGenerator::visitSimdShuffle(MSimdShuffle* ins)
 {
     MOZ_ASSERT(IsSimdType(ins->lhs()->type()));
     MOZ_ASSERT(IsSimdType(ins->rhs()->type()));
     MOZ_ASSERT(IsSimdType(ins->type()));
-    MOZ_ASSERT(ins->type() == MIRType_Int32x4 || ins->type() == MIRType_Float32x4);
+    MOZ_ASSERT(ins->type() == MIRType::Int32x4 || ins->type() == MIRType::Float32x4);
 
     bool zFromLHS = ins->laneZ() < 4;
     bool wFromLHS = ins->laneW() < 4;
     uint32_t lanesFromLHS = (ins->laneX() < 4) + (ins->laneY() < 4) + zFromLHS + wFromLHS;
 
     LSimdShuffle* lir = new (alloc()) LSimdShuffle();
     lowerForFPU(lir, ins, ins->lhs(), ins->rhs());
 
@@ -4489,20 +4487,20 @@ void
 LIRGenerator::visitSimdUnaryArith(MSimdUnaryArith* ins)
 {
     MOZ_ASSERT(IsSimdType(ins->input()->type()));
     MOZ_ASSERT(IsSimdType(ins->type()));
 
     // Cannot be at start, as the ouput is used as a temporary to store values.
     LUse in = use(ins->input());
 
-    if (ins->type() == MIRType_Int32x4 || ins->type() == MIRType_Bool32x4) {
+    if (ins->type() == MIRType::Int32x4 || ins->type() == MIRType::Bool32x4) {
         LSimdUnaryArithIx4* lir = new(alloc()) LSimdUnaryArithIx4(in);
         define(lir, ins);
-    } else if (ins->type() == MIRType_Float32x4) {
+    } else if (ins->type() == MIRType::Float32x4) {
         LSimdUnaryArithFx4* lir = new(alloc()) LSimdUnaryArithFx4(in);
         define(lir, ins);
     } else {
         MOZ_CRASH("Unknown SIMD kind for unary operation");
     }
 }
 
 void
@@ -4510,21 +4508,21 @@ LIRGenerator::visitSimdBinaryComp(MSimdB
 {
     MOZ_ASSERT(IsSimdType(ins->lhs()->type()));
     MOZ_ASSERT(IsSimdType(ins->rhs()->type()));
     MOZ_ASSERT(IsBooleanSimdType(ins->type()));
 
     if (ShouldReorderCommutative(ins->lhs(), ins->rhs(), ins))
         ins->reverse();
 
-    if (ins->specialization() == MIRType_Int32x4) {
+    if (ins->specialization() == MIRType::Int32x4) {
         MOZ_ASSERT(ins->signedness() == SimdSign::Signed);
         LSimdBinaryCompIx4* add = new(alloc()) LSimdBinaryCompIx4();
         lowerForCompIx4(add, ins, ins->lhs(), ins->rhs());
-    } else if (ins->specialization() == MIRType_Float32x4) {
+    } else if (ins->specialization() == MIRType::Float32x4) {
         MOZ_ASSERT(ins->signedness() == SimdSign::NotApplicable);
         LSimdBinaryCompFx4* add = new(alloc()) LSimdBinaryCompFx4();
         lowerForCompFx4(add, ins, ins->lhs(), ins->rhs());
     } else {
         MOZ_CRASH("Unknown compare type when comparing values");
     }
 }
 
@@ -4535,49 +4533,49 @@ LIRGenerator::visitSimdBinaryBitwise(MSi
     MOZ_ASSERT(IsSimdType(ins->rhs()->type()));
     MOZ_ASSERT(IsSimdType(ins->type()));
 
     MDefinition* lhs = ins->lhs();
     MDefinition* rhs = ins->rhs();
     ReorderCommutative(&lhs, &rhs, ins);
 
     switch (ins->type()) {
-      case MIRType_Bool32x4:
-      case MIRType_Int32x4:
-      case MIRType_Float32x4: {
+      case MIRType::Bool32x4:
+      case MIRType::Int32x4:
+      case MIRType::Float32x4: {
         LSimdBinaryBitwiseX4* lir = new(alloc()) LSimdBinaryBitwiseX4;
         lowerForFPU(lir, ins, lhs, rhs);
         break;
       }
       default:
         MOZ_CRASH("Unknown SIMD kind when doing bitwise operations");
     }
 }
 
 void
 LIRGenerator::visitSimdShift(MSimdShift* ins)
 {
-    MOZ_ASSERT(ins->type() == MIRType_Int32x4);
-    MOZ_ASSERT(ins->lhs()->type() == MIRType_Int32x4);
-    MOZ_ASSERT(ins->rhs()->type() == MIRType_Int32);
+    MOZ_ASSERT(ins->type() == MIRType::Int32x4);
+    MOZ_ASSERT(ins->lhs()->type() == MIRType::Int32x4);
+    MOZ_ASSERT(ins->rhs()->type() == MIRType::Int32);
 
     LUse vector = useRegisterAtStart(ins->lhs());
     LAllocation value = useRegisterOrConstant(ins->rhs());
     // We need a temp register to mask the shift amount, but not if the shift
     // amount is a constant.
     LDefinition tempReg = value.isConstant() ? LDefinition::BogusTemp() : temp();
     LSimdShift* lir = new(alloc()) LSimdShift(vector, value, tempReg);
     defineReuseInput(lir, ins, 0);
 }
 
 void
 LIRGenerator::visitLexicalCheck(MLexicalCheck* ins)
 {
     MDefinition* input = ins->input();
-    MOZ_ASSERT(input->type() == MIRType_Value);
+    MOZ_ASSERT(input->type() == MIRType::Value);
     LLexicalCheck* lir = new(alloc()) LLexicalCheck(useBox(input));
     assignSnapshot(lir, ins->bailoutKind());
     add(lir, ins);
     redefine(ins, input);
 }
 
 void
 LIRGenerator::visitThrowRuntimeLexicalError(MThrowRuntimeLexicalError* ins)
@@ -4609,42 +4607,42 @@ LIRGenerator::visitAtomicIsLockFree(MAto
     define(new(alloc()) LAtomicIsLockFree(useRegister(ins->input())), ins);
 }
 
 void
 LIRGenerator::visitCheckReturn(MCheckReturn* ins)
 {
     MDefinition* retVal = ins->returnValue();
     MDefinition* thisVal = ins->thisValue();
-    MOZ_ASSERT(retVal->type() == MIRType_Value);
-    MOZ_ASSERT(thisVal->type() == MIRType_Value);
+    MOZ_ASSERT(retVal->type() == MIRType::Value);
+    MOZ_ASSERT(thisVal->type() == MIRType::Value);
 
     LCheckReturn* lir = new(alloc()) LCheckReturn(useBoxAtStart(retVal), useBoxAtStart(thisVal));
     assignSnapshot(lir, Bailout_BadDerivedConstructorReturn);
     add(lir, ins);
     redefine(ins, retVal);
 }
 
 void
 LIRGenerator::visitCheckObjCoercible(MCheckObjCoercible* ins)
 {
     MDefinition* checkVal = ins->checkValue();
-    MOZ_ASSERT(checkVal->type() == MIRType_Value);
+    MOZ_ASSERT(checkVal->type() == MIRType::Value);
 
     LCheckObjCoercible* lir = new(alloc()) LCheckObjCoercible(useBoxAtStart(checkVal));
     redefine(ins, checkVal);
     add(lir, ins);
     assignSafepoint(lir, ins);
 }
 
 void
 LIRGenerator::visitDebugCheckSelfHosted(MDebugCheckSelfHosted* ins)
 {
     MDefinition* checkVal = ins->checkValue();
-    MOZ_ASSERT(checkVal->type() == MIRType_Value);
+    MOZ_ASSERT(checkVal->type() == MIRType::Value);
 
     LDebugCheckSelfHosted* lir = new (alloc()) LDebugCheckSelfHosted(useBoxAtStart(checkVal));
     redefine(ins, checkVal);
     add(lir, ins);
     assignSafepoint(lir, ins);
 }
 
 static void
@@ -4703,17 +4701,17 @@ LIRGenerator::visitInstruction(MInstruct
 }
 
 void
 LIRGenerator::definePhis()
 {
     size_t lirIndex = 0;
     MBasicBlock* block = current->mir();
     for (MPhiIterator phi(block->phisBegin()); phi != block->phisEnd(); phi++) {
-        if (phi->type() == MIRType_Value) {
+        if (phi->type() == MIRType::Value) {
             defineUntypedPhi(*phi, lirIndex);
             lirIndex += BOX_PIECES;
         } else {
             defineTypedPhi(*phi, lirIndex);
             lirIndex += 1;
         }
     }
 }
@@ -4771,17 +4769,17 @@ LIRGenerator::visitBlock(MBasicBlock* bl
         uint32_t position = block->positionInPhiSuccessor();
         size_t lirIndex = 0;
         for (MPhiIterator phi(successor->phisBegin()); phi != successor->phisEnd(); phi++) {
             MDefinition* opd = phi->getOperand(position);
             ensureDefined(opd);
 
             MOZ_ASSERT(opd->type() == phi->type());
 
-            if (phi->type() == MIRType_Value) {
+            if (phi->type() == MIRType::Value) {
                 lowerUntypedPhiInput(*phi, position, successor->lir(), lirIndex);
                 lirIndex += BOX_PIECES;
             } else {
                 lowerTypedPhiInput(*phi, position, successor->lir(), lirIndex);
                 lirIndex += 1;
             }
         }
     }
--- a/js/src/jit/MCallOptimize.cpp
+++ b/js/src/jit/MCallOptimize.cpp
@@ -228,25 +228,25 @@ IonBuilder::inlineNativeCall(CallInfo& c
         return inlineAssertFloat32(callInfo);
       case InlinableNative::TestAssertRecoveredOnBailout:
         return inlineAssertRecoveredOnBailout(callInfo);
 
       // Slot intrinsics.
       case InlinableNative::IntrinsicUnsafeSetReservedSlot:
         return inlineUnsafeSetReservedSlot(callInfo);
       case InlinableNative::IntrinsicUnsafeGetReservedSlot:
-        return inlineUnsafeGetReservedSlot(callInfo, MIRType_Value);
+        return inlineUnsafeGetReservedSlot(callInfo, MIRType::Value);
       case InlinableNative::IntrinsicUnsafeGetObjectFromReservedSlot:
-        return inlineUnsafeGetReservedSlot(callInfo, MIRType_Object);
+        return inlineUnsafeGetReservedSlot(callInfo, MIRType::Object);
       case InlinableNative::IntrinsicUnsafeGetInt32FromReservedSlot:
-        return inlineUnsafeGetReservedSlot(callInfo, MIRType_Int32);
+        return inlineUnsafeGetReservedSlot(callInfo, MIRType::Int32);
       case InlinableNative::IntrinsicUnsafeGetStringFromReservedSlot:
-        return inlineUnsafeGetReservedSlot(callInfo, MIRType_String);
+        return inlineUnsafeGetReservedSlot(callInfo, MIRType::String);
       case InlinableNative::IntrinsicUnsafeGetBooleanFromReservedSlot:
-        return inlineUnsafeGetReservedSlot(callInfo, MIRType_Boolean);
+        return inlineUnsafeGetReservedSlot(callInfo, MIRType::Boolean);
 
       // Utility intrinsics.
       case InlinableNative::IntrinsicIsCallable:
         return inlineIsCallable(callInfo);
       case InlinableNative::IntrinsicIsConstructor:
         return inlineIsConstructor(callInfo);
       case InlinableNative::IntrinsicToObject:
         return inlineToObject(callInfo);
@@ -357,17 +357,17 @@ IonBuilder::inlineNativeGetter(CallInfo&
     RegExpFlag mask = NoFlags;
     if (RegExpObject::isOriginalFlagGetter