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 3847 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3858 __ LoadRoot(r2, Heap::kUndefinedValueRootIndex); | 3858 __ LoadRoot(r2, Heap::kUndefinedValueRootIndex); |
3859 } | 3859 } |
3860 ElementsKind kind = instr->hydrogen()->elements_kind(); | 3860 ElementsKind kind = instr->hydrogen()->elements_kind(); |
3861 AllocationSiteOverrideMode override_mode = | 3861 AllocationSiteOverrideMode override_mode = |
3862 (AllocationSite::GetMode(kind) == TRACK_ALLOCATION_SITE) | 3862 (AllocationSite::GetMode(kind) == TRACK_ALLOCATION_SITE) |
3863 ? DISABLE_ALLOCATION_SITES | 3863 ? DISABLE_ALLOCATION_SITES |
3864 : DONT_OVERRIDE; | 3864 : DONT_OVERRIDE; |
3865 | 3865 |
3866 if (instr->arity() == 0) { | 3866 if (instr->arity() == 0) { |
3867 ArrayNoArgumentConstructorStub stub(isolate(), kind, override_mode); | 3867 ArrayNoArgumentConstructorStub stub(isolate(), kind, override_mode); |
3868 CallCode(stub.GetCode(), RelocInfo::CONSTRUCT_CALL, instr); | 3868 CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr); |
3869 } else if (instr->arity() == 1) { | 3869 } else if (instr->arity() == 1) { |
3870 Label done; | 3870 Label done; |
3871 if (IsFastPackedElementsKind(kind)) { | 3871 if (IsFastPackedElementsKind(kind)) { |
3872 Label packed_case; | 3872 Label packed_case; |
3873 // We might need a change here | 3873 // We might need a change here |
3874 // look at the first argument | 3874 // look at the first argument |
3875 __ ldr(r5, MemOperand(sp, 0)); | 3875 __ ldr(r5, MemOperand(sp, 0)); |
3876 __ cmp(r5, Operand::Zero()); | 3876 __ cmp(r5, Operand::Zero()); |
3877 __ b(eq, &packed_case); | 3877 __ b(eq, &packed_case); |
3878 | 3878 |
3879 ElementsKind holey_kind = GetHoleyElementsKind(kind); | 3879 ElementsKind holey_kind = GetHoleyElementsKind(kind); |
3880 ArraySingleArgumentConstructorStub stub(isolate(), | 3880 ArraySingleArgumentConstructorStub stub(isolate(), |
3881 holey_kind, | 3881 holey_kind, |
3882 override_mode); | 3882 override_mode); |
3883 CallCode(stub.GetCode(), RelocInfo::CONSTRUCT_CALL, instr); | 3883 CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr); |
3884 __ jmp(&done); | 3884 __ jmp(&done); |
3885 __ bind(&packed_case); | 3885 __ bind(&packed_case); |
3886 } | 3886 } |
3887 | 3887 |
3888 ArraySingleArgumentConstructorStub stub(isolate(), kind, override_mode); | 3888 ArraySingleArgumentConstructorStub stub(isolate(), kind, override_mode); |
3889 CallCode(stub.GetCode(), RelocInfo::CONSTRUCT_CALL, instr); | 3889 CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr); |
3890 __ bind(&done); | 3890 __ bind(&done); |
3891 } else { | 3891 } else { |
3892 ArrayNArgumentsConstructorStub stub(isolate(), kind, override_mode); | 3892 ArrayNArgumentsConstructorStub stub(isolate(), kind, override_mode); |
3893 CallCode(stub.GetCode(), RelocInfo::CONSTRUCT_CALL, instr); | 3893 CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr); |
3894 } | 3894 } |
3895 } | 3895 } |
3896 | 3896 |
3897 | 3897 |
3898 void LCodeGen::DoCallRuntime(LCallRuntime* instr) { | 3898 void LCodeGen::DoCallRuntime(LCallRuntime* instr) { |
3899 CallRuntime(instr->function(), instr->arity(), instr); | 3899 CallRuntime(instr->function(), instr->arity(), instr); |
3900 } | 3900 } |
3901 | 3901 |
3902 | 3902 |
3903 void LCodeGen::DoStoreCodeEntry(LStoreCodeEntry* instr) { | 3903 void LCodeGen::DoStoreCodeEntry(LStoreCodeEntry* instr) { |
(...skipping 1814 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5718 __ push(ToRegister(instr->function())); | 5718 __ push(ToRegister(instr->function())); |
5719 CallRuntime(Runtime::kPushBlockContext, 2, instr); | 5719 CallRuntime(Runtime::kPushBlockContext, 2, instr); |
5720 RecordSafepoint(Safepoint::kNoLazyDeopt); | 5720 RecordSafepoint(Safepoint::kNoLazyDeopt); |
5721 } | 5721 } |
5722 | 5722 |
5723 | 5723 |
5724 #undef __ | 5724 #undef __ |
5725 | 5725 |
5726 } // namespace internal | 5726 } // namespace internal |
5727 } // namespace v8 | 5727 } // namespace v8 |
OLD | NEW |