| 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_IA32 | 5 #if V8_TARGET_ARCH_IA32 |
| 6 | 6 |
| 7 #include "src/crankshaft/ia32/lithium-codegen-ia32.h" | 7 #include "src/crankshaft/ia32/lithium-codegen-ia32.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 3633 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3644 __ InvokeFunction(edi, no_reg, count, CALL_FUNCTION, generator); | 3644 __ InvokeFunction(edi, no_reg, count, CALL_FUNCTION, generator); |
| 3645 } else { | 3645 } else { |
| 3646 CallKnownFunction(known_function, | 3646 CallKnownFunction(known_function, |
| 3647 instr->hydrogen()->formal_parameter_count(), | 3647 instr->hydrogen()->formal_parameter_count(), |
| 3648 instr->arity(), instr); | 3648 instr->arity(), instr); |
| 3649 } | 3649 } |
| 3650 } | 3650 } |
| 3651 | 3651 |
| 3652 | 3652 |
| 3653 void LCodeGen::DoCallFunction(LCallFunction* instr) { | 3653 void LCodeGen::DoCallFunction(LCallFunction* instr) { |
| 3654 HCallFunction* hinstr = instr->hydrogen(); |
| 3654 DCHECK(ToRegister(instr->context()).is(esi)); | 3655 DCHECK(ToRegister(instr->context()).is(esi)); |
| 3655 DCHECK(ToRegister(instr->function()).is(edi)); | 3656 DCHECK(ToRegister(instr->function()).is(edi)); |
| 3656 DCHECK(ToRegister(instr->result()).is(eax)); | 3657 DCHECK(ToRegister(instr->result()).is(eax)); |
| 3657 | 3658 |
| 3658 int arity = instr->arity(); | 3659 int arity = instr->arity(); |
| 3659 ConvertReceiverMode mode = instr->hydrogen()->convert_mode(); | 3660 ConvertReceiverMode mode = hinstr->convert_mode(); |
| 3660 if (instr->hydrogen()->HasVectorAndSlot()) { | 3661 TailCallMode tail_call_mode = hinstr->tail_call_mode(); |
| 3662 if (hinstr->HasVectorAndSlot()) { |
| 3661 Register slot_register = ToRegister(instr->temp_slot()); | 3663 Register slot_register = ToRegister(instr->temp_slot()); |
| 3662 Register vector_register = ToRegister(instr->temp_vector()); | 3664 Register vector_register = ToRegister(instr->temp_vector()); |
| 3663 DCHECK(slot_register.is(edx)); | 3665 DCHECK(slot_register.is(edx)); |
| 3664 DCHECK(vector_register.is(ebx)); | 3666 DCHECK(vector_register.is(ebx)); |
| 3665 | 3667 |
| 3666 AllowDeferredHandleDereference vector_structure_check; | 3668 AllowDeferredHandleDereference vector_structure_check; |
| 3667 Handle<TypeFeedbackVector> vector = instr->hydrogen()->feedback_vector(); | 3669 Handle<TypeFeedbackVector> vector = hinstr->feedback_vector(); |
| 3668 int index = vector->GetIndex(instr->hydrogen()->slot()); | 3670 int index = vector->GetIndex(hinstr->slot()); |
| 3669 | 3671 |
| 3670 __ mov(vector_register, vector); | 3672 __ mov(vector_register, vector); |
| 3671 __ mov(slot_register, Immediate(Smi::FromInt(index))); | 3673 __ mov(slot_register, Immediate(Smi::FromInt(index))); |
| 3672 | 3674 |
| 3673 Handle<Code> ic = | 3675 Handle<Code> ic = CodeFactory::CallICInOptimizedCode(isolate(), arity, mode, |
| 3674 CodeFactory::CallICInOptimizedCode(isolate(), arity, mode).code(); | 3676 tail_call_mode) |
| 3677 .code(); |
| 3675 CallCode(ic, RelocInfo::CODE_TARGET, instr); | 3678 CallCode(ic, RelocInfo::CODE_TARGET, instr); |
| 3676 } else { | 3679 } else { |
| 3677 __ Set(eax, arity); | 3680 __ Set(eax, arity); |
| 3678 CallCode(isolate()->builtins()->Call(mode), RelocInfo::CODE_TARGET, instr); | 3681 CallCode(isolate()->builtins()->Call(mode, tail_call_mode), |
| 3682 RelocInfo::CODE_TARGET, instr); |
| 3679 } | 3683 } |
| 3680 } | 3684 } |
| 3681 | 3685 |
| 3682 | 3686 |
| 3683 void LCodeGen::DoCallNewArray(LCallNewArray* instr) { | 3687 void LCodeGen::DoCallNewArray(LCallNewArray* instr) { |
| 3684 DCHECK(ToRegister(instr->context()).is(esi)); | 3688 DCHECK(ToRegister(instr->context()).is(esi)); |
| 3685 DCHECK(ToRegister(instr->constructor()).is(edi)); | 3689 DCHECK(ToRegister(instr->constructor()).is(edi)); |
| 3686 DCHECK(ToRegister(instr->result()).is(eax)); | 3690 DCHECK(ToRegister(instr->result()).is(eax)); |
| 3687 | 3691 |
| 3688 __ Move(eax, Immediate(instr->arity())); | 3692 __ Move(eax, Immediate(instr->arity())); |
| (...skipping 1763 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5452 RecordSafepoint(Safepoint::kNoLazyDeopt); | 5456 RecordSafepoint(Safepoint::kNoLazyDeopt); |
| 5453 } | 5457 } |
| 5454 | 5458 |
| 5455 | 5459 |
| 5456 #undef __ | 5460 #undef __ |
| 5457 | 5461 |
| 5458 } // namespace internal | 5462 } // namespace internal |
| 5459 } // namespace v8 | 5463 } // namespace v8 |
| 5460 | 5464 |
| 5461 #endif // V8_TARGET_ARCH_IA32 | 5465 #endif // V8_TARGET_ARCH_IA32 |
| OLD | NEW |