OLD | NEW |
1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 the V8 project authors. All rights reserved. |
2 // | 2 // |
3 // Use of this source code is governed by a BSD-style license that can be | 3 // Use of this source code is governed by a BSD-style license that can be |
4 // found in the LICENSE file. | 4 // found in the LICENSE file. |
5 | 5 |
6 #include "src/crankshaft/s390/lithium-codegen-s390.h" | 6 #include "src/crankshaft/s390/lithium-codegen-s390.h" |
7 | 7 |
8 #include "src/base/bits.h" | 8 #include "src/base/bits.h" |
9 #include "src/code-factory.h" | 9 #include "src/code-factory.h" |
10 #include "src/code-stubs.h" | 10 #include "src/code-stubs.h" |
(...skipping 3800 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3811 generator.AfterCall(); | 3811 generator.AfterCall(); |
3812 } | 3812 } |
3813 } | 3813 } |
3814 | 3814 |
3815 void LCodeGen::DoCallNewArray(LCallNewArray* instr) { | 3815 void LCodeGen::DoCallNewArray(LCallNewArray* instr) { |
3816 DCHECK(ToRegister(instr->context()).is(cp)); | 3816 DCHECK(ToRegister(instr->context()).is(cp)); |
3817 DCHECK(ToRegister(instr->constructor()).is(r3)); | 3817 DCHECK(ToRegister(instr->constructor()).is(r3)); |
3818 DCHECK(ToRegister(instr->result()).is(r2)); | 3818 DCHECK(ToRegister(instr->result()).is(r2)); |
3819 | 3819 |
3820 __ mov(r2, Operand(instr->arity())); | 3820 __ mov(r2, Operand(instr->arity())); |
3821 if (instr->arity() == 1) { | 3821 __ Move(r4, instr->hydrogen()->site()); |
3822 // We only need the allocation site for the case we have a length argument. | 3822 |
3823 // The case may bail out to the runtime, which will determine the correct | |
3824 // elements kind with the site. | |
3825 __ Move(r4, instr->hydrogen()->site()); | |
3826 } else { | |
3827 __ LoadRoot(r4, Heap::kUndefinedValueRootIndex); | |
3828 } | |
3829 ElementsKind kind = instr->hydrogen()->elements_kind(); | 3823 ElementsKind kind = instr->hydrogen()->elements_kind(); |
3830 AllocationSiteOverrideMode override_mode = | 3824 AllocationSiteOverrideMode override_mode = |
3831 (AllocationSite::GetMode(kind) == TRACK_ALLOCATION_SITE) | 3825 (AllocationSite::GetMode(kind) == TRACK_ALLOCATION_SITE) |
3832 ? DISABLE_ALLOCATION_SITES | 3826 ? DISABLE_ALLOCATION_SITES |
3833 : DONT_OVERRIDE; | 3827 : DONT_OVERRIDE; |
3834 | 3828 |
3835 if (instr->arity() == 0) { | 3829 if (instr->arity() == 0) { |
3836 ArrayNoArgumentConstructorStub stub(isolate(), kind, override_mode); | 3830 ArrayNoArgumentConstructorStub stub(isolate(), kind, override_mode); |
3837 CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr); | 3831 CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr); |
3838 } else if (instr->arity() == 1) { | 3832 } else if (instr->arity() == 1) { |
(...skipping 11 matching lines...) Expand all Loading... |
3850 override_mode); | 3844 override_mode); |
3851 CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr); | 3845 CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr); |
3852 __ b(&done, Label::kNear); | 3846 __ b(&done, Label::kNear); |
3853 __ bind(&packed_case); | 3847 __ bind(&packed_case); |
3854 } | 3848 } |
3855 | 3849 |
3856 ArraySingleArgumentConstructorStub stub(isolate(), kind, override_mode); | 3850 ArraySingleArgumentConstructorStub stub(isolate(), kind, override_mode); |
3857 CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr); | 3851 CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr); |
3858 __ bind(&done); | 3852 __ bind(&done); |
3859 } else { | 3853 } else { |
3860 ArrayNArgumentsConstructorStub stub(isolate(), kind, override_mode); | 3854 ArrayNArgumentsConstructorStub stub(isolate()); |
3861 CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr); | 3855 CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr); |
3862 } | 3856 } |
3863 } | 3857 } |
3864 | 3858 |
3865 void LCodeGen::DoCallRuntime(LCallRuntime* instr) { | 3859 void LCodeGen::DoCallRuntime(LCallRuntime* instr) { |
3866 CallRuntime(instr->function(), instr->arity(), instr); | 3860 CallRuntime(instr->function(), instr->arity(), instr); |
3867 } | 3861 } |
3868 | 3862 |
3869 void LCodeGen::DoStoreCodeEntry(LStoreCodeEntry* instr) { | 3863 void LCodeGen::DoStoreCodeEntry(LStoreCodeEntry* instr) { |
3870 Register function = ToRegister(instr->function()); | 3864 Register function = ToRegister(instr->function()); |
(...skipping 1830 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5701 __ LoadP(result, | 5695 __ LoadP(result, |
5702 FieldMemOperand(scratch, FixedArray::kHeaderSize - kPointerSize)); | 5696 FieldMemOperand(scratch, FixedArray::kHeaderSize - kPointerSize)); |
5703 __ bind(deferred->exit()); | 5697 __ bind(deferred->exit()); |
5704 __ bind(&done); | 5698 __ bind(&done); |
5705 } | 5699 } |
5706 | 5700 |
5707 #undef __ | 5701 #undef __ |
5708 | 5702 |
5709 } // namespace internal | 5703 } // namespace internal |
5710 } // namespace v8 | 5704 } // namespace v8 |
OLD | NEW |