OLD | NEW |
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 Loading... |
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. |
| 1015 __ mr(r7, r3); |
| 1016 |
| 1017 // Push a slot for the receiver. |
| 1018 __ push(r3); |
| 1019 |
| 1020 // Skip pushing arguments if none. |
| 1021 Label loop_end; |
| 1022 __ cmpi(r7, Operand(0)); |
| 1023 __ beq(&loop_end); |
| 1024 |
| 1025 // Push the arguments |
| 1026 Label loop; |
| 1027 __ addi(r5, r5, Operand(kPointerSize)); // Bias up for LoadPU |
| 1028 __ mtctr(r7); |
| 1029 __ bind(&loop); |
| 1030 __ LoadPU(r7, MemOperand(r5, -kPointerSize)); |
| 1031 __ push(r7); |
| 1032 __ bdnz(&loop); |
| 1033 __ bind(&loop_end); |
| 1034 |
| 1035 // Call the constructor with r3, r4, and r6 unmodified. |
| 1036 __ Jump(masm->isolate()->builtins()->Construct(), RelocInfo::CONSTRUCT_CALL); |
| 1037 } |
| 1038 |
| 1039 |
1004 void Builtins::Generate_CompileLazy(MacroAssembler* masm) { | 1040 void Builtins::Generate_CompileLazy(MacroAssembler* masm) { |
1005 CallRuntimePassFunction(masm, Runtime::kCompileLazy); | 1041 CallRuntimePassFunction(masm, Runtime::kCompileLazy); |
1006 GenerateTailCallToReturnedCode(masm); | 1042 GenerateTailCallToReturnedCode(masm); |
1007 } | 1043 } |
1008 | 1044 |
1009 | 1045 |
1010 static void CallCompileOptimized(MacroAssembler* masm, bool concurrent) { | 1046 static void CallCompileOptimized(MacroAssembler* masm, bool concurrent) { |
1011 FrameAndConstantPoolScope scope(masm, StackFrame::INTERNAL); | 1047 FrameAndConstantPoolScope scope(masm, StackFrame::INTERNAL); |
1012 // Push a copy of the function onto the stack. | 1048 // Push a copy of the function onto the stack. |
1013 // Push function as parameter to the runtime call. | 1049 // Push function as parameter to the runtime call. |
(...skipping 907 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1921 __ bkpt(0); | 1957 __ bkpt(0); |
1922 } | 1958 } |
1923 } | 1959 } |
1924 | 1960 |
1925 | 1961 |
1926 #undef __ | 1962 #undef __ |
1927 } // namespace internal | 1963 } // namespace internal |
1928 } // namespace v8 | 1964 } // namespace v8 |
1929 | 1965 |
1930 #endif // V8_TARGET_ARCH_PPC | 1966 #endif // V8_TARGET_ARCH_PPC |
OLD | NEW |