Backed out changeset 5c7fbeed8f96 (bug 515290, accidentally committed unrelated changes with the bug).

This commit is contained in:
Andreas Gal 2009-09-09 12:52:58 -07:00
parent b29acb6983
commit bb688e13fe

View File

@ -474,6 +474,8 @@ Assembler::genPrologue()
uint32_t stackNeeded = max_out_args + STACK_GRANULARITY * _activation.tos; uint32_t stackNeeded = max_out_args + STACK_GRANULARITY * _activation.tos;
uint32_t savingCount = 2; uint32_t savingCount = 2;
uint32_t savingMask = rmask(FP) | rmask(LR);
// so for alignment purposes we've pushed return addr and fp // so for alignment purposes we've pushed return addr and fp
uint32_t stackPushed = STACK_GRANULARITY * savingCount; uint32_t stackPushed = STACK_GRANULARITY * savingCount;
uint32_t aligned = alignUp(stackNeeded + stackPushed, NJ_ALIGN_STACK); uint32_t aligned = alignUp(stackNeeded + stackPushed, NJ_ALIGN_STACK);
@ -488,7 +490,7 @@ Assembler::genPrologue()
NIns *patchEntry = _nIns; NIns *patchEntry = _nIns;
MOV(FP, SP); MOV(FP, SP);
PUSH_mask((rmask(FP) | rmask(LR))); PUSH_mask(savingMask);
return patchEntry; return patchEntry;
} }
@ -517,7 +519,13 @@ Assembler::nFragExit(LInsp guard)
// will work correctly. // will work correctly.
JMP_far(_epilogue); JMP_far(_epilogue);
asm_ld_imm(R0, int(gr)); // Load the guard record pointer into R2. We want it in R0 but we can't
// do this at this stage because R0 is used for something else.
// I don't understand why I can't load directly into R0. It works for
// the JavaScript JIT but not for the Regular Expression compiler.
// However, I haven't pushed this further as it only saves a single MOV
// instruction in genEpilogue.
asm_ld_imm(R2, int(gr));
// Set the jmp pointer to the start of the sequence so that patched // Set the jmp pointer to the start of the sequence so that patched
// branches can skip the LDi sequence. // branches can skip the LDi sequence.
@ -544,7 +552,13 @@ Assembler::genEpilogue()
// Note that we don't support anything older than ARMv5. // Note that we don't support anything older than ARMv5.
NanoAssert(AvmCore::config.arch >= 5); NanoAssert(AvmCore::config.arch >= 5);
POP_mask((rmask(FP) | rmask(PC))); // regs RegisterMask savingMask = rmask(FP) | rmask(PC);
POP_mask(savingMask); // regs
// nFragExit loads the guard record pointer into R2, but we need it in R0
// so it must be moved here.
MOV(R0,R2); // return GuardRecord*
return _nIns; return _nIns;
} }