author | Matthew Gaudet <mgaudet@mozilla.com> |
Tue, 21 Aug 2018 10:05:47 -0400 | |
changeset 433136 | b733b2488363f3f2bdd6e14cc9df1694f7f8ae3a |
parent 433135 | c594e6a343778c1c0fb27466b5554ca788c97252 |
child 433137 | 370a45e8ea65c3fe50b9abd4651c525c18ab6934 |
push id | 34499 |
push user | csabou@mozilla.com |
push date | Thu, 23 Aug 2018 21:40:51 +0000 |
treeherder | mozilla-central@49b70f7e6817 [default view] [failures only] |
perfherder | [talos] [build metrics] [platform microbench] (compared to previous push) |
reviewers | jandem |
bugs | 1479603 |
milestone | 63.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
|
--- a/js/src/jit/BaselineCacheIRCompiler.cpp +++ b/js/src/jit/BaselineCacheIRCompiler.cpp @@ -2218,18 +2218,17 @@ 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, - ICStubEngine::Baseline); + outerScript); 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/BaselineDebugModeOSR.cpp +++ b/js/src/jit/BaselineDebugModeOSR.cpp @@ -777,18 +777,18 @@ CloneOldBaselineStub(JSContext* cx, Debu for (size_t i = 0; i < entryIndex; i++) { if (oldStub == entries[i].oldStub && entries[i].frameKind != ICEntry::Kind_Invalid) { MOZ_ASSERT(entries[i].newStub); entry.newStub = entries[i].newStub; return true; } } - ICStubSpace* stubSpace = ICStubCompiler::StubSpaceForStub(oldStub->makesGCCalls(), entry.script, - ICStubCompiler::Engine::Baseline); + ICStubSpace* stubSpace = ICStubCompiler::StubSpaceForStub(oldStub->makesGCCalls(), + entry.script); // Clone the existing stub into the recompiled IC. // // Note that since JitCode is a GC thing, cloning an ICStub with the same // JitCode ensures it won't be collected. switch (oldStub->kind()) { #define CASE_KIND(kindName) \ case ICStub::kindName: \
--- a/js/src/jit/BaselineIC.cpp +++ b/js/src/jit/BaselineIC.cpp @@ -173,18 +173,16 @@ typedef bool (*DoWarmUpCounterFallbackOS ICWarmUpCounter_Fallback*, IonOsrTempData** infoPtr); static const VMFunction DoWarmUpCounterFallbackOSRInfo = FunctionInfo<DoWarmUpCounterFallbackOSRFn>(DoWarmUpCounterFallbackOSR, "DoWarmUpCounterFallbackOSR"); bool ICWarmUpCounter_Fallback::Compiler::generateStubCode(MacroAssembler& masm) { - MOZ_ASSERT(engine_ == Engine::Baseline); - // Push a stub frame so that we can perform a non-tail call. enterStubFrame(masm, R1.scratchReg()); Label noCompiledCode; // Call DoWarmUpCounterFallbackOSR to compile/check-for Ion-compiled function { // Push IonOsrTempData pointer storage masm.subFromStackPtr(Imm32(sizeof(void*))); @@ -341,29 +339,25 @@ DoTypeUpdateFallback(JSContext* cx, Base typedef bool (*DoTypeUpdateFallbackFn)(JSContext*, BaselineFrame*, ICUpdatedStub*, HandleValue, HandleValue); const VMFunction DoTypeUpdateFallbackInfo = FunctionInfo<DoTypeUpdateFallbackFn>(DoTypeUpdateFallback, "DoTypeUpdateFallback", NonTailCall); bool ICTypeUpdate_Fallback::Compiler::generateStubCode(MacroAssembler& masm) { - MOZ_ASSERT(engine_ == Engine::Baseline); - // Just store false into R1.scratchReg() and return. masm.move32(Imm32(0), R1.scratchReg()); EmitReturnFromIC(masm); return true; } bool ICTypeUpdate_PrimitiveSet::Compiler::generateStubCode(MacroAssembler& masm) { - MOZ_ASSERT(engine_ == Engine::Baseline); - Label success; if ((flags_ & TypeToFlag(JSVAL_TYPE_INT32)) && !(flags_ & TypeToFlag(JSVAL_TYPE_DOUBLE))) masm.branchTestInt32(Assembler::Equal, R0, &success); if (flags_ & TypeToFlag(JSVAL_TYPE_DOUBLE)) masm.branchTestNumber(Assembler::Equal, R0, &success); if (flags_ & TypeToFlag(JSVAL_TYPE_UNDEFINED)) @@ -392,18 +386,16 @@ ICTypeUpdate_PrimitiveSet::Compiler::gen EmitReturnFromIC(masm); return true; } bool ICTypeUpdate_SingleObject::Compiler::generateStubCode(MacroAssembler& masm) { - MOZ_ASSERT(engine_ == Engine::Baseline); - Label failure; masm.branchTestObject(Assembler::NotEqual, R0, &failure); // Guard on the object's identity. Register obj = masm.extractObject(R0, R1.scratchReg()); Address expectedObject(ICStubReg, ICTypeUpdate_SingleObject::offsetOfObject()); masm.branchPtr(Assembler::NotEqual, expectedObject, obj, &failure); @@ -414,18 +406,16 @@ ICTypeUpdate_SingleObject::Compiler::gen masm.bind(&failure); EmitStubGuardFailure(masm); return true; } bool ICTypeUpdate_ObjectGroup::Compiler::generateStubCode(MacroAssembler& masm) { - MOZ_ASSERT(engine_ == Engine::Baseline); - Label failure; masm.branchTestObject(Assembler::NotEqual, R0, &failure); // Guard on the object's ObjectGroup. Address expectedGroup(ICStubReg, ICTypeUpdate_ObjectGroup::offsetOfGroup()); Register scratch1 = R1.scratchReg(); masm.unboxObject(R0, scratch1); masm.branchTestObjGroup(Assembler::NotEqual, scratch1, expectedGroup, scratch1, @@ -491,17 +481,16 @@ DoToBoolFallback(JSContext* cx, Baseline typedef bool (*pf)(JSContext*, BaselineFrame*, ICToBool_Fallback*, HandleValue, MutableHandleValue); static const VMFunction fun = FunctionInfo<pf>(DoToBoolFallback, "DoToBoolFallback", TailCall); bool ICToBool_Fallback::Compiler::generateStubCode(MacroAssembler& masm) { - MOZ_ASSERT(engine_ == Engine::Baseline); MOZ_ASSERT(R0 == JSReturnOperand); // Restore the tail call register. EmitRestoreTailCallReg(masm); // Push arguments. masm.pushValue(R0); masm.push(ICStubReg); @@ -526,17 +515,16 @@ DoToNumberFallback(JSContext* cx, ICToNu typedef bool (*DoToNumberFallbackFn)(JSContext*, ICToNumber_Fallback*, HandleValue, MutableHandleValue); static const VMFunction DoToNumberFallbackInfo = FunctionInfo<DoToNumberFallbackFn>(DoToNumberFallback, "DoToNumberFallback", TailCall, PopValues(1)); bool ICToNumber_Fallback::Compiler::generateStubCode(MacroAssembler& masm) { - MOZ_ASSERT(engine_ == Engine::Baseline); MOZ_ASSERT(R0 == JSReturnOperand); // Restore the tail call register. EmitRestoreTailCallReg(masm); // Ensure stack is fully synced for the expression decompiler. masm.pushValue(R0); @@ -740,17 +728,16 @@ typedef bool (*DoGetElemSuperFallbackFn) MutableHandleValue); static const VMFunction DoGetElemSuperFallbackInfo = FunctionInfo<DoGetElemSuperFallbackFn>(DoGetElemSuperFallback, "DoGetElemSuperFallback", TailCall, PopValues(3)); bool ICGetElem_Fallback::Compiler::generateStubCode(MacroAssembler& masm) { - MOZ_ASSERT(engine_ == Engine::Baseline); MOZ_ASSERT(R0 == JSReturnOperand); // Restore the tail call register. EmitRestoreTailCallReg(masm); // Super property getters use a |this| that differs from base object if (hasReceiver_) { // State: receiver in R0, index in R1, obj on the stack @@ -928,17 +915,16 @@ typedef bool (*DoSetElemFallbackFn)(JSCo HandleValue, HandleValue, HandleValue); static const VMFunction DoSetElemFallbackInfo = FunctionInfo<DoSetElemFallbackFn>(DoSetElemFallback, "DoSetElemFallback", TailCall, PopValues(2)); bool ICSetElem_Fallback::Compiler::generateStubCode(MacroAssembler& masm) { - MOZ_ASSERT(engine_ == Engine::Baseline); MOZ_ASSERT(R0 == JSReturnOperand); EmitRestoreTailCallReg(masm); // State: R0: object, R1: index, stack: rhs. // For the decompiler, the stack has to be: object, index, rhs, // so we push the index, then overwrite the rhs Value with R0 // and push the rhs value. @@ -1119,18 +1105,16 @@ DoInFallback(JSContext* cx, BaselineFram typedef bool (*DoInFallbackFn)(JSContext*, BaselineFrame*, ICIn_Fallback*, HandleValue, HandleValue, MutableHandleValue); static const VMFunction DoInFallbackInfo = FunctionInfo<DoInFallbackFn>(DoInFallback, "DoInFallback", TailCall, PopValues(2)); bool ICIn_Fallback::Compiler::generateStubCode(MacroAssembler& masm) { - MOZ_ASSERT(engine_ == Engine::Baseline); - EmitRestoreTailCallReg(masm); // Sync for the decompiler. masm.pushValue(R0); masm.pushValue(R1); // Push arguments. masm.pushValue(R1); @@ -1186,18 +1170,16 @@ DoHasOwnFallback(JSContext* cx, Baseline typedef bool (*DoHasOwnFallbackFn)(JSContext*, BaselineFrame*, ICHasOwn_Fallback*, HandleValue, HandleValue, MutableHandleValue); static const VMFunction DoHasOwnFallbackInfo = FunctionInfo<DoHasOwnFallbackFn>(DoHasOwnFallback, "DoHasOwnFallback", TailCall, PopValues(2)); bool ICHasOwn_Fallback::Compiler::generateStubCode(MacroAssembler& masm) { - MOZ_ASSERT(engine_ == Engine::Baseline); - EmitRestoreTailCallReg(masm); // Sync for the decompiler. masm.pushValue(R0); masm.pushValue(R1); // Push arguments. masm.pushValue(R1); @@ -1275,17 +1257,16 @@ DoGetNameFallback(JSContext* cx, Baselin typedef bool (*DoGetNameFallbackFn)(JSContext*, BaselineFrame*, ICGetName_Fallback*, HandleObject, MutableHandleValue); static const VMFunction DoGetNameFallbackInfo = FunctionInfo<DoGetNameFallbackFn>(DoGetNameFallback, "DoGetNameFallback", TailCall); bool ICGetName_Fallback::Compiler::generateStubCode(MacroAssembler& masm) { - MOZ_ASSERT(engine_ == Engine::Baseline); MOZ_ASSERT(R0 == JSReturnOperand); EmitRestoreTailCallReg(masm); masm.push(R0.scratchReg()); masm.push(ICStubReg); pushStubPayload(masm, R0.scratchReg()); @@ -1337,17 +1318,16 @@ DoBindNameFallback(JSContext* cx, Baseli typedef bool (*DoBindNameFallbackFn)(JSContext*, BaselineFrame*, ICBindName_Fallback*, HandleObject, MutableHandleValue); static const VMFunction DoBindNameFallbackInfo = FunctionInfo<DoBindNameFallbackFn>(DoBindNameFallback, "DoBindNameFallback", TailCall); bool ICBindName_Fallback::Compiler::generateStubCode(MacroAssembler& masm) { - MOZ_ASSERT(engine_ == Engine::Baseline); MOZ_ASSERT(R0 == JSReturnOperand); EmitRestoreTailCallReg(masm); masm.push(R0.scratchReg()); masm.push(ICStubReg); pushStubPayload(masm, R0.scratchReg()); @@ -1410,18 +1390,16 @@ typedef bool (*DoGetIntrinsicFallbackFn) MutableHandleValue); static const VMFunction DoGetIntrinsicFallbackInfo = FunctionInfo<DoGetIntrinsicFallbackFn>(DoGetIntrinsicFallback, "DoGetIntrinsicFallback", TailCall); bool ICGetIntrinsic_Fallback::Compiler::generateStubCode(MacroAssembler& masm) { - MOZ_ASSERT(engine_ == Engine::Baseline); - EmitRestoreTailCallReg(masm); masm.push(ICStubReg); pushStubPayload(masm, R0.scratchReg()); return tailCallVM(DoGetIntrinsicFallbackInfo, masm); } @@ -1664,22 +1642,20 @@ ICGetProp_Fallback::Compiler::generateSt EmitEnterTypeMonitorIC(masm, ICTypeMonitor_Fallback::offsetOfFirstMonitorStub()); return true; } void ICGetProp_Fallback::Compiler::postGenerateStubCode(MacroAssembler& masm, Handle<JitCode*> code) { - if (engine_ == Engine::Baseline) { - BailoutReturnStub kind = hasReceiver_ ? BailoutReturnStub::GetPropSuper - : BailoutReturnStub::GetProp; - void* address = code->raw() + bailoutReturnOffset_.offset(); - cx->realm()->jitRealm()->initBailoutReturnAddr(address, getKey(), kind); - } + BailoutReturnStub kind = hasReceiver_ ? BailoutReturnStub::GetPropSuper + : BailoutReturnStub::GetProp; + void* address = code->raw() + bailoutReturnOffset_.offset(); + cx->realm()->jitRealm()->initBailoutReturnAddr(address, getKey(), kind); } // // SetProp_Fallback // static bool DoSetPropFallback(JSContext* cx, BaselineFrame* frame, ICSetProp_Fallback* stub_, Value* stack, @@ -1842,17 +1818,16 @@ typedef bool (*DoSetPropFallbackFn)(JSCo HandleValue, HandleValue); static const VMFunction DoSetPropFallbackInfo = FunctionInfo<DoSetPropFallbackFn>(DoSetPropFallback, "DoSetPropFallback", TailCall, PopValues(1)); bool ICSetProp_Fallback::Compiler::generateStubCode(MacroAssembler& masm) { - MOZ_ASSERT(engine_ == Engine::Baseline); MOZ_ASSERT(R0 == JSReturnOperand); EmitRestoreTailCallReg(masm); // Ensure stack is fully synced for the expression decompiler. // Overwrite the RHS value on top of the stack with the object, then push // the RHS in R1 on top of that. masm.storeValue(R0, Address(masm.getStackPointer(), 0)); @@ -2937,18 +2912,16 @@ static const VMFunction DoCallFallbackIn typedef bool (*DoSpreadCallFallbackFn)(JSContext*, BaselineFrame*, ICCall_Fallback*, Value*, MutableHandleValue); static const VMFunction DoSpreadCallFallbackInfo = FunctionInfo<DoSpreadCallFallbackFn>(DoSpreadCallFallback, "DoSpreadCallFallback"); bool ICCall_Fallback::Compiler::generateStubCode(MacroAssembler& masm) { - MOZ_ASSERT(engine_ == Engine::Baseline); - MOZ_ASSERT(R0 == JSReturnOperand); // Values are on the stack left-to-right. Calling convention wants them // right-to-left so duplicate them on the stack in reverse order. // |this| and callee are pushed last. AllocatableGeneralRegisterSet regs(availableGeneralRegs(0)); @@ -3065,18 +3038,16 @@ ICCall_Fallback::Compiler::postGenerateS typedef bool (*CreateThisFn)(JSContext* cx, HandleObject callee, HandleObject newTarget, MutableHandleValue rval); static const VMFunction CreateThisInfoBaseline = FunctionInfo<CreateThisFn>(CreateThis, "CreateThis"); bool ICCallScriptedCompiler::generateStubCode(MacroAssembler& masm) { - MOZ_ASSERT(engine_ == Engine::Baseline); - Label failure; AllocatableGeneralRegisterSet regs(availableGeneralRegs(0)); bool canUseTailCallReg = regs.has(ICTailCallReg); Register argcReg = R0.scratchReg(); regs.take(argcReg); regs.takeUnchecked(ICTailCallReg); @@ -3333,18 +3304,16 @@ ICCallScriptedCompiler::generateStubCode typedef bool (*CopyStringSplitArrayFn)(JSContext*, HandleArrayObject, MutableHandleValue); static const VMFunction CopyStringSplitArrayInfo = FunctionInfo<CopyStringSplitArrayFn>(CopyStringSplitArray, "CopyStringSplitArray"); bool ICCall_ConstStringSplit::Compiler::generateStubCode(MacroAssembler& masm) { - MOZ_ASSERT(engine_ == Engine::Baseline); - // Stack Layout: [ ..., CalleeVal, ThisVal, strVal, sepVal, +ICStackValueOffset+ ] static const size_t SEP_DEPTH = 0; static const size_t STR_DEPTH = sizeof(Value); static const size_t CALLEE_DEPTH = 3 * sizeof(Value); AllocatableGeneralRegisterSet regs(availableGeneralRegs(0)); Label failureRestoreArgc; #ifdef DEBUG @@ -3433,18 +3402,16 @@ ICCall_ConstStringSplit::Compiler::gener masm.move32(Imm32(2), R0.scratchReg()); EmitStubGuardFailure(masm); return true; } bool ICCall_IsSuspendedGenerator::Compiler::generateStubCode(MacroAssembler& masm) { - MOZ_ASSERT(engine_ == Engine::Baseline); - // The IsSuspendedGenerator intrinsic is only called in self-hosted code, // so it's safe to assume we have a single argument and the callee is our // intrinsic. AllocatableGeneralRegisterSet regs(availableGeneralRegs(0)); // Load the argument. Address argAddr(masm.getStackPointer(), ICStackValueOffset); @@ -3478,18 +3445,16 @@ ICCall_IsSuspendedGenerator::Compiler::g masm.moveValue(BooleanValue(false), R0); EmitReturnFromIC(masm); return true; } bool ICCall_Native::Compiler::generateStubCode(MacroAssembler& masm) { - MOZ_ASSERT(engine_ == Engine::Baseline); - Label failure; AllocatableGeneralRegisterSet regs(availableGeneralRegs(0)); Register argcReg = R0.scratchReg(); regs.take(argcReg); regs.takeUnchecked(ICTailCallReg); if (isSpread_) @@ -3591,18 +3556,16 @@ ICCall_Native::Compiler::generateStubCod masm.bind(&failure); EmitStubGuardFailure(masm); return true; } bool ICCall_ClassHook::Compiler::generateStubCode(MacroAssembler& masm) { - MOZ_ASSERT(engine_ == Engine::Baseline); - Label failure; AllocatableGeneralRegisterSet regs(availableGeneralRegs(0)); Register argcReg = R0.scratchReg(); regs.take(argcReg); regs.takeUnchecked(ICTailCallReg); // Load the callee in R1. @@ -3682,18 +3645,16 @@ ICCall_ClassHook::Compiler::generateStub masm.bind(&failure); EmitStubGuardFailure(masm); return true; } bool ICCall_ScriptedApplyArray::Compiler::generateStubCode(MacroAssembler& masm) { - MOZ_ASSERT(engine_ == Engine::Baseline); - Label failure; AllocatableGeneralRegisterSet regs(availableGeneralRegs(0)); Register argcReg = R0.scratchReg(); regs.take(argcReg); regs.takeUnchecked(ICTailCallReg); // @@ -3780,18 +3741,16 @@ ICCall_ScriptedApplyArray::Compiler::gen masm.bind(&failure); EmitStubGuardFailure(masm); return true; } bool ICCall_ScriptedApplyArguments::Compiler::generateStubCode(MacroAssembler& masm) { - MOZ_ASSERT(engine_ == Engine::Baseline); - Label failure; AllocatableGeneralRegisterSet regs(availableGeneralRegs(0)); Register argcReg = R0.scratchReg(); regs.take(argcReg); regs.takeUnchecked(ICTailCallReg); // @@ -3872,18 +3831,16 @@ ICCall_ScriptedApplyArguments::Compiler: masm.bind(&failure); EmitStubGuardFailure(masm); return true; } bool ICCall_ScriptedFunCall::Compiler::generateStubCode(MacroAssembler& masm) { - MOZ_ASSERT(engine_ == Engine::Baseline); - Label failure; AllocatableGeneralRegisterSet regs(availableGeneralRegs(0)); bool canUseTailCallReg = regs.has(ICTailCallReg); Register argcReg = R0.scratchReg(); regs.take(argcReg); regs.takeUnchecked(ICTailCallReg); @@ -4006,18 +3963,16 @@ DoubleValueToInt32ForSwitch(Value* v) v->setInt32(truncated); return true; } bool ICTableSwitch::Compiler::generateStubCode(MacroAssembler& masm) { - MOZ_ASSERT(engine_ == Engine::Baseline); - Label isInt32, notInt32, outOfRange; Register scratch = R1.scratchReg(); masm.branchTestInt32(Assembler::NotEqual, R0, ¬Int32); Register key = masm.extractInt32(R0, ExtractTemp0); masm.bind(&isInt32); @@ -4154,18 +4109,16 @@ typedef bool (*DoGetIteratorFallbackFn)( HandleValue, MutableHandleValue); static const VMFunction DoGetIteratorFallbackInfo = FunctionInfo<DoGetIteratorFallbackFn>(DoGetIteratorFallback, "DoGetIteratorFallback", TailCall, PopValues(1)); bool ICGetIterator_Fallback::Compiler::generateStubCode(MacroAssembler& masm) { - MOZ_ASSERT(engine_ == Engine::Baseline); - EmitRestoreTailCallReg(masm); // Sync stack for the decompiler. masm.pushValue(R0); masm.pushValue(R0); masm.push(ICStubReg); pushStubPayload(masm, R0.scratchReg()); @@ -4213,18 +4166,16 @@ typedef bool (*DoIteratorMoreFallbackFn) HandleObject, MutableHandleValue); static const VMFunction DoIteratorMoreFallbackInfo = FunctionInfo<DoIteratorMoreFallbackFn>(DoIteratorMoreFallback, "DoIteratorMoreFallback", TailCall); bool ICIteratorMore_Fallback::Compiler::generateStubCode(MacroAssembler& masm) { - MOZ_ASSERT(engine_ == Engine::Baseline); - EmitRestoreTailCallReg(masm); masm.unboxObject(R0, R0.scratchReg()); masm.push(R0.scratchReg()); masm.push(ICStubReg); pushStubPayload(masm, R0.scratchReg()); return tailCallVM(DoIteratorMoreFallbackInfo, masm); @@ -4232,18 +4183,16 @@ ICIteratorMore_Fallback::Compiler::gener // // IteratorMore_Native // bool ICIteratorMore_Native::Compiler::generateStubCode(MacroAssembler& masm) { - MOZ_ASSERT(engine_ == Engine::Baseline); - Label failure; Register obj = masm.extractObject(R0, ExtractTemp0); AllocatableGeneralRegisterSet regs(availableGeneralRegs(1)); Register nativeIterator = regs.takeAny(); Register scratch = regs.takeAny(); @@ -4293,18 +4242,16 @@ DoIteratorCloseFallback(JSContext* cx, I typedef void (*DoIteratorCloseFallbackFn)(JSContext*, ICIteratorClose_Fallback*, HandleValue); static const VMFunction DoIteratorCloseFallbackInfo = FunctionInfo<DoIteratorCloseFallbackFn>(DoIteratorCloseFallback, "DoIteratorCloseFallback", TailCall); bool ICIteratorClose_Fallback::Compiler::generateStubCode(MacroAssembler& masm) { - MOZ_ASSERT(engine_ == Engine::Baseline); - EmitRestoreTailCallReg(masm); masm.pushValue(R0); masm.push(ICStubReg); return tailCallVM(DoIteratorCloseFallbackInfo, masm); } @@ -4390,18 +4337,16 @@ typedef bool (*DoInstanceOfFallbackFn)(J HandleValue, HandleValue, MutableHandleValue); static const VMFunction DoInstanceOfFallbackInfo = FunctionInfo<DoInstanceOfFallbackFn>(DoInstanceOfFallback, "DoInstanceOfFallback", TailCall, PopValues(2)); bool ICInstanceOf_Fallback::Compiler::generateStubCode(MacroAssembler& masm) { - MOZ_ASSERT(engine_ == Engine::Baseline); - EmitRestoreTailCallReg(masm); // Sync stack for the decompiler. masm.pushValue(R0); masm.pushValue(R1); masm.pushValue(R1); masm.pushValue(R0); @@ -4450,18 +4395,16 @@ DoTypeOfFallback(JSContext* cx, Baseline typedef bool (*DoTypeOfFallbackFn)(JSContext*, BaselineFrame* frame, ICTypeOf_Fallback*, HandleValue, MutableHandleValue); static const VMFunction DoTypeOfFallbackInfo = FunctionInfo<DoTypeOfFallbackFn>(DoTypeOfFallback, "DoTypeOfFallback", TailCall); bool ICTypeOf_Fallback::Compiler::generateStubCode(MacroAssembler& masm) { - MOZ_ASSERT(engine_ == Engine::Baseline); - EmitRestoreTailCallReg(masm); masm.pushValue(R0); masm.push(ICStubReg); pushStubPayload(masm, R0.scratchReg()); return tailCallVM(DoTypeOfFallbackInfo, masm); } @@ -4503,18 +4446,16 @@ static const VMFunction DoRetSubFallback typedef bool (*ThrowFn)(JSContext*, HandleValue); static const VMFunction ThrowInfoBaseline = FunctionInfo<ThrowFn>(js::Throw, "ThrowInfoBaseline", TailCall); bool ICRetSub_Fallback::Compiler::generateStubCode(MacroAssembler& masm) { - MOZ_ASSERT(engine_ == Engine::Baseline); - // If R0 is BooleanValue(true), rethrow R1. Label rethrow; masm.branchTestBooleanTruthy(true, R0, &rethrow); { // Call a stub to get the native code address for the pc offset in R1. AllocatableGeneralRegisterSet regs(availableGeneralRegs(0)); regs.take(R1); regs.takeUnchecked(ICTailCallReg); @@ -4539,18 +4480,16 @@ ICRetSub_Fallback::Compiler::generateStu EmitRestoreTailCallReg(masm); masm.pushValue(R1); return tailCallVM(ThrowInfoBaseline, masm); } bool ICRetSub_Resume::Compiler::generateStubCode(MacroAssembler& masm) { - MOZ_ASSERT(engine_ == Engine::Baseline); - // If R0 is BooleanValue(true), rethrow R1. Label fail, rethrow; masm.branchTestBooleanTruthy(true, R0, &rethrow); // R1 is the pc offset. Ensure it matches this stub's offset. Register offset = masm.extractInt32(R1, ExtractTemp0); masm.branch32(Assembler::NotEqual, Address(ICStubReg, ICRetSub_Resume::offsetOfPCOffset()), @@ -4722,18 +4661,16 @@ DoRestFallback(JSContext* cx, BaselineFr typedef bool (*DoRestFallbackFn)(JSContext*, BaselineFrame*, ICRest_Fallback*, MutableHandleValue); static const VMFunction DoRestFallbackInfo = FunctionInfo<DoRestFallbackFn>(DoRestFallback, "DoRestFallback", TailCall); bool ICRest_Fallback::Compiler::generateStubCode(MacroAssembler& masm) { - MOZ_ASSERT(engine_ == Engine::Baseline); - EmitRestoreTailCallReg(masm); masm.push(ICStubReg); pushStubPayload(masm, R0.scratchReg()); return tailCallVM(DoRestFallbackInfo, masm); }
--- a/js/src/jit/BaselineIC.h +++ b/js/src/jit/BaselineIC.h @@ -39,17 +39,17 @@ class ICWarmUpCounter_Fallback : public public: // Compiler for this stub kind. class Compiler : public ICStubCompiler { protected: MOZ_MUST_USE bool generateStubCode(MacroAssembler& masm) override; public: explicit Compiler(JSContext* cx) - : ICStubCompiler(cx, ICStub::WarmUpCounter_Fallback, Engine::Baseline) + : ICStubCompiler(cx, ICStub::WarmUpCounter_Fallback) { } ICWarmUpCounter_Fallback* getStub(ICStubSpace* space) override { return newStub<ICWarmUpCounter_Fallback>(space, getStubCode()); } }; }; @@ -71,17 +71,17 @@ class ICTypeUpdate_Fallback : public ICS public: // Compiler for this stub kind. class Compiler : public ICStubCompiler { protected: MOZ_MUST_USE bool generateStubCode(MacroAssembler& masm) override; public: explicit Compiler(JSContext* cx) - : ICStubCompiler(cx, ICStub::TypeUpdate_Fallback, Engine::Baseline) + : ICStubCompiler(cx, ICStub::TypeUpdate_Fallback) { } ICTypeUpdate_Fallback* getStub(ICStubSpace* space) override { return newStub<ICTypeUpdate_Fallback>(space, getStubCode()); } }; }; @@ -139,17 +139,17 @@ class ICTypeUpdate_SingleObject : public class Compiler : public ICStubCompiler { protected: HandleObject obj_; MOZ_MUST_USE bool generateStubCode(MacroAssembler& masm) override; public: Compiler(JSContext* cx, HandleObject obj) - : ICStubCompiler(cx, TypeUpdate_SingleObject, Engine::Baseline), + : ICStubCompiler(cx, TypeUpdate_SingleObject), obj_(obj) { } ICTypeUpdate_SingleObject* getStub(ICStubSpace* space) override { return newStub<ICTypeUpdate_SingleObject>(space, getStubCode(), obj_); } }; }; @@ -174,17 +174,17 @@ class ICTypeUpdate_ObjectGroup : public class Compiler : public ICStubCompiler { protected: HandleObjectGroup group_; MOZ_MUST_USE bool generateStubCode(MacroAssembler& masm) override; public: Compiler(JSContext* cx, HandleObjectGroup group) - : ICStubCompiler(cx, TypeUpdate_ObjectGroup, Engine::Baseline), + : ICStubCompiler(cx, TypeUpdate_ObjectGroup), group_(group) { } ICTypeUpdate_ObjectGroup* getStub(ICStubSpace* space) override { return newStub<ICTypeUpdate_ObjectGroup>(space, getStubCode(), group_); } }; }; @@ -199,17 +199,17 @@ class ICTypeUpdate_AnyValue : public ICS public: class Compiler : public ICStubCompiler { protected: MOZ_MUST_USE bool generateStubCode(MacroAssembler& masm) override; public: explicit Compiler(JSContext* cx) - : ICStubCompiler(cx, TypeUpdate_AnyValue, Engine::Baseline) + : ICStubCompiler(cx, TypeUpdate_AnyValue) {} ICTypeUpdate_AnyValue* getStub(ICStubSpace* space) override { return newStub<ICTypeUpdate_AnyValue>(space, getStubCode()); } }; }; @@ -228,17 +228,17 @@ class ICToBool_Fallback : public ICFallb // Compiler for this stub kind. class Compiler : public ICStubCompiler { protected: MOZ_MUST_USE bool generateStubCode(MacroAssembler& masm) override; public: explicit Compiler(JSContext* cx) - : ICStubCompiler(cx, ICStub::ToBool_Fallback, Engine::Baseline) {} + : ICStubCompiler(cx, ICStub::ToBool_Fallback) {} ICStub* getStub(ICStubSpace* space) override { return newStub<ICToBool_Fallback>(space, getStubCode()); } }; }; // ToNumber @@ -254,17 +254,17 @@ class ICToNumber_Fallback : public ICFal public: // Compiler for this stub kind. class Compiler : public ICStubCompiler { protected: MOZ_MUST_USE bool generateStubCode(MacroAssembler& masm) override; public: explicit Compiler(JSContext* cx) - : ICStubCompiler(cx, ICStub::ToNumber_Fallback, Engine::Baseline) {} + : ICStubCompiler(cx, ICStub::ToNumber_Fallback) {} ICStub* getStub(ICStubSpace* space) override { return newStub<ICToNumber_Fallback>(space, getStubCode()); } }; }; // GetElem @@ -298,24 +298,23 @@ class ICGetElem_Fallback : public ICMoni // Compiler for this stub kind. class Compiler : public ICStubCompiler { protected: bool hasReceiver_; MOZ_MUST_USE bool generateStubCode(MacroAssembler& masm) override; virtual int32_t getKey() const override { - return static_cast<int32_t>(engine_) | - (static_cast<int32_t>(kind) << 1) | + return static_cast<int32_t>(kind) << 1 | (static_cast<int32_t>(hasReceiver_) << 17); } public: explicit Compiler(JSContext* cx, bool hasReceiver = false) - : ICStubCompiler(cx, ICStub::GetElem_Fallback, Engine::Baseline), + : ICStubCompiler(cx, ICStub::GetElem_Fallback), hasReceiver_(hasReceiver) { } ICStub* getStub(ICStubSpace* space) override { return newStub<ICGetElem_Fallback>(space, getStubCode()); } }; }; @@ -344,17 +343,17 @@ class ICSetElem_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) - : ICStubCompiler(cx, ICStub::SetElem_Fallback, Engine::Baseline) + : ICStubCompiler(cx, ICStub::SetElem_Fallback) { } ICStub* getStub(ICStubSpace* space) override { return newStub<ICSetElem_Fallback>(space, getStubCode()); } }; }; @@ -370,17 +369,17 @@ class ICIn_Fallback : public ICFallbackS public: class Compiler : public ICStubCompiler { protected: MOZ_MUST_USE bool generateStubCode(MacroAssembler& masm) override; public: explicit Compiler(JSContext* cx) - : ICStubCompiler(cx, ICStub::In_Fallback, Engine::Baseline) + : ICStubCompiler(cx, ICStub::In_Fallback) { } ICStub* getStub(ICStubSpace* space) override { return newStub<ICIn_Fallback>(space, getStubCode()); } }; }; @@ -396,17 +395,17 @@ class ICHasOwn_Fallback : public ICFallb public: class Compiler : public ICStubCompiler { protected: MOZ_MUST_USE bool generateStubCode(MacroAssembler& masm) override; public: explicit Compiler(JSContext* cx) - : ICStubCompiler(cx, ICStub::HasOwn_Fallback, Engine::Baseline) + : ICStubCompiler(cx, ICStub::HasOwn_Fallback) { } ICStub* getStub(ICStubSpace* space) override { return newStub<ICHasOwn_Fallback>(space, getStubCode()); } }; }; @@ -432,17 +431,17 @@ class ICGetName_Fallback : public ICMoni } class Compiler : public ICStubCompiler { protected: MOZ_MUST_USE bool generateStubCode(MacroAssembler& masm) override; public: explicit Compiler(JSContext* cx) - : ICStubCompiler(cx, ICStub::GetName_Fallback, Engine::Baseline) + : ICStubCompiler(cx, ICStub::GetName_Fallback) { } ICStub* getStub(ICStubSpace* space) override { return newStub<ICGetName_Fallback>(space, getStubCode()); } }; }; @@ -458,17 +457,17 @@ class ICBindName_Fallback : public ICFal public: class Compiler : public ICStubCompiler { protected: MOZ_MUST_USE bool generateStubCode(MacroAssembler& masm) override; public: explicit Compiler(JSContext* cx) - : ICStubCompiler(cx, ICStub::BindName_Fallback, Engine::Baseline) + : ICStubCompiler(cx, ICStub::BindName_Fallback) { } ICStub* getStub(ICStubSpace* space) override { return newStub<ICBindName_Fallback>(space, getStubCode()); } }; }; @@ -484,17 +483,17 @@ class ICGetIntrinsic_Fallback : public I public: class Compiler : public ICStubCompiler { protected: MOZ_MUST_USE bool generateStubCode(MacroAssembler& masm) override; public: explicit Compiler(JSContext* cx) - : ICStubCompiler(cx, ICStub::GetIntrinsic_Fallback, Engine::Baseline) + : ICStubCompiler(cx, ICStub::GetIntrinsic_Fallback) { } ICStub* getStub(ICStubSpace* space) override { return newStub<ICGetIntrinsic_Fallback>(space, getStubCode()); } }; }; @@ -531,24 +530,23 @@ class ICGetProp_Fallback : public ICMoni class Compiler : public ICStubCompiler { protected: CodeOffset bailoutReturnOffset_; bool hasReceiver_; MOZ_MUST_USE bool generateStubCode(MacroAssembler& masm) override; void postGenerateStubCode(MacroAssembler& masm, Handle<JitCode*> code) override; virtual int32_t getKey() const override { - return static_cast<int32_t>(engine_) | - (static_cast<int32_t>(kind) << 1) | + return static_cast<int32_t>(kind) << 1 | (static_cast<int32_t>(hasReceiver_) << 17); } public: explicit Compiler(JSContext* cx, bool hasReceiver = false) - : ICStubCompiler(cx, ICStub::GetProp_Fallback, Engine::Baseline), + : ICStubCompiler(cx, ICStub::GetProp_Fallback), hasReceiver_(hasReceiver) { } ICStub* getStub(ICStubSpace* space) override { return newStub<ICGetProp_Fallback>(space, getStubCode()); } }; }; @@ -580,17 +578,17 @@ class ICSetProp_Fallback : public ICFall class Compiler : public ICStubCompiler { protected: CodeOffset bailoutReturnOffset_; MOZ_MUST_USE bool generateStubCode(MacroAssembler& masm) override; void postGenerateStubCode(MacroAssembler& masm, Handle<JitCode*> code) override; public: explicit Compiler(JSContext* cx) - : ICStubCompiler(cx, ICStub::SetProp_Fallback, Engine::Baseline) + : ICStubCompiler(cx, ICStub::SetProp_Fallback) { } ICStub* getStub(ICStubSpace* space) override { return newStub<ICSetProp_Fallback>(space, getStubCode()); } }; }; @@ -603,17 +601,17 @@ class ICSetProp_Fallback : public ICFall // JSOP_SPREADCALL // JSOP_SPREADNEW // JSOP_SPREADEVAL class ICCallStubCompiler : public ICStubCompiler { protected: ICCallStubCompiler(JSContext* cx, ICStub::Kind kind) - : ICStubCompiler(cx, kind, Engine::Baseline) + : ICStubCompiler(cx, kind) { } enum FunApplyThing { FunApply_MagicArgs, FunApply_Array }; void pushCallArguments(MacroAssembler& masm, AllocatableGeneralRegisterSet regs, @@ -664,18 +662,17 @@ class ICCall_Fallback : public ICMonitor protected: bool isConstructing_; bool isSpread_; CodeOffset bailoutReturnOffset_; MOZ_MUST_USE bool generateStubCode(MacroAssembler& masm) override; void postGenerateStubCode(MacroAssembler& masm, Handle<JitCode*> code) override; virtual int32_t getKey() const override { - return static_cast<int32_t>(engine_) | - (static_cast<int32_t>(kind) << 1) | + return static_cast<int32_t>(kind) << 1 | (static_cast<int32_t>(isSpread_) << 17) | (static_cast<int32_t>(isConstructing_) << 18); } public: Compiler(JSContext* cx, bool isConstructing, bool isSpread) : ICCallStubCompiler(cx, ICStub::Call_Fallback), isConstructing_(isConstructing), @@ -754,18 +751,17 @@ class ICCallScriptedCompiler : public IC bool isSpread_; bool maybeCrossRealm_; RootedFunction callee_; RootedObject templateObject_; uint32_t pcOffset_; MOZ_MUST_USE bool generateStubCode(MacroAssembler& masm) override; virtual int32_t getKey() const override { - return static_cast<int32_t>(engine_) | - (static_cast<int32_t>(kind) << 1) | + return static_cast<int32_t>(kind) << 1 | (static_cast<int32_t>(isConstructing_) << 17) | (static_cast<int32_t>(isSpread_) << 18) | (static_cast<int32_t>(maybeCrossRealm_) << 19); } public: ICCallScriptedCompiler(JSContext* cx, ICStub* firstMonitorStub, JSFunction* callee, JSObject* templateObject, @@ -852,18 +848,17 @@ class ICCall_Native : public ICMonitored bool isSpread_; bool isCrossRealm_; RootedFunction callee_; RootedObject templateObject_; uint32_t pcOffset_; MOZ_MUST_USE bool generateStubCode(MacroAssembler& masm) override; virtual int32_t getKey() const override { - return static_cast<int32_t>(engine_) | - (static_cast<int32_t>(kind) << 1) | + return static_cast<int32_t>(kind) << 1 | (static_cast<int32_t>(isSpread_) << 17) | (static_cast<int32_t>(isConstructing_) << 18) | (static_cast<int32_t>(ignoresReturnValue_) << 19) | (static_cast<int32_t>(isCrossRealm_) << 20); } public: Compiler(JSContext* cx, ICStub* firstMonitorStub, @@ -933,18 +928,17 @@ class ICCall_ClassHook : public ICMonito bool isConstructing_; const Class* clasp_; Native native_; RootedObject templateObject_; uint32_t pcOffset_; MOZ_MUST_USE bool generateStubCode(MacroAssembler& masm) override; virtual int32_t getKey() const override { - return static_cast<int32_t>(engine_) | - (static_cast<int32_t>(kind) << 1) | + return static_cast<int32_t>(kind) << 1 | (static_cast<int32_t>(isConstructing_) << 17); } public: Compiler(JSContext* cx, ICStub* firstMonitorStub, const Class* clasp, Native native, HandleObject templateObject, uint32_t pcOffset, bool isConstructing) @@ -993,21 +987,16 @@ class ICCall_ScriptedApplyArray : public // Compiler for this stub kind. class Compiler : public ICCallStubCompiler { protected: ICStub* firstMonitorStub_; uint32_t pcOffset_; MOZ_MUST_USE bool generateStubCode(MacroAssembler& masm) override; - virtual int32_t getKey() const override { - return static_cast<int32_t>(engine_) | - (static_cast<int32_t>(kind) << 1); - } - public: Compiler(JSContext* cx, ICStub* firstMonitorStub, uint32_t pcOffset) : ICCallStubCompiler(cx, ICStub::Call_ScriptedApplyArray), firstMonitorStub_(firstMonitorStub), pcOffset_(pcOffset) { } ICStub* getStub(ICStubSpace* space) override { @@ -1041,21 +1030,16 @@ class ICCall_ScriptedApplyArguments : pu // Compiler for this stub kind. class Compiler : public ICCallStubCompiler { protected: ICStub* firstMonitorStub_; uint32_t pcOffset_; MOZ_MUST_USE bool generateStubCode(MacroAssembler& masm) override; - virtual int32_t getKey() const override { - return static_cast<int32_t>(engine_) | - (static_cast<int32_t>(kind) << 1); - } - public: Compiler(JSContext* cx, ICStub* firstMonitorStub, uint32_t pcOffset) : ICCallStubCompiler(cx, ICStub::Call_ScriptedApplyArguments), firstMonitorStub_(firstMonitorStub), pcOffset_(pcOffset) { } ICStub* getStub(ICStubSpace* space) override { @@ -1088,21 +1072,16 @@ class ICCall_ScriptedFunCall : public IC // Compiler for this stub kind. class Compiler : public ICCallStubCompiler { protected: ICStub* firstMonitorStub_; uint32_t pcOffset_; MOZ_MUST_USE bool generateStubCode(MacroAssembler& masm) override; - virtual int32_t getKey() const override { - return static_cast<int32_t>(engine_) | - (static_cast<int32_t>(kind) << 1); - } - public: Compiler(JSContext* cx, ICStub* firstMonitorStub, uint32_t pcOffset) : ICCallStubCompiler(cx, ICStub::Call_ScriptedFunCall), firstMonitorStub_(firstMonitorStub), pcOffset_(pcOffset) { } ICStub* getStub(ICStubSpace* space) override { @@ -1159,21 +1138,16 @@ class ICCall_ConstStringSplit : public I ICStub* firstMonitorStub_; uint32_t pcOffset_; RootedString expectedStr_; RootedString expectedSep_; RootedArrayObject templateObject_; MOZ_MUST_USE bool generateStubCode(MacroAssembler& masm) override; - virtual int32_t getKey() const override { - return static_cast<int32_t>(engine_) | - (static_cast<int32_t>(kind) << 1); - } - public: Compiler(JSContext* cx, ICStub* firstMonitorStub, uint32_t pcOffset, HandleString str, HandleString sep, HandleArrayObject templateObject) : ICCallStubCompiler(cx, ICStub::Call_ConstStringSplit), firstMonitorStub_(firstMonitorStub), pcOffset_(pcOffset), expectedStr_(cx, str), expectedSep_(cx, sep), @@ -1199,17 +1173,17 @@ class ICCall_IsSuspendedGenerator : publ public: class Compiler : public ICStubCompiler { protected: MOZ_MUST_USE bool generateStubCode(MacroAssembler& masm) override; public: explicit Compiler(JSContext* cx) - : ICStubCompiler(cx, ICStub::Call_IsSuspendedGenerator, Engine::Baseline) + : ICStubCompiler(cx, ICStub::Call_IsSuspendedGenerator) {} ICStub* getStub(ICStubSpace* space) override { return newStub<ICCall_IsSuspendedGenerator>(space, getStubCode()); } }; }; // Stub for performing a TableSwitch, updating the IC's return address to jump @@ -1235,17 +1209,17 @@ class ICTableSwitch : public ICStub class Compiler : public ICStubCompiler { MOZ_MUST_USE bool generateStubCode(MacroAssembler& masm) override; jsbytecode* pc_; public: Compiler(JSContext* cx, jsbytecode* pc) - : ICStubCompiler(cx, ICStub::TableSwitch, Engine::Baseline), pc_(pc) + : ICStubCompiler(cx, ICStub::TableSwitch), pc_(pc) {} ICStub* getStub(ICStubSpace* space) override; }; }; // IC for constructing an iterator from an input value. class ICGetIterator_Fallback : public ICFallbackStub @@ -1258,17 +1232,17 @@ class ICGetIterator_Fallback : public IC public: class Compiler : public ICStubCompiler { protected: MOZ_MUST_USE bool generateStubCode(MacroAssembler& masm) override; public: explicit Compiler(JSContext* cx) - : ICStubCompiler(cx, ICStub::GetIterator_Fallback, Engine::Baseline) + : ICStubCompiler(cx, ICStub::GetIterator_Fallback) { } ICStub* getStub(ICStubSpace* space) override { return newStub<ICGetIterator_Fallback>(space, getStubCode()); } }; }; @@ -1291,17 +1265,17 @@ class ICIteratorMore_Fallback : public I } class Compiler : public ICStubCompiler { protected: MOZ_MUST_USE bool generateStubCode(MacroAssembler& masm) override; public: explicit Compiler(JSContext* cx) - : ICStubCompiler(cx, ICStub::IteratorMore_Fallback, Engine::Baseline) + : ICStubCompiler(cx, ICStub::IteratorMore_Fallback) { } ICStub* getStub(ICStubSpace* space) override { return newStub<ICIteratorMore_Fallback>(space, getStubCode()); } }; }; @@ -1316,17 +1290,17 @@ class ICIteratorMore_Native : public ICS public: class Compiler : public ICStubCompiler { protected: MOZ_MUST_USE bool generateStubCode(MacroAssembler& masm) override; public: explicit Compiler(JSContext* cx) - : ICStubCompiler(cx, ICStub::IteratorMore_Native, Engine::Baseline) + : ICStubCompiler(cx, ICStub::IteratorMore_Native) { } ICStub* getStub(ICStubSpace* space) override { return newStub<ICIteratorMore_Native>(space, getStubCode()); } }; }; @@ -1341,17 +1315,17 @@ class ICIteratorClose_Fallback : public public: class Compiler : public ICStubCompiler { protected: MOZ_MUST_USE bool generateStubCode(MacroAssembler& masm) override; public: explicit Compiler(JSContext* cx) - : ICStubCompiler(cx, ICStub::IteratorClose_Fallback, Engine::Baseline) + : ICStubCompiler(cx, ICStub::IteratorClose_Fallback) { } ICStub* getStub(ICStubSpace* space) override { return newStub<ICIteratorClose_Fallback>(space, getStubCode()); } }; }; @@ -1377,17 +1351,17 @@ class ICInstanceOf_Fallback : public ICF } class Compiler : public ICStubCompiler { protected: MOZ_MUST_USE bool generateStubCode(MacroAssembler& masm) override; public: explicit Compiler(JSContext* cx) - : ICStubCompiler(cx, ICStub::InstanceOf_Fallback, Engine::Baseline) + : ICStubCompiler(cx, ICStub::InstanceOf_Fallback) { } ICStub* getStub(ICStubSpace* space) override { return newStub<ICInstanceOf_Fallback>(space, getStubCode()); } }; }; @@ -1406,17 +1380,17 @@ class ICTypeOf_Fallback : public ICFallb static const uint32_t MAX_OPTIMIZED_STUBS = 6; class Compiler : public ICStubCompiler { protected: MOZ_MUST_USE bool generateStubCode(MacroAssembler& masm) override; public: explicit Compiler(JSContext* cx) - : ICStubCompiler(cx, ICStub::TypeOf_Fallback, Engine::Baseline) + : ICStubCompiler(cx, ICStub::TypeOf_Fallback) { } ICStub* getStub(ICStubSpace* space) override { return newStub<ICTypeOf_Fallback>(space, getStubCode()); } }; }; @@ -1439,17 +1413,17 @@ class ICRest_Fallback : public ICFallbac class Compiler : public ICStubCompiler { protected: RootedArrayObject templateObject; MOZ_MUST_USE bool generateStubCode(MacroAssembler& masm) override; public: Compiler(JSContext* cx, ArrayObject* templateObject) - : ICStubCompiler(cx, ICStub::Rest_Fallback, Engine::Baseline), + : ICStubCompiler(cx, ICStub::Rest_Fallback), templateObject(cx, templateObject) { } ICStub* getStub(ICStubSpace* space) override { return newStub<ICRest_Fallback>(space, getStubCode(), templateObject); } }; }; @@ -1467,17 +1441,17 @@ class ICRetSub_Fallback : public ICFallb static const uint32_t MAX_OPTIMIZED_STUBS = 8; class Compiler : public ICStubCompiler { protected: MOZ_MUST_USE bool generateStubCode(MacroAssembler& masm) override; public: explicit Compiler(JSContext* cx) - : ICStubCompiler(cx, ICStub::RetSub_Fallback, Engine::Baseline) + : ICStubCompiler(cx, ICStub::RetSub_Fallback) { } ICStub* getStub(ICStubSpace* space) override { return newStub<ICRetSub_Fallback>(space, getStubCode()); } }; }; @@ -1508,17 +1482,17 @@ class ICRetSub_Resume : public ICStub class Compiler : public ICStubCompiler { uint32_t pcOffset_; uint8_t* addr_; MOZ_MUST_USE bool generateStubCode(MacroAssembler& masm) override; public: Compiler(JSContext* cx, uint32_t pcOffset, uint8_t* addr) - : ICStubCompiler(cx, ICStub::RetSub_Resume, Engine::Baseline), + : ICStubCompiler(cx, ICStub::RetSub_Resume), pcOffset_(pcOffset), addr_(addr) { } ICStub* getStub(ICStubSpace* space) override { return newStub<ICRetSub_Resume>(space, getStubCode(), pcOffset_, addr_); } }; @@ -1548,17 +1522,17 @@ class ICUnaryArith_Fallback : public ICF // Compiler for this stub kind. class Compiler : public ICStubCompiler { protected: MOZ_MUST_USE bool generateStubCode(MacroAssembler& masm) override; public: explicit Compiler(JSContext* cx) - : ICStubCompiler(cx, ICStub::UnaryArith_Fallback, Engine::Baseline) + : ICStubCompiler(cx, ICStub::UnaryArith_Fallback) {} ICStub* getStub(ICStubSpace* space) override { return newStub<ICUnaryArith_Fallback>(space, getStubCode()); } }; }; @@ -1592,17 +1566,17 @@ 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) - : ICStubCompiler(cx, ICStub::Compare_Fallback, Engine::Baseline) {} + : ICStubCompiler(cx, ICStub::Compare_Fallback) {} ICStub* getStub(ICStubSpace* space) override { return newStub<ICCompare_Fallback>(space, getStubCode()); } }; }; @@ -1642,17 +1616,17 @@ 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) - : ICStubCompiler(cx, ICStub::BinaryArith_Fallback, Engine::Baseline) {} + : ICStubCompiler(cx, ICStub::BinaryArith_Fallback) {} ICStub* getStub(ICStubSpace* space) override { return newStub<ICBinaryArith_Fallback>(space, getStubCode()); } }; }; // JSOP_NEWARRAY @@ -1674,17 +1648,17 @@ 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) - : ICStubCompiler(cx, ICStub::NewArray_Fallback, Engine::Baseline), + : ICStubCompiler(cx, ICStub::NewArray_Fallback), templateGroup(cx, templateGroup) {} ICStub* getStub(ICStubSpace* space) override { return newStub<ICNewArray_Fallback>(space, getStubCode(), templateGroup); } }; @@ -1721,17 +1695,17 @@ class ICNewObject_Fallback : public ICFa {} public: class Compiler : public ICStubCompiler { MOZ_MUST_USE bool generateStubCode(MacroAssembler& masm) override; public: explicit Compiler(JSContext* cx) - : ICStubCompiler(cx, ICStub::NewObject_Fallback, Engine::Baseline) + : ICStubCompiler(cx, ICStub::NewObject_Fallback) {} ICStub* getStub(ICStubSpace* space) override { return newStub<ICNewObject_Fallback>(space, getStubCode()); } }; GCPtrObject& templateObject() {
--- a/js/src/jit/SharedIC.cpp +++ b/js/src/jit/SharedIC.cpp @@ -528,42 +528,35 @@ ICStubCompiler::getStubCode() } bool ICStubCompiler::tailCallVM(const VMFunction& fun, MacroAssembler& masm) { TrampolinePtr code = cx->runtime()->jitRuntime()->getVMWrapper(fun); MOZ_ASSERT(fun.expectTailCall == TailCall); uint32_t argSize = fun.explicitStackSlots() * sizeof(void*); - if (engine_ == Engine::Baseline) { - EmitBaselineTailCallVM(code, masm, argSize); - } else { - uint32_t stackSize = argSize + fun.extraValuesToPop * sizeof(Value); - EmitIonTailCallVM(code, masm, stackSize); - } + EmitBaselineTailCallVM(code, masm, argSize); return true; } bool ICStubCompiler::callVM(const VMFunction& fun, MacroAssembler& masm) { MOZ_ASSERT(inStubFrame_); TrampolinePtr code = cx->runtime()->jitRuntime()->getVMWrapper(fun); MOZ_ASSERT(fun.expectTailCall == NonTailCall); - MOZ_ASSERT(engine_ == Engine::Baseline); EmitBaselineCallVM(code, masm); return true; } void ICStubCompiler::enterStubFrame(MacroAssembler& masm, Register scratch) { - MOZ_ASSERT(engine_ == Engine::Baseline); EmitBaselineEnterStubFrame(masm, scratch); #ifdef DEBUG framePushedAtEnterStubFrame_ = masm.framePushed(); #endif MOZ_ASSERT(!inStubFrame_); inStubFrame_ = true; @@ -587,18 +580,17 @@ ICStubCompiler::assumeStubFrame() #endif } void ICStubCompiler::leaveStubFrame(MacroAssembler& masm, bool calledIntoIon) { MOZ_ASSERT(entersStubFrame_ && inStubFrame_); inStubFrame_ = false; - - MOZ_ASSERT(engine_ == Engine::Baseline); + #ifdef DEBUG masm.setFramePushed(framePushedAtEnterStubFrame_); if (calledIntoIon) masm.adjustFrame(sizeof(intptr_t)); // Calls into ion have this extra. #endif EmitBaselineLeaveStubFrame(masm, calledIntoIon); }
--- a/js/src/jit/SharedIC.h +++ b/js/src/jit/SharedIC.h @@ -996,43 +996,38 @@ class ICCacheIR_Updated : public ICUpdat }; // Base class for stubcode compilers. class ICStubCompiler { // Prevent GC in the middle of stub compilation. js::gc::AutoSuppressGC suppressGC; - public: - using Engine = ICStubEngine; - protected: JSContext* cx; ICStub::Kind kind; - Engine engine_; bool inStubFrame_; #ifdef DEBUG bool entersStubFrame_; uint32_t framePushedAtEnterStubFrame_; #endif // By default the stubcode key is just the kind. virtual int32_t getKey() const { - return static_cast<int32_t>(engine_) | - (static_cast<int32_t>(kind) << 1); + return (static_cast<int32_t>(kind) << 1); } virtual MOZ_MUST_USE bool generateStubCode(MacroAssembler& masm) = 0; virtual void postGenerateStubCode(MacroAssembler& masm, Handle<JitCode*> genCode) {} JitCode* getStubCode(); - ICStubCompiler(JSContext* cx, ICStub::Kind kind, Engine engine) - : suppressGC(cx), cx(cx), kind(kind), engine_(engine), inStubFrame_(false) + ICStubCompiler(JSContext* cx, ICStub::Kind kind) + : suppressGC(cx), cx(cx), kind(kind), inStubFrame_(false) #ifdef DEBUG , entersStubFrame_(false), framePushedAtEnterStubFrame_(0) #endif {} // Push a payload specialized per compiler needed to execute stubs. void PushStubPayload(MacroAssembler& masm, Register scratch); void pushStubPayload(MacroAssembler& masm, Register scratch); @@ -1096,25 +1091,24 @@ class ICStubCompiler template <typename T, typename... Args> T* newStub(Args&&... args) { return ICStub::New<T>(cx, std::forward<Args>(args)...); } public: virtual ICStub* getStub(ICStubSpace* space) = 0; - static ICStubSpace* StubSpaceForStub(bool makesGCCalls, JSScript* outerScript, Engine engine) { + static ICStubSpace* StubSpaceForStub(bool makesGCCalls, JSScript* outerScript) { if (makesGCCalls) { - MOZ_ASSERT(engine == ICStubCompiler::Engine::Baseline); return outerScript->baselineScript()->fallbackStubSpace(); } return outerScript->zone()->jitZone()->optimizedStubSpace(); } ICStubSpace* getStubSpace(JSScript* outerScript) { - return StubSpaceForStub(ICStub::NonCacheIRStubMakesGCCalls(kind), outerScript, engine_); + return StubSpaceForStub(ICStub::NonCacheIRStubMakesGCCalls(kind), outerScript); } }; // Monitored fallback stubs - as the name implies. class ICMonitoredFallbackStub : public ICFallbackStub { protected: // Pointer to the fallback monitor stub. Created lazily by @@ -1198,25 +1192,24 @@ class TypeCheckPrimitiveSetStub : public } class Compiler : public ICStubCompiler { protected: TypeCheckPrimitiveSetStub* existingStub_; uint16_t flags_; virtual int32_t getKey() const override { - return static_cast<int32_t>(engine_) | - (static_cast<int32_t>(kind) << 1) | + return static_cast<int32_t>(kind) << 1 | (static_cast<int32_t>(flags_) << 17); } public: Compiler(JSContext* cx, Kind kind, TypeCheckPrimitiveSetStub* existingStub, JSValueType type) - : ICStubCompiler(cx, kind, Engine::Baseline), + : ICStubCompiler(cx, kind), existingStub_(existingStub), flags_((existingStub ? existingStub->typeFlags() : 0) | TypeToFlag(type)) { MOZ_ASSERT_IF(existingStub_, flags_ != existingStub_->typeFlags()); } TypeCheckPrimitiveSetStub* updateStub() { MOZ_ASSERT(existingStub_); @@ -1384,23 +1377,23 @@ class ICTypeMonitor_Fallback : public IC ICMonitoredFallbackStub* mainFallbackStub_; uint32_t argumentIndex_; protected: MOZ_MUST_USE bool generateStubCode(MacroAssembler& masm) override; public: Compiler(JSContext* cx, ICMonitoredFallbackStub* mainFallbackStub) - : ICStubCompiler(cx, ICStub::TypeMonitor_Fallback, Engine::Baseline), + : ICStubCompiler(cx, ICStub::TypeMonitor_Fallback), mainFallbackStub_(mainFallbackStub), argumentIndex_(BYTECODE_INDEX) { } Compiler(JSContext* cx, uint32_t argumentIndex) - : ICStubCompiler(cx, ICStub::TypeMonitor_Fallback, Engine::Baseline), + : ICStubCompiler(cx, ICStub::TypeMonitor_Fallback), mainFallbackStub_(nullptr), argumentIndex_(argumentIndex) { } ICTypeMonitor_Fallback* getStub(ICStubSpace* space) override { return newStub<ICTypeMonitor_Fallback>(space, getStubCode(), mainFallbackStub_, argumentIndex_); } @@ -1461,17 +1454,17 @@ class ICTypeMonitor_SingleObject : publi class Compiler : public ICStubCompiler { protected: HandleObject obj_; MOZ_MUST_USE bool generateStubCode(MacroAssembler& masm) override; public: Compiler(JSContext* cx, HandleObject obj) - : ICStubCompiler(cx, TypeMonitor_SingleObject, Engine::Baseline), + : ICStubCompiler(cx, TypeMonitor_SingleObject), obj_(obj) { } ICTypeMonitor_SingleObject* getStub(ICStubSpace* space) override { return newStub<ICTypeMonitor_SingleObject>(space, getStubCode(), obj_); } }; }; @@ -1495,17 +1488,17 @@ class ICTypeMonitor_ObjectGroup : public class Compiler : public ICStubCompiler { protected: HandleObjectGroup group_; MOZ_MUST_USE bool generateStubCode(MacroAssembler& masm) override; public: Compiler(JSContext* cx, HandleObjectGroup group) - : ICStubCompiler(cx, TypeMonitor_ObjectGroup, Engine::Baseline), + : ICStubCompiler(cx, TypeMonitor_ObjectGroup), group_(group) { } ICTypeMonitor_ObjectGroup* getStub(ICStubSpace* space) override { return newStub<ICTypeMonitor_ObjectGroup>(space, getStubCode(), group_); } }; }; @@ -1520,17 +1513,17 @@ class ICTypeMonitor_AnyValue : public IC public: class Compiler : public ICStubCompiler { protected: MOZ_MUST_USE bool generateStubCode(MacroAssembler& masm) override; public: explicit Compiler(JSContext* cx) - : ICStubCompiler(cx, TypeMonitor_AnyValue, Engine::Baseline) + : ICStubCompiler(cx, TypeMonitor_AnyValue) { } ICTypeMonitor_AnyValue* getStub(ICStubSpace* space) override { return newStub<ICTypeMonitor_AnyValue>(space, getStubCode()); } }; };
--- a/js/src/jit/arm/SharedICHelpers-arm-inl.h +++ b/js/src/jit/arm/SharedICHelpers-arm-inl.h @@ -40,38 +40,16 @@ EmitBaselineTailCallVM(TrampolinePtr tar MOZ_ASSERT(ICTailCallReg == lr); masm.makeFrameDescriptor(r0, JitFrame_BaselineJS, ExitFrameLayout::Size()); masm.push(r0); masm.push(lr); masm.jump(target); } inline void -EmitIonTailCallVM(TrampolinePtr target, MacroAssembler& masm, uint32_t stackSize) -{ - // We assume during this that R0 and R1 have been pushed, and that R2 is - // unused. - MOZ_ASSERT(R2 == ValueOperand(r1, r0)); - - masm.loadPtr(Address(sp, stackSize), r0); - masm.rshiftPtr(Imm32(FRAMESIZE_SHIFT), r0); - masm.add32(Imm32(stackSize + JitStubFrameLayout::Size() - sizeof(intptr_t)), r0); - - // Push frame descriptor and perform the tail call. - // ICTailCallReg (lr) already contains the return address (as we keep - // it there through the stub calls), but the VMWrapper code being called - // expects the return address to also be pushed on the stack. - MOZ_ASSERT(ICTailCallReg == lr); - masm.makeFrameDescriptor(r0, JitFrame_IonJS, ExitFrameLayout::Size()); - masm.push(r0); - masm.push(lr); - masm.jump(target); -} - -inline void EmitBaselineCreateStubFrameDescriptor(MacroAssembler& masm, Register reg, uint32_t headerSize) { // Compute stub frame size. We have to add two pointers: the stub reg and // previous frame pointer pushed by EmitEnterStubFrame. masm.mov(BaselineFrameReg, reg); masm.as_add(reg, reg, Imm8(sizeof(void*) * 2)); masm.ma_sub(BaselineStackReg, reg);
--- a/js/src/jit/arm64/SharedICHelpers-arm64-inl.h +++ b/js/src/jit/arm64/SharedICHelpers-arm64-inl.h @@ -43,22 +43,16 @@ EmitBaselineTailCallVM(TrampolinePtr tar // with direct calls. Refer to the top of generateVMWrapper(). // ICTailCallReg (lr) already contains the return address (as we keep // it there through the stub calls). masm.jump(target); } inline void -EmitIonTailCallVM(TrampolinePtr target, MacroAssembler& masm, uint32_t stackSize) -{ - MOZ_CRASH("Not implemented yet."); -} - -inline void EmitBaselineCreateStubFrameDescriptor(MacroAssembler& masm, Register reg, uint32_t headerSize) { ARMRegister reg64(reg, 64); // Compute stub frame size. masm.Sub(reg64, masm.GetStackPointer64(), Operand(sizeof(void*) * 2)); masm.Sub(reg64, BaselineFrameReg64, reg64);
--- a/js/src/jit/mips-shared/SharedICHelpers-mips-shared-inl.h +++ b/js/src/jit/mips-shared/SharedICHelpers-mips-shared-inl.h @@ -38,33 +38,16 @@ EmitBaselineTailCallVM(TrampolinePtr tar masm.subPtr(Imm32(sizeof(CommonFrameLayout)), StackPointer); masm.storePtr(scratch, Address(StackPointer, CommonFrameLayout::offsetOfDescriptor())); masm.storePtr(ra, Address(StackPointer, CommonFrameLayout::offsetOfReturnAddress())); masm.jump(target); } inline void -EmitIonTailCallVM(TrampolinePtr target, MacroAssembler& masm, uint32_t stackSize) -{ - Register scratch = R2.scratchReg(); - - masm.loadPtr(Address(sp, stackSize), scratch); - masm.rshiftPtr(Imm32(FRAMESIZE_SHIFT), scratch); - masm.addPtr(Imm32(stackSize + JitStubFrameLayout::Size() - sizeof(intptr_t)), scratch); - - // Push frame descriptor and perform the tail call. - MOZ_ASSERT(ICTailCallReg == ra); - masm.makeFrameDescriptor(scratch, JitFrame_IonJS, ExitFrameLayout::Size()); - masm.push(scratch); - masm.push(ICTailCallReg); - masm.jump(target); -} - -inline void EmitBaselineCreateStubFrameDescriptor(MacroAssembler& masm, Register reg, uint32_t headerSize) { // Compute stub frame size. We have to add two pointers: the stub reg and // previous frame pointer pushed by EmitEnterStubFrame. masm.movePtr(BaselineFrameReg, reg); masm.addPtr(Imm32(sizeof(intptr_t) * 2), reg); masm.subPtr(BaselineStackReg, reg);
--- a/js/src/jit/none/SharedICHelpers-none-inl.h +++ b/js/src/jit/none/SharedICHelpers-none-inl.h @@ -8,17 +8,16 @@ #define jit_none_SharedICHelpers_none_inl_h #include "jit/SharedICHelpers.h" namespace js { namespace jit { inline void EmitBaselineTailCallVM(TrampolinePtr, MacroAssembler&, uint32_t) { MOZ_CRASH(); } -inline void EmitIonTailCallVM(TrampolinePtr, MacroAssembler&, uint32_t) { MOZ_CRASH(); } inline void EmitBaselineCreateStubFrameDescriptor(MacroAssembler&, Register, uint32_t) { MOZ_CRASH(); } inline void EmitBaselineCallVM(TrampolinePtr, MacroAssembler&) { MOZ_CRASH(); } static const uint32_t STUB_FRAME_SIZE = 0; static const uint32_t STUB_FRAME_SAVED_STUB_OFFSET = 0; inline void EmitBaselineEnterStubFrame(MacroAssembler&, Register) { MOZ_CRASH(); }
--- a/js/src/jit/x64/SharedICHelpers-x64-inl.h +++ b/js/src/jit/x64/SharedICHelpers-x64-inl.h @@ -32,37 +32,16 @@ EmitBaselineTailCallVM(TrampolinePtr tar // Push frame descriptor and perform the tail call. masm.makeFrameDescriptor(scratch, JitFrame_BaselineJS, ExitFrameLayout::Size()); masm.push(scratch); masm.push(ICTailCallReg); masm.jump(target); } inline void -EmitIonTailCallVM(TrampolinePtr target, MacroAssembler& masm, uint32_t stackSize) -{ - // For tail calls, find the already pushed JitFrame_IonJS signifying the - // end of the Ion frame. Retrieve the length of the frame and repush - // JitFrame_IonJS with the extra stacksize, rendering the original - // JitFrame_IonJS obsolete. - - ScratchRegisterScope scratch(masm); - - masm.loadPtr(Address(esp, stackSize), scratch); - masm.shrq(Imm32(FRAMESIZE_SHIFT), scratch); - masm.addq(Imm32(stackSize + JitStubFrameLayout::Size() - sizeof(intptr_t)), scratch); - - // Push frame descriptor and perform the tail call. - masm.makeFrameDescriptor(scratch, JitFrame_IonJS, ExitFrameLayout::Size()); - masm.push(scratch); - masm.push(ICTailCallReg); - masm.jump(target); -} - -inline void EmitBaselineCreateStubFrameDescriptor(MacroAssembler& masm, Register reg, uint32_t headerSize) { // Compute stub frame size. We have to add two pointers: the stub reg and previous // frame pointer pushed by EmitEnterStubFrame. masm.movq(BaselineFrameReg, reg); masm.addq(Imm32(sizeof(void*) * 2), reg); masm.subq(BaselineStackReg, reg);
--- a/js/src/jit/x86/SharedICHelpers-x86-inl.h +++ b/js/src/jit/x86/SharedICHelpers-x86-inl.h @@ -32,35 +32,16 @@ EmitBaselineTailCallVM(TrampolinePtr tar // Push frame descriptor and perform the tail call. masm.makeFrameDescriptor(eax, JitFrame_BaselineJS, ExitFrameLayout::Size()); masm.push(eax); masm.push(ICTailCallReg); masm.jump(target); } inline void -EmitIonTailCallVM(TrampolinePtr target, MacroAssembler& masm, uint32_t stackSize) -{ - // For tail calls, find the already pushed JitFrame_IonJS signifying the - // end of the Ion frame. Retrieve the length of the frame and repush - // JitFrame_IonJS with the extra stacksize, rendering the original - // JitFrame_IonJS obsolete. - - masm.loadPtr(Address(esp, stackSize), eax); - masm.shrl(Imm32(FRAMESIZE_SHIFT), eax); - masm.addl(Imm32(stackSize + JitStubFrameLayout::Size() - sizeof(intptr_t)), eax); - - // Push frame descriptor and perform the tail call. - masm.makeFrameDescriptor(eax, JitFrame_IonJS, ExitFrameLayout::Size()); - masm.push(eax); - masm.push(ICTailCallReg); - masm.jump(target); -} - -inline void EmitBaselineCreateStubFrameDescriptor(MacroAssembler& masm, Register reg, uint32_t headerSize) { // Compute stub frame size. We have to add two pointers: the stub reg and previous // frame pointer pushed by EmitEnterStubFrame. masm.movl(BaselineFrameReg, reg); masm.addl(Imm32(sizeof(void*) * 2), reg); masm.subl(BaselineStackReg, reg);