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

Side by Side Diff: src/mips/lithium-codegen-mips.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, 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/lithium-codegen-mips.h ('k') | src/mips64/lithium-codegen-mips64.h » ('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 2869 matching lines...) Expand 10 before | Expand all | Expand 10 after
2880 Register result = ToRegister(instr->result()); 2880 Register result = ToRegister(instr->result());
2881 __ li(at, Operand(Handle<Object>(instr->hydrogen()->cell().handle()))); 2881 __ li(at, Operand(Handle<Object>(instr->hydrogen()->cell().handle())));
2882 __ lw(result, FieldMemOperand(at, Cell::kValueOffset)); 2882 __ lw(result, FieldMemOperand(at, Cell::kValueOffset));
2883 if (instr->hydrogen()->RequiresHoleCheck()) { 2883 if (instr->hydrogen()->RequiresHoleCheck()) {
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>
2891 void LCodeGen::EmitVectorLoadICRegisters(T* instr) {
2892 DCHECK(FLAG_vector_ics);
2893 Register vector = ToRegister(instr->temp_vector());
2894 DCHECK(vector.is(LoadIC::VectorRegister()));
2895 __ li(vector, instr->hydrogen()->feedback_vector());
2896 // No need to allocate this register.
2897 DCHECK(LoadIC::SlotRegister().is(a0));
2898 __ li(LoadIC::SlotRegister(),
2899 Operand(Smi::FromInt(instr->hydrogen()->slot())));
2900 }
2901
2902
2890 void LCodeGen::DoLoadGlobalGeneric(LLoadGlobalGeneric* instr) { 2903 void LCodeGen::DoLoadGlobalGeneric(LLoadGlobalGeneric* instr) {
2891 DCHECK(ToRegister(instr->context()).is(cp)); 2904 DCHECK(ToRegister(instr->context()).is(cp));
2892 DCHECK(ToRegister(instr->global_object()).is(LoadIC::ReceiverRegister())); 2905 DCHECK(ToRegister(instr->global_object()).is(LoadIC::ReceiverRegister()));
2893 DCHECK(ToRegister(instr->result()).is(v0)); 2906 DCHECK(ToRegister(instr->result()).is(v0));
2894 2907
2895 __ li(LoadIC::NameRegister(), Operand(instr->name())); 2908 __ li(LoadIC::NameRegister(), Operand(instr->name()));
2896 if (FLAG_vector_ics) { 2909 if (FLAG_vector_ics) {
2897 Register vector = ToRegister(instr->temp_vector()); 2910 EmitVectorLoadICRegisters<LLoadGlobalGeneric>(instr);
2898 DCHECK(vector.is(LoadIC::VectorRegister()));
2899 __ li(vector, instr->hydrogen()->feedback_vector());
2900 // No need to allocate this register.
2901 DCHECK(LoadIC::SlotRegister().is(a0));
2902 __ li(LoadIC::SlotRegister(),
2903 Operand(Smi::FromInt(instr->hydrogen()->slot())));
2904 } 2911 }
2905 ContextualMode mode = instr->for_typeof() ? NOT_CONTEXTUAL : CONTEXTUAL; 2912 ContextualMode mode = instr->for_typeof() ? NOT_CONTEXTUAL : CONTEXTUAL;
2906 Handle<Code> ic = LoadIC::initialize_stub(isolate(), mode); 2913 Handle<Code> ic = LoadIC::initialize_stub(isolate(), mode);
2907 CallCode(ic, RelocInfo::CODE_TARGET, instr); 2914 CallCode(ic, RelocInfo::CODE_TARGET, instr);
2908 } 2915 }
2909 2916
2910 2917
2911 void LCodeGen::DoStoreGlobalCell(LStoreGlobalCell* instr) { 2918 void LCodeGen::DoStoreGlobalCell(LStoreGlobalCell* instr) {
2912 Register value = ToRegister(instr->value()); 2919 Register value = ToRegister(instr->value());
2913 Register cell = scratch0(); 2920 Register cell = scratch0();
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
3021 3028
3022 3029
3023 void LCodeGen::DoLoadNamedGeneric(LLoadNamedGeneric* instr) { 3030 void LCodeGen::DoLoadNamedGeneric(LLoadNamedGeneric* instr) {
3024 DCHECK(ToRegister(instr->context()).is(cp)); 3031 DCHECK(ToRegister(instr->context()).is(cp));
3025 DCHECK(ToRegister(instr->object()).is(LoadIC::ReceiverRegister())); 3032 DCHECK(ToRegister(instr->object()).is(LoadIC::ReceiverRegister()));
3026 DCHECK(ToRegister(instr->result()).is(v0)); 3033 DCHECK(ToRegister(instr->result()).is(v0));
3027 3034
3028 // Name is always in a2. 3035 // Name is always in a2.
3029 __ li(LoadIC::NameRegister(), Operand(instr->name())); 3036 __ li(LoadIC::NameRegister(), Operand(instr->name()));
3030 if (FLAG_vector_ics) { 3037 if (FLAG_vector_ics) {
3031 Register vector = ToRegister(instr->temp_vector()); 3038 EmitVectorLoadICRegisters<LLoadNamedGeneric>(instr);
3032 DCHECK(vector.is(LoadIC::VectorRegister()));
3033 __ li(vector, instr->hydrogen()->feedback_vector());
3034 // No need to allocate this register.
3035 DCHECK(LoadIC::SlotRegister().is(a0));
3036 __ li(LoadIC::SlotRegister(),
3037 Operand(Smi::FromInt(instr->hydrogen()->slot())));
3038 } 3039 }
3039 Handle<Code> ic = LoadIC::initialize_stub(isolate(), NOT_CONTEXTUAL); 3040 Handle<Code> ic = LoadIC::initialize_stub(isolate(), NOT_CONTEXTUAL);
3040 CallCode(ic, RelocInfo::CODE_TARGET, instr); 3041 CallCode(ic, RelocInfo::CODE_TARGET, instr);
3041 } 3042 }
3042 3043
3043 3044
3044 void LCodeGen::DoLoadFunctionPrototype(LLoadFunctionPrototype* instr) { 3045 void LCodeGen::DoLoadFunctionPrototype(LLoadFunctionPrototype* instr) {
3045 Register scratch = scratch0(); 3046 Register scratch = scratch0();
3046 Register function = ToRegister(instr->function()); 3047 Register function = ToRegister(instr->function());
3047 Register result = ToRegister(instr->result()); 3048 Register result = ToRegister(instr->result());
(...skipping 286 matching lines...) Expand 10 before | Expand all | Expand 10 after
3334 } 3335 }
3335 } 3336 }
3336 3337
3337 3338
3338 void LCodeGen::DoLoadKeyedGeneric(LLoadKeyedGeneric* instr) { 3339 void LCodeGen::DoLoadKeyedGeneric(LLoadKeyedGeneric* instr) {
3339 DCHECK(ToRegister(instr->context()).is(cp)); 3340 DCHECK(ToRegister(instr->context()).is(cp));
3340 DCHECK(ToRegister(instr->object()).is(LoadIC::ReceiverRegister())); 3341 DCHECK(ToRegister(instr->object()).is(LoadIC::ReceiverRegister()));
3341 DCHECK(ToRegister(instr->key()).is(LoadIC::NameRegister())); 3342 DCHECK(ToRegister(instr->key()).is(LoadIC::NameRegister()));
3342 3343
3343 if (FLAG_vector_ics) { 3344 if (FLAG_vector_ics) {
3344 Register vector = ToRegister(instr->temp_vector()); 3345 EmitVectorLoadICRegisters<LLoadKeyedGeneric>(instr);
3345 DCHECK(vector.is(LoadIC::VectorRegister()));
3346 __ li(vector, instr->hydrogen()->feedback_vector());
3347 // No need to allocate this register.
3348 DCHECK(LoadIC::SlotRegister().is(a0));
3349 __ li(LoadIC::SlotRegister(),
3350 Operand(Smi::FromInt(instr->hydrogen()->slot())));
3351 } 3346 }
3352 3347
3353 Handle<Code> ic = isolate()->builtins()->KeyedLoadIC_Initialize(); 3348 Handle<Code> ic = isolate()->builtins()->KeyedLoadIC_Initialize();
3354 CallCode(ic, RelocInfo::CODE_TARGET, instr); 3349 CallCode(ic, RelocInfo::CODE_TARGET, instr);
3355 } 3350 }
3356 3351
3357 3352
3358 void LCodeGen::DoArgumentsElements(LArgumentsElements* instr) { 3353 void LCodeGen::DoArgumentsElements(LArgumentsElements* instr) {
3359 Register scratch = scratch0(); 3354 Register scratch = scratch0();
3360 Register temp = scratch1(); 3355 Register temp = scratch1();
(...skipping 2540 matching lines...) Expand 10 before | Expand all | Expand 10 after
5901 __ li(at, scope_info); 5896 __ li(at, scope_info);
5902 __ Push(at, ToRegister(instr->function())); 5897 __ Push(at, ToRegister(instr->function()));
5903 CallRuntime(Runtime::kPushBlockContext, 2, instr); 5898 CallRuntime(Runtime::kPushBlockContext, 2, instr);
5904 RecordSafepoint(Safepoint::kNoLazyDeopt); 5899 RecordSafepoint(Safepoint::kNoLazyDeopt);
5905 } 5900 }
5906 5901
5907 5902
5908 #undef __ 5903 #undef __
5909 5904
5910 } } // namespace v8::internal 5905 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/mips/lithium-codegen-mips.h ('k') | src/mips64/lithium-codegen-mips64.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698