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

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

Issue 503103002: MIPS: 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/mips64/lithium-codegen-mips64.h ('k') | no next file » | 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 2847 matching lines...) Expand 10 before | Expand all | Expand 10 after
2858 Register result = ToRegister(instr->result()); 2858 Register result = ToRegister(instr->result());
2859 __ li(at, Operand(Handle<Object>(instr->hydrogen()->cell().handle()))); 2859 __ li(at, Operand(Handle<Object>(instr->hydrogen()->cell().handle())));
2860 __ ld(result, FieldMemOperand(at, Cell::kValueOffset)); 2860 __ ld(result, FieldMemOperand(at, Cell::kValueOffset));
2861 if (instr->hydrogen()->RequiresHoleCheck()) { 2861 if (instr->hydrogen()->RequiresHoleCheck()) {
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>
2869 void LCodeGen::EmitVectorLoadICRegisters(T* instr) {
2870 DCHECK(FLAG_vector_ics);
2871 Register vector = ToRegister(instr->temp_vector());
2872 DCHECK(vector.is(LoadIC::VectorRegister()));
2873 __ li(vector, instr->hydrogen()->feedback_vector());
2874 // No need to allocate this register.
2875 DCHECK(LoadIC::SlotRegister().is(a0));
2876 __ li(LoadIC::SlotRegister(),
2877 Operand(Smi::FromInt(instr->hydrogen()->slot())));
2878 }
2879
2880
2868 void LCodeGen::DoLoadGlobalGeneric(LLoadGlobalGeneric* instr) { 2881 void LCodeGen::DoLoadGlobalGeneric(LLoadGlobalGeneric* instr) {
2869 DCHECK(ToRegister(instr->context()).is(cp)); 2882 DCHECK(ToRegister(instr->context()).is(cp));
2870 DCHECK(ToRegister(instr->global_object()).is(LoadIC::ReceiverRegister())); 2883 DCHECK(ToRegister(instr->global_object()).is(LoadIC::ReceiverRegister()));
2871 DCHECK(ToRegister(instr->result()).is(v0)); 2884 DCHECK(ToRegister(instr->result()).is(v0));
2872 2885
2873 __ li(LoadIC::NameRegister(), Operand(instr->name())); 2886 __ li(LoadIC::NameRegister(), Operand(instr->name()));
2874 if (FLAG_vector_ics) { 2887 if (FLAG_vector_ics) {
2875 Register vector = ToRegister(instr->temp_vector()); 2888 EmitVectorLoadICRegisters<LLoadGlobalGeneric>(instr);
2876 DCHECK(vector.is(LoadIC::VectorRegister()));
2877 __ li(vector, instr->hydrogen()->feedback_vector());
2878 // No need to allocate this register.
2879 DCHECK(LoadIC::SlotRegister().is(a0));
2880 __ li(LoadIC::SlotRegister(),
2881 Operand(Smi::FromInt(instr->hydrogen()->slot())));
2882 } 2889 }
2883 ContextualMode mode = instr->for_typeof() ? NOT_CONTEXTUAL : CONTEXTUAL; 2890 ContextualMode mode = instr->for_typeof() ? NOT_CONTEXTUAL : CONTEXTUAL;
2884 Handle<Code> ic = LoadIC::initialize_stub(isolate(), mode); 2891 Handle<Code> ic = LoadIC::initialize_stub(isolate(), mode);
2885 CallCode(ic, RelocInfo::CODE_TARGET, instr); 2892 CallCode(ic, RelocInfo::CODE_TARGET, instr);
2886 } 2893 }
2887 2894
2888 2895
2889 void LCodeGen::DoStoreGlobalCell(LStoreGlobalCell* instr) { 2896 void LCodeGen::DoStoreGlobalCell(LStoreGlobalCell* instr) {
2890 Register value = ToRegister(instr->value()); 2897 Register value = ToRegister(instr->value());
2891 Register cell = scratch0(); 2898 Register cell = scratch0();
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after
3013 3020
3014 3021
3015 void LCodeGen::DoLoadNamedGeneric(LLoadNamedGeneric* instr) { 3022 void LCodeGen::DoLoadNamedGeneric(LLoadNamedGeneric* instr) {
3016 DCHECK(ToRegister(instr->context()).is(cp)); 3023 DCHECK(ToRegister(instr->context()).is(cp));
3017 DCHECK(ToRegister(instr->object()).is(LoadIC::ReceiverRegister())); 3024 DCHECK(ToRegister(instr->object()).is(LoadIC::ReceiverRegister()));
3018 DCHECK(ToRegister(instr->result()).is(v0)); 3025 DCHECK(ToRegister(instr->result()).is(v0));
3019 3026
3020 // Name is always in a2. 3027 // Name is always in a2.
3021 __ li(LoadIC::NameRegister(), Operand(instr->name())); 3028 __ li(LoadIC::NameRegister(), Operand(instr->name()));
3022 if (FLAG_vector_ics) { 3029 if (FLAG_vector_ics) {
3023 Register vector = ToRegister(instr->temp_vector()); 3030 EmitVectorLoadICRegisters<LLoadNamedGeneric>(instr);
3024 DCHECK(vector.is(LoadIC::VectorRegister()));
3025 __ li(vector, instr->hydrogen()->feedback_vector());
3026 // No need to allocate this register.
3027 DCHECK(LoadIC::SlotRegister().is(a0));
3028 __ li(LoadIC::SlotRegister(),
3029 Operand(Smi::FromInt(instr->hydrogen()->slot())));
3030 } 3031 }
3031 Handle<Code> ic = LoadIC::initialize_stub(isolate(), NOT_CONTEXTUAL); 3032 Handle<Code> ic = LoadIC::initialize_stub(isolate(), NOT_CONTEXTUAL);
3032 CallCode(ic, RelocInfo::CODE_TARGET, instr); 3033 CallCode(ic, RelocInfo::CODE_TARGET, instr);
3033 } 3034 }
3034 3035
3035 3036
3036 void LCodeGen::DoLoadFunctionPrototype(LLoadFunctionPrototype* instr) { 3037 void LCodeGen::DoLoadFunctionPrototype(LLoadFunctionPrototype* instr) {
3037 Register scratch = scratch0(); 3038 Register scratch = scratch0();
3038 Register function = ToRegister(instr->function()); 3039 Register function = ToRegister(instr->function());
3039 Register result = ToRegister(instr->result()); 3040 Register result = ToRegister(instr->result());
(...skipping 327 matching lines...) Expand 10 before | Expand all | Expand 10 after
3367 } 3368 }
3368 } 3369 }
3369 3370
3370 3371
3371 void LCodeGen::DoLoadKeyedGeneric(LLoadKeyedGeneric* instr) { 3372 void LCodeGen::DoLoadKeyedGeneric(LLoadKeyedGeneric* instr) {
3372 DCHECK(ToRegister(instr->context()).is(cp)); 3373 DCHECK(ToRegister(instr->context()).is(cp));
3373 DCHECK(ToRegister(instr->object()).is(LoadIC::ReceiverRegister())); 3374 DCHECK(ToRegister(instr->object()).is(LoadIC::ReceiverRegister()));
3374 DCHECK(ToRegister(instr->key()).is(LoadIC::NameRegister())); 3375 DCHECK(ToRegister(instr->key()).is(LoadIC::NameRegister()));
3375 3376
3376 if (FLAG_vector_ics) { 3377 if (FLAG_vector_ics) {
3377 Register vector = ToRegister(instr->temp_vector()); 3378 EmitVectorLoadICRegisters<LLoadKeyedGeneric>(instr);
3378 DCHECK(vector.is(LoadIC::VectorRegister()));
3379 __ li(vector, instr->hydrogen()->feedback_vector());
3380 // No need to allocate this register.
3381 DCHECK(LoadIC::SlotRegister().is(a0));
3382 __ li(LoadIC::SlotRegister(),
3383 Operand(Smi::FromInt(instr->hydrogen()->slot())));
3384 } 3379 }
3385 3380
3386 Handle<Code> ic = isolate()->builtins()->KeyedLoadIC_Initialize(); 3381 Handle<Code> ic = isolate()->builtins()->KeyedLoadIC_Initialize();
3387 CallCode(ic, RelocInfo::CODE_TARGET, instr); 3382 CallCode(ic, RelocInfo::CODE_TARGET, instr);
3388 } 3383 }
3389 3384
3390 3385
3391 void LCodeGen::DoArgumentsElements(LArgumentsElements* instr) { 3386 void LCodeGen::DoArgumentsElements(LArgumentsElements* instr) {
3392 Register scratch = scratch0(); 3387 Register scratch = scratch0();
3393 Register temp = scratch1(); 3388 Register temp = scratch1();
(...skipping 2546 matching lines...) Expand 10 before | Expand all | Expand 10 after
5940 __ li(at, scope_info); 5935 __ li(at, scope_info);
5941 __ Push(at, ToRegister(instr->function())); 5936 __ Push(at, ToRegister(instr->function()));
5942 CallRuntime(Runtime::kPushBlockContext, 2, instr); 5937 CallRuntime(Runtime::kPushBlockContext, 2, instr);
5943 RecordSafepoint(Safepoint::kNoLazyDeopt); 5938 RecordSafepoint(Safepoint::kNoLazyDeopt);
5944 } 5939 }
5945 5940
5946 5941
5947 #undef __ 5942 #undef __
5948 5943
5949 } } // namespace v8::internal 5944 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/mips64/lithium-codegen-mips64.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698