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