OLD | NEW |
1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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/arm64/lithium-codegen-arm64.h" | 5 #include "src/crankshaft/arm64/lithium-codegen-arm64.h" |
6 | 6 |
7 #include "src/arm64/frames-arm64.h" | 7 #include "src/arm64/frames-arm64.h" |
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 2998 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3009 AllowDeferredHandleDereference vector_structure_check; | 3009 AllowDeferredHandleDereference vector_structure_check; |
3010 Handle<TypeFeedbackVector> vector = instr->hydrogen()->feedback_vector(); | 3010 Handle<TypeFeedbackVector> vector = instr->hydrogen()->feedback_vector(); |
3011 __ Mov(vector_register, vector); | 3011 __ Mov(vector_register, vector); |
3012 // No need to allocate this register. | 3012 // No need to allocate this register. |
3013 FeedbackVectorSlot slot = instr->hydrogen()->slot(); | 3013 FeedbackVectorSlot slot = instr->hydrogen()->slot(); |
3014 int index = vector->GetIndex(slot); | 3014 int index = vector->GetIndex(slot); |
3015 __ Mov(slot_register, Smi::FromInt(index)); | 3015 __ Mov(slot_register, Smi::FromInt(index)); |
3016 } | 3016 } |
3017 | 3017 |
3018 | 3018 |
3019 template <class T> | |
3020 void LCodeGen::EmitVectorStoreICRegisters(T* instr) { | |
3021 Register vector_register = ToRegister(instr->temp_vector()); | |
3022 Register slot_register = ToRegister(instr->temp_slot()); | |
3023 | |
3024 AllowDeferredHandleDereference vector_structure_check; | |
3025 Handle<TypeFeedbackVector> vector = instr->hydrogen()->feedback_vector(); | |
3026 __ Mov(vector_register, vector); | |
3027 FeedbackVectorSlot slot = instr->hydrogen()->slot(); | |
3028 int index = vector->GetIndex(slot); | |
3029 __ Mov(slot_register, Smi::FromInt(index)); | |
3030 } | |
3031 | |
3032 | |
3033 void LCodeGen::DoLoadGlobalGeneric(LLoadGlobalGeneric* instr) { | 3019 void LCodeGen::DoLoadGlobalGeneric(LLoadGlobalGeneric* instr) { |
3034 DCHECK(ToRegister(instr->context()).is(cp)); | 3020 DCHECK(ToRegister(instr->context()).is(cp)); |
3035 DCHECK(ToRegister(instr->result()).Is(x0)); | 3021 DCHECK(ToRegister(instr->result()).Is(x0)); |
3036 | 3022 |
3037 EmitVectorLoadICRegisters<LLoadGlobalGeneric>(instr); | 3023 EmitVectorLoadICRegisters<LLoadGlobalGeneric>(instr); |
3038 Handle<Code> ic = | 3024 Handle<Code> ic = |
3039 CodeFactory::LoadGlobalICInOptimizedCode(isolate(), instr->typeof_mode()) | 3025 CodeFactory::LoadGlobalICInOptimizedCode(isolate(), instr->typeof_mode()) |
3040 .code(); | 3026 .code(); |
3041 CallCode(ic, RelocInfo::CODE_TARGET, instr); | 3027 CallCode(ic, RelocInfo::CODE_TARGET, instr); |
3042 } | 3028 } |
(...skipping 1878 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4921 ? OMIT_SMI_CHECK : INLINE_SMI_CHECK; | 4907 ? OMIT_SMI_CHECK : INLINE_SMI_CHECK; |
4922 // Compute address of modified element and store it into key register. | 4908 // Compute address of modified element and store it into key register. |
4923 __ Add(element_addr, mem_op.base(), mem_op.OffsetAsOperand()); | 4909 __ Add(element_addr, mem_op.base(), mem_op.OffsetAsOperand()); |
4924 __ RecordWrite(elements, element_addr, value, GetLinkRegisterState(), | 4910 __ RecordWrite(elements, element_addr, value, GetLinkRegisterState(), |
4925 kSaveFPRegs, EMIT_REMEMBERED_SET, check_needed, | 4911 kSaveFPRegs, EMIT_REMEMBERED_SET, check_needed, |
4926 instr->hydrogen()->PointersToHereCheckForValue()); | 4912 instr->hydrogen()->PointersToHereCheckForValue()); |
4927 } | 4913 } |
4928 } | 4914 } |
4929 | 4915 |
4930 | 4916 |
4931 void LCodeGen::DoStoreKeyedGeneric(LStoreKeyedGeneric* instr) { | |
4932 DCHECK(ToRegister(instr->context()).is(cp)); | |
4933 DCHECK(ToRegister(instr->object()).is(StoreDescriptor::ReceiverRegister())); | |
4934 DCHECK(ToRegister(instr->key()).is(StoreDescriptor::NameRegister())); | |
4935 DCHECK(ToRegister(instr->value()).is(StoreDescriptor::ValueRegister())); | |
4936 | |
4937 EmitVectorStoreICRegisters<LStoreKeyedGeneric>(instr); | |
4938 | |
4939 Handle<Code> ic = CodeFactory::KeyedStoreICInOptimizedCode( | |
4940 isolate(), instr->language_mode()) | |
4941 .code(); | |
4942 CallCode(ic, RelocInfo::CODE_TARGET, instr); | |
4943 } | |
4944 | |
4945 | |
4946 void LCodeGen::DoMaybeGrowElements(LMaybeGrowElements* instr) { | 4917 void LCodeGen::DoMaybeGrowElements(LMaybeGrowElements* instr) { |
4947 class DeferredMaybeGrowElements final : public LDeferredCode { | 4918 class DeferredMaybeGrowElements final : public LDeferredCode { |
4948 public: | 4919 public: |
4949 DeferredMaybeGrowElements(LCodeGen* codegen, LMaybeGrowElements* instr) | 4920 DeferredMaybeGrowElements(LCodeGen* codegen, LMaybeGrowElements* instr) |
4950 : LDeferredCode(codegen), instr_(instr) {} | 4921 : LDeferredCode(codegen), instr_(instr) {} |
4951 void Generate() override { codegen()->DoDeferredMaybeGrowElements(instr_); } | 4922 void Generate() override { codegen()->DoDeferredMaybeGrowElements(instr_); } |
4952 LInstruction* instr() override { return instr_; } | 4923 LInstruction* instr() override { return instr_; } |
4953 | 4924 |
4954 private: | 4925 private: |
4955 LMaybeGrowElements* instr_; | 4926 LMaybeGrowElements* instr_; |
(...skipping 723 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5679 // Index is equal to negated out of object property index plus 1. | 5650 // Index is equal to negated out of object property index plus 1. |
5680 __ Sub(result, result, Operand::UntagSmiAndScale(index, kPointerSizeLog2)); | 5651 __ Sub(result, result, Operand::UntagSmiAndScale(index, kPointerSizeLog2)); |
5681 __ Ldr(result, FieldMemOperand(result, | 5652 __ Ldr(result, FieldMemOperand(result, |
5682 FixedArray::kHeaderSize - kPointerSize)); | 5653 FixedArray::kHeaderSize - kPointerSize)); |
5683 __ Bind(deferred->exit()); | 5654 __ Bind(deferred->exit()); |
5684 __ Bind(&done); | 5655 __ Bind(&done); |
5685 } | 5656 } |
5686 | 5657 |
5687 } // namespace internal | 5658 } // namespace internal |
5688 } // namespace v8 | 5659 } // namespace v8 |
OLD | NEW |