Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(281)

Side by Side Diff: src/crankshaft/x64/lithium-codegen-x64.cc

Issue 1436493002: [builtins] Introduce specialized Call/CallFunction builtins. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 3825 matching lines...) Expand 10 before | Expand all | Expand 10 after
3836 } 3836 }
3837 } 3837 }
3838 3838
3839 3839
3840 void LCodeGen::DoCallFunction(LCallFunction* instr) { 3840 void LCodeGen::DoCallFunction(LCallFunction* instr) {
3841 DCHECK(ToRegister(instr->context()).is(rsi)); 3841 DCHECK(ToRegister(instr->context()).is(rsi));
3842 DCHECK(ToRegister(instr->function()).is(rdi)); 3842 DCHECK(ToRegister(instr->function()).is(rdi));
3843 DCHECK(ToRegister(instr->result()).is(rax)); 3843 DCHECK(ToRegister(instr->result()).is(rax));
3844 3844
3845 int arity = instr->arity(); 3845 int arity = instr->arity();
3846 ConvertReceiverMode mode = instr->hydrogen()->convert_mode();
3846 if (instr->hydrogen()->HasVectorAndSlot()) { 3847 if (instr->hydrogen()->HasVectorAndSlot()) {
3847 Register slot_register = ToRegister(instr->temp_slot()); 3848 Register slot_register = ToRegister(instr->temp_slot());
3848 Register vector_register = ToRegister(instr->temp_vector()); 3849 Register vector_register = ToRegister(instr->temp_vector());
3849 DCHECK(slot_register.is(rdx)); 3850 DCHECK(slot_register.is(rdx));
3850 DCHECK(vector_register.is(rbx)); 3851 DCHECK(vector_register.is(rbx));
3851 3852
3852 AllowDeferredHandleDereference vector_structure_check; 3853 AllowDeferredHandleDereference vector_structure_check;
3853 Handle<TypeFeedbackVector> vector = instr->hydrogen()->feedback_vector(); 3854 Handle<TypeFeedbackVector> vector = instr->hydrogen()->feedback_vector();
3854 int index = vector->GetIndex(instr->hydrogen()->slot()); 3855 int index = vector->GetIndex(instr->hydrogen()->slot());
3855 3856
3856 __ Move(vector_register, vector); 3857 __ Move(vector_register, vector);
3857 __ Move(slot_register, Smi::FromInt(index)); 3858 __ Move(slot_register, Smi::FromInt(index));
3858 3859
3859 Handle<Code> ic = 3860 Handle<Code> ic =
3860 CodeFactory::CallICInOptimizedCode(isolate(), arity).code(); 3861 CodeFactory::CallICInOptimizedCode(isolate(), arity, mode).code();
3861 CallCode(ic, RelocInfo::CODE_TARGET, instr); 3862 CallCode(ic, RelocInfo::CODE_TARGET, instr);
3862 } else { 3863 } else {
3863 __ Set(rax, arity); 3864 __ Set(rax, arity);
3864 CallCode(isolate()->builtins()->Call(), RelocInfo::CODE_TARGET, instr); 3865 CallCode(isolate()->builtins()->Call(mode), RelocInfo::CODE_TARGET, instr);
3865 } 3866 }
3866 } 3867 }
3867 3868
3868 3869
3869 void LCodeGen::DoCallNew(LCallNew* instr) { 3870 void LCodeGen::DoCallNew(LCallNew* instr) {
3870 DCHECK(ToRegister(instr->context()).is(rsi)); 3871 DCHECK(ToRegister(instr->context()).is(rsi));
3871 DCHECK(ToRegister(instr->constructor()).is(rdi)); 3872 DCHECK(ToRegister(instr->constructor()).is(rdi));
3872 DCHECK(ToRegister(instr->result()).is(rax)); 3873 DCHECK(ToRegister(instr->result()).is(rax));
3873 3874
3874 __ Set(rax, instr->arity()); 3875 __ Set(rax, instr->arity());
(...skipping 1972 matching lines...) Expand 10 before | Expand all | Expand 10 after
5847 RecordSafepoint(Safepoint::kNoLazyDeopt); 5848 RecordSafepoint(Safepoint::kNoLazyDeopt);
5848 } 5849 }
5849 5850
5850 5851
5851 #undef __ 5852 #undef __
5852 5853
5853 } // namespace internal 5854 } // namespace internal
5854 } // namespace v8 5855 } // namespace v8
5855 5856
5856 #endif // V8_TARGET_ARCH_X64 5857 #endif // V8_TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « src/crankshaft/mips64/lithium-codegen-mips64.cc ('k') | src/full-codegen/arm/full-codegen-arm.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698