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

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

Issue 1209903003: VectorICs: Lithium support for vector-based stores. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix and REBASE. Created 5 years, 6 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
« no previous file with comments | « src/mips/lithium-codegen-mips.h ('k') | src/mips/lithium-mips.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 2839 matching lines...) Expand 10 before | Expand all | Expand 10 after
2850 AllowDeferredHandleDereference vector_structure_check; 2850 AllowDeferredHandleDereference vector_structure_check;
2851 Handle<TypeFeedbackVector> vector = instr->hydrogen()->feedback_vector(); 2851 Handle<TypeFeedbackVector> vector = instr->hydrogen()->feedback_vector();
2852 __ li(vector_register, vector); 2852 __ li(vector_register, vector);
2853 // No need to allocate this register. 2853 // No need to allocate this register.
2854 FeedbackVectorICSlot slot = instr->hydrogen()->slot(); 2854 FeedbackVectorICSlot slot = instr->hydrogen()->slot();
2855 int index = vector->GetIndex(slot); 2855 int index = vector->GetIndex(slot);
2856 __ li(slot_register, Operand(Smi::FromInt(index))); 2856 __ li(slot_register, Operand(Smi::FromInt(index)));
2857 } 2857 }
2858 2858
2859 2859
2860 template <class T>
2861 void LCodeGen::EmitVectorStoreICRegisters(T* instr) {
2862 Register vector_register = ToRegister(instr->temp_vector());
2863 Register slot_register = ToRegister(instr->temp_slot());
2864
2865 AllowDeferredHandleDereference vector_structure_check;
2866 Handle<TypeFeedbackVector> vector = instr->hydrogen()->feedback_vector();
2867 __ li(vector_register, vector);
2868 FeedbackVectorICSlot slot = instr->hydrogen()->slot();
2869 int index = vector->GetIndex(slot);
2870 __ li(slot_register, Operand(Smi::FromInt(index)));
2871 }
2872
2873
2860 void LCodeGen::DoLoadGlobalGeneric(LLoadGlobalGeneric* instr) { 2874 void LCodeGen::DoLoadGlobalGeneric(LLoadGlobalGeneric* instr) {
2861 DCHECK(ToRegister(instr->context()).is(cp)); 2875 DCHECK(ToRegister(instr->context()).is(cp));
2862 DCHECK(ToRegister(instr->global_object()) 2876 DCHECK(ToRegister(instr->global_object())
2863 .is(LoadDescriptor::ReceiverRegister())); 2877 .is(LoadDescriptor::ReceiverRegister()));
2864 DCHECK(ToRegister(instr->result()).is(v0)); 2878 DCHECK(ToRegister(instr->result()).is(v0));
2865 2879
2866 __ li(LoadDescriptor::NameRegister(), Operand(instr->name())); 2880 __ li(LoadDescriptor::NameRegister(), Operand(instr->name()));
2867 EmitVectorLoadICRegisters<LLoadGlobalGeneric>(instr); 2881 EmitVectorLoadICRegisters<LLoadGlobalGeneric>(instr);
2868 ContextualMode mode = instr->for_typeof() ? NOT_CONTEXTUAL : CONTEXTUAL; 2882 ContextualMode mode = instr->for_typeof() ? NOT_CONTEXTUAL : CONTEXTUAL;
2869 Handle<Code> ic = CodeFactory::LoadICInOptimizedCode(isolate(), mode, 2883 Handle<Code> ic = CodeFactory::LoadICInOptimizedCode(isolate(), mode,
(...skipping 1274 matching lines...) Expand 10 before | Expand all | Expand 10 after
4144 } 4158 }
4145 } 4159 }
4146 } 4160 }
4147 4161
4148 4162
4149 void LCodeGen::DoStoreNamedGeneric(LStoreNamedGeneric* instr) { 4163 void LCodeGen::DoStoreNamedGeneric(LStoreNamedGeneric* instr) {
4150 DCHECK(ToRegister(instr->context()).is(cp)); 4164 DCHECK(ToRegister(instr->context()).is(cp));
4151 DCHECK(ToRegister(instr->object()).is(StoreDescriptor::ReceiverRegister())); 4165 DCHECK(ToRegister(instr->object()).is(StoreDescriptor::ReceiverRegister()));
4152 DCHECK(ToRegister(instr->value()).is(StoreDescriptor::ValueRegister())); 4166 DCHECK(ToRegister(instr->value()).is(StoreDescriptor::ValueRegister()));
4153 4167
4168 if (instr->hydrogen()->HasVectorAndSlot()) {
4169 EmitVectorStoreICRegisters<LStoreNamedGeneric>(instr);
4170 }
4171
4154 __ li(StoreDescriptor::NameRegister(), Operand(instr->name())); 4172 __ li(StoreDescriptor::NameRegister(), Operand(instr->name()));
4155 Handle<Code> ic = 4173 Handle<Code> ic = CodeFactory::StoreICInOptimizedCode(
4156 StoreIC::initialize_stub(isolate(), instr->language_mode(), 4174 isolate(), instr->language_mode(),
4157 instr->hydrogen()->initialization_state()); 4175 instr->hydrogen()->initialization_state()).code();
4158 CallCode(ic, RelocInfo::CODE_TARGET, instr); 4176 CallCode(ic, RelocInfo::CODE_TARGET, instr);
4159 } 4177 }
4160 4178
4161 4179
4162 void LCodeGen::DoBoundsCheck(LBoundsCheck* instr) { 4180 void LCodeGen::DoBoundsCheck(LBoundsCheck* instr) {
4163 Condition cc = instr->hydrogen()->allow_equality() ? hi : hs; 4181 Condition cc = instr->hydrogen()->allow_equality() ? hi : hs;
4164 Operand operand(0); 4182 Operand operand(0);
4165 Register reg; 4183 Register reg;
4166 if (instr->index()->IsConstantOperand()) { 4184 if (instr->index()->IsConstantOperand()) {
4167 operand = ToOperand(instr->index()); 4185 operand = ToOperand(instr->index());
(...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after
4378 } 4396 }
4379 } 4397 }
4380 4398
4381 4399
4382 void LCodeGen::DoStoreKeyedGeneric(LStoreKeyedGeneric* instr) { 4400 void LCodeGen::DoStoreKeyedGeneric(LStoreKeyedGeneric* instr) {
4383 DCHECK(ToRegister(instr->context()).is(cp)); 4401 DCHECK(ToRegister(instr->context()).is(cp));
4384 DCHECK(ToRegister(instr->object()).is(StoreDescriptor::ReceiverRegister())); 4402 DCHECK(ToRegister(instr->object()).is(StoreDescriptor::ReceiverRegister()));
4385 DCHECK(ToRegister(instr->key()).is(StoreDescriptor::NameRegister())); 4403 DCHECK(ToRegister(instr->key()).is(StoreDescriptor::NameRegister()));
4386 DCHECK(ToRegister(instr->value()).is(StoreDescriptor::ValueRegister())); 4404 DCHECK(ToRegister(instr->value()).is(StoreDescriptor::ValueRegister()));
4387 4405
4406 if (instr->hydrogen()->HasVectorAndSlot()) {
4407 EmitVectorStoreICRegisters<LStoreKeyedGeneric>(instr);
4408 }
4409
4388 Handle<Code> ic = CodeFactory::KeyedStoreICInOptimizedCode( 4410 Handle<Code> ic = CodeFactory::KeyedStoreICInOptimizedCode(
4389 isolate(), instr->language_mode(), 4411 isolate(), instr->language_mode(),
4390 instr->hydrogen()->initialization_state()).code(); 4412 instr->hydrogen()->initialization_state()).code();
4391 CallCode(ic, RelocInfo::CODE_TARGET, instr); 4413 CallCode(ic, RelocInfo::CODE_TARGET, instr);
4392 } 4414 }
4393 4415
4394 4416
4395 void LCodeGen::DoMaybeGrowElements(LMaybeGrowElements* instr) { 4417 void LCodeGen::DoMaybeGrowElements(LMaybeGrowElements* instr) {
4396 class DeferredMaybeGrowElements final : public LDeferredCode { 4418 class DeferredMaybeGrowElements final : public LDeferredCode {
4397 public: 4419 public:
(...skipping 1605 matching lines...) Expand 10 before | Expand all | Expand 10 after
6003 __ Push(at, ToRegister(instr->function())); 6025 __ Push(at, ToRegister(instr->function()));
6004 CallRuntime(Runtime::kPushBlockContext, 2, instr); 6026 CallRuntime(Runtime::kPushBlockContext, 2, instr);
6005 RecordSafepoint(Safepoint::kNoLazyDeopt); 6027 RecordSafepoint(Safepoint::kNoLazyDeopt);
6006 } 6028 }
6007 6029
6008 6030
6009 #undef __ 6031 #undef __
6010 6032
6011 } // namespace internal 6033 } // namespace internal
6012 } // namespace v8 6034 } // namespace v8
OLDNEW
« no previous file with comments | « src/mips/lithium-codegen-mips.h ('k') | src/mips/lithium-mips.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698