From bb688e13fed8b0d9f5777c0c52bf11a624ed1a9e Mon Sep 17 00:00:00 2001 From: Andreas Gal Date: Wed, 9 Sep 2009 12:52:58 -0700 Subject: [PATCH] Backed out changeset 5c7fbeed8f96 (bug 515290, accidentally committed unrelated changes with the bug). --- js/src/nanojit/NativeARM.cpp | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/js/src/nanojit/NativeARM.cpp b/js/src/nanojit/NativeARM.cpp index ffc94152895..5eef133033a 100644 --- a/js/src/nanojit/NativeARM.cpp +++ b/js/src/nanojit/NativeARM.cpp @@ -474,6 +474,8 @@ 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); @@ -488,7 +490,7 @@ Assembler::genPrologue() NIns *patchEntry = _nIns; MOV(FP, SP); - PUSH_mask((rmask(FP) | rmask(LR))); + PUSH_mask(savingMask); return patchEntry; } @@ -517,7 +519,13 @@ Assembler::nFragExit(LInsp guard) // will work correctly. 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 // branches can skip the LDi sequence. @@ -544,7 +552,13 @@ Assembler::genEpilogue() // Note that we don't support anything older than ARMv5. 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; }