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 3640 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3651 __ mov(r0, Operand(instr->arity())); | 3651 __ mov(r0, Operand(instr->arity())); |
3652 | 3652 |
3653 // Load the code entry address | 3653 // Load the code entry address |
3654 __ ldr(ip, FieldMemOperand(r1, JSFunction::kCodeEntryOffset)); | 3654 __ ldr(ip, FieldMemOperand(r1, JSFunction::kCodeEntryOffset)); |
3655 __ Call(ip); | 3655 __ Call(ip); |
3656 | 3656 |
3657 RecordSafepointWithLazyDeopt(instr, RECORD_SIMPLE_SAFEPOINT); | 3657 RecordSafepointWithLazyDeopt(instr, RECORD_SIMPLE_SAFEPOINT); |
3658 } | 3658 } |
3659 | 3659 |
3660 | 3660 |
3661 void LCodeGen::DoCallFunction(LCallFunction* instr) { | |
3662 HCallFunction* hinstr = instr->hydrogen(); | |
3663 DCHECK(ToRegister(instr->context()).is(cp)); | |
3664 DCHECK(ToRegister(instr->function()).is(r1)); | |
3665 DCHECK(ToRegister(instr->result()).is(r0)); | |
3666 | |
3667 int arity = instr->arity(); | |
3668 ConvertReceiverMode mode = hinstr->convert_mode(); | |
3669 if (hinstr->HasVectorAndSlot()) { | |
3670 Register slot_register = ToRegister(instr->temp_slot()); | |
3671 Register vector_register = ToRegister(instr->temp_vector()); | |
3672 DCHECK(slot_register.is(r3)); | |
3673 DCHECK(vector_register.is(r2)); | |
3674 | |
3675 AllowDeferredHandleDereference vector_structure_check; | |
3676 Handle<TypeFeedbackVector> vector = hinstr->feedback_vector(); | |
3677 int index = vector->GetIndex(hinstr->slot()); | |
3678 | |
3679 __ Move(vector_register, vector); | |
3680 __ mov(slot_register, Operand(Smi::FromInt(index))); | |
3681 | |
3682 Handle<Code> ic = | |
3683 CodeFactory::CallICInOptimizedCode(isolate(), arity, mode).code(); | |
3684 CallCode(ic, RelocInfo::CODE_TARGET, instr); | |
3685 } else { | |
3686 __ mov(r0, Operand(arity)); | |
3687 CallCode(isolate()->builtins()->Call(mode), RelocInfo::CODE_TARGET, instr); | |
3688 } | |
3689 } | |
3690 | |
3691 | |
3692 void LCodeGen::DoCallNewArray(LCallNewArray* instr) { | 3661 void LCodeGen::DoCallNewArray(LCallNewArray* instr) { |
3693 DCHECK(ToRegister(instr->context()).is(cp)); | 3662 DCHECK(ToRegister(instr->context()).is(cp)); |
3694 DCHECK(ToRegister(instr->constructor()).is(r1)); | 3663 DCHECK(ToRegister(instr->constructor()).is(r1)); |
3695 DCHECK(ToRegister(instr->result()).is(r0)); | 3664 DCHECK(ToRegister(instr->result()).is(r0)); |
3696 | 3665 |
3697 __ mov(r0, Operand(instr->arity())); | 3666 __ mov(r0, Operand(instr->arity())); |
3698 if (instr->arity() == 1) { | 3667 if (instr->arity() == 1) { |
3699 // We only need the allocation site for the case we have a length argument. | 3668 // We only need the allocation site for the case we have a length argument. |
3700 // The case may bail out to the runtime, which will determine the correct | 3669 // The case may bail out to the runtime, which will determine the correct |
3701 // elements kind with the site. | 3670 // elements kind with the site. |
(...skipping 1818 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5520 void LCodeGen::DoStoreFrameContext(LStoreFrameContext* instr) { | 5489 void LCodeGen::DoStoreFrameContext(LStoreFrameContext* instr) { |
5521 Register context = ToRegister(instr->context()); | 5490 Register context = ToRegister(instr->context()); |
5522 __ str(context, MemOperand(fp, StandardFrameConstants::kContextOffset)); | 5491 __ str(context, MemOperand(fp, StandardFrameConstants::kContextOffset)); |
5523 } | 5492 } |
5524 | 5493 |
5525 | 5494 |
5526 #undef __ | 5495 #undef __ |
5527 | 5496 |
5528 } // namespace internal | 5497 } // namespace internal |
5529 } // namespace v8 | 5498 } // namespace v8 |
OLD | NEW |