Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(6)

Side by Side Diff: src/ic/mips/ic-mips.cc

Issue 1319123004: Reland Vector ICs: platform support for vector-based stores. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix for arm[64] release build failure. Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/ic/mips/ic-compiler-mips.cc ('k') | src/ic/mips/stub-cache-mips.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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 dictionary = t1;
798 DCHECK(receiver.is(a1)); 798 DCHECK(receiver.is(a1));
799 DCHECK(name.is(a2)); 799 DCHECK(name.is(a2));
800 DCHECK(value.is(a0)); 800 DCHECK(value.is(a0));
801 DCHECK(VectorStoreICDescriptor::VectorRegister().is(a3));
802 DCHECK(VectorStoreICDescriptor::SlotRegister().is(t0));
801 803
802 __ lw(dictionary, FieldMemOperand(receiver, JSObject::kPropertiesOffset)); 804 __ lw(dictionary, FieldMemOperand(receiver, JSObject::kPropertiesOffset));
803 805
804 GenerateDictionaryStore(masm, &miss, dictionary, name, value, t0, t1); 806 GenerateDictionaryStore(masm, &miss, dictionary, name, value, t2, t5);
805 Counters* counters = masm->isolate()->counters(); 807 Counters* counters = masm->isolate()->counters();
806 __ IncrementCounter(counters->store_normal_hit(), 1, t0, t1); 808 __ IncrementCounter(counters->store_normal_hit(), 1, t2, t5);
807 __ Ret(); 809 __ Ret();
808 810
809 __ bind(&miss); 811 __ bind(&miss);
810 __ IncrementCounter(counters->store_normal_miss(), 1, t0, t1); 812 __ IncrementCounter(counters->store_normal_miss(), 1, t2, t5);
811 GenerateMiss(masm); 813 GenerateMiss(masm);
812 } 814 }
813 815
814 816
815 #undef __ 817 #undef __
816 818
817 819
818 Condition CompareIC::ComputeCondition(Token::Value op) { 820 Condition CompareIC::ComputeCondition(Token::Value op) {
819 switch (op) { 821 switch (op) {
820 case Token::EQ_STRICT: 822 case Token::EQ_STRICT:
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
904 patcher.ChangeBranchCondition(ne); 906 patcher.ChangeBranchCondition(ne);
905 } else { 907 } else {
906 DCHECK(Assembler::IsBne(branch_instr)); 908 DCHECK(Assembler::IsBne(branch_instr));
907 patcher.ChangeBranchCondition(eq); 909 patcher.ChangeBranchCondition(eq);
908 } 910 }
909 } 911 }
910 } // namespace internal 912 } // namespace internal
911 } // namespace v8 913 } // namespace v8
912 914
913 #endif // V8_TARGET_ARCH_MIPS 915 #endif // V8_TARGET_ARCH_MIPS
OLDNEW
« no previous file with comments | « src/ic/mips/ic-compiler-mips.cc ('k') | src/ic/mips/stub-cache-mips.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698