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