Bug 888122 - Call MacroAssembler::PushRegsInMask instead of pushing each register manually on x64.

This commit is contained in:
Dan Gohman 2013-06-28 11:27:20 -07:00
Родитель 2efea53f15
Коммит 1b6a2066e6
1 изменённых файлов: 8 добавлений и 18 удалений

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

@ -20,6 +20,12 @@
using namespace js;
using namespace js::ion;
// All registers to save and restore. This includes the stack pointer, since we
// use the ability to reference register values on the stack by index.
static const RegisterSet AllRegs =
RegisterSet(GeneralRegisterSet(Registers::AllMask),
FloatRegisterSet(FloatRegisters::AllMask));
/* This method generates a trampoline on x64 for a c++ function with
* the following signature:
* JSBool blah(void *code, int argc, Value *argv, JSObject *scopeChain,
@ -282,15 +288,7 @@ IonRuntime::generateInvalidator(JSContext *cx)
masm.addq(Imm32(sizeof(uintptr_t)), rsp);
// Push registers such that we can access them from [base + code].
for (uint32_t i = Registers::Total; i > 0; ) {
i--;
masm.Push(Register::FromCode(i));
}
// Push xmm registers, such that we can access them from [base + code].
masm.reserveStack(FloatRegisters::Total * sizeof(double));
for (uint32_t i = 0; i < FloatRegisters::Total; i++)
masm.movsd(FloatRegister::FromCode(i), Operand(rsp, i * sizeof(double)));
masm.PushRegsInMask(AllRegs);
masm.movq(rsp, rax); // Argument to ion::InvalidationBailout.
@ -416,15 +414,7 @@ static void
GenerateBailoutThunk(JSContext *cx, MacroAssembler &masm, uint32_t frameClass)
{
// Push registers such that we can access them from [base + code].
for (uint32_t i = Registers::Total; i > 0; ) {
i--;
masm.Push(Register::FromCode(i));
}
// Push xmm registers, such that we can access them from [base + code].
masm.reserveStack(FloatRegisters::Total * sizeof(double));
for (uint32_t i = 0; i < FloatRegisters::Total; i++)
masm.movsd(FloatRegister::FromCode(i), Operand(rsp, i * sizeof(double)));
masm.PushRegsInMask(AllRegs);
// Get the stack pointer into a register, pre-alignment.
masm.movq(rsp, r8);