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

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

Issue 1407373007: Remove CallFunctionStub, always call through the Call builtin (also from CallIC) (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
« no previous file with comments | « src/crankshaft/hydrogen-instructions.h ('k') | src/crankshaft/mips/lithium-codegen-mips.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 #if V8_TARGET_ARCH_IA32 5 #if V8_TARGET_ARCH_IA32
6 6
7 #include "src/crankshaft/ia32/lithium-codegen-ia32.h" 7 #include "src/crankshaft/ia32/lithium-codegen-ia32.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 3756 matching lines...) Expand 10 before | Expand all | Expand 10 after
3767 } 3767 }
3768 } 3768 }
3769 3769
3770 3770
3771 void LCodeGen::DoCallFunction(LCallFunction* instr) { 3771 void LCodeGen::DoCallFunction(LCallFunction* instr) {
3772 DCHECK(ToRegister(instr->context()).is(esi)); 3772 DCHECK(ToRegister(instr->context()).is(esi));
3773 DCHECK(ToRegister(instr->function()).is(edi)); 3773 DCHECK(ToRegister(instr->function()).is(edi));
3774 DCHECK(ToRegister(instr->result()).is(eax)); 3774 DCHECK(ToRegister(instr->result()).is(eax));
3775 3775
3776 int arity = instr->arity(); 3776 int arity = instr->arity();
3777 CallFunctionFlags flags = instr->hydrogen()->function_flags();
3778 if (instr->hydrogen()->HasVectorAndSlot()) { 3777 if (instr->hydrogen()->HasVectorAndSlot()) {
3779 Register slot_register = ToRegister(instr->temp_slot()); 3778 Register slot_register = ToRegister(instr->temp_slot());
3780 Register vector_register = ToRegister(instr->temp_vector()); 3779 Register vector_register = ToRegister(instr->temp_vector());
3781 DCHECK(slot_register.is(edx)); 3780 DCHECK(slot_register.is(edx));
3782 DCHECK(vector_register.is(ebx)); 3781 DCHECK(vector_register.is(ebx));
3783 3782
3784 AllowDeferredHandleDereference vector_structure_check; 3783 AllowDeferredHandleDereference vector_structure_check;
3785 Handle<TypeFeedbackVector> vector = instr->hydrogen()->feedback_vector(); 3784 Handle<TypeFeedbackVector> vector = instr->hydrogen()->feedback_vector();
3786 int index = vector->GetIndex(instr->hydrogen()->slot()); 3785 int index = vector->GetIndex(instr->hydrogen()->slot());
3787 3786
3788 __ mov(vector_register, vector); 3787 __ mov(vector_register, vector);
3789 __ mov(slot_register, Immediate(Smi::FromInt(index))); 3788 __ mov(slot_register, Immediate(Smi::FromInt(index)));
3790 3789
3791 CallICState::CallType call_type =
3792 (flags & CALL_AS_METHOD) ? CallICState::METHOD : CallICState::FUNCTION;
3793
3794 Handle<Code> ic = 3790 Handle<Code> ic =
3795 CodeFactory::CallICInOptimizedCode(isolate(), arity, call_type).code(); 3791 CodeFactory::CallICInOptimizedCode(isolate(), arity).code();
3796 CallCode(ic, RelocInfo::CODE_TARGET, instr); 3792 CallCode(ic, RelocInfo::CODE_TARGET, instr);
3797 } else { 3793 } else {
3798 CallFunctionStub stub(isolate(), arity, flags); 3794 __ Set(eax, arity);
3799 CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr); 3795 CallCode(isolate()->builtins()->Call(), RelocInfo::CODE_TARGET, instr);
3800 } 3796 }
3801 } 3797 }
3802 3798
3803 3799
3804 void LCodeGen::DoCallNew(LCallNew* instr) { 3800 void LCodeGen::DoCallNew(LCallNew* instr) {
3805 DCHECK(ToRegister(instr->context()).is(esi)); 3801 DCHECK(ToRegister(instr->context()).is(esi));
3806 DCHECK(ToRegister(instr->constructor()).is(edi)); 3802 DCHECK(ToRegister(instr->constructor()).is(edi));
3807 DCHECK(ToRegister(instr->result()).is(eax)); 3803 DCHECK(ToRegister(instr->result()).is(eax));
3808 3804
3809 // No cell in ebx for construct type feedback in optimized code 3805 // No cell in ebx for construct type feedback in optimized code
(...skipping 1863 matching lines...) Expand 10 before | Expand all | Expand 10 after
5673 RecordSafepoint(Safepoint::kNoLazyDeopt); 5669 RecordSafepoint(Safepoint::kNoLazyDeopt);
5674 } 5670 }
5675 5671
5676 5672
5677 #undef __ 5673 #undef __
5678 5674
5679 } // namespace internal 5675 } // namespace internal
5680 } // namespace v8 5676 } // namespace v8
5681 5677
5682 #endif // V8_TARGET_ARCH_IA32 5678 #endif // V8_TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « src/crankshaft/hydrogen-instructions.h ('k') | src/crankshaft/mips/lithium-codegen-mips.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698