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

Side by Side Diff: src/arm/lithium-codegen-arm.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, 4 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/arm/lithium-codegen-arm.h ('k') | src/arm64/lithium-codegen-arm64.h » ('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 #include "src/v8.h" 5 #include "src/v8.h"
6 6
7 #include "src/arm/lithium-codegen-arm.h" 7 #include "src/arm/lithium-codegen-arm.h"
8 #include "src/arm/lithium-gap-resolver-arm.h" 8 #include "src/arm/lithium-gap-resolver-arm.h"
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 2972 matching lines...) Expand 10 before | Expand all | Expand 10 after
2983 __ mov(ip, Operand(Handle<Object>(instr->hydrogen()->cell().handle()))); 2983 __ mov(ip, Operand(Handle<Object>(instr->hydrogen()->cell().handle())));
2984 __ ldr(result, FieldMemOperand(ip, Cell::kValueOffset)); 2984 __ ldr(result, FieldMemOperand(ip, Cell::kValueOffset));
2985 if (instr->hydrogen()->RequiresHoleCheck()) { 2985 if (instr->hydrogen()->RequiresHoleCheck()) {
2986 __ LoadRoot(ip, Heap::kTheHoleValueRootIndex); 2986 __ LoadRoot(ip, Heap::kTheHoleValueRootIndex);
2987 __ cmp(result, ip); 2987 __ cmp(result, ip);
2988 DeoptimizeIf(eq, instr->environment()); 2988 DeoptimizeIf(eq, instr->environment());
2989 } 2989 }
2990 } 2990 }
2991 2991
2992 2992
2993 template <class T>
2994 void LCodeGen::EmitVectorLoadICRegisters(T* instr) {
2995 DCHECK(FLAG_vector_ics);
2996 Register vector = ToRegister(instr->temp_vector());
2997 DCHECK(vector.is(LoadIC::VectorRegister()));
2998 __ Move(vector, instr->hydrogen()->feedback_vector());
2999 // No need to allocate this register.
3000 DCHECK(LoadIC::SlotRegister().is(r0));
3001 __ mov(LoadIC::SlotRegister(),
3002 Operand(Smi::FromInt(instr->hydrogen()->slot())));
3003 }
3004
3005
2993 void LCodeGen::DoLoadGlobalGeneric(LLoadGlobalGeneric* instr) { 3006 void LCodeGen::DoLoadGlobalGeneric(LLoadGlobalGeneric* instr) {
2994 DCHECK(ToRegister(instr->context()).is(cp)); 3007 DCHECK(ToRegister(instr->context()).is(cp));
2995 DCHECK(ToRegister(instr->global_object()).is(LoadIC::ReceiverRegister())); 3008 DCHECK(ToRegister(instr->global_object()).is(LoadIC::ReceiverRegister()));
2996 DCHECK(ToRegister(instr->result()).is(r0)); 3009 DCHECK(ToRegister(instr->result()).is(r0));
2997 3010
2998 __ mov(LoadIC::NameRegister(), Operand(instr->name())); 3011 __ mov(LoadIC::NameRegister(), Operand(instr->name()));
2999 if (FLAG_vector_ics) { 3012 if (FLAG_vector_ics) {
3000 Register vector = ToRegister(instr->temp_vector()); 3013 EmitVectorLoadICRegisters<LLoadGlobalGeneric>(instr);
3001 DCHECK(vector.is(LoadIC::VectorRegister()));
3002 __ Move(vector, instr->hydrogen()->feedback_vector());
3003 // No need to allocate this register.
3004 DCHECK(LoadIC::SlotRegister().is(r0));
3005 __ mov(LoadIC::SlotRegister(),
3006 Operand(Smi::FromInt(instr->hydrogen()->slot())));
3007 } 3014 }
3008 ContextualMode mode = instr->for_typeof() ? NOT_CONTEXTUAL : CONTEXTUAL; 3015 ContextualMode mode = instr->for_typeof() ? NOT_CONTEXTUAL : CONTEXTUAL;
3009 Handle<Code> ic = LoadIC::initialize_stub(isolate(), mode); 3016 Handle<Code> ic = LoadIC::initialize_stub(isolate(), mode);
3010 CallCode(ic, RelocInfo::CODE_TARGET, instr); 3017 CallCode(ic, RelocInfo::CODE_TARGET, instr);
3011 } 3018 }
3012 3019
3013 3020
3014 void LCodeGen::DoStoreGlobalCell(LStoreGlobalCell* instr) { 3021 void LCodeGen::DoStoreGlobalCell(LStoreGlobalCell* instr) {
3015 Register value = ToRegister(instr->value()); 3022 Register value = ToRegister(instr->value());
3016 Register cell = scratch0(); 3023 Register cell = scratch0();
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
3119 3126
3120 3127
3121 void LCodeGen::DoLoadNamedGeneric(LLoadNamedGeneric* instr) { 3128 void LCodeGen::DoLoadNamedGeneric(LLoadNamedGeneric* instr) {
3122 DCHECK(ToRegister(instr->context()).is(cp)); 3129 DCHECK(ToRegister(instr->context()).is(cp));
3123 DCHECK(ToRegister(instr->object()).is(LoadIC::ReceiverRegister())); 3130 DCHECK(ToRegister(instr->object()).is(LoadIC::ReceiverRegister()));
3124 DCHECK(ToRegister(instr->result()).is(r0)); 3131 DCHECK(ToRegister(instr->result()).is(r0));
3125 3132
3126 // Name is always in r2. 3133 // Name is always in r2.
3127 __ mov(LoadIC::NameRegister(), Operand(instr->name())); 3134 __ mov(LoadIC::NameRegister(), Operand(instr->name()));
3128 if (FLAG_vector_ics) { 3135 if (FLAG_vector_ics) {
3129 Register vector = ToRegister(instr->temp_vector()); 3136 EmitVectorLoadICRegisters<LLoadNamedGeneric>(instr);
3130 DCHECK(vector.is(LoadIC::VectorRegister()));
3131 __ Move(vector, instr->hydrogen()->feedback_vector());
3132 // No need to allocate this register.
3133 DCHECK(LoadIC::SlotRegister().is(r0));
3134 __ mov(LoadIC::SlotRegister(),
3135 Operand(Smi::FromInt(instr->hydrogen()->slot())));
3136 } 3137 }
3137 Handle<Code> ic = LoadIC::initialize_stub(isolate(), NOT_CONTEXTUAL); 3138 Handle<Code> ic = LoadIC::initialize_stub(isolate(), NOT_CONTEXTUAL);
3138 CallCode(ic, RelocInfo::CODE_TARGET, instr, NEVER_INLINE_TARGET_ADDRESS); 3139 CallCode(ic, RelocInfo::CODE_TARGET, instr, NEVER_INLINE_TARGET_ADDRESS);
3139 } 3140 }
3140 3141
3141 3142
3142 void LCodeGen::DoLoadFunctionPrototype(LLoadFunctionPrototype* instr) { 3143 void LCodeGen::DoLoadFunctionPrototype(LLoadFunctionPrototype* instr) {
3143 Register scratch = scratch0(); 3144 Register scratch = scratch0();
3144 Register function = ToRegister(instr->function()); 3145 Register function = ToRegister(instr->function());
3145 Register result = ToRegister(instr->result()); 3146 Register result = ToRegister(instr->result());
(...skipping 269 matching lines...) Expand 10 before | Expand all | Expand 10 after
3415 } 3416 }
3416 } 3417 }
3417 3418
3418 3419
3419 void LCodeGen::DoLoadKeyedGeneric(LLoadKeyedGeneric* instr) { 3420 void LCodeGen::DoLoadKeyedGeneric(LLoadKeyedGeneric* instr) {
3420 DCHECK(ToRegister(instr->context()).is(cp)); 3421 DCHECK(ToRegister(instr->context()).is(cp));
3421 DCHECK(ToRegister(instr->object()).is(LoadIC::ReceiverRegister())); 3422 DCHECK(ToRegister(instr->object()).is(LoadIC::ReceiverRegister()));
3422 DCHECK(ToRegister(instr->key()).is(LoadIC::NameRegister())); 3423 DCHECK(ToRegister(instr->key()).is(LoadIC::NameRegister()));
3423 3424
3424 if (FLAG_vector_ics) { 3425 if (FLAG_vector_ics) {
3425 Register vector = ToRegister(instr->temp_vector()); 3426 EmitVectorLoadICRegisters<LLoadKeyedGeneric>(instr);
3426 DCHECK(vector.is(LoadIC::VectorRegister()));
3427 __ Move(vector, instr->hydrogen()->feedback_vector());
3428 // No need to allocate this register.
3429 DCHECK(LoadIC::SlotRegister().is(r0));
3430 __ mov(LoadIC::SlotRegister(),
3431 Operand(Smi::FromInt(instr->hydrogen()->slot())));
3432 } 3427 }
3433 3428
3434 Handle<Code> ic = isolate()->builtins()->KeyedLoadIC_Initialize(); 3429 Handle<Code> ic = isolate()->builtins()->KeyedLoadIC_Initialize();
3435 CallCode(ic, RelocInfo::CODE_TARGET, instr, NEVER_INLINE_TARGET_ADDRESS); 3430 CallCode(ic, RelocInfo::CODE_TARGET, instr, NEVER_INLINE_TARGET_ADDRESS);
3436 } 3431 }
3437 3432
3438 3433
3439 void LCodeGen::DoArgumentsElements(LArgumentsElements* instr) { 3434 void LCodeGen::DoArgumentsElements(LArgumentsElements* instr) {
3440 Register scratch = scratch0(); 3435 Register scratch = scratch0();
3441 Register result = ToRegister(instr->result()); 3436 Register result = ToRegister(instr->result());
(...skipping 2441 matching lines...) Expand 10 before | Expand all | Expand 10 after
5883 __ Push(scope_info); 5878 __ Push(scope_info);
5884 __ push(ToRegister(instr->function())); 5879 __ push(ToRegister(instr->function()));
5885 CallRuntime(Runtime::kPushBlockContext, 2, instr); 5880 CallRuntime(Runtime::kPushBlockContext, 2, instr);
5886 RecordSafepoint(Safepoint::kNoLazyDeopt); 5881 RecordSafepoint(Safepoint::kNoLazyDeopt);
5887 } 5882 }
5888 5883
5889 5884
5890 #undef __ 5885 #undef __
5891 5886
5892 } } // namespace v8::internal 5887 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/arm/lithium-codegen-arm.h ('k') | src/arm64/lithium-codegen-arm64.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698