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 3736 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3747 } | 3747 } |
3748 } | 3748 } |
3749 | 3749 |
3750 | 3750 |
3751 void LCodeGen::DoCallFunction(LCallFunction* instr) { | 3751 void LCodeGen::DoCallFunction(LCallFunction* instr) { |
3752 DCHECK(ToRegister(instr->context()).is(esi)); | 3752 DCHECK(ToRegister(instr->context()).is(esi)); |
3753 DCHECK(ToRegister(instr->function()).is(edi)); | 3753 DCHECK(ToRegister(instr->function()).is(edi)); |
3754 DCHECK(ToRegister(instr->result()).is(eax)); | 3754 DCHECK(ToRegister(instr->result()).is(eax)); |
3755 | 3755 |
3756 int arity = instr->arity(); | 3756 int arity = instr->arity(); |
| 3757 ConvertReceiverMode mode = instr->hydrogen()->convert_mode(); |
3757 if (instr->hydrogen()->HasVectorAndSlot()) { | 3758 if (instr->hydrogen()->HasVectorAndSlot()) { |
3758 Register slot_register = ToRegister(instr->temp_slot()); | 3759 Register slot_register = ToRegister(instr->temp_slot()); |
3759 Register vector_register = ToRegister(instr->temp_vector()); | 3760 Register vector_register = ToRegister(instr->temp_vector()); |
3760 DCHECK(slot_register.is(edx)); | 3761 DCHECK(slot_register.is(edx)); |
3761 DCHECK(vector_register.is(ebx)); | 3762 DCHECK(vector_register.is(ebx)); |
3762 | 3763 |
3763 AllowDeferredHandleDereference vector_structure_check; | 3764 AllowDeferredHandleDereference vector_structure_check; |
3764 Handle<TypeFeedbackVector> vector = instr->hydrogen()->feedback_vector(); | 3765 Handle<TypeFeedbackVector> vector = instr->hydrogen()->feedback_vector(); |
3765 int index = vector->GetIndex(instr->hydrogen()->slot()); | 3766 int index = vector->GetIndex(instr->hydrogen()->slot()); |
3766 | 3767 |
3767 __ mov(vector_register, vector); | 3768 __ mov(vector_register, vector); |
3768 __ mov(slot_register, Immediate(Smi::FromInt(index))); | 3769 __ mov(slot_register, Immediate(Smi::FromInt(index))); |
3769 | 3770 |
3770 Handle<Code> ic = | 3771 Handle<Code> ic = |
3771 CodeFactory::CallICInOptimizedCode(isolate(), arity).code(); | 3772 CodeFactory::CallICInOptimizedCode(isolate(), arity, mode).code(); |
3772 CallCode(ic, RelocInfo::CODE_TARGET, instr); | 3773 CallCode(ic, RelocInfo::CODE_TARGET, instr); |
3773 } else { | 3774 } else { |
3774 __ Set(eax, arity); | 3775 __ Set(eax, arity); |
3775 CallCode(isolate()->builtins()->Call(), RelocInfo::CODE_TARGET, instr); | 3776 CallCode(isolate()->builtins()->Call(mode), RelocInfo::CODE_TARGET, instr); |
3776 } | 3777 } |
3777 } | 3778 } |
3778 | 3779 |
3779 | 3780 |
3780 void LCodeGen::DoCallNew(LCallNew* instr) { | 3781 void LCodeGen::DoCallNew(LCallNew* instr) { |
3781 DCHECK(ToRegister(instr->context()).is(esi)); | 3782 DCHECK(ToRegister(instr->context()).is(esi)); |
3782 DCHECK(ToRegister(instr->constructor()).is(edi)); | 3783 DCHECK(ToRegister(instr->constructor()).is(edi)); |
3783 DCHECK(ToRegister(instr->result()).is(eax)); | 3784 DCHECK(ToRegister(instr->result()).is(eax)); |
3784 | 3785 |
3785 // No cell in ebx for construct type feedback in optimized code | 3786 // No cell in ebx for construct type feedback in optimized code |
(...skipping 1863 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5649 RecordSafepoint(Safepoint::kNoLazyDeopt); | 5650 RecordSafepoint(Safepoint::kNoLazyDeopt); |
5650 } | 5651 } |
5651 | 5652 |
5652 | 5653 |
5653 #undef __ | 5654 #undef __ |
5654 | 5655 |
5655 } // namespace internal | 5656 } // namespace internal |
5656 } // namespace v8 | 5657 } // namespace v8 |
5657 | 5658 |
5658 #endif // V8_TARGET_ARCH_IA32 | 5659 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |