Revision: 10949
Author:   [email protected]
Date:     Wed Mar  7 00:59:43 2012
Log: MIPS: Minor optimizations in Builtins::Generate_ArgumentsAdaptorTrampoline.

The branch delay slot is now utilized in a few loops.
This is the cleanup of an old TODO.

BUG=
TEST=

Review URL: https://chromiumcodereview.appspot.com/9618013
http://code.google.com/p/v8/source/detail?r=10949

Modified:
 /branches/bleeding_edge/src/mips/builtins-mips.cc

=======================================
--- /branches/bleeding_edge/src/mips/builtins-mips.cc Wed Feb 29 01:48:03 2012 +++ /branches/bleeding_edge/src/mips/builtins-mips.cc Wed Mar 7 00:59:43 2012
@@ -1735,8 +1735,6 @@
     __ bind(&too_few);
     EnterArgumentsAdaptorFrame(masm);

-    // TODO(MIPS): Optimize these loops.
-
     // Calculate copy start address into a0 and copy end address is fp.
     // a0: actual number of arguments as a smi
     // a1: function
@@ -1758,9 +1756,10 @@
     Label copy;
     __ bind(&copy);
__ lw(t0, MemOperand(a0)); // Adjusted above for return addr and receiver.
-    __ push(t0);
+    __ Subu(sp, sp, kPointerSize);
     __ Subu(a0, a0, kPointerSize);
-    __ Branch(&copy, ne, a0, Operand(t3));
+    __ Branch(USE_DELAY_SLOT, &copy, ne, a0, Operand(t3));
+    __ sw(t0, MemOperand(sp));  // In the delay slot.

     // Fill the remaining expected arguments with undefined.
     // a1: function
@@ -1773,8 +1772,9 @@

     Label fill;
     __ bind(&fill);
-    __ push(t0);
-    __ Branch(&fill, ne, sp, Operand(a2));
+    __ Subu(sp, sp, kPointerSize);
+    __ Branch(USE_DELAY_SLOT, &fill, ne, sp, Operand(a2));
+    __ sw(t0, MemOperand(sp));
   }

   // Call the entry point.

--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev

Reply via email to