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_MIPS | 5 #if V8_TARGET_ARCH_MIPS |
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 663 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
674 __ bind(&maybe_name_key); | 674 __ bind(&maybe_name_key); |
675 __ lw(t0, FieldMemOperand(key, HeapObject::kMapOffset)); | 675 __ lw(t0, FieldMemOperand(key, HeapObject::kMapOffset)); |
676 __ lb(t0, FieldMemOperand(t0, Map::kInstanceTypeOffset)); | 676 __ lb(t0, FieldMemOperand(t0, Map::kInstanceTypeOffset)); |
677 __ JumpIfNotUniqueNameInstanceType(t0, &slow); | 677 __ JumpIfNotUniqueNameInstanceType(t0, &slow); |
678 | 678 |
679 if (FLAG_vector_stores) { | 679 if (FLAG_vector_stores) { |
680 // The handlers in the stub cache expect a vector and slot. Since we won't | 680 // The handlers in the stub cache expect a vector and slot. Since we won't |
681 // change the IC from any downstream misses, a dummy vector can be used. | 681 // change the IC from any downstream misses, a dummy vector can be used. |
682 Register vector = VectorStoreICDescriptor::VectorRegister(); | 682 Register vector = VectorStoreICDescriptor::VectorRegister(); |
683 Register slot = VectorStoreICDescriptor::SlotRegister(); | 683 Register slot = VectorStoreICDescriptor::SlotRegister(); |
684 DCHECK(!AreAliased(vector, slot, a3, t0, t1, t2)); | 684 DCHECK(!AreAliased(vector, slot, t1, t2, t4, t5)); |
685 Handle<TypeFeedbackVector> dummy_vector = | 685 Handle<TypeFeedbackVector> dummy_vector = |
686 TypeFeedbackVector::DummyVector(masm->isolate()); | 686 TypeFeedbackVector::DummyVector(masm->isolate()); |
687 int slot_index = dummy_vector->GetIndex( | 687 int slot_index = dummy_vector->GetIndex( |
688 FeedbackVectorICSlot(TypeFeedbackVector::kDummyKeyedStoreICSlot)); | 688 FeedbackVectorICSlot(TypeFeedbackVector::kDummyKeyedStoreICSlot)); |
689 __ LoadRoot(vector, Heap::kDummyVectorRootIndex); | 689 __ LoadRoot(vector, Heap::kDummyVectorRootIndex); |
690 __ li(slot, Operand(Smi::FromInt(slot_index))); | 690 __ li(slot, Operand(Smi::FromInt(slot_index))); |
691 } | 691 } |
692 | 692 |
693 Code::Flags flags = Code::RemoveTypeAndHolderFromFlags( | 693 Code::Flags flags = Code::RemoveTypeAndHolderFromFlags( |
694 Code::ComputeHandlerFlags(Code::STORE_IC)); | 694 Code::ComputeHandlerFlags(Code::STORE_IC)); |
695 masm->isolate()->stub_cache()->GenerateProbe(masm, Code::STORE_IC, flags, | 695 masm->isolate()->stub_cache()->GenerateProbe(masm, Code::STORE_IC, flags, |
696 receiver, key, a3, t0, t1, t2); | 696 receiver, key, t1, t2, t4, t5); |
697 // Cache miss. | 697 // Cache miss. |
698 __ Branch(&miss); | 698 __ Branch(&miss); |
699 | 699 |
700 // Extra capacity case: Check if there is extra capacity to | 700 // Extra capacity case: Check if there is extra capacity to |
701 // perform the store and update the length. Used for adding one | 701 // perform the store and update the length. Used for adding one |
702 // element to the array by writing to array[array.length]. | 702 // element to the array by writing to array[array.length]. |
703 __ bind(&extra); | 703 __ bind(&extra); |
704 // Condition code from comparing key and array length is still available. | 704 // Condition code from comparing key and array length is still available. |
705 // Only support writing to array[array.length]. | 705 // Only support writing to array[array.length]. |
706 __ Branch(&slow, ne, key, Operand(t0)); | 706 __ Branch(&slow, ne, key, Operand(t0)); |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
787 int args = FLAG_vector_stores ? 5 : 3; | 787 int args = FLAG_vector_stores ? 5 : 3; |
788 __ TailCallRuntime(Runtime::kStoreIC_Miss, args, 1); | 788 __ TailCallRuntime(Runtime::kStoreIC_Miss, args, 1); |
789 } | 789 } |
790 | 790 |
791 | 791 |
792 void StoreIC::GenerateNormal(MacroAssembler* masm) { | 792 void StoreIC::GenerateNormal(MacroAssembler* masm) { |
793 Label miss; | 793 Label miss; |
794 Register receiver = StoreDescriptor::ReceiverRegister(); | 794 Register receiver = StoreDescriptor::ReceiverRegister(); |
795 Register name = StoreDescriptor::NameRegister(); | 795 Register name = StoreDescriptor::NameRegister(); |
796 Register value = StoreDescriptor::ValueRegister(); | 796 Register value = StoreDescriptor::ValueRegister(); |
797 Register dictionary = a3; | 797 Register vector = VectorStoreICDescriptor::VectorRegister(); |
| 798 Register slot = VectorStoreICDescriptor::SlotRegister(); |
| 799 Register dictionary = t1; |
798 DCHECK(receiver.is(a1)); | 800 DCHECK(receiver.is(a1)); |
799 DCHECK(name.is(a2)); | 801 DCHECK(name.is(a2)); |
800 DCHECK(value.is(a0)); | 802 DCHECK(value.is(a0)); |
| 803 DCHECK(vector.is(a3)); |
| 804 DCHECK(slot.is(t0)); |
801 | 805 |
802 __ lw(dictionary, FieldMemOperand(receiver, JSObject::kPropertiesOffset)); | 806 __ lw(dictionary, FieldMemOperand(receiver, JSObject::kPropertiesOffset)); |
803 | 807 |
804 GenerateDictionaryStore(masm, &miss, dictionary, name, value, t0, t1); | 808 GenerateDictionaryStore(masm, &miss, dictionary, name, value, t2, t5); |
805 Counters* counters = masm->isolate()->counters(); | 809 Counters* counters = masm->isolate()->counters(); |
806 __ IncrementCounter(counters->store_normal_hit(), 1, t0, t1); | 810 __ IncrementCounter(counters->store_normal_hit(), 1, t2, t5); |
807 __ Ret(); | 811 __ Ret(); |
808 | 812 |
809 __ bind(&miss); | 813 __ bind(&miss); |
810 __ IncrementCounter(counters->store_normal_miss(), 1, t0, t1); | 814 __ IncrementCounter(counters->store_normal_miss(), 1, t2, t5); |
811 GenerateMiss(masm); | 815 GenerateMiss(masm); |
812 } | 816 } |
813 | 817 |
814 | 818 |
815 #undef __ | 819 #undef __ |
816 | 820 |
817 | 821 |
818 Condition CompareIC::ComputeCondition(Token::Value op) { | 822 Condition CompareIC::ComputeCondition(Token::Value op) { |
819 switch (op) { | 823 switch (op) { |
820 case Token::EQ_STRICT: | 824 case Token::EQ_STRICT: |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
904 patcher.ChangeBranchCondition(ne); | 908 patcher.ChangeBranchCondition(ne); |
905 } else { | 909 } else { |
906 DCHECK(Assembler::IsBne(branch_instr)); | 910 DCHECK(Assembler::IsBne(branch_instr)); |
907 patcher.ChangeBranchCondition(eq); | 911 patcher.ChangeBranchCondition(eq); |
908 } | 912 } |
909 } | 913 } |
910 } // namespace internal | 914 } // namespace internal |
911 } // namespace v8 | 915 } // namespace v8 |
912 | 916 |
913 #endif // V8_TARGET_ARCH_MIPS | 917 #endif // V8_TARGET_ARCH_MIPS |
OLD | NEW |