Bug 868027 - Use push to push integer registers onto the stack on x64. r=nbp

Use push instead of adjusting the stack pointer and doing stores manually.
This significantly reduces code size for these sequences.
This commit is contained in:
Dan Gohman 2013-05-03 19:20:30 -07:00
parent 42ad8d0952
commit a539075045

View File

@ -282,9 +282,10 @@ IonRuntime::generateInvalidator(JSContext *cx)
masm.addq(Imm32(sizeof(uintptr_t)), rsp);
// 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.movq(Register::FromCode(i), Operand(rsp, i * sizeof(void *)));
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));
@ -415,9 +416,10 @@ 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.movq(Register::FromCode(i), Operand(rsp, i * sizeof(void *)));
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));