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 3781 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3792 Register target = ToRegister(instr->target()); | 3792 Register target = ToRegister(instr->target()); |
3793 generator.BeforeCall(__ CallSize(target)); | 3793 generator.BeforeCall(__ CallSize(target)); |
3794 __ Daddu(target, target, Operand(Code::kHeaderSize - kHeapObjectTag)); | 3794 __ Daddu(target, target, Operand(Code::kHeaderSize - kHeapObjectTag)); |
3795 __ Call(target); | 3795 __ Call(target); |
3796 } | 3796 } |
3797 generator.AfterCall(); | 3797 generator.AfterCall(); |
3798 } | 3798 } |
3799 } | 3799 } |
3800 | 3800 |
3801 | 3801 |
3802 void LCodeGen::DoCallJSFunction(LCallJSFunction* instr) { | |
3803 DCHECK(ToRegister(instr->function()).is(a1)); | |
3804 DCHECK(ToRegister(instr->result()).is(v0)); | |
3805 | |
3806 // Change context. | |
3807 __ ld(cp, FieldMemOperand(a1, JSFunction::kContextOffset)); | |
3808 | |
3809 // Always initialize new target and number of actual arguments. | |
3810 __ LoadRoot(a3, Heap::kUndefinedValueRootIndex); | |
3811 __ li(a0, Operand(instr->arity())); | |
3812 | |
3813 // Load the code entry address | |
3814 __ ld(at, FieldMemOperand(a1, JSFunction::kCodeEntryOffset)); | |
3815 __ Call(at); | |
3816 | |
3817 RecordSafepointWithLazyDeopt(instr, RECORD_SIMPLE_SAFEPOINT); | |
3818 } | |
3819 | |
3820 | |
3821 void LCodeGen::DoCallNewArray(LCallNewArray* instr) { | 3802 void LCodeGen::DoCallNewArray(LCallNewArray* instr) { |
3822 DCHECK(ToRegister(instr->context()).is(cp)); | 3803 DCHECK(ToRegister(instr->context()).is(cp)); |
3823 DCHECK(ToRegister(instr->constructor()).is(a1)); | 3804 DCHECK(ToRegister(instr->constructor()).is(a1)); |
3824 DCHECK(ToRegister(instr->result()).is(v0)); | 3805 DCHECK(ToRegister(instr->result()).is(v0)); |
3825 | 3806 |
3826 __ li(a0, Operand(instr->arity())); | 3807 __ li(a0, Operand(instr->arity())); |
3827 if (instr->arity() == 1) { | 3808 if (instr->arity() == 1) { |
3828 // We only need the allocation site for the case we have a length argument. | 3809 // We only need the allocation site for the case we have a length argument. |
3829 // The case may bail out to the runtime, which will determine the correct | 3810 // The case may bail out to the runtime, which will determine the correct |
3830 // elements kind with the site. | 3811 // elements kind with the site. |
(...skipping 1880 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5711 void LCodeGen::DoStoreFrameContext(LStoreFrameContext* instr) { | 5692 void LCodeGen::DoStoreFrameContext(LStoreFrameContext* instr) { |
5712 Register context = ToRegister(instr->context()); | 5693 Register context = ToRegister(instr->context()); |
5713 __ sd(context, MemOperand(fp, StandardFrameConstants::kContextOffset)); | 5694 __ sd(context, MemOperand(fp, StandardFrameConstants::kContextOffset)); |
5714 } | 5695 } |
5715 | 5696 |
5716 | 5697 |
5717 #undef __ | 5698 #undef __ |
5718 | 5699 |
5719 } // namespace internal | 5700 } // namespace internal |
5720 } // namespace v8 | 5701 } // namespace v8 |
OLD | NEW |