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_PPC | 5 #if V8_TARGET_ARCH_PPC |
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 1200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1211 __ addi(index, index, Operand(kPointerSize)); // Bias up for LoadPU | 1211 __ addi(index, index, Operand(kPointerSize)); // Bias up for LoadPU |
1212 __ mtctr(count); | 1212 __ mtctr(count); |
1213 __ bind(&loop); | 1213 __ bind(&loop); |
1214 __ LoadPU(scratch, MemOperand(index, -kPointerSize)); | 1214 __ LoadPU(scratch, MemOperand(index, -kPointerSize)); |
1215 __ push(scratch); | 1215 __ push(scratch); |
1216 __ bdnz(&loop); | 1216 __ bdnz(&loop); |
1217 } | 1217 } |
1218 | 1218 |
1219 // static | 1219 // static |
1220 void Builtins::Generate_InterpreterPushArgsAndCallImpl( | 1220 void Builtins::Generate_InterpreterPushArgsAndCallImpl( |
1221 MacroAssembler* masm, TailCallMode tail_call_mode) { | 1221 MacroAssembler* masm, TailCallMode tail_call_mode, |
| 1222 CallableType function_type) { |
1222 // ----------- S t a t e ------------- | 1223 // ----------- S t a t e ------------- |
1223 // -- r3 : the number of arguments (not including the receiver) | 1224 // -- r3 : the number of arguments (not including the receiver) |
1224 // -- r5 : the address of the first argument to be pushed. Subsequent | 1225 // -- r5 : the address of the first argument to be pushed. Subsequent |
1225 // arguments should be consecutive above this, in the same order as | 1226 // arguments should be consecutive above this, in the same order as |
1226 // they are to be pushed onto the stack. | 1227 // they are to be pushed onto the stack. |
1227 // -- r4 : the target to call (can be any Object). | 1228 // -- r4 : the target to call (can be any Object). |
1228 // ----------------------------------- | 1229 // ----------------------------------- |
1229 | 1230 |
1230 // Calculate number of arguments (add one for receiver). | 1231 // Calculate number of arguments (add one for receiver). |
1231 __ addi(r6, r3, Operand(1)); | 1232 __ addi(r6, r3, Operand(1)); |
1232 | 1233 |
1233 // Push the arguments. | 1234 // Push the arguments. |
1234 Generate_InterpreterPushArgs(masm, r5, r6, r7); | 1235 Generate_InterpreterPushArgs(masm, r5, r6, r7); |
1235 | 1236 |
1236 // Call the target. | 1237 // Call the target. |
1237 __ Jump(masm->isolate()->builtins()->Call(ConvertReceiverMode::kAny, | 1238 if (function_type == CallableType::kJSFunction) { |
1238 tail_call_mode), | 1239 __ Jump(masm->isolate()->builtins()->CallFunction(ConvertReceiverMode::kAny, |
1239 RelocInfo::CODE_TARGET); | 1240 tail_call_mode), |
| 1241 RelocInfo::CODE_TARGET); |
| 1242 } else { |
| 1243 DCHECK_EQ(function_type, CallableType::kAny); |
| 1244 __ Jump(masm->isolate()->builtins()->Call(ConvertReceiverMode::kAny, |
| 1245 tail_call_mode), |
| 1246 RelocInfo::CODE_TARGET); |
| 1247 } |
1240 } | 1248 } |
1241 | 1249 |
1242 // static | 1250 // static |
1243 void Builtins::Generate_InterpreterPushArgsAndConstruct(MacroAssembler* masm) { | 1251 void Builtins::Generate_InterpreterPushArgsAndConstruct(MacroAssembler* masm) { |
1244 // ----------- S t a t e ------------- | 1252 // ----------- S t a t e ------------- |
1245 // -- r3 : argument count (not including receiver) | 1253 // -- r3 : argument count (not including receiver) |
1246 // -- r6 : new target | 1254 // -- r6 : new target |
1247 // -- r4 : constructor to call | 1255 // -- r4 : constructor to call |
1248 // -- r5 : address of the first argument | 1256 // -- r5 : address of the first argument |
1249 // ----------------------------------- | 1257 // ----------------------------------- |
(...skipping 1796 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3046 __ bkpt(0); | 3054 __ bkpt(0); |
3047 } | 3055 } |
3048 } | 3056 } |
3049 | 3057 |
3050 | 3058 |
3051 #undef __ | 3059 #undef __ |
3052 } // namespace internal | 3060 } // namespace internal |
3053 } // namespace v8 | 3061 } // namespace v8 |
3054 | 3062 |
3055 #endif // V8_TARGET_ARCH_PPC | 3063 #endif // V8_TARGET_ARCH_PPC |
OLD | NEW |