| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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_MIPS64 | 5 #if V8_TARGET_ARCH_MIPS64 |
| 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 964 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 975 | 975 |
| 976 | 976 |
| 977 // static | 977 // static |
| 978 void Builtins::Generate_InterpreterPushArgsAndCall(MacroAssembler* masm) { | 978 void Builtins::Generate_InterpreterPushArgsAndCall(MacroAssembler* masm) { |
| 979 // ----------- S t a t e ------------- | 979 // ----------- S t a t e ------------- |
| 980 // -- a0 : the number of arguments (not including the receiver) | 980 // -- a0 : the number of arguments (not including the receiver) |
| 981 // -- a2 : the address of the first argument to be pushed. Subsequent | 981 // -- a2 : the address of the first argument to be pushed. Subsequent |
| 982 // arguments should be consecutive above this, in the same order as | 982 // arguments should be consecutive above this, in the same order as |
| 983 // they are to be pushed onto the stack. | 983 // they are to be pushed onto the stack. |
| 984 // -- a1 : the target to call (can be any Object). | 984 // -- a1 : the target to call (can be any Object). |
| 985 // ----------------------------------- | |
| 986 | 985 |
| 987 // Find the address of the last argument. | 986 // Find the address of the last argument. |
| 988 __ Daddu(a3, a0, Operand(1)); // Add one for receiver. | 987 __ Daddu(a3, a0, Operand(1)); // Add one for receiver. |
| 989 __ dsll(a3, a3, kPointerSizeLog2); | 988 __ dsll(a3, a3, kPointerSizeLog2); |
| 990 __ Dsubu(a3, a2, Operand(a3)); | 989 __ Dsubu(a3, a2, Operand(a3)); |
| 991 | 990 |
| 992 // Push the arguments. | 991 // Push the arguments. |
| 993 Label loop_header, loop_check; | 992 Label loop_header, loop_check; |
| 994 __ Branch(&loop_check); | 993 __ Branch(&loop_check); |
| 995 __ bind(&loop_header); | 994 __ bind(&loop_header); |
| 996 __ ld(t0, MemOperand(a2)); | 995 __ ld(t0, MemOperand(a2)); |
| 997 __ Daddu(a2, a2, Operand(-kPointerSize)); | 996 __ Daddu(a2, a2, Operand(-kPointerSize)); |
| 998 __ push(t0); | 997 __ push(t0); |
| 999 __ bind(&loop_check); | 998 __ bind(&loop_check); |
| 1000 __ Branch(&loop_header, gt, a2, Operand(a3)); | 999 __ Branch(&loop_header, gt, a2, Operand(a3)); |
| 1001 | 1000 |
| 1002 // Call the target. | 1001 // Call the target. |
| 1003 __ Jump(masm->isolate()->builtins()->Call(), RelocInfo::CODE_TARGET); | 1002 __ Jump(masm->isolate()->builtins()->Call(), RelocInfo::CODE_TARGET); |
| 1004 } | 1003 } |
| 1005 | 1004 |
| 1006 | 1005 |
| 1007 // static | |
| 1008 void Builtins::Generate_InterpreterPushArgsAndConstruct(MacroAssembler* masm) { | |
| 1009 // ----------- S t a t e ------------- | |
| 1010 // -- a0 : argument count (not including receiver) | |
| 1011 // -- a3 : original constructor | |
| 1012 // -- a1 : constructor to call | |
| 1013 // -- a2 : address of the first argument | |
| 1014 // ----------------------------------- | |
| 1015 | |
| 1016 // Find the address of the last argument. | |
| 1017 __ dsll(t0, a0, kPointerSizeLog2); | |
| 1018 __ Dsubu(t0, a2, Operand(t0)); | |
| 1019 | |
| 1020 // Push the arguments. | |
| 1021 Label loop_header, loop_check; | |
| 1022 __ Branch(&loop_check); | |
| 1023 __ bind(&loop_header); | |
| 1024 __ ld(t1, MemOperand(a2)); | |
| 1025 __ Daddu(a2, a2, Operand(-kPointerSize)); | |
| 1026 __ push(t1); | |
| 1027 __ bind(&loop_check); | |
| 1028 __ Branch(&loop_header, gt, a2, Operand(t0)); | |
| 1029 | |
| 1030 // Call the constructor with a0, a1, and a3 unmodified. | |
| 1031 __ Jump(masm->isolate()->builtins()->Construct(), RelocInfo::CONSTRUCT_CALL); | |
| 1032 } | |
| 1033 | |
| 1034 | |
| 1035 void Builtins::Generate_CompileLazy(MacroAssembler* masm) { | 1006 void Builtins::Generate_CompileLazy(MacroAssembler* masm) { |
| 1036 CallRuntimePassFunction(masm, Runtime::kCompileLazy); | 1007 CallRuntimePassFunction(masm, Runtime::kCompileLazy); |
| 1037 GenerateTailCallToReturnedCode(masm); | 1008 GenerateTailCallToReturnedCode(masm); |
| 1038 } | 1009 } |
| 1039 | 1010 |
| 1040 | 1011 |
| 1041 static void CallCompileOptimized(MacroAssembler* masm, bool concurrent) { | 1012 static void CallCompileOptimized(MacroAssembler* masm, bool concurrent) { |
| 1042 FrameScope scope(masm, StackFrame::INTERNAL); | 1013 FrameScope scope(masm, StackFrame::INTERNAL); |
| 1043 // Push a copy of the function onto the stack. | 1014 // Push a copy of the function onto the stack. |
| 1044 // Push function as parameter to the runtime call. | 1015 // Push function as parameter to the runtime call. |
| (...skipping 885 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1930 } | 1901 } |
| 1931 } | 1902 } |
| 1932 | 1903 |
| 1933 | 1904 |
| 1934 #undef __ | 1905 #undef __ |
| 1935 | 1906 |
| 1936 } // namespace internal | 1907 } // namespace internal |
| 1937 } // namespace v8 | 1908 } // namespace v8 |
| 1938 | 1909 |
| 1939 #endif // V8_TARGET_ARCH_MIPS64 | 1910 #endif // V8_TARGET_ARCH_MIPS64 |
| OLD | NEW |