OLD | NEW |
1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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_X64 | 5 #if V8_TARGET_ARCH_X64 |
6 | 6 |
7 #include "src/crankshaft/x64/lithium-codegen-x64.h" | 7 #include "src/crankshaft/x64/lithium-codegen-x64.h" |
8 | 8 |
9 #include "src/base/bits.h" | 9 #include "src/base/bits.h" |
10 #include "src/code-factory.h" | 10 #include "src/code-factory.h" |
(...skipping 3295 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3306 __ decl(length); | 3306 __ decl(length); |
3307 __ j(not_zero, &loop); | 3307 __ j(not_zero, &loop); |
3308 | 3308 |
3309 // Invoke the function. | 3309 // Invoke the function. |
3310 __ bind(&invoke); | 3310 __ bind(&invoke); |
3311 DCHECK(instr->HasPointerMap()); | 3311 DCHECK(instr->HasPointerMap()); |
3312 LPointerMap* pointers = instr->pointer_map(); | 3312 LPointerMap* pointers = instr->pointer_map(); |
3313 SafepointGenerator safepoint_generator( | 3313 SafepointGenerator safepoint_generator( |
3314 this, pointers, Safepoint::kLazyDeopt); | 3314 this, pointers, Safepoint::kLazyDeopt); |
3315 ParameterCount actual(rax); | 3315 ParameterCount actual(rax); |
3316 __ InvokeFunction(function, actual, CALL_FUNCTION, safepoint_generator); | 3316 __ InvokeFunction(function, no_reg, actual, CALL_FUNCTION, |
| 3317 safepoint_generator); |
3317 } | 3318 } |
3318 | 3319 |
3319 | 3320 |
3320 void LCodeGen::DoPushArgument(LPushArgument* instr) { | 3321 void LCodeGen::DoPushArgument(LPushArgument* instr) { |
3321 LOperand* argument = instr->value(); | 3322 LOperand* argument = instr->value(); |
3322 EmitPushTaggedOperand(argument); | 3323 EmitPushTaggedOperand(argument); |
3323 } | 3324 } |
3324 | 3325 |
3325 | 3326 |
3326 void LCodeGen::DoDrop(LDrop* instr) { | 3327 void LCodeGen::DoDrop(LDrop* instr) { |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3380 } | 3381 } |
3381 | 3382 |
3382 // Set up deoptimization. | 3383 // Set up deoptimization. |
3383 RecordSafepointWithLazyDeopt(instr, RECORD_SIMPLE_SAFEPOINT, 0); | 3384 RecordSafepointWithLazyDeopt(instr, RECORD_SIMPLE_SAFEPOINT, 0); |
3384 } else { | 3385 } else { |
3385 // We need to adapt arguments. | 3386 // We need to adapt arguments. |
3386 SafepointGenerator generator( | 3387 SafepointGenerator generator( |
3387 this, pointers, Safepoint::kLazyDeopt); | 3388 this, pointers, Safepoint::kLazyDeopt); |
3388 ParameterCount count(arity); | 3389 ParameterCount count(arity); |
3389 ParameterCount expected(formal_parameter_count); | 3390 ParameterCount expected(formal_parameter_count); |
3390 __ InvokeFunction(function_reg, expected, count, CALL_FUNCTION, generator); | 3391 __ InvokeFunction(function_reg, no_reg, expected, count, CALL_FUNCTION, |
| 3392 generator); |
3391 } | 3393 } |
3392 } | 3394 } |
3393 | 3395 |
3394 | 3396 |
3395 void LCodeGen::DoCallWithDescriptor(LCallWithDescriptor* instr) { | 3397 void LCodeGen::DoCallWithDescriptor(LCallWithDescriptor* instr) { |
3396 DCHECK(ToRegister(instr->result()).is(rax)); | 3398 DCHECK(ToRegister(instr->result()).is(rax)); |
3397 | 3399 |
3398 if (instr->hydrogen()->IsTailCall()) { | 3400 if (instr->hydrogen()->IsTailCall()) { |
3399 if (NeedsEagerFrame()) __ leave(); | 3401 if (NeedsEagerFrame()) __ leave(); |
3400 | 3402 |
(...skipping 423 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3824 void LCodeGen::DoInvokeFunction(LInvokeFunction* instr) { | 3826 void LCodeGen::DoInvokeFunction(LInvokeFunction* instr) { |
3825 DCHECK(ToRegister(instr->context()).is(rsi)); | 3827 DCHECK(ToRegister(instr->context()).is(rsi)); |
3826 DCHECK(ToRegister(instr->function()).is(rdi)); | 3828 DCHECK(ToRegister(instr->function()).is(rdi)); |
3827 DCHECK(instr->HasPointerMap()); | 3829 DCHECK(instr->HasPointerMap()); |
3828 | 3830 |
3829 Handle<JSFunction> known_function = instr->hydrogen()->known_function(); | 3831 Handle<JSFunction> known_function = instr->hydrogen()->known_function(); |
3830 if (known_function.is_null()) { | 3832 if (known_function.is_null()) { |
3831 LPointerMap* pointers = instr->pointer_map(); | 3833 LPointerMap* pointers = instr->pointer_map(); |
3832 SafepointGenerator generator(this, pointers, Safepoint::kLazyDeopt); | 3834 SafepointGenerator generator(this, pointers, Safepoint::kLazyDeopt); |
3833 ParameterCount count(instr->arity()); | 3835 ParameterCount count(instr->arity()); |
3834 __ InvokeFunction(rdi, count, CALL_FUNCTION, generator); | 3836 __ InvokeFunction(rdi, no_reg, count, CALL_FUNCTION, generator); |
3835 } else { | 3837 } else { |
3836 CallKnownFunction(known_function, | 3838 CallKnownFunction(known_function, |
3837 instr->hydrogen()->formal_parameter_count(), | 3839 instr->hydrogen()->formal_parameter_count(), |
3838 instr->arity(), instr); | 3840 instr->arity(), instr); |
3839 } | 3841 } |
3840 } | 3842 } |
3841 | 3843 |
3842 | 3844 |
3843 void LCodeGen::DoCallFunction(LCallFunction* instr) { | 3845 void LCodeGen::DoCallFunction(LCallFunction* instr) { |
3844 DCHECK(ToRegister(instr->context()).is(rsi)); | 3846 DCHECK(ToRegister(instr->context()).is(rsi)); |
(...skipping 1994 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5839 RecordSafepoint(Safepoint::kNoLazyDeopt); | 5841 RecordSafepoint(Safepoint::kNoLazyDeopt); |
5840 } | 5842 } |
5841 | 5843 |
5842 | 5844 |
5843 #undef __ | 5845 #undef __ |
5844 | 5846 |
5845 } // namespace internal | 5847 } // namespace internal |
5846 } // namespace v8 | 5848 } // namespace v8 |
5847 | 5849 |
5848 #endif // V8_TARGET_ARCH_X64 | 5850 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |