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 1101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1112 __ CallRuntime(Runtime::kCompileBaseline); | 1112 __ CallRuntime(Runtime::kCompileBaseline); |
1113 | 1113 |
1114 // Restore return value. | 1114 // Restore return value. |
1115 __ pop(v0); | 1115 __ pop(v0); |
1116 } | 1116 } |
1117 __ Jump(ra); | 1117 __ Jump(ra); |
1118 } | 1118 } |
1119 | 1119 |
1120 // static | 1120 // static |
1121 void Builtins::Generate_InterpreterPushArgsAndCallImpl( | 1121 void Builtins::Generate_InterpreterPushArgsAndCallImpl( |
1122 MacroAssembler* masm, TailCallMode tail_call_mode) { | 1122 MacroAssembler* masm, TailCallMode tail_call_mode, |
| 1123 CallableType function_type) { |
1123 // ----------- S t a t e ------------- | 1124 // ----------- S t a t e ------------- |
1124 // -- a0 : the number of arguments (not including the receiver) | 1125 // -- a0 : the number of arguments (not including the receiver) |
1125 // -- a2 : the address of the first argument to be pushed. Subsequent | 1126 // -- a2 : the address of the first argument to be pushed. Subsequent |
1126 // arguments should be consecutive above this, in the same order as | 1127 // arguments should be consecutive above this, in the same order as |
1127 // they are to be pushed onto the stack. | 1128 // they are to be pushed onto the stack. |
1128 // -- a1 : the target to call (can be any Object). | 1129 // -- a1 : the target to call (can be any Object). |
1129 // ----------------------------------- | 1130 // ----------------------------------- |
1130 | 1131 |
1131 // Find the address of the last argument. | 1132 // Find the address of the last argument. |
1132 __ Daddu(a3, a0, Operand(1)); // Add one for receiver. | 1133 __ Daddu(a3, a0, Operand(1)); // Add one for receiver. |
1133 __ dsll(a3, a3, kPointerSizeLog2); | 1134 __ dsll(a3, a3, kPointerSizeLog2); |
1134 __ Dsubu(a3, a2, Operand(a3)); | 1135 __ Dsubu(a3, a2, Operand(a3)); |
1135 | 1136 |
1136 // Push the arguments. | 1137 // Push the arguments. |
1137 Label loop_header, loop_check; | 1138 Label loop_header, loop_check; |
1138 __ Branch(&loop_check); | 1139 __ Branch(&loop_check); |
1139 __ bind(&loop_header); | 1140 __ bind(&loop_header); |
1140 __ ld(t0, MemOperand(a2)); | 1141 __ ld(t0, MemOperand(a2)); |
1141 __ Daddu(a2, a2, Operand(-kPointerSize)); | 1142 __ Daddu(a2, a2, Operand(-kPointerSize)); |
1142 __ push(t0); | 1143 __ push(t0); |
1143 __ bind(&loop_check); | 1144 __ bind(&loop_check); |
1144 __ Branch(&loop_header, gt, a2, Operand(a3)); | 1145 __ Branch(&loop_header, gt, a2, Operand(a3)); |
1145 | 1146 |
1146 // Call the target. | 1147 // Call the target. |
1147 __ Jump(masm->isolate()->builtins()->Call(ConvertReceiverMode::kAny, | 1148 if (function_type == CallableType::kJSFunction) { |
1148 tail_call_mode), | 1149 __ Jump(masm->isolate()->builtins()->CallFunction(ConvertReceiverMode::kAny, |
1149 RelocInfo::CODE_TARGET); | 1150 tail_call_mode), |
| 1151 RelocInfo::CODE_TARGET); |
| 1152 } else { |
| 1153 DCHECK_EQ(function_type, CallableType::kAny); |
| 1154 __ Jump(masm->isolate()->builtins()->Call(ConvertReceiverMode::kAny, |
| 1155 tail_call_mode), |
| 1156 RelocInfo::CODE_TARGET); |
| 1157 } |
1150 } | 1158 } |
1151 | 1159 |
1152 // static | 1160 // static |
1153 void Builtins::Generate_InterpreterPushArgsAndConstruct(MacroAssembler* masm) { | 1161 void Builtins::Generate_InterpreterPushArgsAndConstruct(MacroAssembler* masm) { |
1154 // ----------- S t a t e ------------- | 1162 // ----------- S t a t e ------------- |
1155 // -- a0 : argument count (not including receiver) | 1163 // -- a0 : argument count (not including receiver) |
1156 // -- a3 : new target | 1164 // -- a3 : new target |
1157 // -- a1 : constructor to call | 1165 // -- a1 : constructor to call |
1158 // -- a2 : address of the first argument | 1166 // -- a2 : address of the first argument |
1159 // ----------------------------------- | 1167 // ----------------------------------- |
(...skipping 1840 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3000 } | 3008 } |
3001 } | 3009 } |
3002 | 3010 |
3003 | 3011 |
3004 #undef __ | 3012 #undef __ |
3005 | 3013 |
3006 } // namespace internal | 3014 } // namespace internal |
3007 } // namespace v8 | 3015 } // namespace v8 |
3008 | 3016 |
3009 #endif // V8_TARGET_ARCH_MIPS64 | 3017 #endif // V8_TARGET_ARCH_MIPS64 |
OLD | NEW |