OLD | NEW |
1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 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/ppc/lithium-codegen-ppc.h" | 5 #include "src/crankshaft/ppc/lithium-codegen-ppc.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/hydrogen-osr.h" | 10 #include "src/crankshaft/hydrogen-osr.h" |
(...skipping 3805 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3816 Register target = ToRegister(instr->target()); | 3816 Register target = ToRegister(instr->target()); |
3817 generator.BeforeCall(__ CallSize(target)); | 3817 generator.BeforeCall(__ CallSize(target)); |
3818 __ addi(ip, target, Operand(Code::kHeaderSize - kHeapObjectTag)); | 3818 __ addi(ip, target, Operand(Code::kHeaderSize - kHeapObjectTag)); |
3819 __ CallJSEntry(ip); | 3819 __ CallJSEntry(ip); |
3820 } | 3820 } |
3821 generator.AfterCall(); | 3821 generator.AfterCall(); |
3822 } | 3822 } |
3823 } | 3823 } |
3824 | 3824 |
3825 | 3825 |
3826 void LCodeGen::DoCallJSFunction(LCallJSFunction* instr) { | |
3827 DCHECK(ToRegister(instr->function()).is(r4)); | |
3828 DCHECK(ToRegister(instr->result()).is(r3)); | |
3829 | |
3830 // Change context. | |
3831 __ LoadP(cp, FieldMemOperand(r4, JSFunction::kContextOffset)); | |
3832 | |
3833 // Always initialize new target and number of actual arguments. | |
3834 __ LoadRoot(r6, Heap::kUndefinedValueRootIndex); | |
3835 __ mov(r3, Operand(instr->arity())); | |
3836 | |
3837 bool is_self_call = false; | |
3838 if (instr->hydrogen()->function()->IsConstant()) { | |
3839 HConstant* fun_const = HConstant::cast(instr->hydrogen()->function()); | |
3840 Handle<JSFunction> jsfun = | |
3841 Handle<JSFunction>::cast(fun_const->handle(isolate())); | |
3842 is_self_call = jsfun.is_identical_to(info()->closure()); | |
3843 } | |
3844 | |
3845 if (is_self_call) { | |
3846 __ CallSelf(); | |
3847 } else { | |
3848 __ LoadP(ip, FieldMemOperand(r4, JSFunction::kCodeEntryOffset)); | |
3849 __ CallJSEntry(ip); | |
3850 } | |
3851 | |
3852 RecordSafepointWithLazyDeopt(instr, RECORD_SIMPLE_SAFEPOINT); | |
3853 } | |
3854 | |
3855 | |
3856 void LCodeGen::DoCallNewArray(LCallNewArray* instr) { | 3826 void LCodeGen::DoCallNewArray(LCallNewArray* instr) { |
3857 DCHECK(ToRegister(instr->context()).is(cp)); | 3827 DCHECK(ToRegister(instr->context()).is(cp)); |
3858 DCHECK(ToRegister(instr->constructor()).is(r4)); | 3828 DCHECK(ToRegister(instr->constructor()).is(r4)); |
3859 DCHECK(ToRegister(instr->result()).is(r3)); | 3829 DCHECK(ToRegister(instr->result()).is(r3)); |
3860 | 3830 |
3861 __ mov(r3, Operand(instr->arity())); | 3831 __ mov(r3, Operand(instr->arity())); |
3862 if (instr->arity() == 1) { | 3832 if (instr->arity() == 1) { |
3863 // We only need the allocation site for the case we have a length argument. | 3833 // We only need the allocation site for the case we have a length argument. |
3864 // The case may bail out to the runtime, which will determine the correct | 3834 // The case may bail out to the runtime, which will determine the correct |
3865 // elements kind with the site. | 3835 // elements kind with the site. |
(...skipping 1848 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5714 | 5684 |
5715 void LCodeGen::DoStoreFrameContext(LStoreFrameContext* instr) { | 5685 void LCodeGen::DoStoreFrameContext(LStoreFrameContext* instr) { |
5716 Register context = ToRegister(instr->context()); | 5686 Register context = ToRegister(instr->context()); |
5717 __ StoreP(context, MemOperand(fp, StandardFrameConstants::kContextOffset)); | 5687 __ StoreP(context, MemOperand(fp, StandardFrameConstants::kContextOffset)); |
5718 } | 5688 } |
5719 | 5689 |
5720 | 5690 |
5721 #undef __ | 5691 #undef __ |
5722 } // namespace internal | 5692 } // namespace internal |
5723 } // namespace v8 | 5693 } // namespace v8 |
OLD | NEW |