Bug 888122 - Call MacroAssembler::PushRegsInMask instead of pushing each register manually on x86. r=dvander

This commit is contained in:
Dan Gohman 2013-06-28 11:28:00 -07:00
Родитель 1b6a2066e6
Коммит 91be8654dd
1 изменённых файлов: 9 добавлений и 15 удалений

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

@ -21,6 +21,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));
enum EnterJitEbpArgumentOffset {
ARG_JITCODE = 2 * sizeof(void *),
ARG_ARGC = 3 * sizeof(void *),
@ -265,13 +271,8 @@ IonRuntime::generateInvalidator(JSContext *cx)
masm.addl(Imm32(sizeof(uintptr_t)), esp);
masm.reserveStack(Registers::Total * sizeof(void *));
for (uint32_t i = 0; i < Registers::Total; i++)
masm.movl(Register::FromCode(i), Operand(esp, i * sizeof(void *)));
masm.reserveStack(FloatRegisters::Total * sizeof(double));
for (uint32_t i = 0; i < FloatRegisters::Total; i++)
masm.movsd(FloatRegister::FromCode(i), Operand(esp, i * sizeof(double)));
// Push registers such that we can access them from [base + code].
masm.PushRegsInMask(AllRegs);
masm.movl(esp, eax); // Argument to ion::InvalidationBailout.
@ -411,14 +412,7 @@ static void
GenerateBailoutThunk(JSContext *cx, MacroAssembler &masm, uint32_t frameClass)
{
// Push registers such that we can access them from [base + code].
masm.reserveStack(Registers::Total * sizeof(void *));
for (uint32_t i = 0; i < Registers::Total; i++)
masm.movl(Register::FromCode(i), Operand(esp, i * sizeof(void *)));
// 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(esp, i * sizeof(double)));
masm.PushRegsInMask(AllRegs);
// Push the bailout table number.
masm.push(Imm32(frameClass));