| 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 #if V8_TARGET_ARCH_ARM | 5 #if V8_TARGET_ARCH_ARM |
| 6 | 6 |
| 7 #include "src/codegen.h" | 7 #include "src/codegen.h" |
| 8 #include "src/ic/ic.h" | 8 #include "src/ic/ic.h" |
| 9 #include "src/ic/ic-compiler.h" | 9 #include "src/ic/ic-compiler.h" |
| 10 #include "src/ic/stub-cache.h" | 10 #include "src/ic/stub-cache.h" |
| (...skipping 674 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 685 // r1: key. | 685 // r1: key. |
| 686 // r2: receiver. | 686 // r2: receiver. |
| 687 PropertyICCompiler::GenerateRuntimeSetProperty(masm, language_mode); | 687 PropertyICCompiler::GenerateRuntimeSetProperty(masm, language_mode); |
| 688 // Never returns to here. | 688 // Never returns to here. |
| 689 | 689 |
| 690 __ bind(&maybe_name_key); | 690 __ bind(&maybe_name_key); |
| 691 __ ldr(r4, FieldMemOperand(key, HeapObject::kMapOffset)); | 691 __ ldr(r4, FieldMemOperand(key, HeapObject::kMapOffset)); |
| 692 __ ldrb(r4, FieldMemOperand(r4, Map::kInstanceTypeOffset)); | 692 __ ldrb(r4, FieldMemOperand(r4, Map::kInstanceTypeOffset)); |
| 693 __ JumpIfNotUniqueNameInstanceType(r4, &slow); | 693 __ JumpIfNotUniqueNameInstanceType(r4, &slow); |
| 694 | 694 |
| 695 // We use register r8 when FLAG_vector_stores is enabled, because otherwise |
| 696 // probing the megamorphic stub cache would require pushing temporaries on |
| 697 // the stack. |
| 698 // TODO(mvstanton): quit using register r8 when |
| 699 // FLAG_enable_embedded_constant_pool is turned on. |
| 700 DCHECK(!FLAG_vector_stores || !FLAG_enable_embedded_constant_pool); |
| 701 Register temporary2 = FLAG_vector_stores ? r8 : r4; |
| 695 if (FLAG_vector_stores) { | 702 if (FLAG_vector_stores) { |
| 696 // The handlers in the stub cache expect a vector and slot. Since we won't | 703 // The handlers in the stub cache expect a vector and slot. Since we won't |
| 697 // change the IC from any downstream misses, a dummy vector can be used. | 704 // change the IC from any downstream misses, a dummy vector can be used. |
| 698 Register vector = VectorStoreICDescriptor::VectorRegister(); | 705 Register vector = VectorStoreICDescriptor::VectorRegister(); |
| 699 Register slot = VectorStoreICDescriptor::SlotRegister(); | 706 Register slot = VectorStoreICDescriptor::SlotRegister(); |
| 700 DCHECK(!AreAliased(vector, slot, r3, r4, r5, r6)); | 707 |
| 708 DCHECK(!AreAliased(vector, slot, r5, temporary2, r6, r9)); |
| 701 Handle<TypeFeedbackVector> dummy_vector = | 709 Handle<TypeFeedbackVector> dummy_vector = |
| 702 TypeFeedbackVector::DummyVector(masm->isolate()); | 710 TypeFeedbackVector::DummyVector(masm->isolate()); |
| 703 int slot_index = dummy_vector->GetIndex( | 711 int slot_index = dummy_vector->GetIndex( |
| 704 FeedbackVectorICSlot(TypeFeedbackVector::kDummyKeyedStoreICSlot)); | 712 FeedbackVectorICSlot(TypeFeedbackVector::kDummyKeyedStoreICSlot)); |
| 705 __ LoadRoot(vector, Heap::kDummyVectorRootIndex); | 713 __ LoadRoot(vector, Heap::kDummyVectorRootIndex); |
| 706 __ mov(slot, Operand(Smi::FromInt(slot_index))); | 714 __ mov(slot, Operand(Smi::FromInt(slot_index))); |
| 707 } | 715 } |
| 708 | 716 |
| 709 Code::Flags flags = Code::RemoveTypeAndHolderFromFlags( | 717 Code::Flags flags = Code::RemoveTypeAndHolderFromFlags( |
| 710 Code::ComputeHandlerFlags(Code::STORE_IC)); | 718 Code::ComputeHandlerFlags(Code::STORE_IC)); |
| 711 masm->isolate()->stub_cache()->GenerateProbe(masm, Code::STORE_IC, flags, | 719 masm->isolate()->stub_cache()->GenerateProbe( |
| 712 receiver, key, r3, r4, r5, r6); | 720 masm, Code::STORE_IC, flags, receiver, key, r5, temporary2, r6, r9); |
| 713 // Cache miss. | 721 // Cache miss. |
| 714 __ b(&miss); | 722 __ b(&miss); |
| 715 | 723 |
| 716 // Extra capacity case: Check if there is extra capacity to | 724 // Extra capacity case: Check if there is extra capacity to |
| 717 // perform the store and update the length. Used for adding one | 725 // perform the store and update the length. Used for adding one |
| 718 // element to the array by writing to array[array.length]. | 726 // element to the array by writing to array[array.length]. |
| 719 __ bind(&extra); | 727 __ bind(&extra); |
| 720 // Condition code from comparing key and array length is still available. | 728 // Condition code from comparing key and array length is still available. |
| 721 __ b(ne, &slow); // Only support writing to writing to array[array.length]. | 729 __ b(ne, &slow); // Only support writing to writing to array[array.length]. |
| 722 // Check for room in the elements backing store. | 730 // Check for room in the elements backing store. |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 785 int args = FLAG_vector_stores ? 5 : 3; | 793 int args = FLAG_vector_stores ? 5 : 3; |
| 786 __ TailCallRuntime(Runtime::kStoreIC_Miss, args, 1); | 794 __ TailCallRuntime(Runtime::kStoreIC_Miss, args, 1); |
| 787 } | 795 } |
| 788 | 796 |
| 789 | 797 |
| 790 void StoreIC::GenerateNormal(MacroAssembler* masm) { | 798 void StoreIC::GenerateNormal(MacroAssembler* masm) { |
| 791 Label miss; | 799 Label miss; |
| 792 Register receiver = StoreDescriptor::ReceiverRegister(); | 800 Register receiver = StoreDescriptor::ReceiverRegister(); |
| 793 Register name = StoreDescriptor::NameRegister(); | 801 Register name = StoreDescriptor::NameRegister(); |
| 794 Register value = StoreDescriptor::ValueRegister(); | 802 Register value = StoreDescriptor::ValueRegister(); |
| 795 Register dictionary = r3; | 803 Register dictionary = r5; |
| 796 DCHECK(receiver.is(r1)); | 804 DCHECK(receiver.is(r1)); |
| 797 DCHECK(name.is(r2)); | 805 DCHECK(name.is(r2)); |
| 798 DCHECK(value.is(r0)); | 806 DCHECK(value.is(r0)); |
| 807 DCHECK(VectorStoreICDescriptor::VectorRegister().is(r3)); |
| 808 DCHECK(VectorStoreICDescriptor::SlotRegister().is(r4)); |
| 799 | 809 |
| 800 __ ldr(dictionary, FieldMemOperand(receiver, JSObject::kPropertiesOffset)); | 810 __ ldr(dictionary, FieldMemOperand(receiver, JSObject::kPropertiesOffset)); |
| 801 | 811 |
| 802 GenerateDictionaryStore(masm, &miss, dictionary, name, value, r4, r5); | 812 GenerateDictionaryStore(masm, &miss, dictionary, name, value, r6, r9); |
| 803 Counters* counters = masm->isolate()->counters(); | 813 Counters* counters = masm->isolate()->counters(); |
| 804 __ IncrementCounter(counters->store_normal_hit(), 1, r4, r5); | 814 __ IncrementCounter(counters->store_normal_hit(), 1, r6, r9); |
| 805 __ Ret(); | 815 __ Ret(); |
| 806 | 816 |
| 807 __ bind(&miss); | 817 __ bind(&miss); |
| 808 __ IncrementCounter(counters->store_normal_miss(), 1, r4, r5); | 818 __ IncrementCounter(counters->store_normal_miss(), 1, r6, r9); |
| 809 GenerateMiss(masm); | 819 GenerateMiss(masm); |
| 810 } | 820 } |
| 811 | 821 |
| 812 | 822 |
| 813 #undef __ | 823 #undef __ |
| 814 | 824 |
| 815 | 825 |
| 816 Condition CompareIC::ComputeCondition(Token::Value op) { | 826 Condition CompareIC::ComputeCondition(Token::Value op) { |
| 817 switch (op) { | 827 switch (op) { |
| 818 case Token::EQ_STRICT: | 828 case Token::EQ_STRICT: |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 901 patcher.EmitCondition(ne); | 911 patcher.EmitCondition(ne); |
| 902 } else { | 912 } else { |
| 903 DCHECK(Assembler::GetCondition(branch_instr) == ne); | 913 DCHECK(Assembler::GetCondition(branch_instr) == ne); |
| 904 patcher.EmitCondition(eq); | 914 patcher.EmitCondition(eq); |
| 905 } | 915 } |
| 906 } | 916 } |
| 907 } // namespace internal | 917 } // namespace internal |
| 908 } // namespace v8 | 918 } // namespace v8 |
| 909 | 919 |
| 910 #endif // V8_TARGET_ARCH_ARM | 920 #endif // V8_TARGET_ARCH_ARM |
| OLD | NEW |