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

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

Issue 527093002: Make concrete classes for individual call descriptors. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: REBASE. 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
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_IA32 7 #if V8_TARGET_ARCH_IA32
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 2814 matching lines...) Expand 10 before | Expand all | Expand 10 after
2825 __ cmp(result, factory()->the_hole_value()); 2825 __ cmp(result, factory()->the_hole_value());
2826 DeoptimizeIf(equal, instr->environment()); 2826 DeoptimizeIf(equal, instr->environment());
2827 } 2827 }
2828 } 2828 }
2829 2829
2830 2830
2831 template <class T> 2831 template <class T>
2832 void LCodeGen::EmitVectorLoadICRegisters(T* instr) { 2832 void LCodeGen::EmitVectorLoadICRegisters(T* instr) {
2833 DCHECK(FLAG_vector_ics); 2833 DCHECK(FLAG_vector_ics);
2834 Register vector = ToRegister(instr->temp_vector()); 2834 Register vector = ToRegister(instr->temp_vector());
2835 DCHECK(vector.is(FullVectorLoadConvention::VectorRegister())); 2835 DCHECK(vector.is(VectorLoadICDescriptor::VectorRegister()));
2836 __ mov(vector, instr->hydrogen()->feedback_vector()); 2836 __ mov(vector, instr->hydrogen()->feedback_vector());
2837 // No need to allocate this register. 2837 // No need to allocate this register.
2838 DCHECK(FullVectorLoadConvention::SlotRegister().is(eax)); 2838 DCHECK(VectorLoadICDescriptor::SlotRegister().is(eax));
2839 __ mov(FullVectorLoadConvention::SlotRegister(), 2839 __ mov(VectorLoadICDescriptor::SlotRegister(),
2840 Immediate(Smi::FromInt(instr->hydrogen()->slot()))); 2840 Immediate(Smi::FromInt(instr->hydrogen()->slot())));
2841 } 2841 }
2842 2842
2843 2843
2844 void LCodeGen::DoLoadGlobalGeneric(LLoadGlobalGeneric* instr) { 2844 void LCodeGen::DoLoadGlobalGeneric(LLoadGlobalGeneric* instr) {
2845 DCHECK(ToRegister(instr->context()).is(esi)); 2845 DCHECK(ToRegister(instr->context()).is(esi));
2846 DCHECK(ToRegister(instr->global_object()) 2846 DCHECK(ToRegister(instr->global_object())
2847 .is(LoadConvention::ReceiverRegister())); 2847 .is(LoadDescriptor::ReceiverRegister()));
2848 DCHECK(ToRegister(instr->result()).is(eax)); 2848 DCHECK(ToRegister(instr->result()).is(eax));
2849 2849
2850 __ mov(LoadConvention::NameRegister(), instr->name()); 2850 __ mov(LoadDescriptor::NameRegister(), instr->name());
2851 if (FLAG_vector_ics) { 2851 if (FLAG_vector_ics) {
2852 EmitVectorLoadICRegisters<LLoadGlobalGeneric>(instr); 2852 EmitVectorLoadICRegisters<LLoadGlobalGeneric>(instr);
2853 } 2853 }
2854 ContextualMode mode = instr->for_typeof() ? NOT_CONTEXTUAL : CONTEXTUAL; 2854 ContextualMode mode = instr->for_typeof() ? NOT_CONTEXTUAL : CONTEXTUAL;
2855 Handle<Code> ic = LoadIC::initialize_stub(isolate(), mode); 2855 Handle<Code> ic = LoadIC::initialize_stub(isolate(), mode);
2856 CallCode(ic, RelocInfo::CODE_TARGET, instr); 2856 CallCode(ic, RelocInfo::CODE_TARGET, instr);
2857 } 2857 }
2858 2858
2859 2859
2860 void LCodeGen::DoStoreGlobalCell(LStoreGlobalCell* instr) { 2860 void LCodeGen::DoStoreGlobalCell(LStoreGlobalCell* instr) {
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after
2974 } else if (operand->IsRegister()) { 2974 } else if (operand->IsRegister()) {
2975 __ push(ToRegister(operand)); 2975 __ push(ToRegister(operand));
2976 } else { 2976 } else {
2977 __ push(ToOperand(operand)); 2977 __ push(ToOperand(operand));
2978 } 2978 }
2979 } 2979 }
2980 2980
2981 2981
2982 void LCodeGen::DoLoadNamedGeneric(LLoadNamedGeneric* instr) { 2982 void LCodeGen::DoLoadNamedGeneric(LLoadNamedGeneric* instr) {
2983 DCHECK(ToRegister(instr->context()).is(esi)); 2983 DCHECK(ToRegister(instr->context()).is(esi));
2984 DCHECK(ToRegister(instr->object()).is(LoadConvention::ReceiverRegister())); 2984 DCHECK(ToRegister(instr->object()).is(LoadDescriptor::ReceiverRegister()));
2985 DCHECK(ToRegister(instr->result()).is(eax)); 2985 DCHECK(ToRegister(instr->result()).is(eax));
2986 2986
2987 __ mov(LoadConvention::NameRegister(), instr->name()); 2987 __ mov(LoadDescriptor::NameRegister(), instr->name());
2988 if (FLAG_vector_ics) { 2988 if (FLAG_vector_ics) {
2989 EmitVectorLoadICRegisters<LLoadNamedGeneric>(instr); 2989 EmitVectorLoadICRegisters<LLoadNamedGeneric>(instr);
2990 } 2990 }
2991 Handle<Code> ic = LoadIC::initialize_stub(isolate(), NOT_CONTEXTUAL); 2991 Handle<Code> ic = LoadIC::initialize_stub(isolate(), NOT_CONTEXTUAL);
2992 CallCode(ic, RelocInfo::CODE_TARGET, instr); 2992 CallCode(ic, RelocInfo::CODE_TARGET, instr);
2993 } 2993 }
2994 2994
2995 2995
2996 void LCodeGen::DoLoadFunctionPrototype(LLoadFunctionPrototype* instr) { 2996 void LCodeGen::DoLoadFunctionPrototype(LLoadFunctionPrototype* instr) {
2997 Register function = ToRegister(instr->function()); 2997 Register function = ToRegister(instr->function());
(...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after
3202 return Operand(elements_pointer_reg, 3202 return Operand(elements_pointer_reg,
3203 ToRegister(key), 3203 ToRegister(key),
3204 scale_factor, 3204 scale_factor,
3205 base_offset); 3205 base_offset);
3206 } 3206 }
3207 } 3207 }
3208 3208
3209 3209
3210 void LCodeGen::DoLoadKeyedGeneric(LLoadKeyedGeneric* instr) { 3210 void LCodeGen::DoLoadKeyedGeneric(LLoadKeyedGeneric* instr) {
3211 DCHECK(ToRegister(instr->context()).is(esi)); 3211 DCHECK(ToRegister(instr->context()).is(esi));
3212 DCHECK(ToRegister(instr->object()).is(LoadConvention::ReceiverRegister())); 3212 DCHECK(ToRegister(instr->object()).is(LoadDescriptor::ReceiverRegister()));
3213 DCHECK(ToRegister(instr->key()).is(LoadConvention::NameRegister())); 3213 DCHECK(ToRegister(instr->key()).is(LoadDescriptor::NameRegister()));
3214 3214
3215 if (FLAG_vector_ics) { 3215 if (FLAG_vector_ics) {
3216 EmitVectorLoadICRegisters<LLoadKeyedGeneric>(instr); 3216 EmitVectorLoadICRegisters<LLoadKeyedGeneric>(instr);
3217 } 3217 }
3218 3218
3219 Handle<Code> ic = isolate()->builtins()->KeyedLoadIC_Initialize(); 3219 Handle<Code> ic = isolate()->builtins()->KeyedLoadIC_Initialize();
3220 CallCode(ic, RelocInfo::CODE_TARGET, instr); 3220 CallCode(ic, RelocInfo::CODE_TARGET, instr);
3221 } 3221 }
3222 3222
3223 3223
(...skipping 837 matching lines...) Expand 10 before | Expand all | Expand 10 after
4061 kSaveFPRegs, 4061 kSaveFPRegs,
4062 EMIT_REMEMBERED_SET, 4062 EMIT_REMEMBERED_SET,
4063 instr->hydrogen()->SmiCheckForWriteBarrier(), 4063 instr->hydrogen()->SmiCheckForWriteBarrier(),
4064 instr->hydrogen()->PointersToHereCheckForValue()); 4064 instr->hydrogen()->PointersToHereCheckForValue());
4065 } 4065 }
4066 } 4066 }
4067 4067
4068 4068
4069 void LCodeGen::DoStoreNamedGeneric(LStoreNamedGeneric* instr) { 4069 void LCodeGen::DoStoreNamedGeneric(LStoreNamedGeneric* instr) {
4070 DCHECK(ToRegister(instr->context()).is(esi)); 4070 DCHECK(ToRegister(instr->context()).is(esi));
4071 DCHECK(ToRegister(instr->object()).is(StoreConvention::ReceiverRegister())); 4071 DCHECK(ToRegister(instr->object()).is(StoreDescriptor::ReceiverRegister()));
4072 DCHECK(ToRegister(instr->value()).is(StoreConvention::ValueRegister())); 4072 DCHECK(ToRegister(instr->value()).is(StoreDescriptor::ValueRegister()));
4073 4073
4074 __ mov(StoreConvention::NameRegister(), instr->name()); 4074 __ mov(StoreDescriptor::NameRegister(), instr->name());
4075 Handle<Code> ic = StoreIC::initialize_stub(isolate(), instr->strict_mode()); 4075 Handle<Code> ic = StoreIC::initialize_stub(isolate(), instr->strict_mode());
4076 CallCode(ic, RelocInfo::CODE_TARGET, instr); 4076 CallCode(ic, RelocInfo::CODE_TARGET, instr);
4077 } 4077 }
4078 4078
4079 4079
4080 void LCodeGen::DoBoundsCheck(LBoundsCheck* instr) { 4080 void LCodeGen::DoBoundsCheck(LBoundsCheck* instr) {
4081 Condition cc = instr->hydrogen()->allow_equality() ? above : above_equal; 4081 Condition cc = instr->hydrogen()->allow_equality() ? above : above_equal;
4082 if (instr->index()->IsConstantOperand()) { 4082 if (instr->index()->IsConstantOperand()) {
4083 __ cmp(ToOperand(instr->length()), 4083 __ cmp(ToOperand(instr->length()),
4084 ToImmediate(LConstantOperand::cast(instr->index()), 4084 ToImmediate(LConstantOperand::cast(instr->index()),
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after
4243 } else if (instr->hydrogen()->value()->representation().IsDouble()) { 4243 } else if (instr->hydrogen()->value()->representation().IsDouble()) {
4244 DoStoreKeyedFixedDoubleArray(instr); 4244 DoStoreKeyedFixedDoubleArray(instr);
4245 } else { 4245 } else {
4246 DoStoreKeyedFixedArray(instr); 4246 DoStoreKeyedFixedArray(instr);
4247 } 4247 }
4248 } 4248 }
4249 4249
4250 4250
4251 void LCodeGen::DoStoreKeyedGeneric(LStoreKeyedGeneric* instr) { 4251 void LCodeGen::DoStoreKeyedGeneric(LStoreKeyedGeneric* instr) {
4252 DCHECK(ToRegister(instr->context()).is(esi)); 4252 DCHECK(ToRegister(instr->context()).is(esi));
4253 DCHECK(ToRegister(instr->object()).is(StoreConvention::ReceiverRegister())); 4253 DCHECK(ToRegister(instr->object()).is(StoreDescriptor::ReceiverRegister()));
4254 DCHECK(ToRegister(instr->key()).is(StoreConvention::NameRegister())); 4254 DCHECK(ToRegister(instr->key()).is(StoreDescriptor::NameRegister()));
4255 DCHECK(ToRegister(instr->value()).is(StoreConvention::ValueRegister())); 4255 DCHECK(ToRegister(instr->value()).is(StoreDescriptor::ValueRegister()));
4256 4256
4257 Handle<Code> ic = instr->strict_mode() == STRICT 4257 Handle<Code> ic = instr->strict_mode() == STRICT
4258 ? isolate()->builtins()->KeyedStoreIC_Initialize_Strict() 4258 ? isolate()->builtins()->KeyedStoreIC_Initialize_Strict()
4259 : isolate()->builtins()->KeyedStoreIC_Initialize(); 4259 : isolate()->builtins()->KeyedStoreIC_Initialize();
4260 CallCode(ic, RelocInfo::CODE_TARGET, instr); 4260 CallCode(ic, RelocInfo::CODE_TARGET, instr);
4261 } 4261 }
4262 4262
4263 4263
4264 void LCodeGen::DoTrapAllocationMemento(LTrapAllocationMemento* instr) { 4264 void LCodeGen::DoTrapAllocationMemento(LTrapAllocationMemento* instr) {
4265 Register object = ToRegister(instr->object()); 4265 Register object = ToRegister(instr->object());
(...skipping 1403 matching lines...) Expand 10 before | Expand all | Expand 10 after
5669 CallRuntime(Runtime::kPushBlockContext, 2, instr); 5669 CallRuntime(Runtime::kPushBlockContext, 2, instr);
5670 RecordSafepoint(Safepoint::kNoLazyDeopt); 5670 RecordSafepoint(Safepoint::kNoLazyDeopt);
5671 } 5671 }
5672 5672
5673 5673
5674 #undef __ 5674 #undef __
5675 5675
5676 } } // namespace v8::internal 5676 } } // namespace v8::internal
5677 5677
5678 #endif // V8_TARGET_ARCH_IA32 5678 #endif // V8_TARGET_ARCH_IA32
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698