Index: src/builtins/ppc/builtins-ppc.cc |
diff --git a/src/builtins/ppc/builtins-ppc.cc b/src/builtins/ppc/builtins-ppc.cc |
index 727d9eadfcc445a8df4c4a41bb95b1d7f2c2a6c4..f84b6a0c03180811f6dcaad77464972f2622252e 100644 |
--- a/src/builtins/ppc/builtins-ppc.cc |
+++ b/src/builtins/ppc/builtins-ppc.cc |
@@ -2198,63 +2198,63 @@ 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 ------------- |
- // -- r4 : the target to call (can be any Object) |
- // -- r5 : start index (to support rest parameters) |
- // -- lr : return address. |
- // -- sp[0] : thisArgument |
+ // -- r3 : the number of arguments (not including the receiver) |
+ // -- r6 : the new.target (for [[Construct]] calls) |
+ // -- r4 : the target to call (can be any Object) |
+ // -- r5 : start index (to support rest parameters) |
// ----------------------------------- |
// Check if we have an arguments adaptor frame below the function frame. |
Label arguments_adaptor, arguments_done; |
- __ LoadP(r6, MemOperand(fp, StandardFrameConstants::kCallerFPOffset)); |
- __ LoadP(ip, MemOperand(r6, CommonFrameConstants::kContextOrFrameTypeOffset)); |
+ __ LoadP(r7, MemOperand(fp, StandardFrameConstants::kCallerFPOffset)); |
+ __ LoadP(ip, MemOperand(r7, CommonFrameConstants::kContextOrFrameTypeOffset)); |
__ cmpi(ip, Operand(StackFrame::TypeToMarker(StackFrame::ARGUMENTS_ADAPTOR))); |
__ beq(&arguments_adaptor); |
{ |
- __ LoadP(r3, MemOperand(fp, JavaScriptFrameConstants::kFunctionOffset)); |
- __ LoadP(r3, FieldMemOperand(r3, JSFunction::kSharedFunctionInfoOffset)); |
+ __ LoadP(r8, MemOperand(fp, JavaScriptFrameConstants::kFunctionOffset)); |
+ __ LoadP(r8, FieldMemOperand(r8, JSFunction::kSharedFunctionInfoOffset)); |
__ LoadWordArith( |
- r3, |
- FieldMemOperand(r3, SharedFunctionInfo::kFormalParameterCountOffset)); |
- __ mr(r6, fp); |
+ r8, |
+ FieldMemOperand(r8, SharedFunctionInfo::kFormalParameterCountOffset)); |
+ __ mr(r7, fp); |
} |
__ b(&arguments_done); |
__ bind(&arguments_adaptor); |
{ |
// Load the length from the ArgumentsAdaptorFrame. |
- __ LoadP(r3, MemOperand(r6, ArgumentsAdaptorFrameConstants::kLengthOffset)); |
+ __ LoadP(r8, MemOperand(r7, ArgumentsAdaptorFrameConstants::kLengthOffset)); |
#if V8_TARGET_ARCH_PPC64 |
- __ SmiUntag(r3); |
+ __ SmiUntag(r8); |
#endif |
} |
__ bind(&arguments_done); |
- Label stack_empty, stack_done, stack_overflow; |
+ Label stack_done, stack_overflow; |
#if !V8_TARGET_ARCH_PPC64 |
- __ SmiUntag(r3); |
+ __ SmiUntag(r8); |
#endif |
- __ sub(r3, r3, r5); |
- __ cmpi(r3, Operand::Zero()); |
- __ ble(&stack_empty); |
+ __ sub(r8, r8, r5); |
+ __ cmpi(r8, Operand::Zero()); |
+ __ ble(&stack_done); |
{ |
// Check for stack overflow. |
- Generate_StackOverflowCheck(masm, r3, r5, &stack_overflow); |
+ Generate_StackOverflowCheck(masm, r8, r5, &stack_overflow); |
// Forward the arguments from the caller frame. |
{ |
Label loop; |
- __ addi(r6, r6, Operand(kPointerSize)); |
- __ mr(r5, r3); |
+ __ addi(r7, r7, Operand(kPointerSize)); |
+ __ add(r3, r3, r8); |
__ bind(&loop); |
{ |
- __ ShiftLeftImm(ip, r5, Operand(kPointerSizeLog2)); |
- __ LoadPX(ip, MemOperand(r6, ip)); |
+ __ ShiftLeftImm(ip, r8, Operand(kPointerSizeLog2)); |
+ __ LoadPX(ip, MemOperand(r7, ip)); |
__ push(ip); |
- __ subi(r5, r5, Operand(1)); |
- __ cmpi(r5, Operand::Zero()); |
+ __ subi(r8, r8, Operand(1)); |
+ __ cmpi(r8, Operand::Zero()); |
__ bne(&loop); |
} |
} |
@@ -2262,13 +2262,9 @@ void Builtins::Generate_CallForwardVarargs(MacroAssembler* masm, |
__ b(&stack_done); |
__ bind(&stack_overflow); |
__ TailCallRuntime(Runtime::kThrowStackOverflow); |
- __ bind(&stack_empty); |
- { |
- // We just pass the receiver, which is already on the stack. |
- __ mov(r3, Operand::Zero()); |
- } |
__ bind(&stack_done); |
+ // Tail-call to the {code} handler. |
__ Jump(code, RelocInfo::CODE_TARGET); |
} |