Revision: 10653
Author: [email protected]
Date: Thu Feb 9 01:13:31 2012
Log: Simplify stackframe of construct stub on ARM and MIPS.
This unifies the stackframe layout of the generic constructor stub to be
in sync with ia32 and x64. There was an unecessary copy of the construct
function saved on the stack which wasn't used at all.
[email protected]
Review URL: https://chromiumcodereview.appspot.com/9348058
http://code.google.com/p/v8/source/detail?r=10653
Modified:
/branches/bleeding_edge/src/arm/builtins-arm.cc
/branches/bleeding_edge/src/mips/builtins-mips.cc
=======================================
--- /branches/bleeding_edge/src/arm/builtins-arm.cc Thu Feb 2 03:22:26 2012
+++ /branches/bleeding_edge/src/arm/builtins-arm.cc Thu Feb 9 01:13:31 2012
@@ -895,23 +895,15 @@
// r4: JSObject
__ bind(&allocated);
__ push(r4);
-
- // Push the function and the allocated receiver from the stack.
- // sp[0]: receiver (newly allocated object)
- // sp[1]: constructor function
- // sp[2]: number of arguments (smi-tagged)
- __ ldr(r1, MemOperand(sp, kPointerSize));
- __ push(r1); // Constructor function.
- __ push(r4); // Receiver.
-
- // Reload the number of arguments from the stack.
- // r1: constructor function
+ __ push(r4);
+
+ // Reload the number of arguments and the constructor from the stack.
// sp[0]: receiver
- // sp[1]: constructor function
- // sp[2]: receiver
- // sp[3]: constructor function
- // sp[4]: number of arguments (smi-tagged)
- __ ldr(r3, MemOperand(sp, 4 * kPointerSize));
+ // sp[1]: receiver
+ // sp[2]: constructor function
+ // sp[3]: number of arguments (smi-tagged)
+ __ ldr(r1, MemOperand(sp, 2 * kPointerSize));
+ __ ldr(r3, MemOperand(sp, 3 * kPointerSize));
// Set up pointer to last argument.
__ add(r2, fp, Operand(StandardFrameConstants::kCallerSPOffset));
@@ -921,14 +913,13 @@
// Copy arguments and receiver to the expression stack.
// r0: number of arguments
- // r2: address of last argument (caller sp)
// r1: constructor function
+ // r2: address of last argument (caller sp)
// r3: number of arguments (smi-tagged)
// sp[0]: receiver
- // sp[1]: constructor function
- // sp[2]: receiver
- // sp[3]: constructor function
- // sp[4]: number of arguments (smi-tagged)
+ // sp[1]: receiver
+ // sp[2]: constructor function
+ // sp[3]: number of arguments (smi-tagged)
Label loop, entry;
__ b(&entry);
__ bind(&loop);
@@ -953,13 +944,6 @@
__ InvokeFunction(r1, actual, CALL_FUNCTION,
NullCallWrapper(), CALL_AS_METHOD);
}
-
- // Pop the function from the stack.
- // sp[0]: constructor function
- // sp[2]: receiver
- // sp[3]: constructor function
- // sp[4]: number of arguments (smi-tagged)
- __ pop();
// Restore context from the frame.
// r0: result
=======================================
--- /branches/bleeding_edge/src/mips/builtins-mips.cc Wed Feb 8 06:43:36
2012
+++ /branches/bleeding_edge/src/mips/builtins-mips.cc Thu Feb 9 01:13:31
2012
@@ -923,22 +923,15 @@
// t4: JSObject
__ bind(&allocated);
__ push(t4);
-
- // Push the function and the allocated receiver from the stack.
- // sp[0]: receiver (newly allocated object)
- // sp[1]: constructor function
- // sp[2]: number of arguments (smi-tagged)
- __ lw(a1, MemOperand(sp, kPointerSize));
- __ MultiPushReversed(a1.bit() | t4.bit());
+ __ push(t4);
// Reload the number of arguments from the stack.
- // a1: constructor function
// sp[0]: receiver
- // sp[1]: constructor function
- // sp[2]: receiver
- // sp[3]: constructor function
- // sp[4]: number of arguments (smi-tagged)
- __ lw(a3, MemOperand(sp, 4 * kPointerSize));
+ // sp[1]: receiver
+ // sp[2]: constructor function
+ // sp[3]: number of arguments (smi-tagged)
+ __ lw(a1, MemOperand(sp, 2 * kPointerSize));
+ __ lw(a3, MemOperand(sp, 3 * kPointerSize));
// Set up pointer to last argument.
__ Addu(a2, fp, Operand(StandardFrameConstants::kCallerSPOffset));
@@ -952,10 +945,9 @@
// a2: address of last argument (caller sp)
// a3: number of arguments (smi-tagged)
// sp[0]: receiver
- // sp[1]: constructor function
- // sp[2]: receiver
- // sp[3]: constructor function
- // sp[4]: number of arguments (smi-tagged)
+ // sp[1]: receiver
+ // sp[2]: constructor function
+ // sp[3]: number of arguments (smi-tagged)
Label loop, entry;
__ jmp(&entry);
__ bind(&loop);
@@ -982,14 +974,6 @@
__ InvokeFunction(a1, actual, CALL_FUNCTION,
NullCallWrapper(), CALL_AS_METHOD);
}
-
- // Pop the function from the stack.
- // v0: result
- // sp[0]: constructor function
- // sp[2]: receiver
- // sp[3]: constructor function
- // sp[4]: number of arguments (smi-tagged)
- __ Pop();
// Restore context from the frame.
__ lw(cp, MemOperand(fp, StandardFrameConstants::kContextOffset));
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev