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

Side by Side Diff: src/ppc/code-stubs-ppc.cc

Issue 1916803002: PPC: [Interpreter] Use FastNewSloppyArguments when possible. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 8 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #if V8_TARGET_ARCH_PPC 5 #if V8_TARGET_ARCH_PPC
6 6
7 #include "src/code-stubs.h" 7 #include "src/code-stubs.h"
8 #include "src/api-arguments.h" 8 #include "src/api-arguments.h"
9 #include "src/base/bits.h" 9 #include "src/base/bits.h"
10 #include "src/bootstrapper.h" 10 #include "src/bootstrapper.h"
(...skipping 4920 matching lines...) Expand 10 before | Expand all | Expand 10 after
4931 } 4931 }
4932 4932
4933 void FastNewSloppyArgumentsStub::Generate(MacroAssembler* masm) { 4933 void FastNewSloppyArgumentsStub::Generate(MacroAssembler* masm) {
4934 // ----------- S t a t e ------------- 4934 // ----------- S t a t e -------------
4935 // -- r4 : function 4935 // -- r4 : function
4936 // -- cp : context 4936 // -- cp : context
4937 // -- fp : frame pointer 4937 // -- fp : frame pointer
4938 // -- lr : return address 4938 // -- lr : return address
4939 // ----------------------------------- 4939 // -----------------------------------
4940 __ AssertFunction(r4); 4940 __ AssertFunction(r4);
4941 4941
MTBrandyberry 2016/04/25 15:46:47 Copy over the comment for this new block as well.
4942 {
4943 Label loop, loop_entry;
4944 __ mr(r10, fp);
4945 __ b(&loop_entry);
4946 __ bind(&loop);
4947 __ LoadP(r10, MemOperand(r10, StandardFrameConstants::kCallerFPOffset));
4948 __ bind(&loop_entry);
4949 __ LoadP(ip, MemOperand(r10, StandardFrameConstants::kFunctionOffset));
4950 __ cmp(ip, r4);
4951 __ bne(&loop);
4952 }
4953
4954
4942 // TODO(bmeurer): Cleanup to match the FastNewStrictArgumentsStub. 4955 // TODO(bmeurer): Cleanup to match the FastNewStrictArgumentsStub.
4943 __ LoadP(r5, FieldMemOperand(r4, JSFunction::kSharedFunctionInfoOffset)); 4956 __ LoadP(r5, FieldMemOperand(r4, JSFunction::kSharedFunctionInfoOffset));
4944 __ LoadWordArith( 4957 __ LoadWordArith(
4945 r5, FieldMemOperand(r5, SharedFunctionInfo::kFormalParameterCountOffset)); 4958 r5, FieldMemOperand(r5, SharedFunctionInfo::kFormalParameterCountOffset));
4946 #if V8_TARGET_ARCH_PPC64 4959 #if V8_TARGET_ARCH_PPC64
4947 __ SmiTag(r5); 4960 __ SmiTag(r5);
4948 #endif 4961 #endif
4949 __ SmiToPtrArrayOffset(r6, r5); 4962 __ SmiToPtrArrayOffset(r6, r5);
4950 __ add(r6, fp, r6); 4963 __ add(r6, r10, r6);
4951 __ addi(r6, r6, Operand(StandardFrameConstants::kCallerSPOffset)); 4964 __ addi(r6, r6, Operand(StandardFrameConstants::kCallerSPOffset));
4952 4965
4953 // r4 : function 4966 // r4 : function
4954 // r5 : number of parameters (tagged) 4967 // r5 : number of parameters (tagged)
4955 // r6 : parameters pointer 4968 // r6 : parameters pointer
4969 // r10 : JavaScript frame pointer
4956 // Registers used over whole function: 4970 // Registers used over whole function:
4957 // r8 : arguments count (tagged) 4971 // r8 : arguments count (tagged)
4958 // r9 : mapped parameter count (tagged) 4972 // r9 : mapped parameter count (tagged)
4959 4973
4960 // Check if the calling frame is an arguments adaptor frame. 4974 // Check if the calling frame is an arguments adaptor frame.
4961 Label adaptor_frame, try_allocate, runtime; 4975 Label adaptor_frame, try_allocate, runtime;
4962 __ LoadP(r7, MemOperand(fp, StandardFrameConstants::kCallerFPOffset)); 4976 __ LoadP(r7, MemOperand(r10, StandardFrameConstants::kCallerFPOffset));
4963 __ LoadP(r3, MemOperand(r7, CommonFrameConstants::kContextOrFrameTypeOffset)); 4977 __ LoadP(r3, MemOperand(r7, CommonFrameConstants::kContextOrFrameTypeOffset));
4964 __ CmpSmiLiteral(r3, Smi::FromInt(StackFrame::ARGUMENTS_ADAPTOR), r0); 4978 __ CmpSmiLiteral(r3, Smi::FromInt(StackFrame::ARGUMENTS_ADAPTOR), r0);
4965 __ beq(&adaptor_frame); 4979 __ beq(&adaptor_frame);
4966 4980
4967 // No adaptor, parameter count = argument count. 4981 // No adaptor, parameter count = argument count.
4968 __ mr(r8, r5); 4982 __ mr(r8, r5);
4969 __ mr(r9, r5); 4983 __ mr(r9, r5);
4970 __ b(&try_allocate); 4984 __ b(&try_allocate);
4971 4985
4972 // We have an adaptor frame. Patch the parameters pointer. 4986 // We have an adaptor frame. Patch the parameters pointer.
(...skipping 828 matching lines...) Expand 10 before | Expand all | Expand 10 after
5801 fp, (PropertyCallbackArguments::kReturnValueOffset + 3) * kPointerSize); 5815 fp, (PropertyCallbackArguments::kReturnValueOffset + 3) * kPointerSize);
5802 CallApiFunctionAndReturn(masm, api_function_address, thunk_ref, 5816 CallApiFunctionAndReturn(masm, api_function_address, thunk_ref,
5803 kStackUnwindSpace, NULL, return_value_operand, NULL); 5817 kStackUnwindSpace, NULL, return_value_operand, NULL);
5804 } 5818 }
5805 5819
5806 #undef __ 5820 #undef __
5807 } // namespace internal 5821 } // namespace internal
5808 } // namespace v8 5822 } // namespace v8
5809 5823
5810 #endif // V8_TARGET_ARCH_PPC 5824 #endif // V8_TARGET_ARCH_PPC
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698