| OLD | NEW |
| 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/crankshaft/mips64/lithium-codegen-mips64.h" | 5 #include "src/crankshaft/mips64/lithium-codegen-mips64.h" |
| 6 | 6 |
| 7 #include "src/code-factory.h" | 7 #include "src/code-factory.h" |
| 8 #include "src/code-stubs.h" | 8 #include "src/code-stubs.h" |
| 9 #include "src/crankshaft/hydrogen-osr.h" | 9 #include "src/crankshaft/hydrogen-osr.h" |
| 10 #include "src/crankshaft/mips64/lithium-gap-resolver-mips64.h" | 10 #include "src/crankshaft/mips64/lithium-gap-resolver-mips64.h" |
| (...skipping 2599 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2610 AllowDeferredHandleDereference vector_structure_check; | 2610 AllowDeferredHandleDereference vector_structure_check; |
| 2611 Handle<TypeFeedbackVector> vector = instr->hydrogen()->feedback_vector(); | 2611 Handle<TypeFeedbackVector> vector = instr->hydrogen()->feedback_vector(); |
| 2612 __ li(vector_register, vector); | 2612 __ li(vector_register, vector); |
| 2613 // No need to allocate this register. | 2613 // No need to allocate this register. |
| 2614 FeedbackVectorSlot slot = instr->hydrogen()->slot(); | 2614 FeedbackVectorSlot slot = instr->hydrogen()->slot(); |
| 2615 int index = vector->GetIndex(slot); | 2615 int index = vector->GetIndex(slot); |
| 2616 __ li(slot_register, Operand(Smi::FromInt(index))); | 2616 __ li(slot_register, Operand(Smi::FromInt(index))); |
| 2617 } | 2617 } |
| 2618 | 2618 |
| 2619 | 2619 |
| 2620 template <class T> | |
| 2621 void LCodeGen::EmitVectorStoreICRegisters(T* instr) { | |
| 2622 Register vector_register = ToRegister(instr->temp_vector()); | |
| 2623 Register slot_register = ToRegister(instr->temp_slot()); | |
| 2624 | |
| 2625 AllowDeferredHandleDereference vector_structure_check; | |
| 2626 Handle<TypeFeedbackVector> vector = instr->hydrogen()->feedback_vector(); | |
| 2627 __ li(vector_register, vector); | |
| 2628 FeedbackVectorSlot slot = instr->hydrogen()->slot(); | |
| 2629 int index = vector->GetIndex(slot); | |
| 2630 __ li(slot_register, Operand(Smi::FromInt(index))); | |
| 2631 } | |
| 2632 | |
| 2633 | |
| 2634 void LCodeGen::DoLoadGlobalGeneric(LLoadGlobalGeneric* instr) { | 2620 void LCodeGen::DoLoadGlobalGeneric(LLoadGlobalGeneric* instr) { |
| 2635 DCHECK(ToRegister(instr->context()).is(cp)); | 2621 DCHECK(ToRegister(instr->context()).is(cp)); |
| 2636 DCHECK(ToRegister(instr->result()).is(v0)); | 2622 DCHECK(ToRegister(instr->result()).is(v0)); |
| 2637 | 2623 |
| 2638 EmitVectorLoadICRegisters<LLoadGlobalGeneric>(instr); | 2624 EmitVectorLoadICRegisters<LLoadGlobalGeneric>(instr); |
| 2639 Handle<Code> ic = | 2625 Handle<Code> ic = |
| 2640 CodeFactory::LoadGlobalICInOptimizedCode(isolate(), instr->typeof_mode()) | 2626 CodeFactory::LoadGlobalICInOptimizedCode(isolate(), instr->typeof_mode()) |
| 2641 .code(); | 2627 .code(); |
| 2642 CallCode(ic, RelocInfo::CODE_TARGET, instr); | 2628 CallCode(ic, RelocInfo::CODE_TARGET, instr); |
| 2643 } | 2629 } |
| (...skipping 1590 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4234 if (instr->is_fixed_typed_array()) { | 4220 if (instr->is_fixed_typed_array()) { |
| 4235 DoStoreKeyedExternalArray(instr); | 4221 DoStoreKeyedExternalArray(instr); |
| 4236 } else if (instr->hydrogen()->value()->representation().IsDouble()) { | 4222 } else if (instr->hydrogen()->value()->representation().IsDouble()) { |
| 4237 DoStoreKeyedFixedDoubleArray(instr); | 4223 DoStoreKeyedFixedDoubleArray(instr); |
| 4238 } else { | 4224 } else { |
| 4239 DoStoreKeyedFixedArray(instr); | 4225 DoStoreKeyedFixedArray(instr); |
| 4240 } | 4226 } |
| 4241 } | 4227 } |
| 4242 | 4228 |
| 4243 | 4229 |
| 4244 void LCodeGen::DoStoreKeyedGeneric(LStoreKeyedGeneric* instr) { | |
| 4245 DCHECK(ToRegister(instr->context()).is(cp)); | |
| 4246 DCHECK(ToRegister(instr->object()).is(StoreDescriptor::ReceiverRegister())); | |
| 4247 DCHECK(ToRegister(instr->key()).is(StoreDescriptor::NameRegister())); | |
| 4248 DCHECK(ToRegister(instr->value()).is(StoreDescriptor::ValueRegister())); | |
| 4249 | |
| 4250 EmitVectorStoreICRegisters<LStoreKeyedGeneric>(instr); | |
| 4251 | |
| 4252 Handle<Code> ic = CodeFactory::KeyedStoreICInOptimizedCode( | |
| 4253 isolate(), instr->language_mode()) | |
| 4254 .code(); | |
| 4255 CallCode(ic, RelocInfo::CODE_TARGET, instr); | |
| 4256 } | |
| 4257 | |
| 4258 | |
| 4259 void LCodeGen::DoMaybeGrowElements(LMaybeGrowElements* instr) { | 4230 void LCodeGen::DoMaybeGrowElements(LMaybeGrowElements* instr) { |
| 4260 class DeferredMaybeGrowElements final : public LDeferredCode { | 4231 class DeferredMaybeGrowElements final : public LDeferredCode { |
| 4261 public: | 4232 public: |
| 4262 DeferredMaybeGrowElements(LCodeGen* codegen, LMaybeGrowElements* instr) | 4233 DeferredMaybeGrowElements(LCodeGen* codegen, LMaybeGrowElements* instr) |
| 4263 : LDeferredCode(codegen), instr_(instr) {} | 4234 : LDeferredCode(codegen), instr_(instr) {} |
| 4264 void Generate() override { codegen()->DoDeferredMaybeGrowElements(instr_); } | 4235 void Generate() override { codegen()->DoDeferredMaybeGrowElements(instr_); } |
| 4265 LInstruction* instr() override { return instr_; } | 4236 LInstruction* instr() override { return instr_; } |
| 4266 | 4237 |
| 4267 private: | 4238 private: |
| 4268 LMaybeGrowElements* instr_; | 4239 LMaybeGrowElements* instr_; |
| (...skipping 1459 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5728 __ ld(result, FieldMemOperand(scratch, | 5699 __ ld(result, FieldMemOperand(scratch, |
| 5729 FixedArray::kHeaderSize - kPointerSize)); | 5700 FixedArray::kHeaderSize - kPointerSize)); |
| 5730 __ bind(deferred->exit()); | 5701 __ bind(deferred->exit()); |
| 5731 __ bind(&done); | 5702 __ bind(&done); |
| 5732 } | 5703 } |
| 5733 | 5704 |
| 5734 #undef __ | 5705 #undef __ |
| 5735 | 5706 |
| 5736 } // namespace internal | 5707 } // namespace internal |
| 5737 } // namespace v8 | 5708 } // namespace v8 |
| OLD | NEW |