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 3697 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3708 | 3708 |
3709 | 3709 |
3710 void LCodeGen::DoCallFunction(LCallFunction* instr) { | 3710 void LCodeGen::DoCallFunction(LCallFunction* instr) { |
3711 HCallFunction* hinstr = instr->hydrogen(); | 3711 HCallFunction* hinstr = instr->hydrogen(); |
3712 DCHECK(ToRegister(instr->context()).is(cp)); | 3712 DCHECK(ToRegister(instr->context()).is(cp)); |
3713 DCHECK(ToRegister(instr->function()).is(r1)); | 3713 DCHECK(ToRegister(instr->function()).is(r1)); |
3714 DCHECK(ToRegister(instr->result()).is(r0)); | 3714 DCHECK(ToRegister(instr->result()).is(r0)); |
3715 | 3715 |
3716 int arity = instr->arity(); | 3716 int arity = instr->arity(); |
3717 ConvertReceiverMode mode = hinstr->convert_mode(); | 3717 ConvertReceiverMode mode = hinstr->convert_mode(); |
3718 TailCallMode tail_call_mode = hinstr->tail_call_mode(); | |
3719 if (hinstr->HasVectorAndSlot()) { | 3718 if (hinstr->HasVectorAndSlot()) { |
3720 Register slot_register = ToRegister(instr->temp_slot()); | 3719 Register slot_register = ToRegister(instr->temp_slot()); |
3721 Register vector_register = ToRegister(instr->temp_vector()); | 3720 Register vector_register = ToRegister(instr->temp_vector()); |
3722 DCHECK(slot_register.is(r3)); | 3721 DCHECK(slot_register.is(r3)); |
3723 DCHECK(vector_register.is(r2)); | 3722 DCHECK(vector_register.is(r2)); |
3724 | 3723 |
3725 AllowDeferredHandleDereference vector_structure_check; | 3724 AllowDeferredHandleDereference vector_structure_check; |
3726 Handle<TypeFeedbackVector> vector = hinstr->feedback_vector(); | 3725 Handle<TypeFeedbackVector> vector = hinstr->feedback_vector(); |
3727 int index = vector->GetIndex(hinstr->slot()); | 3726 int index = vector->GetIndex(hinstr->slot()); |
3728 | 3727 |
3729 __ Move(vector_register, vector); | 3728 __ Move(vector_register, vector); |
3730 __ mov(slot_register, Operand(Smi::FromInt(index))); | 3729 __ mov(slot_register, Operand(Smi::FromInt(index))); |
3731 | 3730 |
3732 Handle<Code> ic = CodeFactory::CallICInOptimizedCode(isolate(), arity, mode, | 3731 Handle<Code> ic = |
3733 tail_call_mode) | 3732 CodeFactory::CallICInOptimizedCode(isolate(), arity, mode).code(); |
3734 .code(); | |
3735 CallCode(ic, RelocInfo::CODE_TARGET, instr); | 3733 CallCode(ic, RelocInfo::CODE_TARGET, instr); |
3736 } else { | 3734 } else { |
3737 __ mov(r0, Operand(arity)); | 3735 __ mov(r0, Operand(arity)); |
3738 CallCode(isolate()->builtins()->Call(mode, tail_call_mode), | 3736 CallCode(isolate()->builtins()->Call(mode), RelocInfo::CODE_TARGET, instr); |
3739 RelocInfo::CODE_TARGET, instr); | |
3740 } | 3737 } |
3741 } | 3738 } |
3742 | 3739 |
3743 | 3740 |
3744 void LCodeGen::DoCallNewArray(LCallNewArray* instr) { | 3741 void LCodeGen::DoCallNewArray(LCallNewArray* instr) { |
3745 DCHECK(ToRegister(instr->context()).is(cp)); | 3742 DCHECK(ToRegister(instr->context()).is(cp)); |
3746 DCHECK(ToRegister(instr->constructor()).is(r1)); | 3743 DCHECK(ToRegister(instr->constructor()).is(r1)); |
3747 DCHECK(ToRegister(instr->result()).is(r0)); | 3744 DCHECK(ToRegister(instr->result()).is(r0)); |
3748 | 3745 |
3749 __ mov(r0, Operand(instr->arity())); | 3746 __ mov(r0, Operand(instr->arity())); |
(...skipping 1831 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5581 __ push(ToRegister(instr->function())); | 5578 __ push(ToRegister(instr->function())); |
5582 CallRuntime(Runtime::kPushBlockContext, instr); | 5579 CallRuntime(Runtime::kPushBlockContext, instr); |
5583 RecordSafepoint(Safepoint::kNoLazyDeopt); | 5580 RecordSafepoint(Safepoint::kNoLazyDeopt); |
5584 } | 5581 } |
5585 | 5582 |
5586 | 5583 |
5587 #undef __ | 5584 #undef __ |
5588 | 5585 |
5589 } // namespace internal | 5586 } // namespace internal |
5590 } // namespace v8 | 5587 } // namespace v8 |
OLD | NEW |