Bug 1479603 - [Part 5] Relocate Baseline fallback stubs to BaselineIC.h r=jandem

--HG--
extra : rebase_source : c214dce7ccbfcfa3666076ff6d1b36cfe7e88574
This commit is contained in:
Matthew Gaudet 2018-08-19 09:29:19 -07:00
Родитель a541dcdf45
Коммит 7cd48ebe3b
2 изменённых файлов: 100 добавлений и 95 удалений

Просмотреть файл

@ -498,6 +498,62 @@ class ICGetIntrinsic_Fallback : public ICMonitoredFallbackStub
};
};
// GetProp
// JSOP_GETPROP
// JSOP_GETPROP_SUPER
class ICGetProp_Fallback : public ICMonitoredFallbackStub
{
friend class ICStubSpace;
explicit ICGetProp_Fallback(JitCode* stubCode)
: ICMonitoredFallbackStub(ICStub::GetProp_Fallback, stubCode)
{ }
public:
static const size_t UNOPTIMIZABLE_ACCESS_BIT = 0;
static const size_t ACCESSED_GETTER_BIT = 1;
void noteUnoptimizableAccess() {
extra_ |= (1u << UNOPTIMIZABLE_ACCESS_BIT);
}
bool hadUnoptimizableAccess() const {
return extra_ & (1u << UNOPTIMIZABLE_ACCESS_BIT);
}
void noteAccessedGetter() {
extra_ |= (1u << ACCESSED_GETTER_BIT);
}
bool hasAccessedGetter() const {
return extra_ & (1u << ACCESSED_GETTER_BIT);
}
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) |
(static_cast<int32_t>(hasReceiver_) << 17);
}
public:
explicit Compiler(JSContext* cx, Engine engine, bool hasReceiver = false)
: ICStubCompiler(cx, ICStub::GetProp_Fallback, engine),
hasReceiver_(hasReceiver)
{ }
ICStub* getStub(ICStubSpace* space) override {
return newStub<ICGetProp_Fallback>(space, getStubCode());
}
};
};
// SetProp
// JSOP_SETPROP
// JSOP_SETNAME
@ -1506,6 +1562,50 @@ class ICUnaryArith_Fallback : public ICFallbackStub
};
};
// Compare
// JSOP_LT
// JSOP_LE
// JSOP_GT
// JSOP_GE
// JSOP_EQ
// JSOP_NE
// JSOP_STRICTEQ
// JSOP_STRICTNE
class ICCompare_Fallback : public ICFallbackStub
{
friend class ICStubSpace;
explicit ICCompare_Fallback(JitCode* stubCode)
: ICFallbackStub(ICStub::Compare_Fallback, stubCode) {}
public:
static const uint32_t MAX_OPTIMIZED_STUBS = 8;
static const size_t UNOPTIMIZABLE_ACCESS_BIT = 0;
void noteUnoptimizableAccess() {
extra_ |= (1u << UNOPTIMIZABLE_ACCESS_BIT);
}
bool hadUnoptimizableAccess() const {
return extra_ & (1u << UNOPTIMIZABLE_ACCESS_BIT);
}
// Compiler for this stub kind.
class Compiler : public ICStubCompiler {
protected:
MOZ_MUST_USE bool generateStubCode(MacroAssembler& masm) override;
public:
explicit Compiler(JSContext* cx, Engine engine)
: ICStubCompiler(cx, ICStub::Compare_Fallback, engine) {}
ICStub* getStub(ICStubSpace* space) override {
return newStub<ICCompare_Fallback>(space, getStubCode());
}
};
};
// BinaryArith
// JSOP_ADD, JSOP_SUB, JSOP_MUL, JOP_DIV, JSOP_MOD
// JSOP_BITAND, JSOP_BITXOR, JSOP_BITOR

Просмотреть файл

@ -1563,101 +1563,6 @@ class ICTypeMonitor_AnyValue : public ICStub
};
};
// Compare
// JSOP_LT
// JSOP_LE
// JSOP_GT
// JSOP_GE
// JSOP_EQ
// JSOP_NE
// JSOP_STRICTEQ
// JSOP_STRICTNE
class ICCompare_Fallback : public ICFallbackStub
{
friend class ICStubSpace;
explicit ICCompare_Fallback(JitCode* stubCode)
: ICFallbackStub(ICStub::Compare_Fallback, stubCode) {}
public:
static const uint32_t MAX_OPTIMIZED_STUBS = 8;
static const size_t UNOPTIMIZABLE_ACCESS_BIT = 0;
void noteUnoptimizableAccess() {
extra_ |= (1u << UNOPTIMIZABLE_ACCESS_BIT);
}
bool hadUnoptimizableAccess() const {
return extra_ & (1u << UNOPTIMIZABLE_ACCESS_BIT);
}
// Compiler for this stub kind.
class Compiler : public ICStubCompiler {
protected:
MOZ_MUST_USE bool generateStubCode(MacroAssembler& masm) override;
public:
explicit Compiler(JSContext* cx, Engine engine)
: ICStubCompiler(cx, ICStub::Compare_Fallback, engine) {}
ICStub* getStub(ICStubSpace* space) override {
return newStub<ICCompare_Fallback>(space, getStubCode());
}
};
};
class ICGetProp_Fallback : public ICMonitoredFallbackStub
{
friend class ICStubSpace;
explicit ICGetProp_Fallback(JitCode* stubCode)
: ICMonitoredFallbackStub(ICStub::GetProp_Fallback, stubCode)
{ }
public:
static const size_t UNOPTIMIZABLE_ACCESS_BIT = 0;
static const size_t ACCESSED_GETTER_BIT = 1;
void noteUnoptimizableAccess() {
extra_ |= (1u << UNOPTIMIZABLE_ACCESS_BIT);
}
bool hadUnoptimizableAccess() const {
return extra_ & (1u << UNOPTIMIZABLE_ACCESS_BIT);
}
void noteAccessedGetter() {
extra_ |= (1u << ACCESSED_GETTER_BIT);
}
bool hasAccessedGetter() const {
return extra_ & (1u << ACCESSED_GETTER_BIT);
}
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) |
(static_cast<int32_t>(hasReceiver_) << 17);
}
public:
explicit Compiler(JSContext* cx, Engine engine, bool hasReceiver = false)
: ICStubCompiler(cx, ICStub::GetProp_Fallback, engine),
hasReceiver_(hasReceiver)
{ }
ICStub* getStub(ICStubSpace* space) override {
return newStub<ICGetProp_Fallback>(space, getStubCode());
}
};
};
} // namespace jit
} // namespace js