Bug 1479603 - [Part 9] Remove ICStubCompiler::Engine r=jandem

--HG--
extra : rebase_source : 463d520b91583489205c3c93bacc88ea57ae7e99
This commit is contained in:
Matthew Gaudet 2018-08-21 10:05:47 -04:00
parent 353d6f779d
commit 93fb1c43b0
12 changed files with 60 additions and 251 deletions

View File

@ -2223,8 +2223,7 @@ js::jit::AttachBaselineCacheIRStub(JSContext* cx, const CacheIRWriter& writer,
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;

View File

@ -782,8 +782,8 @@ CloneOldBaselineStub(JSContext* cx, DebugModeOSREntryVector& entries, size_t ent
}
}
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.
//

View File

@ -178,8 +178,6 @@ static const VMFunction DoWarmUpCounterFallbackOSRInfo =
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());
@ -346,8 +344,6 @@ const VMFunction DoTypeUpdateFallbackInfo =
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);
@ -357,8 +353,6 @@ ICTypeUpdate_Fallback::Compiler::generateStubCode(MacroAssembler& masm)
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);
@ -397,8 +391,6 @@ ICTypeUpdate_PrimitiveSet::Compiler::generateStubCode(MacroAssembler& masm)
bool
ICTypeUpdate_SingleObject::Compiler::generateStubCode(MacroAssembler& masm)
{
MOZ_ASSERT(engine_ == Engine::Baseline);
Label failure;
masm.branchTestObject(Assembler::NotEqual, R0, &failure);
@ -419,8 +411,6 @@ ICTypeUpdate_SingleObject::Compiler::generateStubCode(MacroAssembler& masm)
bool
ICTypeUpdate_ObjectGroup::Compiler::generateStubCode(MacroAssembler& masm)
{
MOZ_ASSERT(engine_ == Engine::Baseline);
Label failure;
masm.branchTestObject(Assembler::NotEqual, R0, &failure);
@ -496,7 +486,6 @@ static const VMFunction fun = FunctionInfo<pf>(DoToBoolFallback, "DoToBoolFallba
bool
ICToBool_Fallback::Compiler::generateStubCode(MacroAssembler& masm)
{
MOZ_ASSERT(engine_ == Engine::Baseline);
MOZ_ASSERT(R0 == JSReturnOperand);
// Restore the tail call register.
@ -531,7 +520,6 @@ static const VMFunction DoToNumberFallbackInfo =
bool
ICToNumber_Fallback::Compiler::generateStubCode(MacroAssembler& masm)
{
MOZ_ASSERT(engine_ == Engine::Baseline);
MOZ_ASSERT(R0 == JSReturnOperand);
// Restore the tail call register.
@ -745,7 +733,6 @@ static const VMFunction DoGetElemSuperFallbackInfo =
bool
ICGetElem_Fallback::Compiler::generateStubCode(MacroAssembler& masm)
{
MOZ_ASSERT(engine_ == Engine::Baseline);
MOZ_ASSERT(R0 == JSReturnOperand);
// Restore the tail call register.
@ -933,7 +920,6 @@ static const VMFunction DoSetElemFallbackInfo =
bool
ICSetElem_Fallback::Compiler::generateStubCode(MacroAssembler& masm)
{
MOZ_ASSERT(engine_ == Engine::Baseline);
MOZ_ASSERT(R0 == JSReturnOperand);
EmitRestoreTailCallReg(masm);
@ -1124,8 +1110,6 @@ static const VMFunction DoInFallbackInfo =
bool
ICIn_Fallback::Compiler::generateStubCode(MacroAssembler& masm)
{
MOZ_ASSERT(engine_ == Engine::Baseline);
EmitRestoreTailCallReg(masm);
// Sync for the decompiler.
@ -1191,8 +1175,6 @@ static const VMFunction DoHasOwnFallbackInfo =
bool
ICHasOwn_Fallback::Compiler::generateStubCode(MacroAssembler& masm)
{
MOZ_ASSERT(engine_ == Engine::Baseline);
EmitRestoreTailCallReg(masm);
// Sync for the decompiler.
@ -1280,7 +1262,6 @@ static const VMFunction DoGetNameFallbackInfo =
bool
ICGetName_Fallback::Compiler::generateStubCode(MacroAssembler& masm)
{
MOZ_ASSERT(engine_ == Engine::Baseline);
MOZ_ASSERT(R0 == JSReturnOperand);
EmitRestoreTailCallReg(masm);
@ -1342,7 +1323,6 @@ static const VMFunction DoBindNameFallbackInfo =
bool
ICBindName_Fallback::Compiler::generateStubCode(MacroAssembler& masm)
{
MOZ_ASSERT(engine_ == Engine::Baseline);
MOZ_ASSERT(R0 == JSReturnOperand);
EmitRestoreTailCallReg(masm);
@ -1415,8 +1395,6 @@ static const VMFunction DoGetIntrinsicFallbackInfo =
bool
ICGetIntrinsic_Fallback::Compiler::generateStubCode(MacroAssembler& masm)
{
MOZ_ASSERT(engine_ == Engine::Baseline);
EmitRestoreTailCallReg(masm);
masm.push(ICStubReg);
@ -1669,12 +1647,10 @@ ICGetProp_Fallback::Compiler::generateStubCode(MacroAssembler& masm)
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);
}
//
@ -1847,7 +1823,6 @@ static const VMFunction DoSetPropFallbackInfo =
bool
ICSetProp_Fallback::Compiler::generateStubCode(MacroAssembler& masm)
{
MOZ_ASSERT(engine_ == Engine::Baseline);
MOZ_ASSERT(R0 == JSReturnOperand);
EmitRestoreTailCallReg(masm);
@ -2942,8 +2917,6 @@ static const VMFunction DoSpreadCallFallbackInfo =
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
@ -3070,8 +3043,6 @@ static const VMFunction CreateThisInfoBaseline =
bool
ICCallScriptedCompiler::generateStubCode(MacroAssembler& masm)
{
MOZ_ASSERT(engine_ == Engine::Baseline);
Label failure;
AllocatableGeneralRegisterSet regs(availableGeneralRegs(0));
bool canUseTailCallReg = regs.has(ICTailCallReg);
@ -3338,8 +3309,6 @@ static const VMFunction CopyStringSplitArrayInfo =
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);
@ -3438,8 +3407,6 @@ ICCall_ConstStringSplit::Compiler::generateStubCode(MacroAssembler& masm)
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.
@ -3483,8 +3450,6 @@ ICCall_IsSuspendedGenerator::Compiler::generateStubCode(MacroAssembler& masm)
bool
ICCall_Native::Compiler::generateStubCode(MacroAssembler& masm)
{
MOZ_ASSERT(engine_ == Engine::Baseline);
Label failure;
AllocatableGeneralRegisterSet regs(availableGeneralRegs(0));
@ -3596,8 +3561,6 @@ ICCall_Native::Compiler::generateStubCode(MacroAssembler& masm)
bool
ICCall_ClassHook::Compiler::generateStubCode(MacroAssembler& masm)
{
MOZ_ASSERT(engine_ == Engine::Baseline);
Label failure;
AllocatableGeneralRegisterSet regs(availableGeneralRegs(0));
@ -3687,8 +3650,6 @@ ICCall_ClassHook::Compiler::generateStubCode(MacroAssembler& masm)
bool
ICCall_ScriptedApplyArray::Compiler::generateStubCode(MacroAssembler& masm)
{
MOZ_ASSERT(engine_ == Engine::Baseline);
Label failure;
AllocatableGeneralRegisterSet regs(availableGeneralRegs(0));
@ -3785,8 +3746,6 @@ ICCall_ScriptedApplyArray::Compiler::generateStubCode(MacroAssembler& masm)
bool
ICCall_ScriptedApplyArguments::Compiler::generateStubCode(MacroAssembler& masm)
{
MOZ_ASSERT(engine_ == Engine::Baseline);
Label failure;
AllocatableGeneralRegisterSet regs(availableGeneralRegs(0));
@ -3877,8 +3836,6 @@ ICCall_ScriptedApplyArguments::Compiler::generateStubCode(MacroAssembler& masm)
bool
ICCall_ScriptedFunCall::Compiler::generateStubCode(MacroAssembler& masm)
{
MOZ_ASSERT(engine_ == Engine::Baseline);
Label failure;
AllocatableGeneralRegisterSet regs(availableGeneralRegs(0));
bool canUseTailCallReg = regs.has(ICTailCallReg);
@ -4011,8 +3968,6 @@ DoubleValueToInt32ForSwitch(Value* v)
bool
ICTableSwitch::Compiler::generateStubCode(MacroAssembler& masm)
{
MOZ_ASSERT(engine_ == Engine::Baseline);
Label isInt32, notInt32, outOfRange;
Register scratch = R1.scratchReg();
@ -4159,8 +4114,6 @@ static const VMFunction DoGetIteratorFallbackInfo =
bool
ICGetIterator_Fallback::Compiler::generateStubCode(MacroAssembler& masm)
{
MOZ_ASSERT(engine_ == Engine::Baseline);
EmitRestoreTailCallReg(masm);
// Sync stack for the decompiler.
@ -4218,8 +4171,6 @@ static const VMFunction DoIteratorMoreFallbackInfo =
bool
ICIteratorMore_Fallback::Compiler::generateStubCode(MacroAssembler& masm)
{
MOZ_ASSERT(engine_ == Engine::Baseline);
EmitRestoreTailCallReg(masm);
masm.unboxObject(R0, R0.scratchReg());
@ -4237,8 +4188,6 @@ ICIteratorMore_Fallback::Compiler::generateStubCode(MacroAssembler& masm)
bool
ICIteratorMore_Native::Compiler::generateStubCode(MacroAssembler& masm)
{
MOZ_ASSERT(engine_ == Engine::Baseline);
Label failure;
Register obj = masm.extractObject(R0, ExtractTemp0);
@ -4298,8 +4247,6 @@ static const VMFunction DoIteratorCloseFallbackInfo =
bool
ICIteratorClose_Fallback::Compiler::generateStubCode(MacroAssembler& masm)
{
MOZ_ASSERT(engine_ == Engine::Baseline);
EmitRestoreTailCallReg(masm);
masm.pushValue(R0);
@ -4395,8 +4342,6 @@ static const VMFunction DoInstanceOfFallbackInfo =
bool
ICInstanceOf_Fallback::Compiler::generateStubCode(MacroAssembler& masm)
{
MOZ_ASSERT(engine_ == Engine::Baseline);
EmitRestoreTailCallReg(masm);
// Sync stack for the decompiler.
@ -4455,8 +4400,6 @@ static const VMFunction DoTypeOfFallbackInfo =
bool
ICTypeOf_Fallback::Compiler::generateStubCode(MacroAssembler& masm)
{
MOZ_ASSERT(engine_ == Engine::Baseline);
EmitRestoreTailCallReg(masm);
masm.pushValue(R0);
@ -4508,8 +4451,6 @@ static const VMFunction ThrowInfoBaseline =
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);
@ -4544,8 +4485,6 @@ ICRetSub_Fallback::Compiler::generateStubCode(MacroAssembler& 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);
@ -4727,8 +4666,6 @@ static const VMFunction DoRestFallbackInfo =
bool
ICRest_Fallback::Compiler::generateStubCode(MacroAssembler& masm)
{
MOZ_ASSERT(engine_ == Engine::Baseline);
EmitRestoreTailCallReg(masm);
masm.push(ICStubReg);

View File

@ -44,7 +44,7 @@ class ICWarmUpCounter_Fallback : public ICFallbackStub
public:
explicit Compiler(JSContext* cx)
: ICStubCompiler(cx, ICStub::WarmUpCounter_Fallback, Engine::Baseline)
: ICStubCompiler(cx, ICStub::WarmUpCounter_Fallback)
{ }
ICWarmUpCounter_Fallback* getStub(ICStubSpace* space) override {
@ -76,7 +76,7 @@ class ICTypeUpdate_Fallback : public ICStub
public:
explicit Compiler(JSContext* cx)
: ICStubCompiler(cx, ICStub::TypeUpdate_Fallback, Engine::Baseline)
: ICStubCompiler(cx, ICStub::TypeUpdate_Fallback)
{ }
ICTypeUpdate_Fallback* getStub(ICStubSpace* space) override {
@ -144,7 +144,7 @@ class ICTypeUpdate_SingleObject : public ICStub
public:
Compiler(JSContext* cx, HandleObject obj)
: ICStubCompiler(cx, TypeUpdate_SingleObject, Engine::Baseline),
: ICStubCompiler(cx, TypeUpdate_SingleObject),
obj_(obj)
{ }
@ -179,7 +179,7 @@ class ICTypeUpdate_ObjectGroup : public ICStub
public:
Compiler(JSContext* cx, HandleObjectGroup group)
: ICStubCompiler(cx, TypeUpdate_ObjectGroup, Engine::Baseline),
: ICStubCompiler(cx, TypeUpdate_ObjectGroup),
group_(group)
{ }
@ -204,7 +204,7 @@ class ICTypeUpdate_AnyValue : public ICStub
public:
explicit Compiler(JSContext* cx)
: ICStubCompiler(cx, TypeUpdate_AnyValue, Engine::Baseline)
: ICStubCompiler(cx, TypeUpdate_AnyValue)
{}
ICTypeUpdate_AnyValue* getStub(ICStubSpace* space) override {
@ -233,7 +233,7 @@ class ICToBool_Fallback : public ICFallbackStub
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());
@ -259,7 +259,7 @@ class ICToNumber_Fallback : public ICFallbackStub
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());
@ -303,14 +303,13 @@ class ICGetElem_Fallback : public ICMonitoredFallbackStub
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)
{ }
@ -349,7 +348,7 @@ class ICSetElem_Fallback : public ICFallbackStub
public:
explicit Compiler(JSContext* cx)
: ICStubCompiler(cx, ICStub::SetElem_Fallback, Engine::Baseline)
: ICStubCompiler(cx, ICStub::SetElem_Fallback)
{ }
ICStub* getStub(ICStubSpace* space) override {
@ -375,7 +374,7 @@ class ICIn_Fallback : public ICFallbackStub
public:
explicit Compiler(JSContext* cx)
: ICStubCompiler(cx, ICStub::In_Fallback, Engine::Baseline)
: ICStubCompiler(cx, ICStub::In_Fallback)
{ }
ICStub* getStub(ICStubSpace* space) override {
@ -401,7 +400,7 @@ class ICHasOwn_Fallback : public ICFallbackStub
public:
explicit Compiler(JSContext* cx)
: ICStubCompiler(cx, ICStub::HasOwn_Fallback, Engine::Baseline)
: ICStubCompiler(cx, ICStub::HasOwn_Fallback)
{ }
ICStub* getStub(ICStubSpace* space) override {
@ -437,7 +436,7 @@ class ICGetName_Fallback : public ICMonitoredFallbackStub
public:
explicit Compiler(JSContext* cx)
: ICStubCompiler(cx, ICStub::GetName_Fallback, Engine::Baseline)
: ICStubCompiler(cx, ICStub::GetName_Fallback)
{ }
ICStub* getStub(ICStubSpace* space) override {
@ -463,7 +462,7 @@ class ICBindName_Fallback : public ICFallbackStub
public:
explicit Compiler(JSContext* cx)
: ICStubCompiler(cx, ICStub::BindName_Fallback, Engine::Baseline)
: ICStubCompiler(cx, ICStub::BindName_Fallback)
{ }
ICStub* getStub(ICStubSpace* space) override {
@ -489,7 +488,7 @@ class ICGetIntrinsic_Fallback : public ICMonitoredFallbackStub
public:
explicit Compiler(JSContext* cx)
: ICStubCompiler(cx, ICStub::GetIntrinsic_Fallback, Engine::Baseline)
: ICStubCompiler(cx, ICStub::GetIntrinsic_Fallback)
{ }
ICStub* getStub(ICStubSpace* space) override {
@ -536,14 +535,13 @@ class ICGetProp_Fallback : public ICMonitoredFallbackStub
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)
{ }
@ -585,7 +583,7 @@ class ICSetProp_Fallback : public ICFallbackStub
public:
explicit Compiler(JSContext* cx)
: ICStubCompiler(cx, ICStub::SetProp_Fallback, Engine::Baseline)
: ICStubCompiler(cx, ICStub::SetProp_Fallback)
{ }
ICStub* getStub(ICStubSpace* space) override {
@ -608,7 +606,7 @@ class ICCallStubCompiler : public ICStubCompiler
{
protected:
ICCallStubCompiler(JSContext* cx, ICStub::Kind kind)
: ICStubCompiler(cx, kind, Engine::Baseline)
: ICStubCompiler(cx, kind)
{ }
enum FunApplyThing {
@ -669,8 +667,7 @@ class ICCall_Fallback : public ICMonitoredFallbackStub
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);
}
@ -759,8 +756,7 @@ class ICCallScriptedCompiler : public ICCallStubCompiler {
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);
@ -857,8 +853,7 @@ class ICCall_Native : public ICMonitoredStub
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) |
@ -938,8 +933,7 @@ class ICCall_ClassHook : public ICMonitoredStub
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);
}
@ -998,11 +992,6 @@ class ICCall_ScriptedApplyArray : public ICMonitoredStub
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),
@ -1046,11 +1035,6 @@ class ICCall_ScriptedApplyArguments : public ICMonitoredStub
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),
@ -1093,11 +1077,6 @@ class ICCall_ScriptedFunCall : public ICMonitoredStub
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),
@ -1164,11 +1143,6 @@ class ICCall_ConstStringSplit : public ICMonitoredStub
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)
@ -1204,7 +1178,7 @@ class ICCall_IsSuspendedGenerator : public ICStub
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());
@ -1240,7 +1214,7 @@ class ICTableSwitch : public ICStub
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;
@ -1263,7 +1237,7 @@ class ICGetIterator_Fallback : public ICFallbackStub
public:
explicit Compiler(JSContext* cx)
: ICStubCompiler(cx, ICStub::GetIterator_Fallback, Engine::Baseline)
: ICStubCompiler(cx, ICStub::GetIterator_Fallback)
{ }
ICStub* getStub(ICStubSpace* space) override {
@ -1296,7 +1270,7 @@ class ICIteratorMore_Fallback : public ICFallbackStub
public:
explicit Compiler(JSContext* cx)
: ICStubCompiler(cx, ICStub::IteratorMore_Fallback, Engine::Baseline)
: ICStubCompiler(cx, ICStub::IteratorMore_Fallback)
{ }
ICStub* getStub(ICStubSpace* space) override {
@ -1321,7 +1295,7 @@ class ICIteratorMore_Native : public ICStub
public:
explicit Compiler(JSContext* cx)
: ICStubCompiler(cx, ICStub::IteratorMore_Native, Engine::Baseline)
: ICStubCompiler(cx, ICStub::IteratorMore_Native)
{ }
ICStub* getStub(ICStubSpace* space) override {
@ -1346,7 +1320,7 @@ class ICIteratorClose_Fallback : public ICFallbackStub
public:
explicit Compiler(JSContext* cx)
: ICStubCompiler(cx, ICStub::IteratorClose_Fallback, Engine::Baseline)
: ICStubCompiler(cx, ICStub::IteratorClose_Fallback)
{ }
ICStub* getStub(ICStubSpace* space) override {
@ -1382,7 +1356,7 @@ class ICInstanceOf_Fallback : public ICFallbackStub
public:
explicit Compiler(JSContext* cx)
: ICStubCompiler(cx, ICStub::InstanceOf_Fallback, Engine::Baseline)
: ICStubCompiler(cx, ICStub::InstanceOf_Fallback)
{ }
ICStub* getStub(ICStubSpace* space) override {
@ -1411,7 +1385,7 @@ class ICTypeOf_Fallback : public ICFallbackStub
public:
explicit Compiler(JSContext* cx)
: ICStubCompiler(cx, ICStub::TypeOf_Fallback, Engine::Baseline)
: ICStubCompiler(cx, ICStub::TypeOf_Fallback)
{ }
ICStub* getStub(ICStubSpace* space) override {
@ -1444,7 +1418,7 @@ class ICRest_Fallback : public ICFallbackStub
public:
Compiler(JSContext* cx, ArrayObject* templateObject)
: ICStubCompiler(cx, ICStub::Rest_Fallback, Engine::Baseline),
: ICStubCompiler(cx, ICStub::Rest_Fallback),
templateObject(cx, templateObject)
{ }
@ -1472,7 +1446,7 @@ class ICRetSub_Fallback : public ICFallbackStub
public:
explicit Compiler(JSContext* cx)
: ICStubCompiler(cx, ICStub::RetSub_Fallback, Engine::Baseline)
: ICStubCompiler(cx, ICStub::RetSub_Fallback)
{ }
ICStub* getStub(ICStubSpace* space) override {
@ -1513,7 +1487,7 @@ class ICRetSub_Resume : public ICStub
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)
{ }
@ -1553,7 +1527,7 @@ class ICUnaryArith_Fallback : public ICFallbackStub
public:
explicit Compiler(JSContext* cx)
: ICStubCompiler(cx, ICStub::UnaryArith_Fallback, Engine::Baseline)
: ICStubCompiler(cx, ICStub::UnaryArith_Fallback)
{}
ICStub* getStub(ICStubSpace* space) override {
@ -1597,7 +1571,7 @@ class ICCompare_Fallback : public ICFallbackStub
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());
@ -1647,7 +1621,7 @@ class ICBinaryArith_Fallback : public ICFallbackStub
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());
@ -1679,7 +1653,7 @@ class ICNewArray_Fallback : public ICFallbackStub
public:
Compiler(JSContext* cx, ObjectGroup* templateGroup)
: ICStubCompiler(cx, ICStub::NewArray_Fallback, Engine::Baseline),
: ICStubCompiler(cx, ICStub::NewArray_Fallback),
templateGroup(cx, templateGroup)
{}
@ -1726,7 +1700,7 @@ class ICNewObject_Fallback : public ICFallbackStub
public:
explicit Compiler(JSContext* cx)
: ICStubCompiler(cx, ICStub::NewObject_Fallback, Engine::Baseline)
: ICStubCompiler(cx, ICStub::NewObject_Fallback)
{}
ICStub* getStub(ICStubSpace* space) override {

View File

@ -533,12 +533,7 @@ 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;
}
@ -549,7 +544,6 @@ ICStubCompiler::callVM(const VMFunction& fun, MacroAssembler& masm)
TrampolinePtr code = cx->runtime()->jitRuntime()->getVMWrapper(fun);
MOZ_ASSERT(fun.expectTailCall == NonTailCall);
MOZ_ASSERT(engine_ == Engine::Baseline);
EmitBaselineCallVM(code, masm);
return true;
@ -558,7 +552,6 @@ ICStubCompiler::callVM(const VMFunction& fun, MacroAssembler& masm)
void
ICStubCompiler::enterStubFrame(MacroAssembler& masm, Register scratch)
{
MOZ_ASSERT(engine_ == Engine::Baseline);
EmitBaselineEnterStubFrame(masm, scratch);
#ifdef DEBUG
framePushedAtEnterStubFrame_ = masm.framePushed();
@ -592,8 +585,7 @@ ICStubCompiler::leaveStubFrame(MacroAssembler& masm, bool calledIntoIon)
{
MOZ_ASSERT(entersStubFrame_ && inStubFrame_);
inStubFrame_ = false;
MOZ_ASSERT(engine_ == Engine::Baseline);
#ifdef DEBUG
masm.setFramePushed(framePushedAtEnterStubFrame_);
if (calledIntoIon)

View File

@ -1001,13 +1001,9 @@ 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
@ -1017,8 +1013,7 @@ class ICStubCompiler
// 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;
@ -1026,8 +1021,8 @@ class ICStubCompiler
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
@ -1101,15 +1096,14 @@ class ICStubCompiler
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);
}
};
@ -1203,15 +1197,14 @@ class TypeCheckPrimitiveSetStub : public ICStub
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))
{
@ -1389,13 +1382,13 @@ class ICTypeMonitor_Fallback : public ICStub
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)
{ }
@ -1466,7 +1459,7 @@ class ICTypeMonitor_SingleObject : public ICStub
public:
Compiler(JSContext* cx, HandleObject obj)
: ICStubCompiler(cx, TypeMonitor_SingleObject, Engine::Baseline),
: ICStubCompiler(cx, TypeMonitor_SingleObject),
obj_(obj)
{ }
@ -1500,7 +1493,7 @@ class ICTypeMonitor_ObjectGroup : public ICStub
public:
Compiler(JSContext* cx, HandleObjectGroup group)
: ICStubCompiler(cx, TypeMonitor_ObjectGroup, Engine::Baseline),
: ICStubCompiler(cx, TypeMonitor_ObjectGroup),
group_(group)
{ }
@ -1525,7 +1518,7 @@ class ICTypeMonitor_AnyValue : public ICStub
public:
explicit Compiler(JSContext* cx)
: ICStubCompiler(cx, TypeMonitor_AnyValue, Engine::Baseline)
: ICStubCompiler(cx, TypeMonitor_AnyValue)
{ }
ICTypeMonitor_AnyValue* getStub(ICStubSpace* space) override {

View File

@ -44,28 +44,6 @@ EmitBaselineTailCallVM(TrampolinePtr target, MacroAssembler& masm, uint32_t argS
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)
{

View File

@ -47,12 +47,6 @@ EmitBaselineTailCallVM(TrampolinePtr target, MacroAssembler& masm, uint32_t argS
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)
{

View File

@ -42,23 +42,6 @@ EmitBaselineTailCallVM(TrampolinePtr target, MacroAssembler& masm, uint32_t argS
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)
{

View File

@ -13,7 +13,6 @@ 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(); }

View File

@ -36,27 +36,6 @@ EmitBaselineTailCallVM(TrampolinePtr target, MacroAssembler& masm, uint32_t argS
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)
{

View File

@ -36,25 +36,6 @@ EmitBaselineTailCallVM(TrampolinePtr target, MacroAssembler& masm, uint32_t argS
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)
{