Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1161)

Unified Diff: src/builtins/ppc/builtins-ppc.cc

Issue 2887153004: PPC/s390: [turbofan] Avoid allocating rest parameters for spread calls. (Closed)
Patch Set: minor fix Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/builtins/s390/builtins-s390.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
}
« no previous file with comments | « no previous file | src/builtins/s390/builtins-s390.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698