OLD | NEW |
1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 the V8 project authors. All rights reserved. |
2 // | 2 // |
3 // Use of this source code is governed by a BSD-style license that can be | 3 // Use of this source code is governed by a BSD-style license that can be |
4 // found in the LICENSE file. | 4 // found in the LICENSE file. |
5 | 5 |
6 #include "src/crankshaft/s390/lithium-codegen-s390.h" | 6 #include "src/crankshaft/s390/lithium-codegen-s390.h" |
7 | 7 |
8 #include "src/base/bits.h" | 8 #include "src/base/bits.h" |
9 #include "src/code-factory.h" | 9 #include "src/code-factory.h" |
10 #include "src/code-stubs.h" | 10 #include "src/code-stubs.h" |
(...skipping 2628 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2639 | 2639 |
2640 AllowDeferredHandleDereference vector_structure_check; | 2640 AllowDeferredHandleDereference vector_structure_check; |
2641 Handle<TypeFeedbackVector> vector = instr->hydrogen()->feedback_vector(); | 2641 Handle<TypeFeedbackVector> vector = instr->hydrogen()->feedback_vector(); |
2642 __ Move(vector_register, vector); | 2642 __ Move(vector_register, vector); |
2643 // No need to allocate this register. | 2643 // No need to allocate this register. |
2644 FeedbackVectorSlot slot = instr->hydrogen()->slot(); | 2644 FeedbackVectorSlot slot = instr->hydrogen()->slot(); |
2645 int index = vector->GetIndex(slot); | 2645 int index = vector->GetIndex(slot); |
2646 __ LoadSmiLiteral(slot_register, Smi::FromInt(index)); | 2646 __ LoadSmiLiteral(slot_register, Smi::FromInt(index)); |
2647 } | 2647 } |
2648 | 2648 |
2649 template <class T> | |
2650 void LCodeGen::EmitVectorStoreICRegisters(T* instr) { | |
2651 Register vector_register = ToRegister(instr->temp_vector()); | |
2652 Register slot_register = ToRegister(instr->temp_slot()); | |
2653 | |
2654 AllowDeferredHandleDereference vector_structure_check; | |
2655 Handle<TypeFeedbackVector> vector = instr->hydrogen()->feedback_vector(); | |
2656 __ Move(vector_register, vector); | |
2657 FeedbackVectorSlot slot = instr->hydrogen()->slot(); | |
2658 int index = vector->GetIndex(slot); | |
2659 __ LoadSmiLiteral(slot_register, Smi::FromInt(index)); | |
2660 } | |
2661 | |
2662 void LCodeGen::DoLoadGlobalGeneric(LLoadGlobalGeneric* instr) { | 2649 void LCodeGen::DoLoadGlobalGeneric(LLoadGlobalGeneric* instr) { |
2663 DCHECK(ToRegister(instr->context()).is(cp)); | 2650 DCHECK(ToRegister(instr->context()).is(cp)); |
2664 DCHECK(ToRegister(instr->result()).is(r2)); | 2651 DCHECK(ToRegister(instr->result()).is(r2)); |
2665 | 2652 |
2666 EmitVectorLoadICRegisters<LLoadGlobalGeneric>(instr); | 2653 EmitVectorLoadICRegisters<LLoadGlobalGeneric>(instr); |
2667 Handle<Code> ic = | 2654 Handle<Code> ic = |
2668 CodeFactory::LoadGlobalICInOptimizedCode(isolate(), instr->typeof_mode()) | 2655 CodeFactory::LoadGlobalICInOptimizedCode(isolate(), instr->typeof_mode()) |
2669 .code(); | 2656 .code(); |
2670 CallCode(ic, RelocInfo::CODE_TARGET, instr); | 2657 CallCode(ic, RelocInfo::CODE_TARGET, instr); |
2671 } | 2658 } |
(...skipping 1587 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4259 // By cases: external, fast double | 4246 // By cases: external, fast double |
4260 if (instr->is_fixed_typed_array()) { | 4247 if (instr->is_fixed_typed_array()) { |
4261 DoStoreKeyedExternalArray(instr); | 4248 DoStoreKeyedExternalArray(instr); |
4262 } else if (instr->hydrogen()->value()->representation().IsDouble()) { | 4249 } else if (instr->hydrogen()->value()->representation().IsDouble()) { |
4263 DoStoreKeyedFixedDoubleArray(instr); | 4250 DoStoreKeyedFixedDoubleArray(instr); |
4264 } else { | 4251 } else { |
4265 DoStoreKeyedFixedArray(instr); | 4252 DoStoreKeyedFixedArray(instr); |
4266 } | 4253 } |
4267 } | 4254 } |
4268 | 4255 |
4269 void LCodeGen::DoStoreKeyedGeneric(LStoreKeyedGeneric* instr) { | |
4270 DCHECK(ToRegister(instr->context()).is(cp)); | |
4271 DCHECK(ToRegister(instr->object()).is(StoreDescriptor::ReceiverRegister())); | |
4272 DCHECK(ToRegister(instr->key()).is(StoreDescriptor::NameRegister())); | |
4273 DCHECK(ToRegister(instr->value()).is(StoreDescriptor::ValueRegister())); | |
4274 | |
4275 EmitVectorStoreICRegisters<LStoreKeyedGeneric>(instr); | |
4276 | |
4277 Handle<Code> ic = CodeFactory::KeyedStoreICInOptimizedCode( | |
4278 isolate(), instr->language_mode()) | |
4279 .code(); | |
4280 CallCode(ic, RelocInfo::CODE_TARGET, instr); | |
4281 } | |
4282 | |
4283 void LCodeGen::DoMaybeGrowElements(LMaybeGrowElements* instr) { | 4256 void LCodeGen::DoMaybeGrowElements(LMaybeGrowElements* instr) { |
4284 class DeferredMaybeGrowElements final : public LDeferredCode { | 4257 class DeferredMaybeGrowElements final : public LDeferredCode { |
4285 public: | 4258 public: |
4286 DeferredMaybeGrowElements(LCodeGen* codegen, LMaybeGrowElements* instr) | 4259 DeferredMaybeGrowElements(LCodeGen* codegen, LMaybeGrowElements* instr) |
4287 : LDeferredCode(codegen), instr_(instr) {} | 4260 : LDeferredCode(codegen), instr_(instr) {} |
4288 void Generate() override { codegen()->DoDeferredMaybeGrowElements(instr_); } | 4261 void Generate() override { codegen()->DoDeferredMaybeGrowElements(instr_); } |
4289 LInstruction* instr() override { return instr_; } | 4262 LInstruction* instr() override { return instr_; } |
4290 | 4263 |
4291 private: | 4264 private: |
4292 LMaybeGrowElements* instr_; | 4265 LMaybeGrowElements* instr_; |
(...skipping 1358 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5651 __ LoadP(result, | 5624 __ LoadP(result, |
5652 FieldMemOperand(scratch, FixedArray::kHeaderSize - kPointerSize)); | 5625 FieldMemOperand(scratch, FixedArray::kHeaderSize - kPointerSize)); |
5653 __ bind(deferred->exit()); | 5626 __ bind(deferred->exit()); |
5654 __ bind(&done); | 5627 __ bind(&done); |
5655 } | 5628 } |
5656 | 5629 |
5657 #undef __ | 5630 #undef __ |
5658 | 5631 |
5659 } // namespace internal | 5632 } // namespace internal |
5660 } // namespace v8 | 5633 } // namespace v8 |
OLD | NEW |