Fix asm_ret on ARM (515290, r=gal,vlad).

This commit is contained in:
danderson@mozilla.com 2009-09-08 20:23:53 -07:00
parent 21dbf49f8b
commit b29acb6983

View File

@ -474,8 +474,6 @@ 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);
@ -490,7 +488,7 @@ Assembler::genPrologue()
NIns *patchEntry = _nIns; NIns *patchEntry = _nIns;
MOV(FP, SP); MOV(FP, SP);
PUSH_mask(savingMask); PUSH_mask((rmask(FP) | rmask(LR)));
return patchEntry; return patchEntry;
} }
@ -519,13 +517,7 @@ Assembler::nFragExit(LInsp guard)
// will work correctly. // will work correctly.
JMP_far(_epilogue); JMP_far(_epilogue);
// Load the guard record pointer into R2. We want it in R0 but we can't asm_ld_imm(R0, int(gr));
// 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.
@ -552,13 +544,7 @@ 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);
RegisterMask savingMask = rmask(FP) | rmask(PC); POP_mask((rmask(FP) | rmask(PC))); // regs
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;
} }