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 1115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1126 __ CallRuntime(Runtime::kCompileBaseline); | 1126 __ CallRuntime(Runtime::kCompileBaseline); |
1127 | 1127 |
1128 // Restore return value. | 1128 // Restore return value. |
1129 __ pop(v0); | 1129 __ pop(v0); |
1130 } | 1130 } |
1131 __ Jump(ra); | 1131 __ Jump(ra); |
1132 } | 1132 } |
1133 | 1133 |
1134 // static | 1134 // static |
1135 void Builtins::Generate_InterpreterPushArgsAndCallImpl( | 1135 void Builtins::Generate_InterpreterPushArgsAndCallImpl( |
1136 MacroAssembler* masm, TailCallMode tail_call_mode) { | 1136 MacroAssembler* masm, TailCallMode tail_call_mode, |
| 1137 CallableType function_type) { |
1137 // ----------- S t a t e ------------- | 1138 // ----------- S t a t e ------------- |
1138 // -- a0 : the number of arguments (not including the receiver) | 1139 // -- a0 : the number of arguments (not including the receiver) |
1139 // -- a2 : the address of the first argument to be pushed. Subsequent | 1140 // -- a2 : the address of the first argument to be pushed. Subsequent |
1140 // arguments should be consecutive above this, in the same order as | 1141 // arguments should be consecutive above this, in the same order as |
1141 // they are to be pushed onto the stack. | 1142 // they are to be pushed onto the stack. |
1142 // -- a1 : the target to call (can be any Object). | 1143 // -- a1 : the target to call (can be any Object). |
1143 // ----------------------------------- | 1144 // ----------------------------------- |
1144 | 1145 |
1145 // Find the address of the last argument. | 1146 // Find the address of the last argument. |
1146 __ Addu(a3, a0, Operand(1)); // Add one for receiver. | 1147 __ Addu(a3, a0, Operand(1)); // Add one for receiver. |
1147 __ sll(a3, a3, kPointerSizeLog2); | 1148 __ sll(a3, a3, kPointerSizeLog2); |
1148 __ Subu(a3, a2, Operand(a3)); | 1149 __ Subu(a3, a2, Operand(a3)); |
1149 | 1150 |
1150 // Push the arguments. | 1151 // Push the arguments. |
1151 Label loop_header, loop_check; | 1152 Label loop_header, loop_check; |
1152 __ Branch(&loop_check); | 1153 __ Branch(&loop_check); |
1153 __ bind(&loop_header); | 1154 __ bind(&loop_header); |
1154 __ lw(t0, MemOperand(a2)); | 1155 __ lw(t0, MemOperand(a2)); |
1155 __ Addu(a2, a2, Operand(-kPointerSize)); | 1156 __ Addu(a2, a2, Operand(-kPointerSize)); |
1156 __ push(t0); | 1157 __ push(t0); |
1157 __ bind(&loop_check); | 1158 __ bind(&loop_check); |
1158 __ Branch(&loop_header, gt, a2, Operand(a3)); | 1159 __ Branch(&loop_header, gt, a2, Operand(a3)); |
1159 | 1160 |
1160 // Call the target. | 1161 // Call the target. |
1161 __ Jump(masm->isolate()->builtins()->Call(ConvertReceiverMode::kAny, | 1162 if (function_type == CallableType::kJSFunction) { |
1162 tail_call_mode), | 1163 __ Jump(masm->isolate()->builtins()->CallFunction(ConvertReceiverMode::kAny, |
1163 RelocInfo::CODE_TARGET); | 1164 tail_call_mode), |
| 1165 RelocInfo::CODE_TARGET); |
| 1166 } else { |
| 1167 DCHECK_EQ(function_type, CallableType::kAny); |
| 1168 __ Jump(masm->isolate()->builtins()->Call(ConvertReceiverMode::kAny, |
| 1169 tail_call_mode), |
| 1170 RelocInfo::CODE_TARGET); |
| 1171 } |
1164 } | 1172 } |
1165 | 1173 |
1166 // static | 1174 // static |
1167 void Builtins::Generate_InterpreterPushArgsAndConstruct(MacroAssembler* masm) { | 1175 void Builtins::Generate_InterpreterPushArgsAndConstruct(MacroAssembler* masm) { |
1168 // ----------- S t a t e ------------- | 1176 // ----------- S t a t e ------------- |
1169 // -- a0 : argument count (not including receiver) | 1177 // -- a0 : argument count (not including receiver) |
1170 // -- a3 : new target | 1178 // -- a3 : new target |
1171 // -- a1 : constructor to call | 1179 // -- a1 : constructor to call |
1172 // -- a2 : address of the first argument | 1180 // -- a2 : address of the first argument |
1173 // ----------------------------------- | 1181 // ----------------------------------- |
(...skipping 1838 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3012 } | 3020 } |
3013 } | 3021 } |
3014 | 3022 |
3015 | 3023 |
3016 #undef __ | 3024 #undef __ |
3017 | 3025 |
3018 } // namespace internal | 3026 } // namespace internal |
3019 } // namespace v8 | 3027 } // namespace v8 |
3020 | 3028 |
3021 #endif // V8_TARGET_ARCH_MIPS | 3029 #endif // V8_TARGET_ARCH_MIPS |
OLD | NEW |