| OLD | NEW |
| 1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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 #if V8_TARGET_ARCH_X64 | 5 #if V8_TARGET_ARCH_X64 |
| 6 | 6 |
| 7 #include "src/crankshaft/x64/lithium-codegen-x64.h" | 7 #include "src/crankshaft/x64/lithium-codegen-x64.h" |
| 8 | 8 |
| 9 #include "src/base/bits.h" | 9 #include "src/base/bits.h" |
| 10 #include "src/code-factory.h" | 10 #include "src/code-factory.h" |
| (...skipping 3875 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3886 } | 3886 } |
| 3887 | 3887 |
| 3888 ElementsKind kind = instr->hydrogen()->elements_kind(); | 3888 ElementsKind kind = instr->hydrogen()->elements_kind(); |
| 3889 AllocationSiteOverrideMode override_mode = | 3889 AllocationSiteOverrideMode override_mode = |
| 3890 (AllocationSite::GetMode(kind) == TRACK_ALLOCATION_SITE) | 3890 (AllocationSite::GetMode(kind) == TRACK_ALLOCATION_SITE) |
| 3891 ? DISABLE_ALLOCATION_SITES | 3891 ? DISABLE_ALLOCATION_SITES |
| 3892 : DONT_OVERRIDE; | 3892 : DONT_OVERRIDE; |
| 3893 | 3893 |
| 3894 if (instr->arity() == 0) { | 3894 if (instr->arity() == 0) { |
| 3895 ArrayNoArgumentConstructorStub stub(isolate(), kind, override_mode); | 3895 ArrayNoArgumentConstructorStub stub(isolate(), kind, override_mode); |
| 3896 CallCode(stub.GetCode(), RelocInfo::CONSTRUCT_CALL, instr); | 3896 CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr); |
| 3897 } else if (instr->arity() == 1) { | 3897 } else if (instr->arity() == 1) { |
| 3898 Label done; | 3898 Label done; |
| 3899 if (IsFastPackedElementsKind(kind)) { | 3899 if (IsFastPackedElementsKind(kind)) { |
| 3900 Label packed_case; | 3900 Label packed_case; |
| 3901 // We might need a change here | 3901 // We might need a change here |
| 3902 // look at the first argument | 3902 // look at the first argument |
| 3903 __ movp(rcx, Operand(rsp, 0)); | 3903 __ movp(rcx, Operand(rsp, 0)); |
| 3904 __ testp(rcx, rcx); | 3904 __ testp(rcx, rcx); |
| 3905 __ j(zero, &packed_case, Label::kNear); | 3905 __ j(zero, &packed_case, Label::kNear); |
| 3906 | 3906 |
| 3907 ElementsKind holey_kind = GetHoleyElementsKind(kind); | 3907 ElementsKind holey_kind = GetHoleyElementsKind(kind); |
| 3908 ArraySingleArgumentConstructorStub stub(isolate(), | 3908 ArraySingleArgumentConstructorStub stub(isolate(), |
| 3909 holey_kind, | 3909 holey_kind, |
| 3910 override_mode); | 3910 override_mode); |
| 3911 CallCode(stub.GetCode(), RelocInfo::CONSTRUCT_CALL, instr); | 3911 CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr); |
| 3912 __ jmp(&done, Label::kNear); | 3912 __ jmp(&done, Label::kNear); |
| 3913 __ bind(&packed_case); | 3913 __ bind(&packed_case); |
| 3914 } | 3914 } |
| 3915 | 3915 |
| 3916 ArraySingleArgumentConstructorStub stub(isolate(), kind, override_mode); | 3916 ArraySingleArgumentConstructorStub stub(isolate(), kind, override_mode); |
| 3917 CallCode(stub.GetCode(), RelocInfo::CONSTRUCT_CALL, instr); | 3917 CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr); |
| 3918 __ bind(&done); | 3918 __ bind(&done); |
| 3919 } else { | 3919 } else { |
| 3920 ArrayNArgumentsConstructorStub stub(isolate(), kind, override_mode); | 3920 ArrayNArgumentsConstructorStub stub(isolate(), kind, override_mode); |
| 3921 CallCode(stub.GetCode(), RelocInfo::CONSTRUCT_CALL, instr); | 3921 CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr); |
| 3922 } | 3922 } |
| 3923 } | 3923 } |
| 3924 | 3924 |
| 3925 | 3925 |
| 3926 void LCodeGen::DoCallRuntime(LCallRuntime* instr) { | 3926 void LCodeGen::DoCallRuntime(LCallRuntime* instr) { |
| 3927 DCHECK(ToRegister(instr->context()).is(rsi)); | 3927 DCHECK(ToRegister(instr->context()).is(rsi)); |
| 3928 CallRuntime(instr->function(), instr->arity(), instr, instr->save_doubles()); | 3928 CallRuntime(instr->function(), instr->arity(), instr, instr->save_doubles()); |
| 3929 } | 3929 } |
| 3930 | 3930 |
| 3931 | 3931 |
| (...skipping 1856 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5788 RecordSafepoint(Safepoint::kNoLazyDeopt); | 5788 RecordSafepoint(Safepoint::kNoLazyDeopt); |
| 5789 } | 5789 } |
| 5790 | 5790 |
| 5791 | 5791 |
| 5792 #undef __ | 5792 #undef __ |
| 5793 | 5793 |
| 5794 } // namespace internal | 5794 } // namespace internal |
| 5795 } // namespace v8 | 5795 } // namespace v8 |
| 5796 | 5796 |
| 5797 #endif // V8_TARGET_ARCH_X64 | 5797 #endif // V8_TARGET_ARCH_X64 |
| OLD | NEW |