diff --git a/js/src/nanojit/NativeARM.cpp b/js/src/nanojit/NativeARM.cpp index 5eef133033a..ffc94152895 100644 --- a/js/src/nanojit/NativeARM.cpp +++ b/js/src/nanojit/NativeARM.cpp @@ -474,8 +474,6 @@ Assembler::genPrologue() uint32_t stackNeeded = max_out_args + STACK_GRANULARITY * _activation.tos; uint32_t savingCount = 2; - uint32_t savingMask = rmask(FP) | rmask(LR); - // so for alignment purposes we've pushed return addr and fp uint32_t stackPushed = STACK_GRANULARITY * savingCount; uint32_t aligned = alignUp(stackNeeded + stackPushed, NJ_ALIGN_STACK); @@ -490,7 +488,7 @@ Assembler::genPrologue() NIns *patchEntry = _nIns; MOV(FP, SP); - PUSH_mask(savingMask); + PUSH_mask((rmask(FP) | rmask(LR))); return patchEntry; } @@ -519,13 +517,7 @@ Assembler::nFragExit(LInsp guard) // will work correctly. JMP_far(_epilogue); - // 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)); + asm_ld_imm(R0, int(gr)); // Set the jmp pointer to the start of the sequence so that patched // branches can skip the LDi sequence. @@ -552,13 +544,7 @@ Assembler::genEpilogue() // Note that we don't support anything older than ARMv5. NanoAssert(AvmCore::config.arch >= 5); - 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* + POP_mask((rmask(FP) | rmask(PC))); // regs return _nIns; }