mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 991069 - Optimize MPostWriteBarrier OOL path to not save non-volatile regs. r=terrence
This commit is contained in:
parent
e1e2408909
commit
2cd42336bd
@ -1742,14 +1742,11 @@ class OutOfLineCallPostWriteBarrier : public OutOfLineCodeBase<CodeGenerator>
|
||||
bool
|
||||
CodeGenerator::visitOutOfLineCallPostWriteBarrier(OutOfLineCallPostWriteBarrier *ool)
|
||||
{
|
||||
saveLive(ool->lir());
|
||||
saveLiveVolatile(ool->lir());
|
||||
|
||||
const LAllocation *obj = ool->object();
|
||||
|
||||
GeneralRegisterSet regs;
|
||||
regs.add(CallTempReg0);
|
||||
regs.add(CallTempReg1);
|
||||
regs.add(CallTempReg2);
|
||||
GeneralRegisterSet regs = GeneralRegisterSet::Volatile();
|
||||
|
||||
Register objreg;
|
||||
bool isGlobal = false;
|
||||
@ -1772,7 +1769,7 @@ CodeGenerator::visitOutOfLineCallPostWriteBarrier(OutOfLineCallPostWriteBarrier
|
||||
masm.passABIArg(objreg);
|
||||
masm.callWithABI(JS_FUNC_TO_DATA_PTR(void *, fun));
|
||||
|
||||
restoreLive(ool->lir());
|
||||
restoreLiveVolatile(ool->lir());
|
||||
|
||||
masm.jump(ool->rejoin());
|
||||
return true;
|
||||
|
@ -164,6 +164,24 @@ CodeGeneratorShared::restoreLiveIgnore(LInstruction *ins, RegisterSet ignore)
|
||||
masm.PopRegsInMaskIgnore(safepoint->liveRegs(), ignore);
|
||||
}
|
||||
|
||||
void
|
||||
CodeGeneratorShared::saveLiveVolatile(LInstruction *ins)
|
||||
{
|
||||
JS_ASSERT(!ins->isCall());
|
||||
LSafepoint *safepoint = ins->safepoint();
|
||||
RegisterSet regs = RegisterSet::Intersect(safepoint->liveRegs(), RegisterSet::Volatile());
|
||||
masm.PushRegsInMask(regs);
|
||||
}
|
||||
|
||||
void
|
||||
CodeGeneratorShared::restoreLiveVolatile(LInstruction *ins)
|
||||
{
|
||||
JS_ASSERT(!ins->isCall());
|
||||
LSafepoint *safepoint = ins->safepoint();
|
||||
RegisterSet regs = RegisterSet::Intersect(safepoint->liveRegs(), RegisterSet::Volatile());
|
||||
masm.PopRegsInMask(regs);
|
||||
}
|
||||
|
||||
} // ion
|
||||
} // js
|
||||
|
||||
|
@ -351,6 +351,10 @@ class CodeGeneratorShared : public LInstructionVisitor
|
||||
inline void restoreLive(LInstruction *ins);
|
||||
inline void restoreLiveIgnore(LInstruction *ins, RegisterSet reg);
|
||||
|
||||
// Save/restore all registers that are both live and volatile.
|
||||
inline void saveLiveVolatile(LInstruction *ins);
|
||||
inline void restoreLiveVolatile(LInstruction *ins);
|
||||
|
||||
template <typename T>
|
||||
void pushArg(const T &t) {
|
||||
masm.Push(t);
|
||||
|
Loading…
Reference in New Issue
Block a user