OLD | NEW |
1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 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/crankshaft/ppc/lithium-codegen-ppc.h" | 5 #include "src/crankshaft/ppc/lithium-codegen-ppc.h" |
6 | 6 |
7 #include "src/base/bits.h" | 7 #include "src/base/bits.h" |
8 #include "src/code-factory.h" | 8 #include "src/code-factory.h" |
9 #include "src/code-stubs.h" | 9 #include "src/code-stubs.h" |
10 #include "src/crankshaft/hydrogen-osr.h" | 10 #include "src/crankshaft/hydrogen-osr.h" |
(...skipping 2653 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2664 AllowDeferredHandleDereference vector_structure_check; | 2664 AllowDeferredHandleDereference vector_structure_check; |
2665 Handle<TypeFeedbackVector> vector = instr->hydrogen()->feedback_vector(); | 2665 Handle<TypeFeedbackVector> vector = instr->hydrogen()->feedback_vector(); |
2666 __ Move(vector_register, vector); | 2666 __ Move(vector_register, vector); |
2667 // No need to allocate this register. | 2667 // No need to allocate this register. |
2668 FeedbackVectorSlot slot = instr->hydrogen()->slot(); | 2668 FeedbackVectorSlot slot = instr->hydrogen()->slot(); |
2669 int index = vector->GetIndex(slot); | 2669 int index = vector->GetIndex(slot); |
2670 __ LoadSmiLiteral(slot_register, Smi::FromInt(index)); | 2670 __ LoadSmiLiteral(slot_register, Smi::FromInt(index)); |
2671 } | 2671 } |
2672 | 2672 |
2673 | 2673 |
2674 template <class T> | |
2675 void LCodeGen::EmitVectorStoreICRegisters(T* instr) { | |
2676 Register vector_register = ToRegister(instr->temp_vector()); | |
2677 Register slot_register = ToRegister(instr->temp_slot()); | |
2678 | |
2679 AllowDeferredHandleDereference vector_structure_check; | |
2680 Handle<TypeFeedbackVector> vector = instr->hydrogen()->feedback_vector(); | |
2681 __ Move(vector_register, vector); | |
2682 FeedbackVectorSlot slot = instr->hydrogen()->slot(); | |
2683 int index = vector->GetIndex(slot); | |
2684 __ LoadSmiLiteral(slot_register, Smi::FromInt(index)); | |
2685 } | |
2686 | |
2687 | |
2688 void LCodeGen::DoLoadGlobalGeneric(LLoadGlobalGeneric* instr) { | 2674 void LCodeGen::DoLoadGlobalGeneric(LLoadGlobalGeneric* instr) { |
2689 DCHECK(ToRegister(instr->context()).is(cp)); | 2675 DCHECK(ToRegister(instr->context()).is(cp)); |
2690 DCHECK(ToRegister(instr->result()).is(r3)); | 2676 DCHECK(ToRegister(instr->result()).is(r3)); |
2691 | 2677 |
2692 EmitVectorLoadICRegisters<LLoadGlobalGeneric>(instr); | 2678 EmitVectorLoadICRegisters<LLoadGlobalGeneric>(instr); |
2693 Handle<Code> ic = | 2679 Handle<Code> ic = |
2694 CodeFactory::LoadGlobalICInOptimizedCode(isolate(), instr->typeof_mode()) | 2680 CodeFactory::LoadGlobalICInOptimizedCode(isolate(), instr->typeof_mode()) |
2695 .code(); | 2681 .code(); |
2696 CallCode(ic, RelocInfo::CODE_TARGET, instr); | 2682 CallCode(ic, RelocInfo::CODE_TARGET, instr); |
2697 } | 2683 } |
(...skipping 1618 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4316 if (instr->is_fixed_typed_array()) { | 4302 if (instr->is_fixed_typed_array()) { |
4317 DoStoreKeyedExternalArray(instr); | 4303 DoStoreKeyedExternalArray(instr); |
4318 } else if (instr->hydrogen()->value()->representation().IsDouble()) { | 4304 } else if (instr->hydrogen()->value()->representation().IsDouble()) { |
4319 DoStoreKeyedFixedDoubleArray(instr); | 4305 DoStoreKeyedFixedDoubleArray(instr); |
4320 } else { | 4306 } else { |
4321 DoStoreKeyedFixedArray(instr); | 4307 DoStoreKeyedFixedArray(instr); |
4322 } | 4308 } |
4323 } | 4309 } |
4324 | 4310 |
4325 | 4311 |
4326 void LCodeGen::DoStoreKeyedGeneric(LStoreKeyedGeneric* instr) { | |
4327 DCHECK(ToRegister(instr->context()).is(cp)); | |
4328 DCHECK(ToRegister(instr->object()).is(StoreDescriptor::ReceiverRegister())); | |
4329 DCHECK(ToRegister(instr->key()).is(StoreDescriptor::NameRegister())); | |
4330 DCHECK(ToRegister(instr->value()).is(StoreDescriptor::ValueRegister())); | |
4331 | |
4332 EmitVectorStoreICRegisters<LStoreKeyedGeneric>(instr); | |
4333 | |
4334 Handle<Code> ic = CodeFactory::KeyedStoreICInOptimizedCode( | |
4335 isolate(), instr->language_mode()) | |
4336 .code(); | |
4337 CallCode(ic, RelocInfo::CODE_TARGET, instr); | |
4338 } | |
4339 | |
4340 | |
4341 void LCodeGen::DoMaybeGrowElements(LMaybeGrowElements* instr) { | 4312 void LCodeGen::DoMaybeGrowElements(LMaybeGrowElements* instr) { |
4342 class DeferredMaybeGrowElements final : public LDeferredCode { | 4313 class DeferredMaybeGrowElements final : public LDeferredCode { |
4343 public: | 4314 public: |
4344 DeferredMaybeGrowElements(LCodeGen* codegen, LMaybeGrowElements* instr) | 4315 DeferredMaybeGrowElements(LCodeGen* codegen, LMaybeGrowElements* instr) |
4345 : LDeferredCode(codegen), instr_(instr) {} | 4316 : LDeferredCode(codegen), instr_(instr) {} |
4346 void Generate() override { codegen()->DoDeferredMaybeGrowElements(instr_); } | 4317 void Generate() override { codegen()->DoDeferredMaybeGrowElements(instr_); } |
4347 LInstruction* instr() override { return instr_; } | 4318 LInstruction* instr() override { return instr_; } |
4348 | 4319 |
4349 private: | 4320 private: |
4350 LMaybeGrowElements* instr_; | 4321 LMaybeGrowElements* instr_; |
(...skipping 1410 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5761 __ LoadP(result, | 5732 __ LoadP(result, |
5762 FieldMemOperand(scratch, FixedArray::kHeaderSize - kPointerSize)); | 5733 FieldMemOperand(scratch, FixedArray::kHeaderSize - kPointerSize)); |
5763 __ bind(deferred->exit()); | 5734 __ bind(deferred->exit()); |
5764 __ bind(&done); | 5735 __ bind(&done); |
5765 } | 5736 } |
5766 | 5737 |
5767 #undef __ | 5738 #undef __ |
5768 | 5739 |
5769 } // namespace internal | 5740 } // namespace internal |
5770 } // namespace v8 | 5741 } // namespace v8 |
OLD | NEW |