Revision: 15432
Author:   [email protected]
Date:     Mon Jul  1 14:05:03 2013
Log:      MIPS: Fix register usage in ProfileEntryHookStub

Different register must be used to pass the test on target hardware.

BUG=
TEST=cctest/test-api/SetFunctionEntryHook

Review URL: https://codereview.chromium.org/18368002
Patch from Balazs Kilvady <[email protected]>.
http://code.google.com/p/v8/source/detail?r=15432

Modified:
 /branches/bleeding_edge/src/mips/code-stubs-mips.cc

=======================================
--- /branches/bleeding_edge/src/mips/code-stubs-mips.cc Fri Jun 28 12:52:44 2013 +++ /branches/bleeding_edge/src/mips/code-stubs-mips.cc Mon Jul 1 14:05:03 2013
@@ -7530,12 +7530,16 @@
   const int32_t kReturnAddressDistanceFromFunctionStart =
       Assembler::kCallTargetAddressOffset + (2 * Assembler::kInstrSize);

-  // Save live volatile registers.
+  // This should contain all kJSCallerSaved registers.
+  const RegList kSavedRegs =
+     kJSCallerSaved |  // Caller saved registers.
+     s5.bit();         // Saved stack pointer.
+
// We also save ra, so the count here is one higher than the mask indicates.
-  const int32_t kNumSavedRegs = kNumJSCallerSaved + 1;
+  const int32_t kNumSavedRegs = kNumJSCallerSaved + 2;

   // Save all caller-save registers as this may be called from anywhere.
-  __ MultiPush(kJSCallerSaved | ra.bit());
+  __ MultiPush(kSavedRegs | ra.bit());

   // Compute the function's address for the first argument.
   __ Subu(a0, ra, Operand(kReturnAddressDistanceFromFunctionStart));
@@ -7547,7 +7551,7 @@
   // Align the stack if necessary.
   int frame_alignment = masm->ActivationFrameAlignment();
   if (frame_alignment > kPointerSize) {
-    __ mov(t1, sp);
+    __ mov(s5, sp);
     ASSERT(IsPowerOf2(frame_alignment));
     __ And(sp, sp, Operand(-frame_alignment));
   }
@@ -7568,11 +7572,11 @@

   // Restore the stack pointer if needed.
   if (frame_alignment > kPointerSize) {
-    __ mov(sp, t1);
+    __ mov(sp, s5);
   }

   // Also pop ra to get Ret(0).
-  __ MultiPop(kJSCallerSaved | ra.bit());
+  __ MultiPop(kSavedRegs | ra.bit());
   __ Ret();
 }

--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
--- You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to