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

Side by Side Diff: src/ppc/builtins-ppc.cc

Issue 1402943002: [Interpreter] Support for operator new. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: One more test. Created 5 years, 2 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
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/codegen.h" 7 #include "src/codegen.h"
8 #include "src/debug/debug.h" 8 #include "src/debug/debug.h"
9 #include "src/deoptimizer.h" 9 #include "src/deoptimizer.h"
10 #include "src/full-codegen/full-codegen.h" 10 #include "src/full-codegen/full-codegen.h"
(...skipping 965 matching lines...) Expand 10 before | Expand all | Expand 10 after
976 976
977 977
978 // static 978 // static
979 void Builtins::Generate_InterpreterPushArgsAndCall(MacroAssembler* masm) { 979 void Builtins::Generate_InterpreterPushArgsAndCall(MacroAssembler* masm) {
980 // ----------- S t a t e ------------- 980 // ----------- S t a t e -------------
981 // -- r3 : the number of arguments (not including the receiver) 981 // -- r3 : the number of arguments (not including the receiver)
982 // -- r5 : the address of the first argument to be pushed. Subsequent 982 // -- r5 : the address of the first argument to be pushed. Subsequent
983 // arguments should be consecutive above this, in the same order as 983 // arguments should be consecutive above this, in the same order as
984 // they are to be pushed onto the stack. 984 // they are to be pushed onto the stack.
985 // -- r4 : the target to call (can be any Object). 985 // -- r4 : the target to call (can be any Object).
986 // -----------------------------------
986 987
987 // Calculate number of arguments (add one for receiver). 988 // Calculate number of arguments (add one for receiver).
988 __ addi(r6, r3, Operand(1)); 989 __ addi(r6, r3, Operand(1));
989 990
990 // Push the arguments. 991 // Push the arguments.
991 Label loop; 992 Label loop;
992 __ addi(r5, r5, Operand(kPointerSize)); // Bias up for LoadPU 993 __ addi(r5, r5, Operand(kPointerSize)); // Bias up for LoadPU
993 __ mtctr(r6); 994 __ mtctr(r6);
994 __ bind(&loop); 995 __ bind(&loop);
995 __ LoadPU(r6, MemOperand(r5, -kPointerSize)); 996 __ LoadPU(r6, MemOperand(r5, -kPointerSize));
996 __ push(r6); 997 __ push(r6);
997 __ bdnz(&loop); 998 __ bdnz(&loop);
998 999
999 // Call the target. 1000 // Call the target.
1000 __ Jump(masm->isolate()->builtins()->Call(), RelocInfo::CODE_TARGET); 1001 __ Jump(masm->isolate()->builtins()->Call(), RelocInfo::CODE_TARGET);
1001 } 1002 }
1002 1003
1003 1004
1005 // static
1006 void Builtins::Generate_InterpreterPushArgsAndConstruct(MacroAssembler* masm) {
1007 // ----------- S t a t e -------------
1008 // -- r3 : argument count (not including receiver)
1009 // -- r6 : original constructor
1010 // -- r4 : constructor to call
1011 // -- r5 : address of the first argument
1012 // -----------------------------------
1013
1014 // Calculate number of arguments (add one for receiver).
1015 __ mr(r11, r3);
1016
1017 // Push the arguments.
1018 Label loop;
1019 __ addi(r5, r5, Operand(kPointerSize)); // Bias up for LoadPU
1020 __ mtctr(r11);
1021 __ bind(&loop);
1022 __ LoadPU(r11, MemOperand(r5, -kPointerSize));
1023 __ push(r11);
1024 __ bdnz(&loop);
1025
1026 // Call the constructor with r3, r4, and r6 unmodified.
1027 __ Jump(masm->isolate()->builtins()->Constuct(), RelocInfo::CONSTRUCT_CALL);
1028 }
1029
1030
1004 void Builtins::Generate_CompileLazy(MacroAssembler* masm) { 1031 void Builtins::Generate_CompileLazy(MacroAssembler* masm) {
1005 CallRuntimePassFunction(masm, Runtime::kCompileLazy); 1032 CallRuntimePassFunction(masm, Runtime::kCompileLazy);
1006 GenerateTailCallToReturnedCode(masm); 1033 GenerateTailCallToReturnedCode(masm);
1007 } 1034 }
1008 1035
1009 1036
1010 static void CallCompileOptimized(MacroAssembler* masm, bool concurrent) { 1037 static void CallCompileOptimized(MacroAssembler* masm, bool concurrent) {
1011 FrameAndConstantPoolScope scope(masm, StackFrame::INTERNAL); 1038 FrameAndConstantPoolScope scope(masm, StackFrame::INTERNAL);
1012 // Push a copy of the function onto the stack. 1039 // Push a copy of the function onto the stack.
1013 // Push function as parameter to the runtime call. 1040 // Push function as parameter to the runtime call.
(...skipping 907 matching lines...) Expand 10 before | Expand all | Expand 10 after
1921 __ bkpt(0); 1948 __ bkpt(0);
1922 } 1949 }
1923 } 1950 }
1924 1951
1925 1952
1926 #undef __ 1953 #undef __
1927 } // namespace internal 1954 } // namespace internal
1928 } // namespace v8 1955 } // namespace v8
1929 1956
1930 #endif // V8_TARGET_ARCH_PPC 1957 #endif // V8_TARGET_ARCH_PPC
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698