Bug 1479603 - [Part 6] Reduce redundant usage of ICStubEngine r=jandem
authorMatthew Gaudet <mgaudet@mozilla.com>
Fri, 17 Aug 2018 17:16:19 -0700
changeset 433133 4bdec5f4de8812ff5b5bb2df9473345744744a40
parent 433132 68b7d42b931d9b0e7be37ad0098eb1b013e6cdca
child 433134 652d157c6c62c1b24ffd3db5f08d04c3393e2b4c
push id34499
push usercsabou@mozilla.com
push dateThu, 23 Aug 2018 21:40:51 +0000
treeherdermozilla-central@49b70f7e6817 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjandem
bugs1479603
milestone63.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 1479603 - [Part 6] Reduce redundant usage of ICStubEngine r=jandem
js/src/jit/BaselineCacheIRCompiler.cpp
js/src/jit/BaselineCacheIRCompiler.h
js/src/jit/BaselineCompiler.cpp
js/src/jit/BaselineDebugModeOSR.h
js/src/jit/BaselineIC.cpp
js/src/jit/BaselineIC.h
js/src/jit/JitRealm.h
js/src/jit/SharedIC.cpp
--- a/js/src/jit/BaselineCacheIRCompiler.cpp
+++ b/js/src/jit/BaselineCacheIRCompiler.cpp
@@ -30,45 +30,35 @@ CacheRegisterAllocator::addressOf(MacroA
 {
     uint32_t offset = stackPushed_ + ICStackValueOffset + slot.slot() * sizeof(JS::Value);
     return Address(masm.getStackPointer(), offset);
 }
 
 // BaselineCacheIRCompiler compiles CacheIR to BaselineIC native code.
 class MOZ_RAII BaselineCacheIRCompiler : public CacheIRCompiler
 {
-#ifdef DEBUG
-    // Some Baseline IC stubs can be used in IonMonkey through SharedStubs.
-    // Those stubs have different machine code, so we need to track whether
-    // we're compiling for Baseline or Ion.
-    ICStubEngine engine_;
-#endif
-
 
     bool inStubFrame_;
     bool makesGCCalls_;
 
     MOZ_MUST_USE bool callVM(MacroAssembler& masm, const VMFunction& fun);
     MOZ_MUST_USE bool tailCallVM(MacroAssembler& masm, const VMFunction& fun);
 
     MOZ_MUST_USE bool callTypeUpdateIC(Register obj, ValueOperand val, Register scratch,
                                        LiveGeneralRegisterSet saveRegs);
 
     MOZ_MUST_USE bool emitStoreSlotShared(bool isFixed);
     MOZ_MUST_USE bool emitAddAndStoreSlotShared(CacheOp op);
 
   public:
     friend class AutoStubFrame;
 
-    BaselineCacheIRCompiler(JSContext* cx, const CacheIRWriter& writer, ICStubEngine engine,
+    BaselineCacheIRCompiler(JSContext* cx, const CacheIRWriter& writer,
                             uint32_t stubDataOffset)
       : CacheIRCompiler(cx, writer, stubDataOffset, Mode::Baseline, StubFieldPolicy::Address),
-#ifdef DEBUG
-        engine_(engine),
-#endif
         inStubFrame_(false),
         makesGCCalls_(false)
     {}
 
     MOZ_MUST_USE bool init(CacheKind kind);
 
     JitCode* compile();
 
@@ -108,17 +98,16 @@ class MOZ_RAII AutoStubFrame
       : compiler(compiler)
 #ifdef DEBUG
         , framePushedAtEnterStubFrame_(0)
 #endif
     { }
 
     void enter(MacroAssembler& masm, Register scratch, CallCanGC canGC = CallCanGC::CanGC) {
         MOZ_ASSERT(compiler.allocator.stackPushed() == 0);
-        MOZ_ASSERT(compiler.engine_ == ICStubEngine::Baseline);
 
         EmitBaselineEnterStubFrame(masm, scratch);
 
 #ifdef DEBUG
         framePushedAtEnterStubFrame_ = masm.framePushed();
 #endif
 
         MOZ_ASSERT(!compiler.inStubFrame_);
@@ -148,30 +137,28 @@ class MOZ_RAII AutoStubFrame
 
 bool
 BaselineCacheIRCompiler::callVM(MacroAssembler& masm, const VMFunction& fun)
 {
     MOZ_ASSERT(inStubFrame_);
 
     TrampolinePtr code = cx_->runtime()->jitRuntime()->getVMWrapper(fun);
     MOZ_ASSERT(fun.expectTailCall == NonTailCall);
-    MOZ_ASSERT(engine_ == ICStubEngine::Baseline);
 
     EmitBaselineCallVM(code, masm);
     return true;
 }
 
 bool
 BaselineCacheIRCompiler::tailCallVM(MacroAssembler& masm, const VMFunction& fun)
 {
     MOZ_ASSERT(!inStubFrame_);
 
     TrampolinePtr code = cx_->runtime()->jitRuntime()->getVMWrapper(fun);
     MOZ_ASSERT(fun.expectTailCall == TailCall);
-    MOZ_ASSERT(engine_ == ICStubEngine::Baseline);
     size_t argSize = fun.explicitStackSlots() * sizeof(void*);
 
     EmitBaselineTailCallVM(code, masm, argSize);
     return true;
 }
 
 JitCode*
 BaselineCacheIRCompiler::compile()
@@ -552,18 +539,16 @@ BaselineCacheIRCompiler::emitGuardHasGet
 
     masm.branchIfFalseBool(scratch1, failure->label());
     return true;
 }
 
 bool
 BaselineCacheIRCompiler::emitCallScriptedGetterResult()
 {
-    MOZ_ASSERT(engine_ == ICStubEngine::Baseline);
-
     Register obj = allocator.useRegister(masm, reader.objOperandId());
     Address getterAddr(stubAddress(reader.stubOffset()));
     bool isCrossRealm = reader.readBool();
 
     AutoScratchRegister code(allocator, masm);
     AutoScratchRegister callee(allocator, masm);
     AutoScratchRegister scratch(allocator, masm);
 
@@ -2116,18 +2101,18 @@ BaselineCacheIRCompiler::init(CacheKind 
     return true;
 }
 
 static const size_t MaxOptimizedCacheIRStubs = 16;
 
 ICStub*
 js::jit::AttachBaselineCacheIRStub(JSContext* cx, const CacheIRWriter& writer,
                                    CacheKind kind, BaselineCacheIRStubKind stubKind,
-                                   ICStubEngine engine, JSScript* outerScript,
-                                   ICFallbackStub* stub, bool* attached)
+                                   JSScript* outerScript, ICFallbackStub* stub,
+                                   bool* attached)
 {
     // We shouldn't GC or report OOM (or any other exception) here.
     AutoAssertNoPendingException aanpe(cx);
     JS::AutoCheckCannotGC nogc;
 
     MOZ_ASSERT(!*attached);
 
     if (writer.failed())
@@ -2149,35 +2134,37 @@ js::jit::AttachBaselineCacheIRStub(JSCon
         stubDataOffset = sizeof(ICCacheIR_Updated);
         break;
     }
 
     JitZone* jitZone = cx->zone()->jitZone();
 
     // Check if we already have JitCode for this stub.
     CacheIRStubInfo* stubInfo;
-    CacheIRStubKey::Lookup lookup(kind, engine, writer.codeStart(), writer.codeLength());
+    CacheIRStubKey::Lookup lookup(kind, ICStubEngine::Baseline, writer.codeStart(),
+                                  writer.codeLength());
     JitCode* code = jitZone->getBaselineCacheIRStubCode(lookup, &stubInfo);
     if (!code) {
         // We have to generate stub code.
         JitContext jctx(cx, nullptr);
-        BaselineCacheIRCompiler comp(cx, writer, engine, stubDataOffset);
+        BaselineCacheIRCompiler comp(cx, writer, stubDataOffset);
         if (!comp.init(kind))
             return nullptr;
 
         code = comp.compile();
         if (!code)
             return nullptr;
 
         // Allocate the shared CacheIRStubInfo. Note that the
         // putBaselineCacheIRStubCode call below will transfer ownership
         // to the stub code HashMap, so we don't have to worry about freeing
         // it below.
         MOZ_ASSERT(!stubInfo);
-        stubInfo = CacheIRStubInfo::New(kind, engine, comp.makesGCCalls(), stubDataOffset, writer);
+        stubInfo = CacheIRStubInfo::New(kind, ICStubEngine::Baseline, comp.makesGCCalls(),
+                                        stubDataOffset, writer);
         if (!stubInfo)
             return nullptr;
 
         CacheIRStubKey key(stubInfo);
         if (!jitZone->putBaselineCacheIRStubCode(lookup, key, code))
             return nullptr;
     }
 
@@ -2231,17 +2218,18 @@ js::jit::AttachBaselineCacheIRStub(JSCon
         return nullptr;
     }
 
     // Time to allocate and attach a new stub.
 
     size_t bytesNeeded = stubInfo->stubDataOffset() + stubInfo->stubDataSize();
 
     ICStubSpace* stubSpace = ICStubCompiler::StubSpaceForStub(stubInfo->makesGCCalls(),
-                                                              outerScript, engine);
+                                                              outerScript,
+                                                              ICStubEngine::Baseline);
     void* newStubMem = stubSpace->alloc(bytesNeeded);
     if (!newStubMem)
         return nullptr;
 
     switch (stubKind) {
       case BaselineCacheIRStubKind::Regular: {
         auto newStub = new(newStubMem) ICCacheIR_Regular(code, stubInfo);
         writer.copyStubData(newStub->stubDataStart());
--- a/js/src/jit/BaselineCacheIRCompiler.h
+++ b/js/src/jit/BaselineCacheIRCompiler.h
@@ -16,15 +16,15 @@ namespace jit {
 
 class ICFallbackStub;
 class ICStub;
 
 enum class BaselineCacheIRStubKind { Regular, Monitored, Updated };
 
 ICStub* AttachBaselineCacheIRStub(JSContext* cx, const CacheIRWriter& writer,
                                   CacheKind kind, BaselineCacheIRStubKind stubKind,
-                                  ICStubEngine engine, JSScript* outerScript,
-                                  ICFallbackStub* stub, bool* attached);
+                                  JSScript* outerScript, ICFallbackStub* stub,
+                                  bool* attached);
 
 } // namespace jit
 } // namespace js
 
 #endif /* jit_BaselineCacheIRCompiler_h */
--- a/js/src/jit/BaselineCompiler.cpp
+++ b/js/src/jit/BaselineCompiler.cpp
@@ -1921,17 +1921,17 @@ BaselineCompiler::emit_JSOP_POW()
 
 bool
 BaselineCompiler::emitBinaryArith()
 {
     // Keep top JSStack value in R0 and R2
     frame.popRegsAndSync(2);
 
     // Call IC
-    ICBinaryArith_Fallback::Compiler stubCompiler(cx, ICStubCompiler::Engine::Baseline);
+    ICBinaryArith_Fallback::Compiler stubCompiler(cx);
     if (!emitOpIC(stubCompiler.getStub(&stubSpace_)))
         return false;
 
     // Mark R0 as pushed stack value.
     frame.push(R0);
     return true;
 }
 
@@ -2003,17 +2003,17 @@ bool
 BaselineCompiler::emitCompare()
 {
     // CODEGEN
 
     // Keep top JSStack value in R0 and R1.
     frame.popRegsAndSync(2);
 
     // Call IC.
-    ICCompare_Fallback::Compiler stubCompiler(cx, ICStubCompiler::Engine::Baseline);
+    ICCompare_Fallback::Compiler stubCompiler(cx);
     if (!emitOpIC(stubCompiler.getStub(&stubSpace_)))
         return false;
 
     // Mark R0 as pushed stack value.
     frame.push(R0, JSVAL_TYPE_BOOLEAN);
     return true;
 }
 
@@ -2038,17 +2038,17 @@ BaselineCompiler::emit_JSOP_CONDSWITCH()
 bool
 BaselineCompiler::emit_JSOP_CASE()
 {
     frame.popRegsAndSync(2);
     frame.push(R0);
     frame.syncStack(0);
 
     // Call IC.
-    ICCompare_Fallback::Compiler stubCompiler(cx, ICStubCompiler::Engine::Baseline);
+    ICCompare_Fallback::Compiler stubCompiler(cx);
     if (!emitOpIC(stubCompiler.getStub(&stubSpace_)))
         return false;
 
     Register payload = masm.extractInt32(R0, R0.scratchReg());
     jsbytecode* target = pc + GET_JUMP_OFFSET(pc);
 
     Label done;
     masm.branch32(Assembler::Equal, payload, Imm32(0), &done);
@@ -2086,17 +2086,17 @@ BaselineCompiler::emit_JSOP_NEWARRAY()
 
     // Pass length in R0.
     masm.move32(Imm32(AssertedCast<int32_t>(length)), R0.scratchReg());
 
     ObjectGroup* group = ObjectGroup::allocationSiteGroup(cx, script, pc, JSProto_Array);
     if (!group)
         return false;
 
-    ICNewArray_Fallback::Compiler stubCompiler(cx, group, ICStubCompiler::Engine::Baseline);
+    ICNewArray_Fallback::Compiler stubCompiler(cx, group);
     if (!emitOpIC(stubCompiler.getStub(&stubSpace_)))
         return false;
 
     frame.push(R0);
     return true;
 }
 
 typedef ArrayObject* (*NewArrayCopyOnWriteFn)(JSContext*, HandleArrayObject, gc::InitialHeap);
@@ -2150,30 +2150,30 @@ BaselineCompiler::emit_JSOP_INITELEM_ARR
     return true;
 }
 
 bool
 BaselineCompiler::emit_JSOP_NEWOBJECT()
 {
     frame.syncStack(0);
 
-    ICNewObject_Fallback::Compiler stubCompiler(cx, ICStubCompiler::Engine::Baseline);
+    ICNewObject_Fallback::Compiler stubCompiler(cx);
     if (!emitOpIC(stubCompiler.getStub(&stubSpace_)))
         return false;
 
     frame.push(R0);
     return true;
 }
 
 bool
 BaselineCompiler::emit_JSOP_NEWINIT()
 {
     frame.syncStack(0);
 
-    ICNewObject_Fallback::Compiler stubCompiler(cx, ICStubCompiler::Engine::Baseline);
+    ICNewObject_Fallback::Compiler stubCompiler(cx);
     if (!emitOpIC(stubCompiler.getStub(&stubSpace_)))
         return false;
 
     frame.push(R0);
     return true;
 }
 
 bool
@@ -2611,17 +2611,17 @@ BaselineCompiler::emit_JSOP_STRICTSETPRO
 
 bool
 BaselineCompiler::emit_JSOP_GETPROP()
 {
     // Keep object in R0.
     frame.popRegsAndSync(1);
 
     // Call IC.
-    ICGetProp_Fallback::Compiler compiler(cx, ICStubCompiler::Engine::Baseline);
+    ICGetProp_Fallback::Compiler compiler(cx);
     if (!emitOpIC(compiler.getStub(&stubSpace_)))
         return false;
 
     // Mark R0 as pushed stack value.
     frame.push(R0);
     return true;
 }
 
@@ -2646,18 +2646,17 @@ BaselineCompiler::emit_JSOP_GETBOUNDNAME
 bool
 BaselineCompiler::emit_JSOP_GETPROP_SUPER()
 {
     // Receiver -> R1, Object -> R0
     frame.popRegsAndSync(1);
     masm.loadValue(frame.addressOfStackValue(frame.peek(-1)), R1);
     frame.pop();
 
-    ICGetProp_Fallback::Compiler compiler(cx, ICStubCompiler::Engine::Baseline,
-                                          /* hasReceiver = */ true);
+    ICGetProp_Fallback::Compiler compiler(cx, /* hasReceiver = */ true);
     if (!emitOpIC(compiler.getStub(&stubSpace_)))
         return false;
 
     frame.push(R0);
     return true;
 }
 
 
--- a/js/src/jit/BaselineDebugModeOSR.h
+++ b/js/src/jit/BaselineDebugModeOSR.h
@@ -36,40 +36,28 @@ namespace jit {
 //     if (stub.invalid())
 //         return true;
 //
 //     // First use of stub after VM call.
 //
 template <typename T>
 class DebugModeOSRVolatileStub
 {
-    ICStubCompiler::Engine engine_;
     T stub_;
     BaselineFrame* frame_;
     uint32_t pcOffset_;
 
   public:
-    DebugModeOSRVolatileStub(ICStubCompiler::Engine engine, BaselineFrame* frame,
-                             ICFallbackStub* stub)
-      : engine_(engine),
-        stub_(static_cast<T>(stub)),
-        frame_(frame),
-        pcOffset_(stub->icEntry()->pcOffset())
-    { }
-
     DebugModeOSRVolatileStub(BaselineFrame* frame, ICFallbackStub* stub)
-      : engine_(ICStubCompiler::Engine::Baseline),
-        stub_(static_cast<T>(stub)),
+      : stub_(static_cast<T>(stub)),
         frame_(frame),
         pcOffset_(stub->icEntry()->pcOffset())
     { }
 
     bool invalid() const {
-        if (engine_ == ICStubCompiler::Engine::IonSharedIC)
-            return stub_->invalid();
         MOZ_ASSERT(!frame_->isHandlingException());
         ICEntry& entry = frame_->script()->baselineScript()->icEntryFromPCOffset(pcOffset_);
         return stub_ != entry.fallbackStub();
     }
 
     operator const T&() const { MOZ_ASSERT(!invalid()); return stub_; }
     T operator->() const { MOZ_ASSERT(!invalid()); return stub_; }
     T* address() { MOZ_ASSERT(!invalid()); return &stub_; }
--- a/js/src/jit/BaselineIC.cpp
+++ b/js/src/jit/BaselineIC.cpp
@@ -464,24 +464,23 @@ DoToBoolFallback(JSContext* cx, Baseline
     if (stub->state().maybeTransition())
         stub->discardStubs(cx);
 
     if (stub->state().canAttachStub()) {
 
         RootedScript script(cx, frame->script());
         jsbytecode* pc = stub->icEntry()->pc(script);
 
-        ICStubEngine engine = ICStubEngine::Baseline;
         ToBoolIRGenerator gen(cx, script, pc, stub->state().mode(),
                               arg);
         bool attached = false;
         if (gen.tryAttachStub()) {
             ICStub* newStub = AttachBaselineCacheIRStub(cx, gen.writerRef(), gen.cacheKind(),
                                                         BaselineCacheIRStubKind::Regular,
-                                                        engine, script, stub, &attached);
+                                                        script, stub, &attached);
             if (newStub)
                 JitSpew(JitSpew_BaselineIC, "  Attached ToBool CacheIR stub, attached is now %d", attached);
         }
         if (!attached)
             stub->state().trackNotAttached();
     }
 
     bool cond = ToBoolean(arg);
@@ -604,25 +603,24 @@ DoGetElemFallback(JSContext* cx, Baselin
 
     bool attached = false;
     bool isTemporarilyUnoptimizable = false;
 
     if (stub->state().maybeTransition())
         stub->discardStubs(cx);
 
     if (stub->state().canAttachStub()) {
-        ICStubEngine engine = ICStubEngine::Baseline;
         GetPropIRGenerator gen(cx, script, pc,
                                CacheKind::GetElem, stub->state().mode(),
                                &isTemporarilyUnoptimizable, lhs, rhs, lhs,
                                GetPropertyResultFlags::All);
         if (gen.tryAttachStub()) {
             ICStub* newStub = AttachBaselineCacheIRStub(cx, gen.writerRef(), gen.cacheKind(),
                                                         BaselineCacheIRStubKind::Monitored,
-                                                        engine, script, stub, &attached);
+                                                        script, stub, &attached);
             if (newStub) {
                 JitSpew(JitSpew_BaselineIC, "  Attached GetElem CacheIR stub");
                 if (gen.shouldNotePreliminaryObjectStub())
                     newStub->toCacheIR_Monitored()->notePreliminaryObject();
                 else if (gen.shouldUnlinkPreliminaryObjectStubs())
                     StripPreliminaryObjectStubs(cx, stub);
             }
         }
@@ -678,24 +676,23 @@ DoGetElemSuperFallback(JSContext* cx, Ba
 
     bool attached = false;
     bool isTemporarilyUnoptimizable = false;
 
     if (stub->state().maybeTransition())
         stub->discardStubs(cx);
 
     if (stub->state().canAttachStub()) {
-        ICStubEngine engine = ICStubEngine::Baseline;
         GetPropIRGenerator gen(cx, script, pc, CacheKind::GetElemSuper, stub->state().mode(),
                                &isTemporarilyUnoptimizable, lhs, rhs, receiver,
                                GetPropertyResultFlags::All);
         if (gen.tryAttachStub()) {
             ICStub* newStub = AttachBaselineCacheIRStub(cx, gen.writerRef(), gen.cacheKind(),
                                                         BaselineCacheIRStubKind::Monitored,
-                                                        engine, script, stub, &attached);
+                                                        script, stub, &attached);
             if (newStub) {
                 JitSpew(JitSpew_BaselineIC, "  Attached GetElemSuper CacheIR stub");
                 if (gen.shouldNotePreliminaryObjectStub())
                     newStub->toCacheIR_Monitored()->notePreliminaryObject();
                 else if (gen.shouldUnlinkPreliminaryObjectStubs())
                     StripPreliminaryObjectStubs(cx, stub);
             }
         }
@@ -838,18 +835,17 @@ DoSetElemFallback(JSContext* cx, Baselin
         stub->discardStubs(cx);
 
     if (stub->state().canAttachStub()) {
         SetPropIRGenerator gen(cx, script, pc, CacheKind::SetElem, stub->state().mode(),
                                &isTemporarilyUnoptimizable, objv, index, rhs);
         if (gen.tryAttachStub()) {
             ICStub* newStub = AttachBaselineCacheIRStub(cx, gen.writerRef(), gen.cacheKind(),
                                                         BaselineCacheIRStubKind::Updated,
-                                                        ICStubEngine::Baseline, frame->script(),
-                                                        stub, &attached);
+                                                        frame->script(), stub, &attached);
             if (newStub) {
                 JitSpew(JitSpew_BaselineIC, "  Attached SetElem CacheIR stub");
 
                 SetUpdateStubData(newStub->toCacheIR_Updated(), gen.typeCheckInfo());
 
                 if (gen.shouldNotePreliminaryObjectStub())
                     newStub->toCacheIR_Updated()->notePreliminaryObject();
                 else if (gen.shouldUnlinkPreliminaryObjectStubs())
@@ -902,18 +898,17 @@ DoSetElemFallback(JSContext* cx, Baselin
         stub->discardStubs(cx);
 
     if (stub->state().canAttachStub()) {
         SetPropIRGenerator gen(cx, script, pc, CacheKind::SetElem, stub->state().mode(),
                                &isTemporarilyUnoptimizable, objv, index, rhs);
         if (gen.tryAttachAddSlotStub(oldGroup, oldShape)) {
             ICStub* newStub = AttachBaselineCacheIRStub(cx, gen.writerRef(), gen.cacheKind(),
                                                         BaselineCacheIRStubKind::Updated,
-                                                        ICStubEngine::Baseline, frame->script(),
-                                                        stub, &attached);
+                                                        frame->script(), stub, &attached);
             if (newStub) {
                 if (gen.shouldNotePreliminaryObjectStub())
                     newStub->toCacheIR_Updated()->notePreliminaryObject();
                 else if (gen.shouldUnlinkPreliminaryObjectStubs())
                     StripPreliminaryObjectStubs(cx, stub);
 
                 JitSpew(JitSpew_BaselineIC, "  Attached SetElem CacheIR stub");
                 SetUpdateStubData(newStub->toCacheIR_Updated(), gen.typeCheckInfo());
@@ -1094,23 +1089,22 @@ DoInFallback(JSContext* cx, BaselineFram
 
     if (stub->state().maybeTransition())
         stub->discardStubs(cx);
 
     if (stub->state().canAttachStub()) {
         RootedScript script(cx, frame->script());
         jsbytecode* pc = stub->icEntry()->pc(script);
 
-        ICStubEngine engine = ICStubEngine::Baseline;
         HasPropIRGenerator gen(cx, script, pc, CacheKind::In, stub->state().mode(), key, objValue);
         bool attached = false;
         if (gen.tryAttachStub()) {
             ICStub* newStub = AttachBaselineCacheIRStub(cx, gen.writerRef(), gen.cacheKind(),
                                                         BaselineCacheIRStubKind::Regular,
-                                                        engine, script, stub, &attached);
+                                                        script, stub, &attached);
             if (newStub)
                 JitSpew(JitSpew_BaselineIC, "  Attached In CacheIR stub");
         }
         if (!attached)
             stub->state().trackNotAttached();
     }
 
     RootedObject obj(cx, &objValue.toObject());
@@ -1162,24 +1156,23 @@ DoHasOwnFallback(JSContext* cx, Baseline
 
     if (stub->state().maybeTransition())
         stub->discardStubs(cx);
 
     if (stub->state().canAttachStub()) {
         RootedScript script(cx, frame->script());
         jsbytecode* pc = stub->icEntry()->pc(script);
 
-        ICStubEngine engine = ICStubEngine::Baseline;
         HasPropIRGenerator gen(cx, script, pc, CacheKind::HasOwn,
                                stub->state().mode(), keyValue, objValue);
         bool attached = false;
         if (gen.tryAttachStub()) {
             ICStub* newStub = AttachBaselineCacheIRStub(cx, gen.writerRef(), gen.cacheKind(),
                                                         BaselineCacheIRStubKind::Regular,
-                                                        engine, script, stub, &attached);
+                                                        script, stub, &attached);
             if (newStub)
                 JitSpew(JitSpew_BaselineIC, "  Attached HasOwn CacheIR stub");
         }
         if (!attached)
             stub->state().trackNotAttached();
     }
 
     bool found;
@@ -1236,22 +1229,21 @@ DoGetNameFallback(JSContext* cx, Baselin
 
     RootedPropertyName name(cx, script->getName(pc));
     bool attached = false;
 
     if (stub->state().maybeTransition())
         stub->discardStubs(cx);
 
     if (stub->state().canAttachStub()) {
-        ICStubEngine engine = ICStubEngine::Baseline;
         GetNameIRGenerator gen(cx, script, pc, stub->state().mode(), envChain, name);
         if (gen.tryAttachStub()) {
             ICStub* newStub = AttachBaselineCacheIRStub(cx, gen.writerRef(), gen.cacheKind(),
                                                         BaselineCacheIRStubKind::Monitored,
-                                                        engine, script, stub, &attached);
+                                                        script, stub, &attached);
             if (newStub)
                 JitSpew(JitSpew_BaselineIC, "  Attached GetName CacheIR stub");
         }
         if (!attached)
             stub->state().trackNotAttached();
     }
 
     static_assert(JSOP_GETGNAME_LENGTH == JSOP_GETNAME_LENGTH,
@@ -1321,18 +1313,17 @@ DoBindNameFallback(JSContext* cx, Baseli
 
     if (stub->state().canAttachStub()) {
         bool attached = false;
         RootedScript script(cx, frame->script());
         BindNameIRGenerator gen(cx, script, pc, stub->state().mode(), envChain, name);
         if (gen.tryAttachStub()) {
             ICStub* newStub = AttachBaselineCacheIRStub(cx, gen.writerRef(), gen.cacheKind(),
                                                         BaselineCacheIRStubKind::Regular,
-                                                        ICStubEngine::Baseline, script, stub,
-                                                        &attached);
+                                                        script, stub, &attached);
             if (newStub)
                 JitSpew(JitSpew_BaselineIC, "  Attached BindName CacheIR stub");
         }
         if (!attached)
             stub->state().trackNotAttached();
     }
 
     RootedObject scope(cx);
@@ -1399,18 +1390,17 @@ DoGetIntrinsicFallback(JSContext* cx, Ba
 
     if (stub->state().canAttachStub()) {
         bool attached = false;
         RootedScript script(cx, frame->script());
         GetIntrinsicIRGenerator gen(cx, script, pc, stub->state().mode(), res);
         if (gen.tryAttachStub()) {
             ICStub* newStub = AttachBaselineCacheIRStub(cx, gen.writerRef(), gen.cacheKind(),
                                                         BaselineCacheIRStubKind::Regular,
-                                                        ICStubEngine::Baseline, script, stub,
-                                                        &attached);
+                                                        script, stub, &attached);
             if (newStub)
                 JitSpew(JitSpew_BaselineIC, "  Attached GetIntrinsic CacheIR stub");
         }
         if (!attached)
             stub->state().trackNotAttached();
     }
 
     return true;
@@ -1501,18 +1491,17 @@ DoGetPropFallback(JSContext* cx, Baselin
     if (stub->state().canAttachStub()) {
         RootedValue idVal(cx, StringValue(name));
         GetPropIRGenerator gen(cx, script, pc, CacheKind::GetProp, stub->state().mode(),
                                &isTemporarilyUnoptimizable, val, idVal, val,
                                GetPropertyResultFlags::All);
         if (gen.tryAttachStub()) {
             ICStub* newStub = AttachBaselineCacheIRStub(cx, gen.writerRef(), gen.cacheKind(),
                                                         BaselineCacheIRStubKind::Monitored,
-                                                        ICStubEngine::Baseline, script,
-                                                        stub, &attached);
+                                                        script, stub, &attached);
             if (newStub) {
                 JitSpew(JitSpew_BaselineIC, "  Attached CacheIR stub");
                 if (gen.shouldNotePreliminaryObjectStub())
                     newStub->toCacheIR_Monitored()->notePreliminaryObject();
                 else if (gen.shouldUnlinkPreliminaryObjectStubs())
                     StripPreliminaryObjectStubs(cx, stub);
             }
         }
@@ -1572,18 +1561,17 @@ DoGetPropSuperFallback(JSContext* cx, Ba
     if (stub->state().canAttachStub()) {
         RootedValue idVal(cx, StringValue(name));
         GetPropIRGenerator gen(cx, script, pc, CacheKind::GetPropSuper, stub->state().mode(),
                                &isTemporarilyUnoptimizable, val, idVal, receiver,
                                GetPropertyResultFlags::All);
         if (gen.tryAttachStub()) {
             ICStub* newStub = AttachBaselineCacheIRStub(cx, gen.writerRef(), gen.cacheKind(),
                                                         BaselineCacheIRStubKind::Monitored,
-                                                        ICStubEngine::Baseline, script,
-                                                        stub, &attached);
+                                                        script, stub, &attached);
             if (newStub) {
                 JitSpew(JitSpew_BaselineIC, "  Attached CacheIR stub");
                 if (gen.shouldNotePreliminaryObjectStub())
                     newStub->toCacheIR_Monitored()->notePreliminaryObject();
                 else if (gen.shouldUnlinkPreliminaryObjectStubs())
                     StripPreliminaryObjectStubs(cx, stub);
             }
         }
@@ -1751,18 +1739,17 @@ DoSetPropFallback(JSContext* cx, Baselin
 
     if (stub->state().canAttachStub()) {
         RootedValue idVal(cx, StringValue(name));
         SetPropIRGenerator gen(cx, script, pc, CacheKind::SetProp, stub->state().mode(),
                                &isTemporarilyUnoptimizable, lhs, idVal, rhs);
         if (gen.tryAttachStub()) {
             ICStub* newStub = AttachBaselineCacheIRStub(cx, gen.writerRef(), gen.cacheKind(),
                                                         BaselineCacheIRStubKind::Updated,
-                                                        ICStubEngine::Baseline, frame->script(),
-                                                        stub, &attached);
+                                                        frame->script(), stub, &attached);
             if (newStub) {
                 JitSpew(JitSpew_BaselineIC, "  Attached SetProp CacheIR stub");
 
                 SetUpdateStubData(newStub->toCacheIR_Updated(), gen.typeCheckInfo());
 
                 if (gen.shouldNotePreliminaryObjectStub())
                     newStub->toCacheIR_Updated()->notePreliminaryObject();
                 else if (gen.shouldUnlinkPreliminaryObjectStubs())
@@ -1823,18 +1810,17 @@ DoSetPropFallback(JSContext* cx, Baselin
 
     if (stub->state().canAttachStub()) {
         RootedValue idVal(cx, StringValue(name));
         SetPropIRGenerator gen(cx, script, pc, CacheKind::SetProp, stub->state().mode(),
                                &isTemporarilyUnoptimizable, lhs, idVal, rhs);
         if (gen.tryAttachAddSlotStub(oldGroup, oldShape)) {
             ICStub* newStub = AttachBaselineCacheIRStub(cx, gen.writerRef(), gen.cacheKind(),
                                                         BaselineCacheIRStubKind::Updated,
-                                                        ICStubEngine::Baseline, frame->script(),
-                                                        stub, &attached);
+                                                        frame->script(), stub, &attached);
             if (newStub) {
                 if (gen.shouldNotePreliminaryObjectStub())
                     newStub->toCacheIR_Updated()->notePreliminaryObject();
                 else if (gen.shouldUnlinkPreliminaryObjectStubs())
                     StripPreliminaryObjectStubs(cx, stub);
 
                 JitSpew(JitSpew_BaselineIC, "  Attached SetProp CacheIR stub");
                 SetUpdateStubData(newStub->toCacheIR_Updated(), gen.typeCheckInfo());
@@ -2512,19 +2498,18 @@ DoCallFallback(JSContext* cx, BaselineFr
     // Only bother to try optimizing JSOP_CALL with CacheIR if the chain is still
     // allowed to attach stubs.
     if (canAttachStub) {
         CallIRGenerator gen(cx, script, pc, op, stub->state().mode(), argc,
                             callee, callArgs.thisv(),
                             HandleValueArray::fromMarkedLocation(argc, vp+2));
         if (gen.tryAttachStub()) {
             ICStub* newStub = AttachBaselineCacheIRStub(cx, gen.writerRef(), gen.cacheKind(),
-                                                        gen.cacheIRStubKind(),
-                                                        ICStubEngine::Baseline,
-                                                        script, stub, &handled);
+                                                        gen.cacheIRStubKind(), script,
+                                                        stub, &handled);
 
             if (newStub) {
                 JitSpew(JitSpew_BaselineIC, "  Attached Call CacheIR stub");
 
                 // If it's an updated stub, initialize it.
                 if (gen.cacheIRStubKind() == BaselineCacheIRStubKind::Updated)
                     SetUpdateStubData(newStub->toCacheIR_Updated(), gen.typeCheckInfo());
             }
@@ -4139,23 +4124,22 @@ DoGetIteratorFallback(JSContext* cx, Bas
 
     if (stub->state().maybeTransition())
         stub->discardStubs(cx);
 
     if (stub->state().canAttachStub()) {
         RootedScript script(cx, frame->script());
         jsbytecode* pc = stub->icEntry()->pc(script);
 
-        ICStubEngine engine = ICStubEngine::Baseline;
         GetIteratorIRGenerator gen(cx, script, pc, stub->state().mode(), value);
         bool attached = false;
         if (gen.tryAttachStub()) {
             ICStub* newStub = AttachBaselineCacheIRStub(cx, gen.writerRef(), gen.cacheKind(),
                                                         BaselineCacheIRStubKind::Regular,
-                                                        engine, script, stub, &attached);
+                                                        script, stub, &attached);
             if (newStub)
                 JitSpew(JitSpew_BaselineIC, "  Attached GetIterator CacheIR stub");
         }
         if (!attached)
             stub->state().trackNotAttached();
     }
 
     JSObject* iterobj = ValueToIterator(cx, value);
@@ -4337,41 +4321,40 @@ TryAttachInstanceOfStub(JSContext* cx, B
 
     if (stub->state().maybeTransition())
         stub->discardStubs(cx);
 
     if (stub->state().canAttachStub()) {
         RootedScript script(cx, frame->script());
         jsbytecode* pc = stub->icEntry()->pc(script);
 
-        ICStubEngine engine = ICStubEngine::Baseline;
         InstanceOfIRGenerator gen(cx, script, pc, stub->state().mode(),
                                   lhs,
                                   rhs);
 
         if (gen.tryAttachStub()) {
             ICStub* newStub = AttachBaselineCacheIRStub(cx, gen.writerRef(), gen.cacheKind(),
                                                         BaselineCacheIRStubKind::Regular,
-                                                        engine, script, stub, attached);
+                                                        script, stub, attached);
             if (newStub)
                 JitSpew(JitSpew_BaselineIC, "  Attached InstanceOf CacheIR stub, attached is now %d", *attached);
         }
         if (!attached)
             stub->state().trackNotAttached();
     }
 
     return true;
 }
 
 static bool
 DoInstanceOfFallback(JSContext* cx, BaselineFrame* frame, ICInstanceOf_Fallback* stub_,
                      HandleValue lhs, HandleValue rhs, MutableHandleValue res)
 {
     // This fallback stub may trigger debug mode toggling.
-    DebugModeOSRVolatileStub<ICInstanceOf_Fallback*> stub(ICStubEngine::Baseline, frame, stub_);
+    DebugModeOSRVolatileStub<ICInstanceOf_Fallback*> stub(frame, stub_);
 
     FallbackICSpew(cx, stub, "InstanceOf");
 
     if (!rhs.isObject()) {
         ReportValueError(cx, JSMSG_BAD_INSTANCEOF_RHS, -1, rhs, nullptr);
         return false;
     }
 
@@ -4440,23 +4423,22 @@ DoTypeOfFallback(JSContext* cx, Baseline
 
     if (stub->state().maybeTransition())
         stub->discardStubs(cx);
 
     if (stub->state().canAttachStub()) {
         RootedScript script(cx, frame->script());
         jsbytecode* pc = stub->icEntry()->pc(script);
 
-        ICStubEngine engine = ICStubEngine::Baseline;
         TypeOfIRGenerator gen(cx, script, pc, stub->state().mode(), val);
         bool attached = false;
         if (gen.tryAttachStub()) {
             ICStub* newStub = AttachBaselineCacheIRStub(cx, gen.writerRef(), gen.cacheKind(),
                                                         BaselineCacheIRStubKind::Regular,
-                                                        engine, script, stub, &attached);
+                                                        script, stub, &attached);
             if (newStub)
                 JitSpew(JitSpew_BaselineIC, "  Attached TypeOf CacheIR stub");
         }
         if (!attached)
             stub->state().trackNotAttached();
     }
 
     JSType type = js::TypeOfValue(val);
@@ -4759,17 +4741,17 @@ ICRest_Fallback::Compiler::generateStubC
 // UnaryArith_Fallback
 //
 
 static bool
 DoUnaryArithFallback(JSContext* cx, BaselineFrame* frame, ICUnaryArith_Fallback* stub,
                      HandleValue val, MutableHandleValue res)
 {
     // This fallback stub may trigger debug mode toggling.
-    DebugModeOSRVolatileStub<ICUnaryArith_Fallback*> debug_stub(ICStubEngine::Baseline, frame, stub);
+    DebugModeOSRVolatileStub<ICUnaryArith_Fallback*> debug_stub(frame, stub);
 
     RootedScript script(cx, frame->script());
     jsbytecode* pc = stub->icEntry()->pc(script);
     JSOp op = JSOp(*pc);
     FallbackICSpew(cx, stub, "UnaryArith(%s)", CodeName[op]);
 
     switch (op) {
       case JSOP_BITNOT: {
@@ -4802,17 +4784,17 @@ DoUnaryArithFallback(JSContext* cx, Base
 
     if (stub->state().canAttachStub()) {
         UnaryArithIRGenerator gen(cx, script, pc, stub->state().mode(),
                                     op, val, res);
         if (gen.tryAttachStub()) {
             bool attached = false;
             ICStub* newStub = AttachBaselineCacheIRStub(cx, gen.writerRef(), gen.cacheKind(),
                                                         BaselineCacheIRStubKind::Regular,
-                                                        ICStubEngine::Baseline, script, stub, &attached);
+                                                        script, stub, &attached);
             if (newStub) {
                 JitSpew(JitSpew_BaselineIC, "  Attached UnaryArith CacheIR stub for %s", CodeName[op]);
             }
         }
     }
 
     return true;
 }
@@ -4846,17 +4828,17 @@ ICUnaryArith_Fallback::Compiler::generat
 // BinaryArith_Fallback
 //
 
 static bool
 DoBinaryArithFallback(JSContext* cx, BaselineFrame* frame, ICBinaryArith_Fallback* stub_,
                       HandleValue lhs, HandleValue rhs, MutableHandleValue ret)
 {
     // This fallback stub may trigger debug mode toggling.
-    DebugModeOSRVolatileStub<ICBinaryArith_Fallback*> stub(ICStubEngine::Baseline, frame, stub_);
+    DebugModeOSRVolatileStub<ICBinaryArith_Fallback*> stub(frame, stub_);
 
     RootedScript script(cx, frame->script());
     jsbytecode* pc = stub->icEntry()->pc(script);
     JSOp op = JSOp(*pc);
     FallbackICSpew(cx, stub, "CacheIRBinaryArith(%s,%d,%d)", CodeName[op],
             int(lhs.isDouble() ? JSVAL_TYPE_DOUBLE : lhs.extractNonDoubleType()),
             int(rhs.isDouble() ? JSVAL_TYPE_DOUBLE : rhs.extractNonDoubleType()));
 
@@ -4955,17 +4937,17 @@ DoBinaryArithFallback(JSContext* cx, Bas
 
     if (stub->state().canAttachStub()) {
         BinaryArithIRGenerator gen(cx, script, pc, stub->state().mode(),
                                    op, lhs, rhs, ret);
         if (gen.tryAttachStub()) {
             bool attached = false;
             ICStub* newStub = AttachBaselineCacheIRStub(cx, gen.writerRef(), gen.cacheKind(),
                                                         BaselineCacheIRStubKind::Regular,
-                                                        ICStubEngine::Baseline, script, stub, &attached);
+                                                        script, stub, &attached);
             if (newStub)
                 JitSpew(JitSpew_BaselineIC, "  Attached BinaryArith CacheIR stub for %s", CodeName[op]);
 
         } else {
             stub->noteUnoptimizableOperands();
         }
     }
     return true;
@@ -5001,17 +4983,17 @@ ICBinaryArith_Fallback::Compiler::genera
 //
 // Compare_Fallback
 //
 static bool
 DoCompareFallback(JSContext* cx, BaselineFrame* frame, ICCompare_Fallback* stub_, HandleValue lhs,
                   HandleValue rhs, MutableHandleValue ret)
 {
     // This fallback stub may trigger debug mode toggling.
-    DebugModeOSRVolatileStub<ICCompare_Fallback*> stub(ICStubEngine::Baseline, frame, stub_);
+    DebugModeOSRVolatileStub<ICCompare_Fallback*> stub(frame, stub_);
 
     RootedScript script(cx, frame->script());
     jsbytecode* pc = stub->icEntry()->pc(script);
     JSOp op = JSOp(*pc);
 
     FallbackICSpew(cx, stub, "Compare(%s)", CodeName[op]);
 
     // Case operations in a CONDSWITCH are performing strict equality.
@@ -5077,17 +5059,17 @@ DoCompareFallback(JSContext* cx, Baselin
     }
 
     if (stub->state().canAttachStub()) {
         CompareIRGenerator gen(cx, script, pc, stub->state().mode(), op, lhs, rhs);
         bool attached = false;
         if (gen.tryAttachStub()) {
             ICStub* newStub = AttachBaselineCacheIRStub(cx, gen.writerRef(), gen.cacheKind(),
                                                         BaselineCacheIRStubKind::Regular,
-                                                        ICStubEngine::Baseline, script, stub, &attached);
+                                                        script, stub, &attached);
             if (newStub)
                     JitSpew(JitSpew_BaselineIC, "  Attached CacheIR stub");
             return true;
         }
     }
 
     stub->noteUnoptimizableAccess();
     return true;
@@ -5199,17 +5181,17 @@ DoNewObject(JSContext* cx, BaselineFrame
                 return false;
 
             if (!JitOptions.disableCacheIR) {
                 bool attached = false;
                 NewObjectIRGenerator gen(cx, script, pc, stub->state().mode(), JSOp(*pc), templateObject);
                 if (gen.tryAttachStub()) {
                     ICStub* newStub = AttachBaselineCacheIRStub(cx, gen.writerRef(), gen.cacheKind(),
                                                                 BaselineCacheIRStubKind::Regular,
-                                                                ICStubEngine::Baseline , script, stub, &attached);
+                                                                script, stub, &attached);
                     if (newStub)
                         JitSpew(JitSpew_BaselineIC, "  NewObject Attached CacheIR stub");
                 }
             }
             stub->setTemplateObject(templateObject);
         }
     }
 
--- a/js/src/jit/BaselineIC.h
+++ b/js/src/jit/BaselineIC.h
@@ -537,18 +537,18 @@ class ICGetProp_Fallback : public ICMoni
 
         virtual int32_t getKey() const override {
             return static_cast<int32_t>(engine_) |
                   (static_cast<int32_t>(kind) << 1) |
                   (static_cast<int32_t>(hasReceiver_) << 17);
         }
 
       public:
-        explicit Compiler(JSContext* cx, Engine engine, bool hasReceiver = false)
-          : ICStubCompiler(cx, ICStub::GetProp_Fallback, engine),
+        explicit Compiler(JSContext* cx, bool hasReceiver = false)
+          : ICStubCompiler(cx, ICStub::GetProp_Fallback, Engine::Baseline),
             hasReceiver_(hasReceiver)
         { }
 
         ICStub* getStub(ICStubSpace* space) override {
             return newStub<ICGetProp_Fallback>(space, getStubCode());
         }
     };
 };
@@ -1591,18 +1591,18 @@ class ICCompare_Fallback : public ICFall
     }
 
     // Compiler for this stub kind.
     class Compiler : public ICStubCompiler {
       protected:
         MOZ_MUST_USE bool generateStubCode(MacroAssembler& masm) override;
 
       public:
-        explicit Compiler(JSContext* cx, Engine engine)
-          : ICStubCompiler(cx, ICStub::Compare_Fallback, engine) {}
+        explicit Compiler(JSContext* cx)
+          : ICStubCompiler(cx, ICStub::Compare_Fallback, Engine::Baseline) {}
 
         ICStub* getStub(ICStubSpace* space) override {
             return newStub<ICCompare_Fallback>(space, getStubCode());
         }
     };
 };
 
 
@@ -1641,18 +1641,18 @@ class ICBinaryArith_Fallback : public IC
     }
 
     // Compiler for this stub kind.
     class Compiler : public ICStubCompiler {
       protected:
         MOZ_MUST_USE bool generateStubCode(MacroAssembler& masm) override;
 
       public:
-        explicit Compiler(JSContext* cx, Engine engine)
-          : ICStubCompiler(cx, ICStub::BinaryArith_Fallback, engine) {}
+        explicit Compiler(JSContext* cx)
+          : ICStubCompiler(cx, ICStub::BinaryArith_Fallback, Engine::Baseline) {}
 
         ICStub* getStub(ICStubSpace* space) override {
             return newStub<ICBinaryArith_Fallback>(space, getStubCode());
         }
     };
 };
 
 // JSOP_NEWARRAY
@@ -1673,18 +1673,18 @@ class ICNewArray_Fallback : public ICFal
     {}
 
   public:
     class Compiler : public ICStubCompiler {
         RootedObjectGroup templateGroup;
         MOZ_MUST_USE bool generateStubCode(MacroAssembler& masm) override;
 
       public:
-        Compiler(JSContext* cx, ObjectGroup* templateGroup, Engine engine)
-          : ICStubCompiler(cx, ICStub::NewArray_Fallback, engine),
+        Compiler(JSContext* cx, ObjectGroup* templateGroup)
+          : ICStubCompiler(cx, ICStub::NewArray_Fallback, Engine::Baseline),
             templateGroup(cx, templateGroup)
         {}
 
         ICStub* getStub(ICStubSpace* space) override {
             return newStub<ICNewArray_Fallback>(space, getStubCode(), templateGroup);
         }
     };
 
@@ -1720,18 +1720,18 @@ class ICNewObject_Fallback : public ICFa
       : ICFallbackStub(ICStub::NewObject_Fallback, stubCode), templateObject_(nullptr)
     {}
 
   public:
     class Compiler : public ICStubCompiler {
         MOZ_MUST_USE bool generateStubCode(MacroAssembler& masm) override;
 
       public:
-        explicit Compiler(JSContext* cx, Engine engine)
-          : ICStubCompiler(cx, ICStub::NewObject_Fallback, engine)
+        explicit Compiler(JSContext* cx)
+          : ICStubCompiler(cx, ICStub::NewObject_Fallback, Engine::Baseline)
         {}
 
         ICStub* getStub(ICStubSpace* space) override {
             return newStub<ICNewObject_Fallback>(space, getStubCode());
         }
     };
 
     GCPtrObject& templateObject() {
--- a/js/src/jit/JitRealm.h
+++ b/js/src/jit/JitRealm.h
@@ -340,19 +340,16 @@ class JitRuntime
 
 enum class CacheKind : uint8_t;
 class CacheIRStubInfo;
 
 enum class ICStubEngine : uint8_t {
     // Baseline IC, see SharedIC.h and BaselineIC.h.
     Baseline = 0,
 
-    // Ion IC that reuses Baseline IC code, see SharedIC.h.
-    IonSharedIC,
-
     // Ion IC, see IonIC.h.
     IonIC
 };
 
 struct CacheIRStubKey : public DefaultHasher<CacheIRStubKey> {
     struct Lookup {
         CacheKind kind;
         ICStubEngine engine;
--- a/js/src/jit/SharedIC.cpp
+++ b/js/src/jit/SharedIC.cpp
@@ -613,21 +613,16 @@ ICStubCompiler::leaveStubFrame(MacroAsse
         masm.adjustFrame(sizeof(intptr_t)); // Calls into ion have this extra.
 #endif
     EmitBaselineLeaveStubFrame(masm, calledIntoIon);
 }
 
 void
 ICStubCompiler::pushStubPayload(MacroAssembler& masm, Register scratch)
 {
-    if (engine_ == Engine::IonSharedIC) {
-        masm.push(Imm32(0));
-        return;
-    }
-
     if (inStubFrame_) {
         masm.loadPtr(Address(BaselineFrameReg, 0), scratch);
         masm.pushBaselineFramePtr(scratch, scratch);
     } else {
         masm.pushBaselineFramePtr(BaselineFrameReg, scratch);
     }
 }