| 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/mips64/lithium-codegen-mips64.h" | 5 #include "src/crankshaft/mips64/lithium-codegen-mips64.h" |
| 6 | 6 |
| 7 #include "src/code-factory.h" | 7 #include "src/code-factory.h" |
| 8 #include "src/code-stubs.h" | 8 #include "src/code-stubs.h" |
| 9 #include "src/crankshaft/hydrogen-osr.h" | 9 #include "src/crankshaft/hydrogen-osr.h" |
| 10 #include "src/crankshaft/mips64/lithium-gap-resolver-mips64.h" | 10 #include "src/crankshaft/mips64/lithium-gap-resolver-mips64.h" |
| (...skipping 3800 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3811 __ li(a0, Operand(instr->arity())); | 3811 __ li(a0, Operand(instr->arity())); |
| 3812 | 3812 |
| 3813 // Load the code entry address | 3813 // Load the code entry address |
| 3814 __ ld(at, FieldMemOperand(a1, JSFunction::kCodeEntryOffset)); | 3814 __ ld(at, FieldMemOperand(a1, JSFunction::kCodeEntryOffset)); |
| 3815 __ Call(at); | 3815 __ Call(at); |
| 3816 | 3816 |
| 3817 RecordSafepointWithLazyDeopt(instr, RECORD_SIMPLE_SAFEPOINT); | 3817 RecordSafepointWithLazyDeopt(instr, RECORD_SIMPLE_SAFEPOINT); |
| 3818 } | 3818 } |
| 3819 | 3819 |
| 3820 | 3820 |
| 3821 void LCodeGen::DoCallFunction(LCallFunction* instr) { | |
| 3822 HCallFunction* hinstr = instr->hydrogen(); | |
| 3823 DCHECK(ToRegister(instr->context()).is(cp)); | |
| 3824 DCHECK(ToRegister(instr->function()).is(a1)); | |
| 3825 DCHECK(ToRegister(instr->result()).is(v0)); | |
| 3826 | |
| 3827 int arity = instr->arity(); | |
| 3828 ConvertReceiverMode mode = hinstr->convert_mode(); | |
| 3829 if (hinstr->HasVectorAndSlot()) { | |
| 3830 Register slot_register = ToRegister(instr->temp_slot()); | |
| 3831 Register vector_register = ToRegister(instr->temp_vector()); | |
| 3832 DCHECK(slot_register.is(a3)); | |
| 3833 DCHECK(vector_register.is(a2)); | |
| 3834 | |
| 3835 AllowDeferredHandleDereference vector_structure_check; | |
| 3836 Handle<TypeFeedbackVector> vector = hinstr->feedback_vector(); | |
| 3837 int index = vector->GetIndex(hinstr->slot()); | |
| 3838 | |
| 3839 __ li(vector_register, vector); | |
| 3840 __ li(slot_register, Operand(Smi::FromInt(index))); | |
| 3841 | |
| 3842 Handle<Code> ic = | |
| 3843 CodeFactory::CallICInOptimizedCode(isolate(), arity, mode).code(); | |
| 3844 CallCode(ic, RelocInfo::CODE_TARGET, instr); | |
| 3845 } else { | |
| 3846 __ li(a0, Operand(arity)); | |
| 3847 CallCode(isolate()->builtins()->Call(mode), RelocInfo::CODE_TARGET, instr); | |
| 3848 } | |
| 3849 } | |
| 3850 | |
| 3851 | |
| 3852 void LCodeGen::DoCallNewArray(LCallNewArray* instr) { | 3821 void LCodeGen::DoCallNewArray(LCallNewArray* instr) { |
| 3853 DCHECK(ToRegister(instr->context()).is(cp)); | 3822 DCHECK(ToRegister(instr->context()).is(cp)); |
| 3854 DCHECK(ToRegister(instr->constructor()).is(a1)); | 3823 DCHECK(ToRegister(instr->constructor()).is(a1)); |
| 3855 DCHECK(ToRegister(instr->result()).is(v0)); | 3824 DCHECK(ToRegister(instr->result()).is(v0)); |
| 3856 | 3825 |
| 3857 __ li(a0, Operand(instr->arity())); | 3826 __ li(a0, Operand(instr->arity())); |
| 3858 if (instr->arity() == 1) { | 3827 if (instr->arity() == 1) { |
| 3859 // We only need the allocation site for the case we have a length argument. | 3828 // We only need the allocation site for the case we have a length argument. |
| 3860 // The case may bail out to the runtime, which will determine the correct | 3829 // The case may bail out to the runtime, which will determine the correct |
| 3861 // elements kind with the site. | 3830 // elements kind with the site. |
| (...skipping 1880 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5742 void LCodeGen::DoStoreFrameContext(LStoreFrameContext* instr) { | 5711 void LCodeGen::DoStoreFrameContext(LStoreFrameContext* instr) { |
| 5743 Register context = ToRegister(instr->context()); | 5712 Register context = ToRegister(instr->context()); |
| 5744 __ sd(context, MemOperand(fp, StandardFrameConstants::kContextOffset)); | 5713 __ sd(context, MemOperand(fp, StandardFrameConstants::kContextOffset)); |
| 5745 } | 5714 } |
| 5746 | 5715 |
| 5747 | 5716 |
| 5748 #undef __ | 5717 #undef __ |
| 5749 | 5718 |
| 5750 } // namespace internal | 5719 } // namespace internal |
| 5751 } // namespace v8 | 5720 } // namespace v8 |
| OLD | NEW |