| 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_ARM | 5 #if V8_TARGET_ARCH_ARM |
| 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 1127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1138 __ bind(&loop_header); | 1138 __ bind(&loop_header); |
| 1139 __ ldr(scratch, MemOperand(index, -kPointerSize, PostIndex)); | 1139 __ ldr(scratch, MemOperand(index, -kPointerSize, PostIndex)); |
| 1140 __ push(scratch); | 1140 __ push(scratch); |
| 1141 __ bind(&loop_check); | 1141 __ bind(&loop_check); |
| 1142 __ cmp(index, limit); | 1142 __ cmp(index, limit); |
| 1143 __ b(gt, &loop_header); | 1143 __ b(gt, &loop_header); |
| 1144 } | 1144 } |
| 1145 | 1145 |
| 1146 // static | 1146 // static |
| 1147 void Builtins::Generate_InterpreterPushArgsAndCallImpl( | 1147 void Builtins::Generate_InterpreterPushArgsAndCallImpl( |
| 1148 MacroAssembler* masm, TailCallMode tail_call_mode) { | 1148 MacroAssembler* masm, TailCallMode tail_call_mode, |
| 1149 CallableType function_type) { |
| 1149 // ----------- S t a t e ------------- | 1150 // ----------- S t a t e ------------- |
| 1150 // -- r0 : the number of arguments (not including the receiver) | 1151 // -- r0 : the number of arguments (not including the receiver) |
| 1151 // -- r2 : the address of the first argument to be pushed. Subsequent | 1152 // -- r2 : the address of the first argument to be pushed. Subsequent |
| 1152 // arguments should be consecutive above this, in the same order as | 1153 // arguments should be consecutive above this, in the same order as |
| 1153 // they are to be pushed onto the stack. | 1154 // they are to be pushed onto the stack. |
| 1154 // -- r1 : the target to call (can be any Object). | 1155 // -- r1 : the target to call (can be any Object). |
| 1155 // ----------------------------------- | 1156 // ----------------------------------- |
| 1156 | 1157 |
| 1157 // Find the address of the last argument. | 1158 // Find the address of the last argument. |
| 1158 __ add(r3, r0, Operand(1)); // Add one for receiver. | 1159 __ add(r3, r0, Operand(1)); // Add one for receiver. |
| 1159 __ mov(r3, Operand(r3, LSL, kPointerSizeLog2)); | 1160 __ mov(r3, Operand(r3, LSL, kPointerSizeLog2)); |
| 1160 __ sub(r3, r2, r3); | 1161 __ sub(r3, r2, r3); |
| 1161 | 1162 |
| 1162 // Push the arguments. | 1163 // Push the arguments. |
| 1163 Generate_InterpreterPushArgs(masm, r2, r3, r4); | 1164 Generate_InterpreterPushArgs(masm, r2, r3, r4); |
| 1164 | 1165 |
| 1165 // Call the target. | 1166 // Call the target. |
| 1166 __ Jump(masm->isolate()->builtins()->Call(ConvertReceiverMode::kAny, | 1167 if (function_type == CallableType::kJSFunction) { |
| 1167 tail_call_mode), | 1168 __ Jump(masm->isolate()->builtins()->CallFunction(ConvertReceiverMode::kAny, |
| 1168 RelocInfo::CODE_TARGET); | 1169 tail_call_mode), |
| 1170 RelocInfo::CODE_TARGET); |
| 1171 } else { |
| 1172 DCHECK_EQ(function_type, CallableType::kAny); |
| 1173 __ Jump(masm->isolate()->builtins()->Call(ConvertReceiverMode::kAny, |
| 1174 tail_call_mode), |
| 1175 RelocInfo::CODE_TARGET); |
| 1176 } |
| 1169 } | 1177 } |
| 1170 | 1178 |
| 1171 // static | 1179 // static |
| 1172 void Builtins::Generate_InterpreterPushArgsAndConstruct(MacroAssembler* masm) { | 1180 void Builtins::Generate_InterpreterPushArgsAndConstruct(MacroAssembler* masm) { |
| 1173 // ----------- S t a t e ------------- | 1181 // ----------- S t a t e ------------- |
| 1174 // -- r0 : argument count (not including receiver) | 1182 // -- r0 : argument count (not including receiver) |
| 1175 // -- r3 : new target | 1183 // -- r3 : new target |
| 1176 // -- r1 : constructor to call | 1184 // -- r1 : constructor to call |
| 1177 // -- r2 : address of the first argument | 1185 // -- r2 : address of the first argument |
| 1178 // ----------------------------------- | 1186 // ----------------------------------- |
| (...skipping 1743 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2922 } | 2930 } |
| 2923 } | 2931 } |
| 2924 | 2932 |
| 2925 | 2933 |
| 2926 #undef __ | 2934 #undef __ |
| 2927 | 2935 |
| 2928 } // namespace internal | 2936 } // namespace internal |
| 2929 } // namespace v8 | 2937 } // namespace v8 |
| 2930 | 2938 |
| 2931 #endif // V8_TARGET_ARCH_ARM | 2939 #endif // V8_TARGET_ARCH_ARM |
| OLD | NEW |