Bug 1479603 - [Part 6] Reduce redundant usage of ICStubEngine r=jandem

--HG--
extra : rebase_source : 381f2381b0dee932f64f8136385ee0d5480b60de
This commit is contained in:
Matthew Gaudet 2018-08-17 17:16:19 -07:00
Родитель 7cd48ebe3b
Коммит a98146ee37
8 изменённых файлов: 58 добавлений и 109 удалений

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

@ -35,13 +35,6 @@ CacheRegisterAllocator::addressOf(MacroAssembler& masm, BaselineFrameSlot slot)
// BaselineCacheIRCompiler compiles CacheIR to BaselineIC native code.
class MOZ_RAII BaselineCacheIRCompiler : public CacheIRCompiler
{
#ifdef DEBUG
// Some Baseline IC stubs can be used in IonMonkey through SharedStubs.
// Those stubs have different machine code, so we need to track whether
// we're compiling for Baseline or Ion.
ICStubEngine engine_;
#endif
bool inStubFrame_;
bool makesGCCalls_;
@ -58,12 +51,9 @@ class MOZ_RAII BaselineCacheIRCompiler : public CacheIRCompiler
public:
friend class AutoStubFrame;
BaselineCacheIRCompiler(JSContext* cx, const CacheIRWriter& writer, ICStubEngine engine,
BaselineCacheIRCompiler(JSContext* cx, const CacheIRWriter& writer,
uint32_t stubDataOffset)
: CacheIRCompiler(cx, writer, stubDataOffset, Mode::Baseline, StubFieldPolicy::Address),
#ifdef DEBUG
engine_(engine),
#endif
inStubFrame_(false),
makesGCCalls_(false)
{}
@ -113,7 +103,6 @@ class MOZ_RAII AutoStubFrame
void enter(MacroAssembler& masm, Register scratch, CallCanGC canGC = CallCanGC::CanGC) {
MOZ_ASSERT(compiler.allocator.stackPushed() == 0);
MOZ_ASSERT(compiler.engine_ == ICStubEngine::Baseline);
EmitBaselineEnterStubFrame(masm, scratch);
@ -153,7 +142,6 @@ BaselineCacheIRCompiler::callVM(MacroAssembler& masm, const VMFunction& fun)
TrampolinePtr code = cx_->runtime()->jitRuntime()->getVMWrapper(fun);
MOZ_ASSERT(fun.expectTailCall == NonTailCall);
MOZ_ASSERT(engine_ == ICStubEngine::Baseline);
EmitBaselineCallVM(code, masm);
return true;
@ -166,7 +154,6 @@ BaselineCacheIRCompiler::tailCallVM(MacroAssembler& masm, const VMFunction& fun)
TrampolinePtr code = cx_->runtime()->jitRuntime()->getVMWrapper(fun);
MOZ_ASSERT(fun.expectTailCall == TailCall);
MOZ_ASSERT(engine_ == ICStubEngine::Baseline);
size_t argSize = fun.explicitStackSlots() * sizeof(void*);
EmitBaselineTailCallVM(code, masm, argSize);
@ -557,8 +544,6 @@ BaselineCacheIRCompiler::emitGuardHasGetterSetter()
bool
BaselineCacheIRCompiler::emitCallScriptedGetterResult()
{
MOZ_ASSERT(engine_ == ICStubEngine::Baseline);
Register obj = allocator.useRegister(masm, reader.objOperandId());
Address getterAddr(stubAddress(reader.stubOffset()));
bool isCrossRealm = reader.readBool();
@ -2121,8 +2106,8 @@ static const size_t MaxOptimizedCacheIRStubs = 16;
ICStub*
js::jit::AttachBaselineCacheIRStub(JSContext* cx, const CacheIRWriter& writer,
CacheKind kind, BaselineCacheIRStubKind stubKind,
ICStubEngine engine, JSScript* outerScript,
ICFallbackStub* stub, bool* attached)
JSScript* outerScript, ICFallbackStub* stub,
bool* attached)
{
// We shouldn't GC or report OOM (or any other exception) here.
AutoAssertNoPendingException aanpe(cx);
@ -2154,12 +2139,13 @@ js::jit::AttachBaselineCacheIRStub(JSContext* cx, const CacheIRWriter& writer,
// Check if we already have JitCode for this stub.
CacheIRStubInfo* stubInfo;
CacheIRStubKey::Lookup lookup(kind, engine, writer.codeStart(), writer.codeLength());
CacheIRStubKey::Lookup lookup(kind, ICStubEngine::Baseline, writer.codeStart(),
writer.codeLength());
JitCode* code = jitZone->getBaselineCacheIRStubCode(lookup, &stubInfo);
if (!code) {
// We have to generate stub code.
JitContext jctx(cx, nullptr);
BaselineCacheIRCompiler comp(cx, writer, engine, stubDataOffset);
BaselineCacheIRCompiler comp(cx, writer, stubDataOffset);
if (!comp.init(kind))
return nullptr;
@ -2172,7 +2158,8 @@ js::jit::AttachBaselineCacheIRStub(JSContext* cx, const CacheIRWriter& writer,
// to the stub code HashMap, so we don't have to worry about freeing
// it below.
MOZ_ASSERT(!stubInfo);
stubInfo = CacheIRStubInfo::New(kind, engine, comp.makesGCCalls(), stubDataOffset, writer);
stubInfo = CacheIRStubInfo::New(kind, ICStubEngine::Baseline, comp.makesGCCalls(),
stubDataOffset, writer);
if (!stubInfo)
return nullptr;
@ -2236,7 +2223,8 @@ js::jit::AttachBaselineCacheIRStub(JSContext* cx, const CacheIRWriter& writer,
size_t bytesNeeded = stubInfo->stubDataOffset() + stubInfo->stubDataSize();
ICStubSpace* stubSpace = ICStubCompiler::StubSpaceForStub(stubInfo->makesGCCalls(),
outerScript, engine);
outerScript,
ICStubEngine::Baseline);
void* newStubMem = stubSpace->alloc(bytesNeeded);
if (!newStubMem)
return nullptr;

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

@ -21,8 +21,8 @@ enum class BaselineCacheIRStubKind { Regular, Monitored, Updated };
ICStub* AttachBaselineCacheIRStub(JSContext* cx, const CacheIRWriter& writer,
CacheKind kind, BaselineCacheIRStubKind stubKind,
ICStubEngine engine, JSScript* outerScript,
ICFallbackStub* stub, bool* attached);
JSScript* outerScript, ICFallbackStub* stub,
bool* attached);
} // namespace jit
} // namespace js

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

@ -1926,7 +1926,7 @@ BaselineCompiler::emitBinaryArith()
frame.popRegsAndSync(2);
// Call IC
ICBinaryArith_Fallback::Compiler stubCompiler(cx, ICStubCompiler::Engine::Baseline);
ICBinaryArith_Fallback::Compiler stubCompiler(cx);
if (!emitOpIC(stubCompiler.getStub(&stubSpace_)))
return false;
@ -2008,7 +2008,7 @@ BaselineCompiler::emitCompare()
frame.popRegsAndSync(2);
// Call IC.
ICCompare_Fallback::Compiler stubCompiler(cx, ICStubCompiler::Engine::Baseline);
ICCompare_Fallback::Compiler stubCompiler(cx);
if (!emitOpIC(stubCompiler.getStub(&stubSpace_)))
return false;
@ -2043,7 +2043,7 @@ BaselineCompiler::emit_JSOP_CASE()
frame.syncStack(0);
// Call IC.
ICCompare_Fallback::Compiler stubCompiler(cx, ICStubCompiler::Engine::Baseline);
ICCompare_Fallback::Compiler stubCompiler(cx);
if (!emitOpIC(stubCompiler.getStub(&stubSpace_)))
return false;
@ -2091,7 +2091,7 @@ BaselineCompiler::emit_JSOP_NEWARRAY()
if (!group)
return false;
ICNewArray_Fallback::Compiler stubCompiler(cx, group, ICStubCompiler::Engine::Baseline);
ICNewArray_Fallback::Compiler stubCompiler(cx, group);
if (!emitOpIC(stubCompiler.getStub(&stubSpace_)))
return false;
@ -2155,7 +2155,7 @@ BaselineCompiler::emit_JSOP_NEWOBJECT()
{
frame.syncStack(0);
ICNewObject_Fallback::Compiler stubCompiler(cx, ICStubCompiler::Engine::Baseline);
ICNewObject_Fallback::Compiler stubCompiler(cx);
if (!emitOpIC(stubCompiler.getStub(&stubSpace_)))
return false;
@ -2168,7 +2168,7 @@ BaselineCompiler::emit_JSOP_NEWINIT()
{
frame.syncStack(0);
ICNewObject_Fallback::Compiler stubCompiler(cx, ICStubCompiler::Engine::Baseline);
ICNewObject_Fallback::Compiler stubCompiler(cx);
if (!emitOpIC(stubCompiler.getStub(&stubSpace_)))
return false;
@ -2616,7 +2616,7 @@ BaselineCompiler::emit_JSOP_GETPROP()
frame.popRegsAndSync(1);
// Call IC.
ICGetProp_Fallback::Compiler compiler(cx, ICStubCompiler::Engine::Baseline);
ICGetProp_Fallback::Compiler compiler(cx);
if (!emitOpIC(compiler.getStub(&stubSpace_)))
return false;
@ -2651,8 +2651,7 @@ BaselineCompiler::emit_JSOP_GETPROP_SUPER()
masm.loadValue(frame.addressOfStackValue(frame.peek(-1)), R1);
frame.pop();
ICGetProp_Fallback::Compiler compiler(cx, ICStubCompiler::Engine::Baseline,
/* hasReceiver = */ true);
ICGetProp_Fallback::Compiler compiler(cx, /* hasReceiver = */ true);
if (!emitOpIC(compiler.getStub(&stubSpace_)))
return false;

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

@ -41,30 +41,18 @@ namespace jit {
template <typename T>
class DebugModeOSRVolatileStub
{
ICStubCompiler::Engine engine_;
T stub_;
BaselineFrame* frame_;
uint32_t pcOffset_;
public:
DebugModeOSRVolatileStub(ICStubCompiler::Engine engine, BaselineFrame* frame,
ICFallbackStub* stub)
: engine_(engine),
stub_(static_cast<T>(stub)),
frame_(frame),
pcOffset_(stub->icEntry()->pcOffset())
{ }
DebugModeOSRVolatileStub(BaselineFrame* frame, ICFallbackStub* stub)
: engine_(ICStubCompiler::Engine::Baseline),
stub_(static_cast<T>(stub)),
: stub_(static_cast<T>(stub)),
frame_(frame),
pcOffset_(stub->icEntry()->pcOffset())
{ }
bool invalid() const {
if (engine_ == ICStubCompiler::Engine::IonSharedIC)
return stub_->invalid();
MOZ_ASSERT(!frame_->isHandlingException());
ICEntry& entry = frame_->script()->baselineScript()->icEntryFromPCOffset(pcOffset_);
return stub_ != entry.fallbackStub();

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

@ -469,14 +469,13 @@ DoToBoolFallback(JSContext* cx, BaselineFrame* frame, ICToBool_Fallback* stub, H
RootedScript script(cx, frame->script());
jsbytecode* pc = stub->icEntry()->pc(script);
ICStubEngine engine = ICStubEngine::Baseline;
ToBoolIRGenerator gen(cx, script, pc, stub->state().mode(),
arg);
bool attached = false;
if (gen.tryAttachStub()) {
ICStub* newStub = AttachBaselineCacheIRStub(cx, gen.writerRef(), gen.cacheKind(),
BaselineCacheIRStubKind::Regular,
engine, script, stub, &attached);
script, stub, &attached);
if (newStub)
JitSpew(JitSpew_BaselineIC, " Attached ToBool CacheIR stub, attached is now %d", attached);
}
@ -609,7 +608,6 @@ DoGetElemFallback(JSContext* cx, BaselineFrame* frame, ICGetElem_Fallback* stub_
stub->discardStubs(cx);
if (stub->state().canAttachStub()) {
ICStubEngine engine = ICStubEngine::Baseline;
GetPropIRGenerator gen(cx, script, pc,
CacheKind::GetElem, stub->state().mode(),
&isTemporarilyUnoptimizable, lhs, rhs, lhs,
@ -617,7 +615,7 @@ DoGetElemFallback(JSContext* cx, BaselineFrame* frame, ICGetElem_Fallback* stub_
if (gen.tryAttachStub()) {
ICStub* newStub = AttachBaselineCacheIRStub(cx, gen.writerRef(), gen.cacheKind(),
BaselineCacheIRStubKind::Monitored,
engine, script, stub, &attached);
script, stub, &attached);
if (newStub) {
JitSpew(JitSpew_BaselineIC, " Attached GetElem CacheIR stub");
if (gen.shouldNotePreliminaryObjectStub())
@ -683,14 +681,13 @@ DoGetElemSuperFallback(JSContext* cx, BaselineFrame* frame, ICGetElem_Fallback*
stub->discardStubs(cx);
if (stub->state().canAttachStub()) {
ICStubEngine engine = ICStubEngine::Baseline;
GetPropIRGenerator gen(cx, script, pc, CacheKind::GetElemSuper, stub->state().mode(),
&isTemporarilyUnoptimizable, lhs, rhs, receiver,
GetPropertyResultFlags::All);
if (gen.tryAttachStub()) {
ICStub* newStub = AttachBaselineCacheIRStub(cx, gen.writerRef(), gen.cacheKind(),
BaselineCacheIRStubKind::Monitored,
engine, script, stub, &attached);
script, stub, &attached);
if (newStub) {
JitSpew(JitSpew_BaselineIC, " Attached GetElemSuper CacheIR stub");
if (gen.shouldNotePreliminaryObjectStub())
@ -843,8 +840,7 @@ DoSetElemFallback(JSContext* cx, BaselineFrame* frame, ICSetElem_Fallback* stub_
if (gen.tryAttachStub()) {
ICStub* newStub = AttachBaselineCacheIRStub(cx, gen.writerRef(), gen.cacheKind(),
BaselineCacheIRStubKind::Updated,
ICStubEngine::Baseline, frame->script(),
stub, &attached);
frame->script(), stub, &attached);
if (newStub) {
JitSpew(JitSpew_BaselineIC, " Attached SetElem CacheIR stub");
@ -907,8 +903,7 @@ DoSetElemFallback(JSContext* cx, BaselineFrame* frame, ICSetElem_Fallback* stub_
if (gen.tryAttachAddSlotStub(oldGroup, oldShape)) {
ICStub* newStub = AttachBaselineCacheIRStub(cx, gen.writerRef(), gen.cacheKind(),
BaselineCacheIRStubKind::Updated,
ICStubEngine::Baseline, frame->script(),
stub, &attached);
frame->script(), stub, &attached);
if (newStub) {
if (gen.shouldNotePreliminaryObjectStub())
newStub->toCacheIR_Updated()->notePreliminaryObject();
@ -1099,13 +1094,12 @@ DoInFallback(JSContext* cx, BaselineFrame* frame, ICIn_Fallback* stub_,
RootedScript script(cx, frame->script());
jsbytecode* pc = stub->icEntry()->pc(script);
ICStubEngine engine = ICStubEngine::Baseline;
HasPropIRGenerator gen(cx, script, pc, CacheKind::In, stub->state().mode(), key, objValue);
bool attached = false;
if (gen.tryAttachStub()) {
ICStub* newStub = AttachBaselineCacheIRStub(cx, gen.writerRef(), gen.cacheKind(),
BaselineCacheIRStubKind::Regular,
engine, script, stub, &attached);
script, stub, &attached);
if (newStub)
JitSpew(JitSpew_BaselineIC, " Attached In CacheIR stub");
}
@ -1167,14 +1161,13 @@ DoHasOwnFallback(JSContext* cx, BaselineFrame* frame, ICHasOwn_Fallback* stub_,
RootedScript script(cx, frame->script());
jsbytecode* pc = stub->icEntry()->pc(script);
ICStubEngine engine = ICStubEngine::Baseline;
HasPropIRGenerator gen(cx, script, pc, CacheKind::HasOwn,
stub->state().mode(), keyValue, objValue);
bool attached = false;
if (gen.tryAttachStub()) {
ICStub* newStub = AttachBaselineCacheIRStub(cx, gen.writerRef(), gen.cacheKind(),
BaselineCacheIRStubKind::Regular,
engine, script, stub, &attached);
script, stub, &attached);
if (newStub)
JitSpew(JitSpew_BaselineIC, " Attached HasOwn CacheIR stub");
}
@ -1241,12 +1234,11 @@ DoGetNameFallback(JSContext* cx, BaselineFrame* frame, ICGetName_Fallback* stub_
stub->discardStubs(cx);
if (stub->state().canAttachStub()) {
ICStubEngine engine = ICStubEngine::Baseline;
GetNameIRGenerator gen(cx, script, pc, stub->state().mode(), envChain, name);
if (gen.tryAttachStub()) {
ICStub* newStub = AttachBaselineCacheIRStub(cx, gen.writerRef(), gen.cacheKind(),
BaselineCacheIRStubKind::Monitored,
engine, script, stub, &attached);
script, stub, &attached);
if (newStub)
JitSpew(JitSpew_BaselineIC, " Attached GetName CacheIR stub");
}
@ -1326,8 +1318,7 @@ DoBindNameFallback(JSContext* cx, BaselineFrame* frame, ICBindName_Fallback* stu
if (gen.tryAttachStub()) {
ICStub* newStub = AttachBaselineCacheIRStub(cx, gen.writerRef(), gen.cacheKind(),
BaselineCacheIRStubKind::Regular,
ICStubEngine::Baseline, script, stub,
&attached);
script, stub, &attached);
if (newStub)
JitSpew(JitSpew_BaselineIC, " Attached BindName CacheIR stub");
}
@ -1404,8 +1395,7 @@ DoGetIntrinsicFallback(JSContext* cx, BaselineFrame* frame, ICGetIntrinsic_Fallb
if (gen.tryAttachStub()) {
ICStub* newStub = AttachBaselineCacheIRStub(cx, gen.writerRef(), gen.cacheKind(),
BaselineCacheIRStubKind::Regular,
ICStubEngine::Baseline, script, stub,
&attached);
script, stub, &attached);
if (newStub)
JitSpew(JitSpew_BaselineIC, " Attached GetIntrinsic CacheIR stub");
}
@ -1506,8 +1496,7 @@ DoGetPropFallback(JSContext* cx, BaselineFrame* frame, ICGetProp_Fallback* stub_
if (gen.tryAttachStub()) {
ICStub* newStub = AttachBaselineCacheIRStub(cx, gen.writerRef(), gen.cacheKind(),
BaselineCacheIRStubKind::Monitored,
ICStubEngine::Baseline, script,
stub, &attached);
script, stub, &attached);
if (newStub) {
JitSpew(JitSpew_BaselineIC, " Attached CacheIR stub");
if (gen.shouldNotePreliminaryObjectStub())
@ -1577,8 +1566,7 @@ DoGetPropSuperFallback(JSContext* cx, BaselineFrame* frame, ICGetProp_Fallback*
if (gen.tryAttachStub()) {
ICStub* newStub = AttachBaselineCacheIRStub(cx, gen.writerRef(), gen.cacheKind(),
BaselineCacheIRStubKind::Monitored,
ICStubEngine::Baseline, script,
stub, &attached);
script, stub, &attached);
if (newStub) {
JitSpew(JitSpew_BaselineIC, " Attached CacheIR stub");
if (gen.shouldNotePreliminaryObjectStub())
@ -1756,8 +1744,7 @@ DoSetPropFallback(JSContext* cx, BaselineFrame* frame, ICSetProp_Fallback* stub_
if (gen.tryAttachStub()) {
ICStub* newStub = AttachBaselineCacheIRStub(cx, gen.writerRef(), gen.cacheKind(),
BaselineCacheIRStubKind::Updated,
ICStubEngine::Baseline, frame->script(),
stub, &attached);
frame->script(), stub, &attached);
if (newStub) {
JitSpew(JitSpew_BaselineIC, " Attached SetProp CacheIR stub");
@ -1828,8 +1815,7 @@ DoSetPropFallback(JSContext* cx, BaselineFrame* frame, ICSetProp_Fallback* stub_
if (gen.tryAttachAddSlotStub(oldGroup, oldShape)) {
ICStub* newStub = AttachBaselineCacheIRStub(cx, gen.writerRef(), gen.cacheKind(),
BaselineCacheIRStubKind::Updated,
ICStubEngine::Baseline, frame->script(),
stub, &attached);
frame->script(), stub, &attached);
if (newStub) {
if (gen.shouldNotePreliminaryObjectStub())
newStub->toCacheIR_Updated()->notePreliminaryObject();
@ -2517,9 +2503,8 @@ DoCallFallback(JSContext* cx, BaselineFrame* frame, ICCall_Fallback* stub_, uint
HandleValueArray::fromMarkedLocation(argc, vp+2));
if (gen.tryAttachStub()) {
ICStub* newStub = AttachBaselineCacheIRStub(cx, gen.writerRef(), gen.cacheKind(),
gen.cacheIRStubKind(),
ICStubEngine::Baseline,
script, stub, &handled);
gen.cacheIRStubKind(), script,
stub, &handled);
if (newStub) {
JitSpew(JitSpew_BaselineIC, " Attached Call CacheIR stub");
@ -4144,13 +4129,12 @@ DoGetIteratorFallback(JSContext* cx, BaselineFrame* frame, ICGetIterator_Fallbac
RootedScript script(cx, frame->script());
jsbytecode* pc = stub->icEntry()->pc(script);
ICStubEngine engine = ICStubEngine::Baseline;
GetIteratorIRGenerator gen(cx, script, pc, stub->state().mode(), value);
bool attached = false;
if (gen.tryAttachStub()) {
ICStub* newStub = AttachBaselineCacheIRStub(cx, gen.writerRef(), gen.cacheKind(),
BaselineCacheIRStubKind::Regular,
engine, script, stub, &attached);
script, stub, &attached);
if (newStub)
JitSpew(JitSpew_BaselineIC, " Attached GetIterator CacheIR stub");
}
@ -4342,7 +4326,6 @@ TryAttachInstanceOfStub(JSContext* cx, BaselineFrame* frame, ICInstanceOf_Fallba
RootedScript script(cx, frame->script());
jsbytecode* pc = stub->icEntry()->pc(script);
ICStubEngine engine = ICStubEngine::Baseline;
InstanceOfIRGenerator gen(cx, script, pc, stub->state().mode(),
lhs,
rhs);
@ -4350,7 +4333,7 @@ TryAttachInstanceOfStub(JSContext* cx, BaselineFrame* frame, ICInstanceOf_Fallba
if (gen.tryAttachStub()) {
ICStub* newStub = AttachBaselineCacheIRStub(cx, gen.writerRef(), gen.cacheKind(),
BaselineCacheIRStubKind::Regular,
engine, script, stub, attached);
script, stub, attached);
if (newStub)
JitSpew(JitSpew_BaselineIC, " Attached InstanceOf CacheIR stub, attached is now %d", *attached);
}
@ -4366,7 +4349,7 @@ DoInstanceOfFallback(JSContext* cx, BaselineFrame* frame, ICInstanceOf_Fallback*
HandleValue lhs, HandleValue rhs, MutableHandleValue res)
{
// This fallback stub may trigger debug mode toggling.
DebugModeOSRVolatileStub<ICInstanceOf_Fallback*> stub(ICStubEngine::Baseline, frame, stub_);
DebugModeOSRVolatileStub<ICInstanceOf_Fallback*> stub(frame, stub_);
FallbackICSpew(cx, stub, "InstanceOf");
@ -4445,13 +4428,12 @@ DoTypeOfFallback(JSContext* cx, BaselineFrame* frame, ICTypeOf_Fallback* stub, H
RootedScript script(cx, frame->script());
jsbytecode* pc = stub->icEntry()->pc(script);
ICStubEngine engine = ICStubEngine::Baseline;
TypeOfIRGenerator gen(cx, script, pc, stub->state().mode(), val);
bool attached = false;
if (gen.tryAttachStub()) {
ICStub* newStub = AttachBaselineCacheIRStub(cx, gen.writerRef(), gen.cacheKind(),
BaselineCacheIRStubKind::Regular,
engine, script, stub, &attached);
script, stub, &attached);
if (newStub)
JitSpew(JitSpew_BaselineIC, " Attached TypeOf CacheIR stub");
}
@ -4764,7 +4746,7 @@ DoUnaryArithFallback(JSContext* cx, BaselineFrame* frame, ICUnaryArith_Fallback*
HandleValue val, MutableHandleValue res)
{
// This fallback stub may trigger debug mode toggling.
DebugModeOSRVolatileStub<ICUnaryArith_Fallback*> debug_stub(ICStubEngine::Baseline, frame, stub);
DebugModeOSRVolatileStub<ICUnaryArith_Fallback*> debug_stub(frame, stub);
RootedScript script(cx, frame->script());
jsbytecode* pc = stub->icEntry()->pc(script);
@ -4807,7 +4789,7 @@ DoUnaryArithFallback(JSContext* cx, BaselineFrame* frame, ICUnaryArith_Fallback*
bool attached = false;
ICStub* newStub = AttachBaselineCacheIRStub(cx, gen.writerRef(), gen.cacheKind(),
BaselineCacheIRStubKind::Regular,
ICStubEngine::Baseline, script, stub, &attached);
script, stub, &attached);
if (newStub) {
JitSpew(JitSpew_BaselineIC, " Attached UnaryArith CacheIR stub for %s", CodeName[op]);
}
@ -4851,7 +4833,7 @@ DoBinaryArithFallback(JSContext* cx, BaselineFrame* frame, ICBinaryArith_Fallbac
HandleValue lhs, HandleValue rhs, MutableHandleValue ret)
{
// This fallback stub may trigger debug mode toggling.
DebugModeOSRVolatileStub<ICBinaryArith_Fallback*> stub(ICStubEngine::Baseline, frame, stub_);
DebugModeOSRVolatileStub<ICBinaryArith_Fallback*> stub(frame, stub_);
RootedScript script(cx, frame->script());
jsbytecode* pc = stub->icEntry()->pc(script);
@ -4960,7 +4942,7 @@ DoBinaryArithFallback(JSContext* cx, BaselineFrame* frame, ICBinaryArith_Fallbac
bool attached = false;
ICStub* newStub = AttachBaselineCacheIRStub(cx, gen.writerRef(), gen.cacheKind(),
BaselineCacheIRStubKind::Regular,
ICStubEngine::Baseline, script, stub, &attached);
script, stub, &attached);
if (newStub)
JitSpew(JitSpew_BaselineIC, " Attached BinaryArith CacheIR stub for %s", CodeName[op]);
@ -5006,7 +4988,7 @@ DoCompareFallback(JSContext* cx, BaselineFrame* frame, ICCompare_Fallback* stub_
HandleValue rhs, MutableHandleValue ret)
{
// This fallback stub may trigger debug mode toggling.
DebugModeOSRVolatileStub<ICCompare_Fallback*> stub(ICStubEngine::Baseline, frame, stub_);
DebugModeOSRVolatileStub<ICCompare_Fallback*> stub(frame, stub_);
RootedScript script(cx, frame->script());
jsbytecode* pc = stub->icEntry()->pc(script);
@ -5082,7 +5064,7 @@ DoCompareFallback(JSContext* cx, BaselineFrame* frame, ICCompare_Fallback* stub_
if (gen.tryAttachStub()) {
ICStub* newStub = AttachBaselineCacheIRStub(cx, gen.writerRef(), gen.cacheKind(),
BaselineCacheIRStubKind::Regular,
ICStubEngine::Baseline, script, stub, &attached);
script, stub, &attached);
if (newStub)
JitSpew(JitSpew_BaselineIC, " Attached CacheIR stub");
return true;
@ -5204,7 +5186,7 @@ DoNewObject(JSContext* cx, BaselineFrame* frame, ICNewObject_Fallback* stub, Mut
if (gen.tryAttachStub()) {
ICStub* newStub = AttachBaselineCacheIRStub(cx, gen.writerRef(), gen.cacheKind(),
BaselineCacheIRStubKind::Regular,
ICStubEngine::Baseline , script, stub, &attached);
script, stub, &attached);
if (newStub)
JitSpew(JitSpew_BaselineIC, " NewObject Attached CacheIR stub");
}

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

@ -542,8 +542,8 @@ class ICGetProp_Fallback : public ICMonitoredFallbackStub
}
public:
explicit Compiler(JSContext* cx, Engine engine, bool hasReceiver = false)
: ICStubCompiler(cx, ICStub::GetProp_Fallback, engine),
explicit Compiler(JSContext* cx, bool hasReceiver = false)
: ICStubCompiler(cx, ICStub::GetProp_Fallback, Engine::Baseline),
hasReceiver_(hasReceiver)
{ }
@ -1596,8 +1596,8 @@ class ICCompare_Fallback : public ICFallbackStub
MOZ_MUST_USE bool generateStubCode(MacroAssembler& masm) override;
public:
explicit Compiler(JSContext* cx, Engine engine)
: ICStubCompiler(cx, ICStub::Compare_Fallback, engine) {}
explicit Compiler(JSContext* cx)
: ICStubCompiler(cx, ICStub::Compare_Fallback, Engine::Baseline) {}
ICStub* getStub(ICStubSpace* space) override {
return newStub<ICCompare_Fallback>(space, getStubCode());
@ -1646,8 +1646,8 @@ class ICBinaryArith_Fallback : public ICFallbackStub
MOZ_MUST_USE bool generateStubCode(MacroAssembler& masm) override;
public:
explicit Compiler(JSContext* cx, Engine engine)
: ICStubCompiler(cx, ICStub::BinaryArith_Fallback, engine) {}
explicit Compiler(JSContext* cx)
: ICStubCompiler(cx, ICStub::BinaryArith_Fallback, Engine::Baseline) {}
ICStub* getStub(ICStubSpace* space) override {
return newStub<ICBinaryArith_Fallback>(space, getStubCode());
@ -1678,8 +1678,8 @@ class ICNewArray_Fallback : public ICFallbackStub
MOZ_MUST_USE bool generateStubCode(MacroAssembler& masm) override;
public:
Compiler(JSContext* cx, ObjectGroup* templateGroup, Engine engine)
: ICStubCompiler(cx, ICStub::NewArray_Fallback, engine),
Compiler(JSContext* cx, ObjectGroup* templateGroup)
: ICStubCompiler(cx, ICStub::NewArray_Fallback, Engine::Baseline),
templateGroup(cx, templateGroup)
{}
@ -1725,8 +1725,8 @@ class ICNewObject_Fallback : public ICFallbackStub
MOZ_MUST_USE bool generateStubCode(MacroAssembler& masm) override;
public:
explicit Compiler(JSContext* cx, Engine engine)
: ICStubCompiler(cx, ICStub::NewObject_Fallback, engine)
explicit Compiler(JSContext* cx)
: ICStubCompiler(cx, ICStub::NewObject_Fallback, Engine::Baseline)
{}
ICStub* getStub(ICStubSpace* space) override {

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

@ -345,9 +345,6 @@ enum class ICStubEngine : uint8_t {
// Baseline IC, see SharedIC.h and BaselineIC.h.
Baseline = 0,
// Ion IC that reuses Baseline IC code, see SharedIC.h.
IonSharedIC,
// Ion IC, see IonIC.h.
IonIC
};

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

@ -618,11 +618,6 @@ ICStubCompiler::leaveStubFrame(MacroAssembler& masm, bool calledIntoIon)
void
ICStubCompiler::pushStubPayload(MacroAssembler& masm, Register scratch)
{
if (engine_ == Engine::IonSharedIC) {
masm.push(Imm32(0));
return;
}
if (inStubFrame_) {
masm.loadPtr(Address(BaselineFrameReg, 0), scratch);
masm.pushBaselineFramePtr(scratch, scratch);