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

Side by Side Diff: src/mips64/lithium-codegen-mips64.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/mips64/full-codegen-mips64.cc ('k') | src/mips64/lithium-mips64.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 #include "src/code-stubs.h" 7 #include "src/code-stubs.h"
8 #include "src/hydrogen-osr.h" 8 #include "src/hydrogen-osr.h"
9 #include "src/mips64/lithium-codegen-mips64.h" 9 #include "src/mips64/lithium-codegen-mips64.h"
10 #include "src/mips64/lithium-gap-resolver-mips64.h" 10 #include "src/mips64/lithium-gap-resolver-mips64.h"
(...skipping 2851 matching lines...) Expand 10 before | Expand all | Expand 10 after
2862 __ LoadRoot(at, Heap::kTheHoleValueRootIndex); 2862 __ LoadRoot(at, Heap::kTheHoleValueRootIndex);
2863 DeoptimizeIf(eq, instr->environment(), result, Operand(at)); 2863 DeoptimizeIf(eq, instr->environment(), result, Operand(at));
2864 } 2864 }
2865 } 2865 }
2866 2866
2867 2867
2868 template <class T> 2868 template <class T>
2869 void LCodeGen::EmitVectorLoadICRegisters(T* instr) { 2869 void LCodeGen::EmitVectorLoadICRegisters(T* instr) {
2870 DCHECK(FLAG_vector_ics); 2870 DCHECK(FLAG_vector_ics);
2871 Register vector = ToRegister(instr->temp_vector()); 2871 Register vector = ToRegister(instr->temp_vector());
2872 DCHECK(vector.is(LoadIC::VectorRegister())); 2872 DCHECK(vector.is(FullVectorLoadConvention::VectorRegister()));
2873 __ li(vector, instr->hydrogen()->feedback_vector()); 2873 __ li(vector, instr->hydrogen()->feedback_vector());
2874 // No need to allocate this register. 2874 // No need to allocate this register.
2875 DCHECK(LoadIC::SlotRegister().is(a0)); 2875 DCHECK(FullVectorLoadConvention::SlotRegister().is(a0));
2876 __ li(LoadIC::SlotRegister(), 2876 __ li(FullVectorLoadConvention::SlotRegister(),
2877 Operand(Smi::FromInt(instr->hydrogen()->slot()))); 2877 Operand(Smi::FromInt(instr->hydrogen()->slot())));
2878 } 2878 }
2879 2879
2880 2880
2881 void LCodeGen::DoLoadGlobalGeneric(LLoadGlobalGeneric* instr) { 2881 void LCodeGen::DoLoadGlobalGeneric(LLoadGlobalGeneric* instr) {
2882 DCHECK(ToRegister(instr->context()).is(cp)); 2882 DCHECK(ToRegister(instr->context()).is(cp));
2883 DCHECK(ToRegister(instr->global_object()).is(LoadIC::ReceiverRegister())); 2883 DCHECK(ToRegister(instr->global_object())
2884 .is(LoadConvention::ReceiverRegister()));
2884 DCHECK(ToRegister(instr->result()).is(v0)); 2885 DCHECK(ToRegister(instr->result()).is(v0));
2885 2886
2886 __ li(LoadIC::NameRegister(), Operand(instr->name())); 2887 __ li(LoadConvention::NameRegister(), Operand(instr->name()));
2887 if (FLAG_vector_ics) { 2888 if (FLAG_vector_ics) {
2888 EmitVectorLoadICRegisters<LLoadGlobalGeneric>(instr); 2889 EmitVectorLoadICRegisters<LLoadGlobalGeneric>(instr);
2889 } 2890 }
2890 ContextualMode mode = instr->for_typeof() ? NOT_CONTEXTUAL : CONTEXTUAL; 2891 ContextualMode mode = instr->for_typeof() ? NOT_CONTEXTUAL : CONTEXTUAL;
2891 Handle<Code> ic = LoadIC::initialize_stub(isolate(), mode); 2892 Handle<Code> ic = LoadIC::initialize_stub(isolate(), mode);
2892 CallCode(ic, RelocInfo::CODE_TARGET, instr); 2893 CallCode(ic, RelocInfo::CODE_TARGET, instr);
2893 } 2894 }
2894 2895
2895 2896
2896 void LCodeGen::DoStoreGlobalCell(LStoreGlobalCell* instr) { 2897 void LCodeGen::DoStoreGlobalCell(LStoreGlobalCell* instr) {
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
3014 STATIC_ASSERT(kSmiTagSize + kSmiShiftSize == 32); 3015 STATIC_ASSERT(kSmiTagSize + kSmiShiftSize == 32);
3015 offset += kPointerSize / 2; 3016 offset += kPointerSize / 2;
3016 representation = Representation::Integer32(); 3017 representation = Representation::Integer32();
3017 } 3018 }
3018 __ Load(result, FieldMemOperand(object, offset), representation); 3019 __ Load(result, FieldMemOperand(object, offset), representation);
3019 } 3020 }
3020 3021
3021 3022
3022 void LCodeGen::DoLoadNamedGeneric(LLoadNamedGeneric* instr) { 3023 void LCodeGen::DoLoadNamedGeneric(LLoadNamedGeneric* instr) {
3023 DCHECK(ToRegister(instr->context()).is(cp)); 3024 DCHECK(ToRegister(instr->context()).is(cp));
3024 DCHECK(ToRegister(instr->object()).is(LoadIC::ReceiverRegister())); 3025 DCHECK(ToRegister(instr->object()).is(LoadConvention::ReceiverRegister()));
3025 DCHECK(ToRegister(instr->result()).is(v0)); 3026 DCHECK(ToRegister(instr->result()).is(v0));
3026 3027
3027 // Name is always in a2. 3028 // Name is always in a2.
3028 __ li(LoadIC::NameRegister(), Operand(instr->name())); 3029 __ li(LoadConvention::NameRegister(), Operand(instr->name()));
3029 if (FLAG_vector_ics) { 3030 if (FLAG_vector_ics) {
3030 EmitVectorLoadICRegisters<LLoadNamedGeneric>(instr); 3031 EmitVectorLoadICRegisters<LLoadNamedGeneric>(instr);
3031 } 3032 }
3032 Handle<Code> ic = LoadIC::initialize_stub(isolate(), NOT_CONTEXTUAL); 3033 Handle<Code> ic = LoadIC::initialize_stub(isolate(), NOT_CONTEXTUAL);
3033 CallCode(ic, RelocInfo::CODE_TARGET, instr); 3034 CallCode(ic, RelocInfo::CODE_TARGET, instr);
3034 } 3035 }
3035 3036
3036 3037
3037 void LCodeGen::DoLoadFunctionPrototype(LLoadFunctionPrototype* instr) { 3038 void LCodeGen::DoLoadFunctionPrototype(LLoadFunctionPrototype* instr) {
3038 Register scratch = scratch0(); 3039 Register scratch = scratch0();
(...skipping 325 matching lines...) Expand 10 before | Expand all | Expand 10 after
3364 __ dsra(scratch0(), key, -shift_size); 3365 __ dsra(scratch0(), key, -shift_size);
3365 } 3366 }
3366 __ Daddu(scratch0(), base, scratch0()); 3367 __ Daddu(scratch0(), base, scratch0());
3367 return MemOperand(scratch0(), base_offset); 3368 return MemOperand(scratch0(), base_offset);
3368 } 3369 }
3369 } 3370 }
3370 3371
3371 3372
3372 void LCodeGen::DoLoadKeyedGeneric(LLoadKeyedGeneric* instr) { 3373 void LCodeGen::DoLoadKeyedGeneric(LLoadKeyedGeneric* instr) {
3373 DCHECK(ToRegister(instr->context()).is(cp)); 3374 DCHECK(ToRegister(instr->context()).is(cp));
3374 DCHECK(ToRegister(instr->object()).is(LoadIC::ReceiverRegister())); 3375 DCHECK(ToRegister(instr->object()).is(LoadConvention::ReceiverRegister()));
3375 DCHECK(ToRegister(instr->key()).is(LoadIC::NameRegister())); 3376 DCHECK(ToRegister(instr->key()).is(LoadConvention::NameRegister()));
3376 3377
3377 if (FLAG_vector_ics) { 3378 if (FLAG_vector_ics) {
3378 EmitVectorLoadICRegisters<LLoadKeyedGeneric>(instr); 3379 EmitVectorLoadICRegisters<LLoadKeyedGeneric>(instr);
3379 } 3380 }
3380 3381
3381 Handle<Code> ic = isolate()->builtins()->KeyedLoadIC_Initialize(); 3382 Handle<Code> ic = isolate()->builtins()->KeyedLoadIC_Initialize();
3382 CallCode(ic, RelocInfo::CODE_TARGET, instr); 3383 CallCode(ic, RelocInfo::CODE_TARGET, instr);
3383 } 3384 }
3384 3385
3385 3386
(...skipping 800 matching lines...) Expand 10 before | Expand all | Expand 10 after
4186 kSaveFPRegs, 4187 kSaveFPRegs,
4187 EMIT_REMEMBERED_SET, 4188 EMIT_REMEMBERED_SET,
4188 instr->hydrogen()->SmiCheckForWriteBarrier(), 4189 instr->hydrogen()->SmiCheckForWriteBarrier(),
4189 instr->hydrogen()->PointersToHereCheckForValue()); 4190 instr->hydrogen()->PointersToHereCheckForValue());
4190 } 4191 }
4191 } 4192 }
4192 4193
4193 4194
4194 void LCodeGen::DoStoreNamedGeneric(LStoreNamedGeneric* instr) { 4195 void LCodeGen::DoStoreNamedGeneric(LStoreNamedGeneric* instr) {
4195 DCHECK(ToRegister(instr->context()).is(cp)); 4196 DCHECK(ToRegister(instr->context()).is(cp));
4196 DCHECK(ToRegister(instr->object()).is(StoreIC::ReceiverRegister())); 4197 DCHECK(ToRegister(instr->object()).is(StoreConvention::ReceiverRegister()));
4197 DCHECK(ToRegister(instr->value()).is(StoreIC::ValueRegister())); 4198 DCHECK(ToRegister(instr->value()).is(StoreConvention::ValueRegister()));
4198 4199
4199 __ li(StoreIC::NameRegister(), Operand(instr->name())); 4200 __ li(StoreConvention::NameRegister(), Operand(instr->name()));
4200 Handle<Code> ic = StoreIC::initialize_stub(isolate(), instr->strict_mode()); 4201 Handle<Code> ic = StoreIC::initialize_stub(isolate(), instr->strict_mode());
4201 CallCode(ic, RelocInfo::CODE_TARGET, instr); 4202 CallCode(ic, RelocInfo::CODE_TARGET, instr);
4202 } 4203 }
4203 4204
4204 4205
4205 void LCodeGen::DoBoundsCheck(LBoundsCheck* instr) { 4206 void LCodeGen::DoBoundsCheck(LBoundsCheck* instr) {
4206 Condition cc = instr->hydrogen()->allow_equality() ? hi : hs; 4207 Condition cc = instr->hydrogen()->allow_equality() ? hi : hs;
4207 Operand operand((int64_t)0); 4208 Operand operand((int64_t)0);
4208 Register reg; 4209 Register reg;
4209 if (instr->index()->IsConstantOperand()) { 4210 if (instr->index()->IsConstantOperand()) {
(...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after
4450 } else if (instr->hydrogen()->value()->representation().IsDouble()) { 4451 } else if (instr->hydrogen()->value()->representation().IsDouble()) {
4451 DoStoreKeyedFixedDoubleArray(instr); 4452 DoStoreKeyedFixedDoubleArray(instr);
4452 } else { 4453 } else {
4453 DoStoreKeyedFixedArray(instr); 4454 DoStoreKeyedFixedArray(instr);
4454 } 4455 }
4455 } 4456 }
4456 4457
4457 4458
4458 void LCodeGen::DoStoreKeyedGeneric(LStoreKeyedGeneric* instr) { 4459 void LCodeGen::DoStoreKeyedGeneric(LStoreKeyedGeneric* instr) {
4459 DCHECK(ToRegister(instr->context()).is(cp)); 4460 DCHECK(ToRegister(instr->context()).is(cp));
4460 DCHECK(ToRegister(instr->object()).is(KeyedStoreIC::ReceiverRegister())); 4461 DCHECK(ToRegister(instr->object()).is(StoreConvention::ReceiverRegister()));
4461 DCHECK(ToRegister(instr->key()).is(KeyedStoreIC::NameRegister())); 4462 DCHECK(ToRegister(instr->key()).is(StoreConvention::NameRegister()));
4462 DCHECK(ToRegister(instr->value()).is(KeyedStoreIC::ValueRegister())); 4463 DCHECK(ToRegister(instr->value()).is(StoreConvention::ValueRegister()));
4463 4464
4464 Handle<Code> ic = (instr->strict_mode() == STRICT) 4465 Handle<Code> ic = (instr->strict_mode() == STRICT)
4465 ? isolate()->builtins()->KeyedStoreIC_Initialize_Strict() 4466 ? isolate()->builtins()->KeyedStoreIC_Initialize_Strict()
4466 : isolate()->builtins()->KeyedStoreIC_Initialize(); 4467 : isolate()->builtins()->KeyedStoreIC_Initialize();
4467 CallCode(ic, RelocInfo::CODE_TARGET, instr); 4468 CallCode(ic, RelocInfo::CODE_TARGET, instr);
4468 } 4469 }
4469 4470
4470 4471
4471 void LCodeGen::DoTransitionElementsKind(LTransitionElementsKind* instr) { 4472 void LCodeGen::DoTransitionElementsKind(LTransitionElementsKind* instr) {
4472 Register object_reg = ToRegister(instr->object()); 4473 Register object_reg = ToRegister(instr->object());
(...skipping 1462 matching lines...) Expand 10 before | Expand all | Expand 10 after
5935 __ li(at, scope_info); 5936 __ li(at, scope_info);
5936 __ Push(at, ToRegister(instr->function())); 5937 __ Push(at, ToRegister(instr->function()));
5937 CallRuntime(Runtime::kPushBlockContext, 2, instr); 5938 CallRuntime(Runtime::kPushBlockContext, 2, instr);
5938 RecordSafepoint(Safepoint::kNoLazyDeopt); 5939 RecordSafepoint(Safepoint::kNoLazyDeopt);
5939 } 5940 }
5940 5941
5941 5942
5942 #undef __ 5943 #undef __
5943 5944
5944 } } // namespace v8::internal 5945 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/mips64/full-codegen-mips64.cc ('k') | src/mips64/lithium-mips64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698