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

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

Issue 508673002: MIPS: Move register conventions out of the IC classes. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Fix nits. 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/mips/full-codegen-mips.cc ('k') | src/mips/lithium-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.7 1 // Copyright 2012 the V8 project authors. All rights reserved.7
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 2873 matching lines...) Expand 10 before | Expand all | Expand 10 after
2884 __ LoadRoot(at, Heap::kTheHoleValueRootIndex); 2884 __ LoadRoot(at, Heap::kTheHoleValueRootIndex);
2885 DeoptimizeIf(eq, instr->environment(), result, Operand(at)); 2885 DeoptimizeIf(eq, instr->environment(), result, Operand(at));
2886 } 2886 }
2887 } 2887 }
2888 2888
2889 2889
2890 template <class T> 2890 template <class T>
2891 void LCodeGen::EmitVectorLoadICRegisters(T* instr) { 2891 void LCodeGen::EmitVectorLoadICRegisters(T* instr) {
2892 DCHECK(FLAG_vector_ics); 2892 DCHECK(FLAG_vector_ics);
2893 Register vector = ToRegister(instr->temp_vector()); 2893 Register vector = ToRegister(instr->temp_vector());
2894 DCHECK(vector.is(LoadIC::VectorRegister())); 2894 DCHECK(vector.is(FullVectorLoadConvention::VectorRegister()));
2895 __ li(vector, instr->hydrogen()->feedback_vector()); 2895 __ li(vector, instr->hydrogen()->feedback_vector());
2896 // No need to allocate this register. 2896 // No need to allocate this register.
2897 DCHECK(LoadIC::SlotRegister().is(a0)); 2897 DCHECK(FullVectorLoadConvention::SlotRegister().is(a0));
2898 __ li(LoadIC::SlotRegister(), 2898 __ li(FullVectorLoadConvention::SlotRegister(),
2899 Operand(Smi::FromInt(instr->hydrogen()->slot()))); 2899 Operand(Smi::FromInt(instr->hydrogen()->slot())));
2900 } 2900 }
2901 2901
2902 2902
2903 void LCodeGen::DoLoadGlobalGeneric(LLoadGlobalGeneric* instr) { 2903 void LCodeGen::DoLoadGlobalGeneric(LLoadGlobalGeneric* instr) {
2904 DCHECK(ToRegister(instr->context()).is(cp)); 2904 DCHECK(ToRegister(instr->context()).is(cp));
2905 DCHECK(ToRegister(instr->global_object()).is(LoadIC::ReceiverRegister())); 2905 DCHECK(ToRegister(instr->global_object())
2906 .is(LoadConvention::ReceiverRegister()));
2906 DCHECK(ToRegister(instr->result()).is(v0)); 2907 DCHECK(ToRegister(instr->result()).is(v0));
2907 2908
2908 __ li(LoadIC::NameRegister(), Operand(instr->name())); 2909 __ li(LoadConvention::NameRegister(), Operand(instr->name()));
2909 if (FLAG_vector_ics) { 2910 if (FLAG_vector_ics) {
2910 EmitVectorLoadICRegisters<LLoadGlobalGeneric>(instr); 2911 EmitVectorLoadICRegisters<LLoadGlobalGeneric>(instr);
2911 } 2912 }
2912 ContextualMode mode = instr->for_typeof() ? NOT_CONTEXTUAL : CONTEXTUAL; 2913 ContextualMode mode = instr->for_typeof() ? NOT_CONTEXTUAL : CONTEXTUAL;
2913 Handle<Code> ic = LoadIC::initialize_stub(isolate(), mode); 2914 Handle<Code> ic = LoadIC::initialize_stub(isolate(), mode);
2914 CallCode(ic, RelocInfo::CODE_TARGET, instr); 2915 CallCode(ic, RelocInfo::CODE_TARGET, instr);
2915 } 2916 }
2916 2917
2917 2918
2918 void LCodeGen::DoStoreGlobalCell(LStoreGlobalCell* instr) { 2919 void LCodeGen::DoStoreGlobalCell(LStoreGlobalCell* instr) {
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
3022 __ lw(result, FieldMemOperand(object, JSObject::kPropertiesOffset)); 3023 __ lw(result, FieldMemOperand(object, JSObject::kPropertiesOffset));
3023 object = result; 3024 object = result;
3024 } 3025 }
3025 MemOperand operand = FieldMemOperand(object, offset); 3026 MemOperand operand = FieldMemOperand(object, offset);
3026 __ Load(result, operand, access.representation()); 3027 __ Load(result, operand, access.representation());
3027 } 3028 }
3028 3029
3029 3030
3030 void LCodeGen::DoLoadNamedGeneric(LLoadNamedGeneric* instr) { 3031 void LCodeGen::DoLoadNamedGeneric(LLoadNamedGeneric* instr) {
3031 DCHECK(ToRegister(instr->context()).is(cp)); 3032 DCHECK(ToRegister(instr->context()).is(cp));
3032 DCHECK(ToRegister(instr->object()).is(LoadIC::ReceiverRegister())); 3033 DCHECK(ToRegister(instr->object()).is(LoadConvention::ReceiverRegister()));
3033 DCHECK(ToRegister(instr->result()).is(v0)); 3034 DCHECK(ToRegister(instr->result()).is(v0));
3034 3035
3035 // Name is always in a2. 3036 // Name is always in a2.
3036 __ li(LoadIC::NameRegister(), Operand(instr->name())); 3037 __ li(LoadConvention::NameRegister(), Operand(instr->name()));
3037 if (FLAG_vector_ics) { 3038 if (FLAG_vector_ics) {
3038 EmitVectorLoadICRegisters<LLoadNamedGeneric>(instr); 3039 EmitVectorLoadICRegisters<LLoadNamedGeneric>(instr);
3039 } 3040 }
3040 Handle<Code> ic = LoadIC::initialize_stub(isolate(), NOT_CONTEXTUAL); 3041 Handle<Code> ic = LoadIC::initialize_stub(isolate(), NOT_CONTEXTUAL);
3041 CallCode(ic, RelocInfo::CODE_TARGET, instr); 3042 CallCode(ic, RelocInfo::CODE_TARGET, instr);
3042 } 3043 }
3043 3044
3044 3045
3045 void LCodeGen::DoLoadFunctionPrototype(LLoadFunctionPrototype* instr) { 3046 void LCodeGen::DoLoadFunctionPrototype(LLoadFunctionPrototype* instr) {
3046 Register scratch = scratch0(); 3047 Register scratch = scratch0();
(...skipping 284 matching lines...) Expand 10 before | Expand all | Expand 10 after
3331 DCHECK_EQ(-1, shift_size); 3332 DCHECK_EQ(-1, shift_size);
3332 __ sra(scratch0(), key, 1); 3333 __ sra(scratch0(), key, 1);
3333 __ Addu(scratch0(), base, scratch0()); 3334 __ Addu(scratch0(), base, scratch0());
3334 return MemOperand(scratch0(), base_offset); 3335 return MemOperand(scratch0(), 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(cp)); 3341 DCHECK(ToRegister(instr->context()).is(cp));
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 794 matching lines...) Expand 10 before | Expand all | Expand 10 after
4147 EMIT_REMEMBERED_SET, 4148 EMIT_REMEMBERED_SET,
4148 instr->hydrogen()->SmiCheckForWriteBarrier(), 4149 instr->hydrogen()->SmiCheckForWriteBarrier(),
4149 instr->hydrogen()->PointersToHereCheckForValue()); 4150 instr->hydrogen()->PointersToHereCheckForValue());
4150 } 4151 }
4151 } 4152 }
4152 } 4153 }
4153 4154
4154 4155
4155 void LCodeGen::DoStoreNamedGeneric(LStoreNamedGeneric* instr) { 4156 void LCodeGen::DoStoreNamedGeneric(LStoreNamedGeneric* instr) {
4156 DCHECK(ToRegister(instr->context()).is(cp)); 4157 DCHECK(ToRegister(instr->context()).is(cp));
4157 DCHECK(ToRegister(instr->object()).is(StoreIC::ReceiverRegister())); 4158 DCHECK(ToRegister(instr->object()).is(StoreConvention::ReceiverRegister()));
4158 DCHECK(ToRegister(instr->value()).is(StoreIC::ValueRegister())); 4159 DCHECK(ToRegister(instr->value()).is(StoreConvention::ValueRegister()));
4159 4160
4160 __ li(StoreIC::NameRegister(), Operand(instr->name())); 4161 __ li(StoreConvention::NameRegister(), Operand(instr->name()));
4161 Handle<Code> ic = StoreIC::initialize_stub(isolate(), instr->strict_mode()); 4162 Handle<Code> ic = StoreIC::initialize_stub(isolate(), instr->strict_mode());
4162 CallCode(ic, RelocInfo::CODE_TARGET, instr); 4163 CallCode(ic, RelocInfo::CODE_TARGET, instr);
4163 } 4164 }
4164 4165
4165 4166
4166 void LCodeGen::DoBoundsCheck(LBoundsCheck* instr) { 4167 void LCodeGen::DoBoundsCheck(LBoundsCheck* instr) {
4167 Condition cc = instr->hydrogen()->allow_equality() ? hi : hs; 4168 Condition cc = instr->hydrogen()->allow_equality() ? hi : hs;
4168 Operand operand(0); 4169 Operand operand(0);
4169 Register reg; 4170 Register reg;
4170 if (instr->index()->IsConstantOperand()) { 4171 if (instr->index()->IsConstantOperand()) {
(...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after
4378 } else if (instr->hydrogen()->value()->representation().IsDouble()) { 4379 } else if (instr->hydrogen()->value()->representation().IsDouble()) {
4379 DoStoreKeyedFixedDoubleArray(instr); 4380 DoStoreKeyedFixedDoubleArray(instr);
4380 } else { 4381 } else {
4381 DoStoreKeyedFixedArray(instr); 4382 DoStoreKeyedFixedArray(instr);
4382 } 4383 }
4383 } 4384 }
4384 4385
4385 4386
4386 void LCodeGen::DoStoreKeyedGeneric(LStoreKeyedGeneric* instr) { 4387 void LCodeGen::DoStoreKeyedGeneric(LStoreKeyedGeneric* instr) {
4387 DCHECK(ToRegister(instr->context()).is(cp)); 4388 DCHECK(ToRegister(instr->context()).is(cp));
4388 DCHECK(ToRegister(instr->object()).is(KeyedStoreIC::ReceiverRegister())); 4389 DCHECK(ToRegister(instr->object()).is(StoreConvention::ReceiverRegister()));
4389 DCHECK(ToRegister(instr->key()).is(KeyedStoreIC::NameRegister())); 4390 DCHECK(ToRegister(instr->key()).is(StoreConvention::NameRegister()));
4390 DCHECK(ToRegister(instr->value()).is(KeyedStoreIC::ValueRegister())); 4391 DCHECK(ToRegister(instr->value()).is(StoreConvention::ValueRegister()));
4391 4392
4392 Handle<Code> ic = (instr->strict_mode() == STRICT) 4393 Handle<Code> ic = (instr->strict_mode() == STRICT)
4393 ? isolate()->builtins()->KeyedStoreIC_Initialize_Strict() 4394 ? isolate()->builtins()->KeyedStoreIC_Initialize_Strict()
4394 : isolate()->builtins()->KeyedStoreIC_Initialize(); 4395 : isolate()->builtins()->KeyedStoreIC_Initialize();
4395 CallCode(ic, RelocInfo::CODE_TARGET, instr); 4396 CallCode(ic, RelocInfo::CODE_TARGET, instr);
4396 } 4397 }
4397 4398
4398 4399
4399 void LCodeGen::DoTransitionElementsKind(LTransitionElementsKind* instr) { 4400 void LCodeGen::DoTransitionElementsKind(LTransitionElementsKind* instr) {
4400 Register object_reg = ToRegister(instr->object()); 4401 Register object_reg = ToRegister(instr->object());
(...skipping 1495 matching lines...) Expand 10 before | Expand all | Expand 10 after
5896 __ li(at, scope_info); 5897 __ li(at, scope_info);
5897 __ Push(at, ToRegister(instr->function())); 5898 __ Push(at, ToRegister(instr->function()));
5898 CallRuntime(Runtime::kPushBlockContext, 2, instr); 5899 CallRuntime(Runtime::kPushBlockContext, 2, instr);
5899 RecordSafepoint(Safepoint::kNoLazyDeopt); 5900 RecordSafepoint(Safepoint::kNoLazyDeopt);
5900 } 5901 }
5901 5902
5902 5903
5903 #undef __ 5904 #undef __
5904 5905
5905 } } // namespace v8::internal 5906 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/mips/full-codegen-mips.cc ('k') | src/mips/lithium-mips.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698