Index: src/builtins/mips/builtins-mips.cc |
diff --git a/src/builtins/mips/builtins-mips.cc b/src/builtins/mips/builtins-mips.cc |
index 6f9cd9a3ff66c9ddb7ea84d37882984ed2e9bcec..24fe271cb346d02bb131e52d391a5456c5ed8c75 100644 |
--- a/src/builtins/mips/builtins-mips.cc |
+++ b/src/builtins/mips/builtins-mips.cc |
@@ -2168,68 +2168,64 @@ void Builtins::Generate_Apply(MacroAssembler* masm) { |
} |
// static |
-void Builtins::Generate_CallForwardVarargs(MacroAssembler* masm, |
- Handle<Code> code) { |
+void Builtins::Generate_ForwardVarargs(MacroAssembler* masm, |
+ Handle<Code> code) { |
// ----------- S t a t e ------------- |
- // -- a1 : the target to call (can be any Object) |
- // -- a2 : start index (to support rest parameters) |
- // -- ra : return address. |
- // -- sp[0] : thisArgument |
+ // -- a0 : the number of arguments (not including the receiver) |
+ // -- a3 : the new.target (for [[Construct]] calls) |
+ // -- a1 : the target to call (can be any Object) |
+ // -- a2 : start index (to support rest parameters) |
// ----------------------------------- |
// Check if we have an arguments adaptor frame below the function frame. |
Label arguments_adaptor, arguments_done; |
- __ lw(a3, MemOperand(fp, StandardFrameConstants::kCallerFPOffset)); |
- __ lw(a0, MemOperand(a3, CommonFrameConstants::kContextOrFrameTypeOffset)); |
- __ Branch(&arguments_adaptor, eq, a0, |
+ __ lw(t3, MemOperand(fp, StandardFrameConstants::kCallerFPOffset)); |
+ __ lw(t2, MemOperand(t3, CommonFrameConstants::kContextOrFrameTypeOffset)); |
+ __ Branch(&arguments_adaptor, eq, t2, |
Operand(StackFrame::TypeToMarker(StackFrame::ARGUMENTS_ADAPTOR))); |
{ |
- __ lw(a0, MemOperand(fp, JavaScriptFrameConstants::kFunctionOffset)); |
- __ lw(a0, FieldMemOperand(a0, JSFunction::kSharedFunctionInfoOffset)); |
- __ lw(a0, |
- FieldMemOperand(a0, SharedFunctionInfo::kFormalParameterCountOffset)); |
- __ mov(a3, fp); |
+ __ lw(t2, MemOperand(fp, JavaScriptFrameConstants::kFunctionOffset)); |
+ __ lw(t2, FieldMemOperand(t2, JSFunction::kSharedFunctionInfoOffset)); |
+ __ lw(t2, |
+ FieldMemOperand(t2, SharedFunctionInfo::kFormalParameterCountOffset)); |
+ __ mov(t3, fp); |
} |
__ Branch(&arguments_done); |
__ bind(&arguments_adaptor); |
{ |
// Just get the length from the ArgumentsAdaptorFrame. |
- __ lw(a0, MemOperand(a3, ArgumentsAdaptorFrameConstants::kLengthOffset)); |
+ __ lw(t2, MemOperand(t3, ArgumentsAdaptorFrameConstants::kLengthOffset)); |
} |
__ bind(&arguments_done); |
- Label stack_empty, stack_done, stack_overflow; |
- __ SmiUntag(a0); |
- __ Subu(a0, a0, a2); |
- __ Branch(&stack_empty, le, a0, Operand(zero_reg)); |
+ Label stack_done, stack_overflow; |
+ __ SmiUntag(t2); |
+ __ Subu(t2, t2, a2); |
+ __ Branch(&stack_done, le, t2, Operand(zero_reg)); |
{ |
// Check for stack overflow. |
- Generate_StackOverflowCheck(masm, a0, t0, t1, &stack_overflow); |
+ Generate_StackOverflowCheck(masm, t2, t0, t1, &stack_overflow); |
// Forward the arguments from the caller frame. |
{ |
Label loop; |
- __ mov(a2, a0); |
+ __ Addu(a0, a0, t2); |
__ bind(&loop); |
{ |
- __ Lsa(at, a3, a2, kPointerSizeLog2); |
+ __ Lsa(at, t3, t2, kPointerSizeLog2); |
__ lw(at, MemOperand(at, 1 * kPointerSize)); |
__ push(at); |
- __ Subu(a2, a2, Operand(1)); |
- __ Branch(&loop, ne, a2, Operand(zero_reg)); |
+ __ Subu(t2, t2, Operand(1)); |
+ __ Branch(&loop, ne, t2, Operand(zero_reg)); |
} |
} |
} |
__ Branch(&stack_done); |
__ bind(&stack_overflow); |
__ TailCallRuntime(Runtime::kThrowStackOverflow); |
- __ bind(&stack_empty); |
- { |
- // We just pass the receiver, which is already on the stack. |
- __ li(a0, Operand(0)); |
- } |
__ bind(&stack_done); |
+ // Tail-call to the {code} handler. |
__ Jump(code, RelocInfo::CODE_TARGET); |
} |