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 3843 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3854 } | 3854 } |
3855 } | 3855 } |
3856 | 3856 |
3857 | 3857 |
3858 void LCodeGen::DoCallFunction(LCallFunction* instr) { | 3858 void LCodeGen::DoCallFunction(LCallFunction* instr) { |
3859 DCHECK(ToRegister(instr->context()).is(rsi)); | 3859 DCHECK(ToRegister(instr->context()).is(rsi)); |
3860 DCHECK(ToRegister(instr->function()).is(rdi)); | 3860 DCHECK(ToRegister(instr->function()).is(rdi)); |
3861 DCHECK(ToRegister(instr->result()).is(rax)); | 3861 DCHECK(ToRegister(instr->result()).is(rax)); |
3862 | 3862 |
3863 int arity = instr->arity(); | 3863 int arity = instr->arity(); |
3864 CallFunctionFlags flags = instr->hydrogen()->function_flags(); | |
3865 if (instr->hydrogen()->HasVectorAndSlot()) { | 3864 if (instr->hydrogen()->HasVectorAndSlot()) { |
3866 Register slot_register = ToRegister(instr->temp_slot()); | 3865 Register slot_register = ToRegister(instr->temp_slot()); |
3867 Register vector_register = ToRegister(instr->temp_vector()); | 3866 Register vector_register = ToRegister(instr->temp_vector()); |
3868 DCHECK(slot_register.is(rdx)); | 3867 DCHECK(slot_register.is(rdx)); |
3869 DCHECK(vector_register.is(rbx)); | 3868 DCHECK(vector_register.is(rbx)); |
3870 | 3869 |
3871 AllowDeferredHandleDereference vector_structure_check; | 3870 AllowDeferredHandleDereference vector_structure_check; |
3872 Handle<TypeFeedbackVector> vector = instr->hydrogen()->feedback_vector(); | 3871 Handle<TypeFeedbackVector> vector = instr->hydrogen()->feedback_vector(); |
3873 int index = vector->GetIndex(instr->hydrogen()->slot()); | 3872 int index = vector->GetIndex(instr->hydrogen()->slot()); |
3874 | 3873 |
3875 __ Move(vector_register, vector); | 3874 __ Move(vector_register, vector); |
3876 __ Move(slot_register, Smi::FromInt(index)); | 3875 __ Move(slot_register, Smi::FromInt(index)); |
3877 | 3876 |
3878 CallICState::CallType call_type = | |
3879 (flags & CALL_AS_METHOD) ? CallICState::METHOD : CallICState::FUNCTION; | |
3880 | |
3881 Handle<Code> ic = | 3877 Handle<Code> ic = |
3882 CodeFactory::CallICInOptimizedCode(isolate(), arity, call_type).code(); | 3878 CodeFactory::CallICInOptimizedCode(isolate(), arity).code(); |
3883 CallCode(ic, RelocInfo::CODE_TARGET, instr); | 3879 CallCode(ic, RelocInfo::CODE_TARGET, instr); |
3884 } else { | 3880 } else { |
3885 CallFunctionStub stub(isolate(), arity, flags); | 3881 __ Set(rax, arity); |
3886 CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr); | 3882 CallCode(isolate()->builtins()->Call(), RelocInfo::CODE_TARGET, instr); |
3887 } | 3883 } |
3888 } | 3884 } |
3889 | 3885 |
3890 | 3886 |
3891 void LCodeGen::DoCallNew(LCallNew* instr) { | 3887 void LCodeGen::DoCallNew(LCallNew* instr) { |
3892 DCHECK(ToRegister(instr->context()).is(rsi)); | 3888 DCHECK(ToRegister(instr->context()).is(rsi)); |
3893 DCHECK(ToRegister(instr->constructor()).is(rdi)); | 3889 DCHECK(ToRegister(instr->constructor()).is(rdi)); |
3894 DCHECK(ToRegister(instr->result()).is(rax)); | 3890 DCHECK(ToRegister(instr->result()).is(rax)); |
3895 | 3891 |
3896 __ Set(rax, instr->arity()); | 3892 __ Set(rax, instr->arity()); |
(...skipping 1972 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5869 RecordSafepoint(Safepoint::kNoLazyDeopt); | 5865 RecordSafepoint(Safepoint::kNoLazyDeopt); |
5870 } | 5866 } |
5871 | 5867 |
5872 | 5868 |
5873 #undef __ | 5869 #undef __ |
5874 | 5870 |
5875 } // namespace internal | 5871 } // namespace internal |
5876 } // namespace v8 | 5872 } // namespace v8 |
5877 | 5873 |
5878 #endif // V8_TARGET_ARCH_X64 | 5874 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |