OLD | NEW |
1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 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_S390 | 5 #if V8_TARGET_ARCH_S390 |
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 1187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1198 __ bind(&loop); | 1198 __ bind(&loop); |
1199 __ LoadP(scratch, MemOperand(index, -kPointerSize)); | 1199 __ LoadP(scratch, MemOperand(index, -kPointerSize)); |
1200 __ lay(index, MemOperand(index, -kPointerSize)); | 1200 __ lay(index, MemOperand(index, -kPointerSize)); |
1201 __ push(scratch); | 1201 __ push(scratch); |
1202 __ SubP(r0, Operand(1)); | 1202 __ SubP(r0, Operand(1)); |
1203 __ bne(&loop); | 1203 __ bne(&loop); |
1204 } | 1204 } |
1205 | 1205 |
1206 // static | 1206 // static |
1207 void Builtins::Generate_InterpreterPushArgsAndCallImpl( | 1207 void Builtins::Generate_InterpreterPushArgsAndCallImpl( |
1208 MacroAssembler* masm, TailCallMode tail_call_mode) { | 1208 MacroAssembler* masm, TailCallMode tail_call_mode, |
| 1209 CallableType function_type) { |
1209 // ----------- S t a t e ------------- | 1210 // ----------- S t a t e ------------- |
1210 // -- r2 : the number of arguments (not including the receiver) | 1211 // -- r2 : the number of arguments (not including the receiver) |
1211 // -- r4 : the address of the first argument to be pushed. Subsequent | 1212 // -- r4 : the address of the first argument to be pushed. Subsequent |
1212 // arguments should be consecutive above this, in the same order as | 1213 // arguments should be consecutive above this, in the same order as |
1213 // they are to be pushed onto the stack. | 1214 // they are to be pushed onto the stack. |
1214 // -- r3 : the target to call (can be any Object). | 1215 // -- r3 : the target to call (can be any Object). |
1215 // ----------------------------------- | 1216 // ----------------------------------- |
1216 | 1217 |
1217 // Calculate number of arguments (AddP one for receiver). | 1218 // Calculate number of arguments (AddP one for receiver). |
1218 __ AddP(r5, r2, Operand(1)); | 1219 __ AddP(r5, r2, Operand(1)); |
1219 | 1220 |
1220 // Push the arguments. | 1221 // Push the arguments. |
1221 Generate_InterpreterPushArgs(masm, r4, r5, r6); | 1222 Generate_InterpreterPushArgs(masm, r4, r5, r6); |
1222 | 1223 |
1223 // Call the target. | 1224 // Call the target. |
1224 __ Jump(masm->isolate()->builtins()->Call(ConvertReceiverMode::kAny, | 1225 if (function_type == CallableType::kJSFunction) { |
1225 tail_call_mode), | 1226 __ Jump(masm->isolate()->builtins()->CallFunction(ConvertReceiverMode::kAny, |
1226 RelocInfo::CODE_TARGET); | 1227 tail_call_mode), |
| 1228 RelocInfo::CODE_TARGET); |
| 1229 } else { |
| 1230 DCHECK_EQ(function_type, CallableType::kAny); |
| 1231 __ Jump(masm->isolate()->builtins()->Call(ConvertReceiverMode::kAny, |
| 1232 tail_call_mode), |
| 1233 RelocInfo::CODE_TARGET); |
| 1234 } |
1227 } | 1235 } |
1228 | 1236 |
1229 // static | 1237 // static |
1230 void Builtins::Generate_InterpreterPushArgsAndConstruct(MacroAssembler* masm) { | 1238 void Builtins::Generate_InterpreterPushArgsAndConstruct(MacroAssembler* masm) { |
1231 // ----------- S t a t e ------------- | 1239 // ----------- S t a t e ------------- |
1232 // -- r2 : argument count (not including receiver) | 1240 // -- r2 : argument count (not including receiver) |
1233 // -- r5 : new target | 1241 // -- r5 : new target |
1234 // -- r3 : constructor to call | 1242 // -- r3 : constructor to call |
1235 // -- r4 : address of the first argument | 1243 // -- r4 : address of the first argument |
1236 // ----------------------------------- | 1244 // ----------------------------------- |
(...skipping 1770 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3007 __ bkpt(0); | 3015 __ bkpt(0); |
3008 } | 3016 } |
3009 } | 3017 } |
3010 | 3018 |
3011 #undef __ | 3019 #undef __ |
3012 | 3020 |
3013 } // namespace internal | 3021 } // namespace internal |
3014 } // namespace v8 | 3022 } // namespace v8 |
3015 | 3023 |
3016 #endif // V8_TARGET_ARCH_S390 | 3024 #endif // V8_TARGET_ARCH_S390 |
OLD | NEW |