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

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

Issue 513533003: X87: Move register conventions out of the IC classes. (Closed) Base URL: https://chromium.googlesource.com/external/v8.git@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
« no previous file with comments | « src/x87/full-codegen-x87.cc ('k') | src/x87/lithium-x87.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 #include "src/v8.h" 5 #include "src/v8.h"
6 6
7 #if V8_TARGET_ARCH_X87 7 #if V8_TARGET_ARCH_X87
8 8
9 #include "src/code-stubs.h" 9 #include "src/code-stubs.h"
10 #include "src/codegen.h" 10 #include "src/codegen.h"
(...skipping 2949 matching lines...) Expand 10 before | Expand all | Expand 10 after
2960 __ cmp(result, factory()->the_hole_value()); 2960 __ cmp(result, factory()->the_hole_value());
2961 DeoptimizeIf(equal, instr->environment()); 2961 DeoptimizeIf(equal, instr->environment());
2962 } 2962 }
2963 } 2963 }
2964 2964
2965 2965
2966 template <class T> 2966 template <class T>
2967 void LCodeGen::EmitVectorLoadICRegisters(T* instr) { 2967 void LCodeGen::EmitVectorLoadICRegisters(T* instr) {
2968 DCHECK(FLAG_vector_ics); 2968 DCHECK(FLAG_vector_ics);
2969 Register vector = ToRegister(instr->temp_vector()); 2969 Register vector = ToRegister(instr->temp_vector());
2970 DCHECK(vector.is(LoadIC::VectorRegister())); 2970 DCHECK(vector.is(FullVectorLoadConvention::VectorRegister()));
2971 __ mov(vector, instr->hydrogen()->feedback_vector()); 2971 __ mov(vector, instr->hydrogen()->feedback_vector());
2972 // No need to allocate this register. 2972 // No need to allocate this register.
2973 DCHECK(LoadIC::SlotRegister().is(eax)); 2973 DCHECK(FullVectorLoadConvention::SlotRegister().is(eax));
2974 __ mov(LoadIC::SlotRegister(), 2974 __ mov(FullVectorLoadConvention::SlotRegister(),
2975 Immediate(Smi::FromInt(instr->hydrogen()->slot()))); 2975 Immediate(Smi::FromInt(instr->hydrogen()->slot())));
2976 } 2976 }
2977 2977
2978 2978
2979 void LCodeGen::DoLoadGlobalGeneric(LLoadGlobalGeneric* instr) { 2979 void LCodeGen::DoLoadGlobalGeneric(LLoadGlobalGeneric* instr) {
2980 DCHECK(ToRegister(instr->context()).is(esi)); 2980 DCHECK(ToRegister(instr->context()).is(esi));
2981 DCHECK(ToRegister(instr->global_object()).is(LoadIC::ReceiverRegister())); 2981 DCHECK(ToRegister(instr->global_object())
2982 .is(LoadConvention::ReceiverRegister()));
2982 DCHECK(ToRegister(instr->result()).is(eax)); 2983 DCHECK(ToRegister(instr->result()).is(eax));
2983 2984
2984 __ mov(LoadIC::NameRegister(), instr->name()); 2985 __ mov(LoadConvention::NameRegister(), instr->name());
2985 if (FLAG_vector_ics) { 2986 if (FLAG_vector_ics) {
2986 EmitVectorLoadICRegisters<LLoadGlobalGeneric>(instr); 2987 EmitVectorLoadICRegisters<LLoadGlobalGeneric>(instr);
2987 } 2988 }
2988 ContextualMode mode = instr->for_typeof() ? NOT_CONTEXTUAL : CONTEXTUAL; 2989 ContextualMode mode = instr->for_typeof() ? NOT_CONTEXTUAL : CONTEXTUAL;
2989 Handle<Code> ic = LoadIC::initialize_stub(isolate(), mode); 2990 Handle<Code> ic = LoadIC::initialize_stub(isolate(), mode);
2990 CallCode(ic, RelocInfo::CODE_TARGET, instr); 2991 CallCode(ic, RelocInfo::CODE_TARGET, instr);
2991 } 2992 }
2992 2993
2993 2994
2994 void LCodeGen::DoStoreGlobalCell(LStoreGlobalCell* instr) { 2995 void LCodeGen::DoStoreGlobalCell(LStoreGlobalCell* instr) {
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after
3106 } else if (operand->IsRegister()) { 3107 } else if (operand->IsRegister()) {
3107 __ push(ToRegister(operand)); 3108 __ push(ToRegister(operand));
3108 } else { 3109 } else {
3109 __ push(ToOperand(operand)); 3110 __ push(ToOperand(operand));
3110 } 3111 }
3111 } 3112 }
3112 3113
3113 3114
3114 void LCodeGen::DoLoadNamedGeneric(LLoadNamedGeneric* instr) { 3115 void LCodeGen::DoLoadNamedGeneric(LLoadNamedGeneric* instr) {
3115 DCHECK(ToRegister(instr->context()).is(esi)); 3116 DCHECK(ToRegister(instr->context()).is(esi));
3116 DCHECK(ToRegister(instr->object()).is(LoadIC::ReceiverRegister())); 3117 DCHECK(ToRegister(instr->object()).is(LoadConvention::ReceiverRegister()));
3117 DCHECK(ToRegister(instr->result()).is(eax)); 3118 DCHECK(ToRegister(instr->result()).is(eax));
3118 3119
3119 __ mov(LoadIC::NameRegister(), instr->name()); 3120 __ mov(LoadConvention::NameRegister(), instr->name());
3120 if (FLAG_vector_ics) { 3121 if (FLAG_vector_ics) {
3121 EmitVectorLoadICRegisters<LLoadNamedGeneric>(instr); 3122 EmitVectorLoadICRegisters<LLoadNamedGeneric>(instr);
3122 } 3123 }
3123 Handle<Code> ic = LoadIC::initialize_stub(isolate(), NOT_CONTEXTUAL); 3124 Handle<Code> ic = LoadIC::initialize_stub(isolate(), NOT_CONTEXTUAL);
3124 CallCode(ic, RelocInfo::CODE_TARGET, instr); 3125 CallCode(ic, RelocInfo::CODE_TARGET, instr);
3125 } 3126 }
3126 3127
3127 3128
3128 void LCodeGen::DoLoadFunctionPrototype(LLoadFunctionPrototype* instr) { 3129 void LCodeGen::DoLoadFunctionPrototype(LLoadFunctionPrototype* instr) {
3129 Register function = ToRegister(instr->function()); 3130 Register function = ToRegister(instr->function());
(...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after
3331 return Operand(elements_pointer_reg, 3332 return Operand(elements_pointer_reg,
3332 ToRegister(key), 3333 ToRegister(key),
3333 scale_factor, 3334 scale_factor,
3334 base_offset); 3335 base_offset);
3335 } 3336 }
3336 } 3337 }
3337 3338
3338 3339
3339 void LCodeGen::DoLoadKeyedGeneric(LLoadKeyedGeneric* instr) { 3340 void LCodeGen::DoLoadKeyedGeneric(LLoadKeyedGeneric* instr) {
3340 DCHECK(ToRegister(instr->context()).is(esi)); 3341 DCHECK(ToRegister(instr->context()).is(esi));
3341 DCHECK(ToRegister(instr->object()).is(LoadIC::ReceiverRegister())); 3342 DCHECK(ToRegister(instr->object()).is(LoadConvention::ReceiverRegister()));
3342 DCHECK(ToRegister(instr->key()).is(LoadIC::NameRegister())); 3343 DCHECK(ToRegister(instr->key()).is(LoadConvention::NameRegister()));
3343 3344
3344 if (FLAG_vector_ics) { 3345 if (FLAG_vector_ics) {
3345 EmitVectorLoadICRegisters<LLoadKeyedGeneric>(instr); 3346 EmitVectorLoadICRegisters<LLoadKeyedGeneric>(instr);
3346 } 3347 }
3347 3348
3348 Handle<Code> ic = isolate()->builtins()->KeyedLoadIC_Initialize(); 3349 Handle<Code> ic = isolate()->builtins()->KeyedLoadIC_Initialize();
3349 CallCode(ic, RelocInfo::CODE_TARGET, instr); 3350 CallCode(ic, RelocInfo::CODE_TARGET, instr);
3350 } 3351 }
3351 3352
3352 3353
(...skipping 614 matching lines...) Expand 10 before | Expand all | Expand 10 after
3967 temp, 3968 temp,
3968 EMIT_REMEMBERED_SET, 3969 EMIT_REMEMBERED_SET,
3969 instr->hydrogen()->SmiCheckForWriteBarrier(), 3970 instr->hydrogen()->SmiCheckForWriteBarrier(),
3970 instr->hydrogen()->PointersToHereCheckForValue()); 3971 instr->hydrogen()->PointersToHereCheckForValue());
3971 } 3972 }
3972 } 3973 }
3973 3974
3974 3975
3975 void LCodeGen::DoStoreNamedGeneric(LStoreNamedGeneric* instr) { 3976 void LCodeGen::DoStoreNamedGeneric(LStoreNamedGeneric* instr) {
3976 DCHECK(ToRegister(instr->context()).is(esi)); 3977 DCHECK(ToRegister(instr->context()).is(esi));
3977 DCHECK(ToRegister(instr->object()).is(StoreIC::ReceiverRegister())); 3978 DCHECK(ToRegister(instr->object()).is(StoreConvention::ReceiverRegister()));
3978 DCHECK(ToRegister(instr->value()).is(StoreIC::ValueRegister())); 3979 DCHECK(ToRegister(instr->value()).is(StoreConvention::ValueRegister()));
3979 3980
3980 __ mov(StoreIC::NameRegister(), instr->name()); 3981 __ mov(StoreConvention::NameRegister(), instr->name());
3981 Handle<Code> ic = StoreIC::initialize_stub(isolate(), instr->strict_mode()); 3982 Handle<Code> ic = StoreIC::initialize_stub(isolate(), instr->strict_mode());
3982 CallCode(ic, RelocInfo::CODE_TARGET, instr); 3983 CallCode(ic, RelocInfo::CODE_TARGET, instr);
3983 } 3984 }
3984 3985
3985 3986
3986 void LCodeGen::DoBoundsCheck(LBoundsCheck* instr) { 3987 void LCodeGen::DoBoundsCheck(LBoundsCheck* instr) {
3987 Condition cc = instr->hydrogen()->allow_equality() ? above : above_equal; 3988 Condition cc = instr->hydrogen()->allow_equality() ? above : above_equal;
3988 if (instr->index()->IsConstantOperand()) { 3989 if (instr->index()->IsConstantOperand()) {
3989 __ cmp(ToOperand(instr->length()), 3990 __ cmp(ToOperand(instr->length()),
3990 ToImmediate(LConstantOperand::cast(instr->index()), 3991 ToImmediate(LConstantOperand::cast(instr->index()),
(...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after
4178 } else if (instr->hydrogen()->value()->representation().IsDouble()) { 4179 } else if (instr->hydrogen()->value()->representation().IsDouble()) {
4179 DoStoreKeyedFixedDoubleArray(instr); 4180 DoStoreKeyedFixedDoubleArray(instr);
4180 } else { 4181 } else {
4181 DoStoreKeyedFixedArray(instr); 4182 DoStoreKeyedFixedArray(instr);
4182 } 4183 }
4183 } 4184 }
4184 4185
4185 4186
4186 void LCodeGen::DoStoreKeyedGeneric(LStoreKeyedGeneric* instr) { 4187 void LCodeGen::DoStoreKeyedGeneric(LStoreKeyedGeneric* instr) {
4187 DCHECK(ToRegister(instr->context()).is(esi)); 4188 DCHECK(ToRegister(instr->context()).is(esi));
4188 DCHECK(ToRegister(instr->object()).is(KeyedStoreIC::ReceiverRegister())); 4189 DCHECK(ToRegister(instr->object()).is(StoreConvention::ReceiverRegister()));
4189 DCHECK(ToRegister(instr->key()).is(KeyedStoreIC::NameRegister())); 4190 DCHECK(ToRegister(instr->key()).is(StoreConvention::NameRegister()));
4190 DCHECK(ToRegister(instr->value()).is(KeyedStoreIC::ValueRegister())); 4191 DCHECK(ToRegister(instr->value()).is(StoreConvention::ValueRegister()));
4191 4192
4192 Handle<Code> ic = instr->strict_mode() == STRICT 4193 Handle<Code> ic = instr->strict_mode() == STRICT
4193 ? isolate()->builtins()->KeyedStoreIC_Initialize_Strict() 4194 ? isolate()->builtins()->KeyedStoreIC_Initialize_Strict()
4194 : isolate()->builtins()->KeyedStoreIC_Initialize(); 4195 : isolate()->builtins()->KeyedStoreIC_Initialize();
4195 CallCode(ic, RelocInfo::CODE_TARGET, instr); 4196 CallCode(ic, RelocInfo::CODE_TARGET, instr);
4196 } 4197 }
4197 4198
4198 4199
4199 void LCodeGen::DoTrapAllocationMemento(LTrapAllocationMemento* instr) { 4200 void LCodeGen::DoTrapAllocationMemento(LTrapAllocationMemento* instr) {
4200 Register object = ToRegister(instr->object()); 4201 Register object = ToRegister(instr->object());
(...skipping 1500 matching lines...) Expand 10 before | Expand all | Expand 10 after
5701 CallRuntime(Runtime::kPushBlockContext, 2, instr); 5702 CallRuntime(Runtime::kPushBlockContext, 2, instr);
5702 RecordSafepoint(Safepoint::kNoLazyDeopt); 5703 RecordSafepoint(Safepoint::kNoLazyDeopt);
5703 } 5704 }
5704 5705
5705 5706
5706 #undef __ 5707 #undef __
5707 5708
5708 } } // namespace v8::internal 5709 } } // namespace v8::internal
5709 5710
5710 #endif // V8_TARGET_ARCH_X87 5711 #endif // V8_TARGET_ARCH_X87
OLDNEW
« no previous file with comments | « src/x87/full-codegen-x87.cc ('k') | src/x87/lithium-x87.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698