Bug 818138 - On x64 optimize push with small pointer immediates. r=jandem

This commit is contained in:
Tom Schuster 2012-12-06 16:33:35 +01:00
parent 4a5f707dbb
commit 252d483b90
2 changed files with 9 additions and 3 deletions

View File

@ -492,7 +492,7 @@ class MacroAssembler : public MacroAssemblerSpecific
// Push VMFunction pointer, to mark arguments.
Push(ImmWord(f));
}
void enterFakeExitFrame(void *codeVal = NULL) {
void enterFakeExitFrame(IonCode *codeVal = NULL) {
linkExitFrame();
Push(ImmWord(uintptr_t(codeVal)));
Push(ImmWord(uintptr_t(NULL)));

View File

@ -289,8 +289,14 @@ class Assembler : public AssemblerX86Shared
push(ScratchReg);
}
void push(const ImmWord ptr) {
movq(ptr, ScratchReg);
push(ScratchReg);
// We often end up with ImmWords that actually fit into int32.
// Be aware of the sign extension behavior.
if (ptr.value <= INT32_MAX) {
push(Imm32(ptr.value));
} else {
movq(ptr, ScratchReg);
push(ScratchReg);
}
}
void push(const FloatRegister &src) {
subq(Imm32(sizeof(void*)), StackPointer);