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_IA32 | 5 #if V8_TARGET_ARCH_IA32 |
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 559 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
570 TypeFeedbackVector::DummyVector(masm->isolate()); | 570 TypeFeedbackVector::DummyVector(masm->isolate()); |
571 int slot = dummy_vector->GetIndex( | 571 int slot = dummy_vector->GetIndex( |
572 FeedbackVectorICSlot(TypeFeedbackVector::kDummyKeyedStoreICSlot)); | 572 FeedbackVectorICSlot(TypeFeedbackVector::kDummyKeyedStoreICSlot)); |
573 __ push(Immediate(Smi::FromInt(slot))); | 573 __ push(Immediate(Smi::FromInt(slot))); |
574 __ push(Immediate(dummy_vector)); | 574 __ push(Immediate(dummy_vector)); |
575 } | 575 } |
576 | 576 |
577 Code::Flags flags = Code::RemoveTypeAndHolderFromFlags( | 577 Code::Flags flags = Code::RemoveTypeAndHolderFromFlags( |
578 Code::ComputeHandlerFlags(Code::STORE_IC)); | 578 Code::ComputeHandlerFlags(Code::STORE_IC)); |
579 masm->isolate()->stub_cache()->GenerateProbe(masm, Code::STORE_IC, flags, | 579 masm->isolate()->stub_cache()->GenerateProbe(masm, Code::STORE_IC, flags, |
580 receiver, key, edi, no_reg); | 580 receiver, key, ebx, no_reg); |
581 | 581 |
582 if (FLAG_vector_stores) { | 582 if (FLAG_vector_stores) { |
583 __ pop(VectorStoreICDescriptor::VectorRegister()); | 583 __ pop(VectorStoreICDescriptor::VectorRegister()); |
584 __ pop(VectorStoreICDescriptor::SlotRegister()); | 584 __ pop(VectorStoreICDescriptor::SlotRegister()); |
585 } | 585 } |
586 | 586 |
587 // Cache miss. | 587 // Cache miss. |
588 __ jmp(&miss); | 588 __ jmp(&miss); |
589 | 589 |
590 // Extra capacity case: Check if there is extra capacity to | 590 // Extra capacity case: Check if there is extra capacity to |
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
727 __ push(ebx); | 727 __ push(ebx); |
728 | 728 |
729 // Do tail-call to runtime routine. | 729 // Do tail-call to runtime routine. |
730 __ TailCallRuntime(is_strong(language_mode) ? Runtime::kKeyedGetPropertyStrong | 730 __ TailCallRuntime(is_strong(language_mode) ? Runtime::kKeyedGetPropertyStrong |
731 : Runtime::kKeyedGetProperty, | 731 : Runtime::kKeyedGetProperty, |
732 2, 1); | 732 2, 1); |
733 } | 733 } |
734 | 734 |
735 | 735 |
736 void StoreIC::GenerateMegamorphic(MacroAssembler* masm) { | 736 void StoreIC::GenerateMegamorphic(MacroAssembler* masm) { |
737 if (FLAG_vector_stores) { | |
738 // This shouldn't be called. | |
739 __ int3(); | |
740 return; | |
741 } | |
742 | |
743 // Return address is on the stack. | 737 // Return address is on the stack. |
744 Code::Flags flags = Code::RemoveTypeAndHolderFromFlags( | 738 Code::Flags flags = Code::RemoveTypeAndHolderFromFlags( |
745 Code::ComputeHandlerFlags(Code::STORE_IC)); | 739 Code::ComputeHandlerFlags(Code::STORE_IC)); |
746 masm->isolate()->stub_cache()->GenerateProbe( | 740 masm->isolate()->stub_cache()->GenerateProbe( |
747 masm, Code::STORE_IC, flags, StoreDescriptor::ReceiverRegister(), | 741 masm, Code::STORE_IC, flags, StoreDescriptor::ReceiverRegister(), |
748 StoreDescriptor::NameRegister(), ebx, no_reg); | 742 StoreDescriptor::NameRegister(), ebx, no_reg); |
749 | 743 |
750 // Cache miss: Jump to runtime. | 744 // Cache miss: Jump to runtime. |
751 GenerateMiss(masm); | 745 GenerateMiss(masm); |
752 } | 746 } |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
786 int args = FLAG_vector_stores ? 5 : 3; | 780 int args = FLAG_vector_stores ? 5 : 3; |
787 __ TailCallRuntime(Runtime::kStoreIC_Miss, args, 1); | 781 __ TailCallRuntime(Runtime::kStoreIC_Miss, args, 1); |
788 } | 782 } |
789 | 783 |
790 | 784 |
791 void StoreIC::GenerateNormal(MacroAssembler* masm) { | 785 void StoreIC::GenerateNormal(MacroAssembler* masm) { |
792 Label restore_miss; | 786 Label restore_miss; |
793 Register receiver = StoreDescriptor::ReceiverRegister(); | 787 Register receiver = StoreDescriptor::ReceiverRegister(); |
794 Register name = StoreDescriptor::NameRegister(); | 788 Register name = StoreDescriptor::NameRegister(); |
795 Register value = StoreDescriptor::ValueRegister(); | 789 Register value = StoreDescriptor::ValueRegister(); |
796 Register vector = VectorStoreICDescriptor::VectorRegister(); | 790 Register dictionary = ebx; |
797 Register slot = VectorStoreICDescriptor::SlotRegister(); | 791 |
| 792 __ mov(dictionary, FieldOperand(receiver, JSObject::kPropertiesOffset)); |
798 | 793 |
799 // A lot of registers are needed for storing to slow case | 794 // A lot of registers are needed for storing to slow case |
800 // objects. Push and restore receiver but rely on | 795 // objects. Push and restore receiver but rely on |
801 // GenerateDictionaryStore preserving the value and name. | 796 // GenerateDictionaryStore preserving the value and name. |
802 __ push(receiver); | 797 __ push(receiver); |
803 if (FLAG_vector_stores) { | |
804 __ push(vector); | |
805 __ push(slot); | |
806 } | |
807 | |
808 Register dictionary = ebx; | |
809 __ mov(dictionary, FieldOperand(receiver, JSObject::kPropertiesOffset)); | |
810 GenerateDictionaryStore(masm, &restore_miss, dictionary, name, value, | 798 GenerateDictionaryStore(masm, &restore_miss, dictionary, name, value, |
811 receiver, edi); | 799 receiver, edi); |
812 __ Drop(FLAG_vector_stores ? 3 : 1); | 800 __ Drop(1); |
813 Counters* counters = masm->isolate()->counters(); | 801 Counters* counters = masm->isolate()->counters(); |
814 __ IncrementCounter(counters->store_normal_hit(), 1); | 802 __ IncrementCounter(counters->store_normal_hit(), 1); |
815 __ ret(0); | 803 __ ret(0); |
816 | 804 |
817 __ bind(&restore_miss); | 805 __ bind(&restore_miss); |
818 if (FLAG_vector_stores) { | |
819 __ pop(slot); | |
820 __ pop(vector); | |
821 } | |
822 __ pop(receiver); | 806 __ pop(receiver); |
823 __ IncrementCounter(counters->store_normal_miss(), 1); | 807 __ IncrementCounter(counters->store_normal_miss(), 1); |
824 GenerateMiss(masm); | 808 GenerateMiss(masm); |
825 } | 809 } |
826 | 810 |
827 | 811 |
828 void KeyedStoreIC::GenerateMiss(MacroAssembler* masm) { | 812 void KeyedStoreIC::GenerateMiss(MacroAssembler* masm) { |
829 // Return address is on the stack. | 813 // Return address is on the stack. |
830 StoreIC_PushArgs(masm); | 814 StoreIC_PushArgs(masm); |
831 | 815 |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
902 Condition cc = | 886 Condition cc = |
903 (check == ENABLE_INLINED_SMI_CHECK) | 887 (check == ENABLE_INLINED_SMI_CHECK) |
904 ? (*jmp_address == Assembler::kJncShortOpcode ? not_zero : zero) | 888 ? (*jmp_address == Assembler::kJncShortOpcode ? not_zero : zero) |
905 : (*jmp_address == Assembler::kJnzShortOpcode ? not_carry : carry); | 889 : (*jmp_address == Assembler::kJnzShortOpcode ? not_carry : carry); |
906 *jmp_address = static_cast<byte>(Assembler::kJccShortPrefix | cc); | 890 *jmp_address = static_cast<byte>(Assembler::kJccShortPrefix | cc); |
907 } | 891 } |
908 } // namespace internal | 892 } // namespace internal |
909 } // namespace v8 | 893 } // namespace v8 |
910 | 894 |
911 #endif // V8_TARGET_ARCH_IA32 | 895 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |