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

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

Issue 500073002: Eliminate code duplication in lithium calls to vector-based LoadICs (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 3 months 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 | Annotate | Revision Log
« no previous file with comments | « src/x64/lithium-codegen-x64.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 #include "src/v8.h" 5 #include "src/v8.h"
6 6
7 #if V8_TARGET_ARCH_X64 7 #if V8_TARGET_ARCH_X64
8 8
9 #include "src/code-stubs.h" 9 #include "src/code-stubs.h"
10 #include "src/hydrogen-osr.h" 10 #include "src/hydrogen-osr.h"
(...skipping 2828 matching lines...) Expand 10 before | Expand all | Expand 10 after
2839 void LCodeGen::DoLoadGlobalCell(LLoadGlobalCell* instr) { 2839 void LCodeGen::DoLoadGlobalCell(LLoadGlobalCell* instr) {
2840 Register result = ToRegister(instr->result()); 2840 Register result = ToRegister(instr->result());
2841 __ LoadGlobalCell(result, instr->hydrogen()->cell().handle()); 2841 __ LoadGlobalCell(result, instr->hydrogen()->cell().handle());
2842 if (instr->hydrogen()->RequiresHoleCheck()) { 2842 if (instr->hydrogen()->RequiresHoleCheck()) {
2843 __ CompareRoot(result, Heap::kTheHoleValueRootIndex); 2843 __ CompareRoot(result, Heap::kTheHoleValueRootIndex);
2844 DeoptimizeIf(equal, instr->environment()); 2844 DeoptimizeIf(equal, instr->environment());
2845 } 2845 }
2846 } 2846 }
2847 2847
2848 2848
2849 template <class T>
2850 void LCodeGen::EmitVectorLoadICRegisters(T* instr) {
2851 DCHECK(FLAG_vector_ics);
2852 Register vector = ToRegister(instr->temp_vector());
2853 DCHECK(vector.is(LoadIC::VectorRegister()));
2854 __ Move(vector, instr->hydrogen()->feedback_vector());
2855 // No need to allocate this register.
2856 DCHECK(LoadIC::SlotRegister().is(rax));
2857 __ Move(LoadIC::SlotRegister(), Smi::FromInt(instr->hydrogen()->slot()));
2858 }
2859
2860
2849 void LCodeGen::DoLoadGlobalGeneric(LLoadGlobalGeneric* instr) { 2861 void LCodeGen::DoLoadGlobalGeneric(LLoadGlobalGeneric* instr) {
2850 DCHECK(ToRegister(instr->context()).is(rsi)); 2862 DCHECK(ToRegister(instr->context()).is(rsi));
2851 DCHECK(ToRegister(instr->global_object()).is(LoadIC::ReceiverRegister())); 2863 DCHECK(ToRegister(instr->global_object()).is(LoadIC::ReceiverRegister()));
2852 DCHECK(ToRegister(instr->result()).is(rax)); 2864 DCHECK(ToRegister(instr->result()).is(rax));
2853 2865
2854 __ Move(LoadIC::NameRegister(), instr->name()); 2866 __ Move(LoadIC::NameRegister(), instr->name());
2855 if (FLAG_vector_ics) { 2867 if (FLAG_vector_ics) {
2856 Register vector = ToRegister(instr->temp_vector()); 2868 EmitVectorLoadICRegisters<LLoadGlobalGeneric>(instr);
2857 DCHECK(vector.is(LoadIC::VectorRegister()));
2858 __ Move(vector, instr->hydrogen()->feedback_vector());
2859 // No need to allocate this register.
2860 DCHECK(LoadIC::SlotRegister().is(rax));
2861 __ Move(LoadIC::SlotRegister(), Smi::FromInt(instr->hydrogen()->slot()));
2862 } 2869 }
2863 ContextualMode mode = instr->for_typeof() ? NOT_CONTEXTUAL : CONTEXTUAL; 2870 ContextualMode mode = instr->for_typeof() ? NOT_CONTEXTUAL : CONTEXTUAL;
2864 Handle<Code> ic = LoadIC::initialize_stub(isolate(), mode); 2871 Handle<Code> ic = LoadIC::initialize_stub(isolate(), mode);
2865 CallCode(ic, RelocInfo::CODE_TARGET, instr); 2872 CallCode(ic, RelocInfo::CODE_TARGET, instr);
2866 } 2873 }
2867 2874
2868 2875
2869 void LCodeGen::DoStoreGlobalCell(LStoreGlobalCell* instr) { 2876 void LCodeGen::DoStoreGlobalCell(LStoreGlobalCell* instr) {
2870 Register value = ToRegister(instr->value()); 2877 Register value = ToRegister(instr->value());
2871 Handle<Cell> cell_handle = instr->hydrogen()->cell().handle(); 2878 Handle<Cell> cell_handle = instr->hydrogen()->cell().handle();
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after
2994 } 3001 }
2995 3002
2996 3003
2997 void LCodeGen::DoLoadNamedGeneric(LLoadNamedGeneric* instr) { 3004 void LCodeGen::DoLoadNamedGeneric(LLoadNamedGeneric* instr) {
2998 DCHECK(ToRegister(instr->context()).is(rsi)); 3005 DCHECK(ToRegister(instr->context()).is(rsi));
2999 DCHECK(ToRegister(instr->object()).is(LoadIC::ReceiverRegister())); 3006 DCHECK(ToRegister(instr->object()).is(LoadIC::ReceiverRegister()));
3000 DCHECK(ToRegister(instr->result()).is(rax)); 3007 DCHECK(ToRegister(instr->result()).is(rax));
3001 3008
3002 __ Move(LoadIC::NameRegister(), instr->name()); 3009 __ Move(LoadIC::NameRegister(), instr->name());
3003 if (FLAG_vector_ics) { 3010 if (FLAG_vector_ics) {
3004 Register vector = ToRegister(instr->temp_vector()); 3011 EmitVectorLoadICRegisters<LLoadNamedGeneric>(instr);
3005 DCHECK(vector.is(LoadIC::VectorRegister()));
3006 __ Move(vector, instr->hydrogen()->feedback_vector());
3007 // No need to allocate this register.
3008 DCHECK(LoadIC::SlotRegister().is(rax));
3009 __ Move(LoadIC::SlotRegister(), Smi::FromInt(instr->hydrogen()->slot()));
3010 } 3012 }
3011 Handle<Code> ic = LoadIC::initialize_stub(isolate(), NOT_CONTEXTUAL); 3013 Handle<Code> ic = LoadIC::initialize_stub(isolate(), NOT_CONTEXTUAL);
3012 CallCode(ic, RelocInfo::CODE_TARGET, instr); 3014 CallCode(ic, RelocInfo::CODE_TARGET, instr);
3013 } 3015 }
3014 3016
3015 3017
3016 void LCodeGen::DoLoadFunctionPrototype(LLoadFunctionPrototype* instr) { 3018 void LCodeGen::DoLoadFunctionPrototype(LLoadFunctionPrototype* instr) {
3017 Register function = ToRegister(instr->function()); 3019 Register function = ToRegister(instr->function());
3018 Register result = ToRegister(instr->result()); 3020 Register result = ToRegister(instr->result());
3019 3021
(...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after
3282 } 3284 }
3283 } 3285 }
3284 3286
3285 3287
3286 void LCodeGen::DoLoadKeyedGeneric(LLoadKeyedGeneric* instr) { 3288 void LCodeGen::DoLoadKeyedGeneric(LLoadKeyedGeneric* instr) {
3287 DCHECK(ToRegister(instr->context()).is(rsi)); 3289 DCHECK(ToRegister(instr->context()).is(rsi));
3288 DCHECK(ToRegister(instr->object()).is(LoadIC::ReceiverRegister())); 3290 DCHECK(ToRegister(instr->object()).is(LoadIC::ReceiverRegister()));
3289 DCHECK(ToRegister(instr->key()).is(LoadIC::NameRegister())); 3291 DCHECK(ToRegister(instr->key()).is(LoadIC::NameRegister()));
3290 3292
3291 if (FLAG_vector_ics) { 3293 if (FLAG_vector_ics) {
3292 Register vector = ToRegister(instr->temp_vector()); 3294 EmitVectorLoadICRegisters<LLoadKeyedGeneric>(instr);
3293 DCHECK(vector.is(LoadIC::VectorRegister()));
3294 __ Move(vector, instr->hydrogen()->feedback_vector());
3295 // No need to allocate this register.
3296 DCHECK(LoadIC::SlotRegister().is(rax));
3297 __ Move(LoadIC::SlotRegister(), Smi::FromInt(instr->hydrogen()->slot()));
3298 } 3295 }
3299 3296
3300 Handle<Code> ic = isolate()->builtins()->KeyedLoadIC_Initialize(); 3297 Handle<Code> ic = isolate()->builtins()->KeyedLoadIC_Initialize();
3301 CallCode(ic, RelocInfo::CODE_TARGET, instr); 3298 CallCode(ic, RelocInfo::CODE_TARGET, instr);
3302 } 3299 }
3303 3300
3304 3301
3305 void LCodeGen::DoArgumentsElements(LArgumentsElements* instr) { 3302 void LCodeGen::DoArgumentsElements(LArgumentsElements* instr) {
3306 Register result = ToRegister(instr->result()); 3303 Register result = ToRegister(instr->result());
3307 3304
(...skipping 2543 matching lines...) Expand 10 before | Expand all | Expand 10 after
5851 CallRuntime(Runtime::kPushBlockContext, 2, instr); 5848 CallRuntime(Runtime::kPushBlockContext, 2, instr);
5852 RecordSafepoint(Safepoint::kNoLazyDeopt); 5849 RecordSafepoint(Safepoint::kNoLazyDeopt);
5853 } 5850 }
5854 5851
5855 5852
5856 #undef __ 5853 #undef __
5857 5854
5858 } } // namespace v8::internal 5855 } } // namespace v8::internal
5859 5856
5860 #endif // V8_TARGET_ARCH_X64 5857 #endif // V8_TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « src/x64/lithium-codegen-x64.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698