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