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 3852 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3863 Handle<Code> ic = | 3863 Handle<Code> ic = |
3864 CodeFactory::CallICInOptimizedCode(isolate(), arity, mode).code(); | 3864 CodeFactory::CallICInOptimizedCode(isolate(), arity, mode).code(); |
3865 CallCode(ic, RelocInfo::CODE_TARGET, instr); | 3865 CallCode(ic, RelocInfo::CODE_TARGET, instr); |
3866 } else { | 3866 } else { |
3867 __ Set(rax, arity); | 3867 __ Set(rax, arity); |
3868 CallCode(isolate()->builtins()->Call(mode), RelocInfo::CODE_TARGET, instr); | 3868 CallCode(isolate()->builtins()->Call(mode), RelocInfo::CODE_TARGET, instr); |
3869 } | 3869 } |
3870 } | 3870 } |
3871 | 3871 |
3872 | 3872 |
3873 void LCodeGen::DoCallNew(LCallNew* instr) { | |
3874 DCHECK(ToRegister(instr->context()).is(rsi)); | |
3875 DCHECK(ToRegister(instr->constructor()).is(rdi)); | |
3876 DCHECK(ToRegister(instr->result()).is(rax)); | |
3877 | |
3878 __ Set(rax, instr->arity()); | |
3879 // No cell in ebx for construct type feedback in optimized code | |
3880 __ LoadRoot(rbx, Heap::kUndefinedValueRootIndex); | |
3881 CallConstructStub stub(isolate(), NO_CALL_CONSTRUCTOR_FLAGS); | |
3882 CallCode(stub.GetCode(), RelocInfo::CONSTRUCT_CALL, instr); | |
3883 } | |
3884 | |
3885 | |
3886 void LCodeGen::DoCallNewArray(LCallNewArray* instr) { | 3873 void LCodeGen::DoCallNewArray(LCallNewArray* instr) { |
3887 DCHECK(ToRegister(instr->context()).is(rsi)); | 3874 DCHECK(ToRegister(instr->context()).is(rsi)); |
3888 DCHECK(ToRegister(instr->constructor()).is(rdi)); | 3875 DCHECK(ToRegister(instr->constructor()).is(rdi)); |
3889 DCHECK(ToRegister(instr->result()).is(rax)); | 3876 DCHECK(ToRegister(instr->result()).is(rax)); |
3890 | 3877 |
3891 __ Set(rax, instr->arity()); | 3878 __ Set(rax, instr->arity()); |
3892 if (instr->arity() == 1) { | 3879 if (instr->arity() == 1) { |
3893 // We only need the allocation site for the case we have a length argument. | 3880 // We only need the allocation site for the case we have a length argument. |
3894 // The case may bail out to the runtime, which will determine the correct | 3881 // The case may bail out to the runtime, which will determine the correct |
3895 // elements kind with the site. | 3882 // elements kind with the site. |
(...skipping 1956 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5852 RecordSafepoint(Safepoint::kNoLazyDeopt); | 5839 RecordSafepoint(Safepoint::kNoLazyDeopt); |
5853 } | 5840 } |
5854 | 5841 |
5855 | 5842 |
5856 #undef __ | 5843 #undef __ |
5857 | 5844 |
5858 } // namespace internal | 5845 } // namespace internal |
5859 } // namespace v8 | 5846 } // namespace v8 |
5860 | 5847 |
5861 #endif // V8_TARGET_ARCH_X64 | 5848 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |