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

Side by Side Diff: src/arm/lithium-codegen-arm.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, 5 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/arm/lithium-codegen-arm.h ('k') | src/arm64/lithium-arm64.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. 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/arm/lithium-codegen-arm.h" 7 #include "src/arm/lithium-codegen-arm.h"
8 #include "src/arm/lithium-gap-resolver-arm.h" 8 #include "src/arm/lithium-gap-resolver-arm.h"
9 #include "src/base/bits.h" 9 #include "src/base/bits.h"
10 #include "src/code-factory.h" 10 #include "src/code-factory.h"
(...skipping 2929 matching lines...) Expand 10 before | Expand all | Expand 10 after
2940 AllowDeferredHandleDereference vector_structure_check; 2940 AllowDeferredHandleDereference vector_structure_check;
2941 Handle<TypeFeedbackVector> vector = instr->hydrogen()->feedback_vector(); 2941 Handle<TypeFeedbackVector> vector = instr->hydrogen()->feedback_vector();
2942 __ Move(vector_register, vector); 2942 __ Move(vector_register, vector);
2943 // No need to allocate this register. 2943 // No need to allocate this register.
2944 FeedbackVectorICSlot slot = instr->hydrogen()->slot(); 2944 FeedbackVectorICSlot slot = instr->hydrogen()->slot();
2945 int index = vector->GetIndex(slot); 2945 int index = vector->GetIndex(slot);
2946 __ mov(slot_register, Operand(Smi::FromInt(index))); 2946 __ mov(slot_register, Operand(Smi::FromInt(index)));
2947 } 2947 }
2948 2948
2949 2949
2950 template <class T>
2951 void LCodeGen::EmitVectorStoreICRegisters(T* instr) {
2952 Register vector_register = ToRegister(instr->temp_vector());
2953 Register slot_register = ToRegister(instr->temp_slot());
2954
2955 AllowDeferredHandleDereference vector_structure_check;
2956 Handle<TypeFeedbackVector> vector = instr->hydrogen()->feedback_vector();
2957 __ Move(vector_register, vector);
2958 FeedbackVectorICSlot slot = instr->hydrogen()->slot();
2959 int index = vector->GetIndex(slot);
2960 __ mov(slot_register, Operand(Smi::FromInt(index)));
2961 }
2962
2963
2950 void LCodeGen::DoLoadGlobalGeneric(LLoadGlobalGeneric* instr) { 2964 void LCodeGen::DoLoadGlobalGeneric(LLoadGlobalGeneric* instr) {
2951 DCHECK(ToRegister(instr->context()).is(cp)); 2965 DCHECK(ToRegister(instr->context()).is(cp));
2952 DCHECK(ToRegister(instr->global_object()) 2966 DCHECK(ToRegister(instr->global_object())
2953 .is(LoadDescriptor::ReceiverRegister())); 2967 .is(LoadDescriptor::ReceiverRegister()));
2954 DCHECK(ToRegister(instr->result()).is(r0)); 2968 DCHECK(ToRegister(instr->result()).is(r0));
2955 2969
2956 __ mov(LoadDescriptor::NameRegister(), Operand(instr->name())); 2970 __ mov(LoadDescriptor::NameRegister(), Operand(instr->name()));
2957 EmitVectorLoadICRegisters<LLoadGlobalGeneric>(instr); 2971 EmitVectorLoadICRegisters<LLoadGlobalGeneric>(instr);
2958 ContextualMode mode = instr->for_typeof() ? NOT_CONTEXTUAL : CONTEXTUAL; 2972 ContextualMode mode = instr->for_typeof() ? NOT_CONTEXTUAL : CONTEXTUAL;
2959 Handle<Code> ic = CodeFactory::LoadICInOptimizedCode(isolate(), mode, 2973 Handle<Code> ic = CodeFactory::LoadICInOptimizedCode(isolate(), mode,
(...skipping 1225 matching lines...) Expand 10 before | Expand all | Expand 10 after
4185 } 4199 }
4186 } 4200 }
4187 } 4201 }
4188 4202
4189 4203
4190 void LCodeGen::DoStoreNamedGeneric(LStoreNamedGeneric* instr) { 4204 void LCodeGen::DoStoreNamedGeneric(LStoreNamedGeneric* instr) {
4191 DCHECK(ToRegister(instr->context()).is(cp)); 4205 DCHECK(ToRegister(instr->context()).is(cp));
4192 DCHECK(ToRegister(instr->object()).is(StoreDescriptor::ReceiverRegister())); 4206 DCHECK(ToRegister(instr->object()).is(StoreDescriptor::ReceiverRegister()));
4193 DCHECK(ToRegister(instr->value()).is(StoreDescriptor::ValueRegister())); 4207 DCHECK(ToRegister(instr->value()).is(StoreDescriptor::ValueRegister()));
4194 4208
4209 if (instr->hydrogen()->HasVectorAndSlot()) {
4210 EmitVectorStoreICRegisters<LStoreNamedGeneric>(instr);
4211 }
4212
4195 __ mov(StoreDescriptor::NameRegister(), Operand(instr->name())); 4213 __ mov(StoreDescriptor::NameRegister(), Operand(instr->name()));
4196 Handle<Code> ic = 4214 Handle<Code> ic = CodeFactory::StoreICInOptimizedCode(
4197 StoreIC::initialize_stub(isolate(), instr->language_mode(), 4215 isolate(), instr->language_mode(),
4198 instr->hydrogen()->initialization_state()); 4216 instr->hydrogen()->initialization_state()).code();
4199 CallCode(ic, RelocInfo::CODE_TARGET, instr, NEVER_INLINE_TARGET_ADDRESS); 4217 CallCode(ic, RelocInfo::CODE_TARGET, instr, NEVER_INLINE_TARGET_ADDRESS);
4200 } 4218 }
4201 4219
4202 4220
4203 void LCodeGen::DoBoundsCheck(LBoundsCheck* instr) { 4221 void LCodeGen::DoBoundsCheck(LBoundsCheck* instr) {
4204 Condition cc = instr->hydrogen()->allow_equality() ? hi : hs; 4222 Condition cc = instr->hydrogen()->allow_equality() ? hi : hs;
4205 if (instr->index()->IsConstantOperand()) { 4223 if (instr->index()->IsConstantOperand()) {
4206 Operand index = ToOperand(instr->index()); 4224 Operand index = ToOperand(instr->index());
4207 Register length = ToRegister(instr->length()); 4225 Register length = ToRegister(instr->length());
4208 __ cmp(length, index); 4226 __ cmp(length, index);
(...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after
4409 } 4427 }
4410 } 4428 }
4411 4429
4412 4430
4413 void LCodeGen::DoStoreKeyedGeneric(LStoreKeyedGeneric* instr) { 4431 void LCodeGen::DoStoreKeyedGeneric(LStoreKeyedGeneric* instr) {
4414 DCHECK(ToRegister(instr->context()).is(cp)); 4432 DCHECK(ToRegister(instr->context()).is(cp));
4415 DCHECK(ToRegister(instr->object()).is(StoreDescriptor::ReceiverRegister())); 4433 DCHECK(ToRegister(instr->object()).is(StoreDescriptor::ReceiverRegister()));
4416 DCHECK(ToRegister(instr->key()).is(StoreDescriptor::NameRegister())); 4434 DCHECK(ToRegister(instr->key()).is(StoreDescriptor::NameRegister()));
4417 DCHECK(ToRegister(instr->value()).is(StoreDescriptor::ValueRegister())); 4435 DCHECK(ToRegister(instr->value()).is(StoreDescriptor::ValueRegister()));
4418 4436
4437 if (instr->hydrogen()->HasVectorAndSlot()) {
4438 EmitVectorStoreICRegisters<LStoreKeyedGeneric>(instr);
4439 }
4440
4419 Handle<Code> ic = CodeFactory::KeyedStoreICInOptimizedCode( 4441 Handle<Code> ic = CodeFactory::KeyedStoreICInOptimizedCode(
4420 isolate(), instr->language_mode(), 4442 isolate(), instr->language_mode(),
4421 instr->hydrogen()->initialization_state()).code(); 4443 instr->hydrogen()->initialization_state()).code();
4422 CallCode(ic, RelocInfo::CODE_TARGET, instr, NEVER_INLINE_TARGET_ADDRESS); 4444 CallCode(ic, RelocInfo::CODE_TARGET, instr, NEVER_INLINE_TARGET_ADDRESS);
4423 } 4445 }
4424 4446
4425 4447
4426 void LCodeGen::DoMaybeGrowElements(LMaybeGrowElements* instr) { 4448 void LCodeGen::DoMaybeGrowElements(LMaybeGrowElements* instr) {
4427 class DeferredMaybeGrowElements final : public LDeferredCode { 4449 class DeferredMaybeGrowElements final : public LDeferredCode {
4428 public: 4450 public:
(...skipping 1535 matching lines...) Expand 10 before | Expand all | Expand 10 after
5964 __ push(ToRegister(instr->function())); 5986 __ push(ToRegister(instr->function()));
5965 CallRuntime(Runtime::kPushBlockContext, 2, instr); 5987 CallRuntime(Runtime::kPushBlockContext, 2, instr);
5966 RecordSafepoint(Safepoint::kNoLazyDeopt); 5988 RecordSafepoint(Safepoint::kNoLazyDeopt);
5967 } 5989 }
5968 5990
5969 5991
5970 #undef __ 5992 #undef __
5971 5993
5972 } // namespace internal 5994 } // namespace internal
5973 } // namespace v8 5995 } // namespace v8
OLDNEW
« no previous file with comments | « src/arm/lithium-codegen-arm.h ('k') | src/arm64/lithium-arm64.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698