From 04e7600a5693816958e707231a62d797a6fe3405 Mon Sep 17 00:00:00 2001 From: Vladimir Vukicevic Date: Wed, 22 Oct 2008 11:02:24 -0700 Subject: [PATCH] [arm] Get correct value in return reg after fragment exit --- js/src/nanojit/NativeARM.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/js/src/nanojit/NativeARM.cpp b/js/src/nanojit/NativeARM.cpp index 9967b53aa5e2..9663692b43e6 100644 --- a/js/src/nanojit/NativeARM.cpp +++ b/js/src/nanojit/NativeARM.cpp @@ -137,8 +137,11 @@ Assembler::nFragExit(LInsp guard) } #endif - // return value is GuardRecord* - LDi(R0, int(lr)); + // return value is GuardRecord*; note that this goes into + // R2, not R0 -- genEpilogue will move it into R0. Otherwise + // we want R0 to have the original value that it had at the + // start of trace. + LDi(R2, int(lr)); } NIns* @@ -147,7 +150,7 @@ Assembler::genEpilogue() BX(LR); // return // this is needed if we jump here from nFragExit - //MR(R0,R2); // return LinkRecord* + MR(R0,R2); // return LinkRecord* RegisterMask savingMask = rmask(FP) | rmask(LR); POP_mask(savingMask); // regs