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

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

Issue 1328603003: Vector ICs: platform support for vector-based stores. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: mips build fixes. 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/arm/handler-compiler-arm.cc ('k') | src/ic/arm/ic-compiler-arm.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_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
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
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 vector = VectorStoreICDescriptor::VectorRegister();
804 Register slot = VectorStoreICDescriptor::SlotRegister();
805 Register dictionary = r5;
796 DCHECK(receiver.is(r1)); 806 DCHECK(receiver.is(r1));
797 DCHECK(name.is(r2)); 807 DCHECK(name.is(r2));
798 DCHECK(value.is(r0)); 808 DCHECK(value.is(r0));
809 DCHECK(vector.is(r3));
810 DCHECK(slot.is(r4));
799 811
800 __ ldr(dictionary, FieldMemOperand(receiver, JSObject::kPropertiesOffset)); 812 __ ldr(dictionary, FieldMemOperand(receiver, JSObject::kPropertiesOffset));
801 813
802 GenerateDictionaryStore(masm, &miss, dictionary, name, value, r4, r5); 814 GenerateDictionaryStore(masm, &miss, dictionary, name, value, r6, r9);
803 Counters* counters = masm->isolate()->counters(); 815 Counters* counters = masm->isolate()->counters();
804 __ IncrementCounter(counters->store_normal_hit(), 1, r4, r5); 816 __ IncrementCounter(counters->store_normal_hit(), 1, r6, r9);
805 __ Ret(); 817 __ Ret();
806 818
807 __ bind(&miss); 819 __ bind(&miss);
808 __ IncrementCounter(counters->store_normal_miss(), 1, r4, r5); 820 __ IncrementCounter(counters->store_normal_miss(), 1, r6, r9);
809 GenerateMiss(masm); 821 GenerateMiss(masm);
810 } 822 }
811 823
812 824
813 #undef __ 825 #undef __
814 826
815 827
816 Condition CompareIC::ComputeCondition(Token::Value op) { 828 Condition CompareIC::ComputeCondition(Token::Value op) {
817 switch (op) { 829 switch (op) {
818 case Token::EQ_STRICT: 830 case Token::EQ_STRICT:
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
901 patcher.EmitCondition(ne); 913 patcher.EmitCondition(ne);
902 } else { 914 } else {
903 DCHECK(Assembler::GetCondition(branch_instr) == ne); 915 DCHECK(Assembler::GetCondition(branch_instr) == ne);
904 patcher.EmitCondition(eq); 916 patcher.EmitCondition(eq);
905 } 917 }
906 } 918 }
907 } // namespace internal 919 } // namespace internal
908 } // namespace v8 920 } // namespace v8
909 921
910 #endif // V8_TARGET_ARCH_ARM 922 #endif // V8_TARGET_ARCH_ARM
OLDNEW
« no previous file with comments | « src/ic/arm/handler-compiler-arm.cc ('k') | src/ic/arm/ic-compiler-arm.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698