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 #include "src/crankshaft/arm/lithium-codegen-arm.h" | 5 #include "src/crankshaft/arm/lithium-codegen-arm.h" |
6 | 6 |
7 #include "src/base/bits.h" | 7 #include "src/base/bits.h" |
8 #include "src/code-factory.h" | 8 #include "src/code-factory.h" |
9 #include "src/code-stubs.h" | 9 #include "src/code-stubs.h" |
10 #include "src/crankshaft/arm/lithium-gap-resolver-arm.h" | 10 #include "src/crankshaft/arm/lithium-gap-resolver-arm.h" |
(...skipping 3798 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3809 RecordSafepointWithLazyDeopt(instr, RECORD_SIMPLE_SAFEPOINT); | 3809 RecordSafepointWithLazyDeopt(instr, RECORD_SIMPLE_SAFEPOINT); |
3810 } | 3810 } |
3811 | 3811 |
3812 | 3812 |
3813 void LCodeGen::DoCallFunction(LCallFunction* instr) { | 3813 void LCodeGen::DoCallFunction(LCallFunction* instr) { |
3814 DCHECK(ToRegister(instr->context()).is(cp)); | 3814 DCHECK(ToRegister(instr->context()).is(cp)); |
3815 DCHECK(ToRegister(instr->function()).is(r1)); | 3815 DCHECK(ToRegister(instr->function()).is(r1)); |
3816 DCHECK(ToRegister(instr->result()).is(r0)); | 3816 DCHECK(ToRegister(instr->result()).is(r0)); |
3817 | 3817 |
3818 int arity = instr->arity(); | 3818 int arity = instr->arity(); |
| 3819 ConvertReceiverMode mode = instr->hydrogen()->convert_mode(); |
3819 if (instr->hydrogen()->HasVectorAndSlot()) { | 3820 if (instr->hydrogen()->HasVectorAndSlot()) { |
3820 Register slot_register = ToRegister(instr->temp_slot()); | 3821 Register slot_register = ToRegister(instr->temp_slot()); |
3821 Register vector_register = ToRegister(instr->temp_vector()); | 3822 Register vector_register = ToRegister(instr->temp_vector()); |
3822 DCHECK(slot_register.is(r3)); | 3823 DCHECK(slot_register.is(r3)); |
3823 DCHECK(vector_register.is(r2)); | 3824 DCHECK(vector_register.is(r2)); |
3824 | 3825 |
3825 AllowDeferredHandleDereference vector_structure_check; | 3826 AllowDeferredHandleDereference vector_structure_check; |
3826 Handle<TypeFeedbackVector> vector = instr->hydrogen()->feedback_vector(); | 3827 Handle<TypeFeedbackVector> vector = instr->hydrogen()->feedback_vector(); |
3827 int index = vector->GetIndex(instr->hydrogen()->slot()); | 3828 int index = vector->GetIndex(instr->hydrogen()->slot()); |
3828 | 3829 |
3829 __ Move(vector_register, vector); | 3830 __ Move(vector_register, vector); |
3830 __ mov(slot_register, Operand(Smi::FromInt(index))); | 3831 __ mov(slot_register, Operand(Smi::FromInt(index))); |
3831 | 3832 |
3832 Handle<Code> ic = | 3833 Handle<Code> ic = |
3833 CodeFactory::CallICInOptimizedCode(isolate(), arity).code(); | 3834 CodeFactory::CallICInOptimizedCode(isolate(), arity, mode).code(); |
3834 CallCode(ic, RelocInfo::CODE_TARGET, instr); | 3835 CallCode(ic, RelocInfo::CODE_TARGET, instr); |
3835 } else { | 3836 } else { |
3836 __ mov(r0, Operand(arity)); | 3837 __ mov(r0, Operand(arity)); |
3837 CallCode(isolate()->builtins()->Call(), RelocInfo::CODE_TARGET, instr); | 3838 CallCode(isolate()->builtins()->Call(mode), RelocInfo::CODE_TARGET, instr); |
3838 } | 3839 } |
3839 } | 3840 } |
3840 | 3841 |
3841 | 3842 |
3842 void LCodeGen::DoCallNew(LCallNew* instr) { | 3843 void LCodeGen::DoCallNew(LCallNew* instr) { |
3843 DCHECK(ToRegister(instr->context()).is(cp)); | 3844 DCHECK(ToRegister(instr->context()).is(cp)); |
3844 DCHECK(ToRegister(instr->constructor()).is(r1)); | 3845 DCHECK(ToRegister(instr->constructor()).is(r1)); |
3845 DCHECK(ToRegister(instr->result()).is(r0)); | 3846 DCHECK(ToRegister(instr->result()).is(r0)); |
3846 | 3847 |
3847 __ mov(r0, Operand(instr->arity())); | 3848 __ mov(r0, Operand(instr->arity())); |
(...skipping 1922 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5770 __ push(ToRegister(instr->function())); | 5771 __ push(ToRegister(instr->function())); |
5771 CallRuntime(Runtime::kPushBlockContext, 2, instr); | 5772 CallRuntime(Runtime::kPushBlockContext, 2, instr); |
5772 RecordSafepoint(Safepoint::kNoLazyDeopt); | 5773 RecordSafepoint(Safepoint::kNoLazyDeopt); |
5773 } | 5774 } |
5774 | 5775 |
5775 | 5776 |
5776 #undef __ | 5777 #undef __ |
5777 | 5778 |
5778 } // namespace internal | 5779 } // namespace internal |
5779 } // namespace v8 | 5780 } // namespace v8 |
OLD | NEW |