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 #include "src/v8.h" | 5 #include "src/v8.h" |
6 | 6 |
7 #if V8_TARGET_ARCH_IA32 | 7 #if V8_TARGET_ARCH_IA32 |
8 | 8 |
9 #include "src/codegen.h" | 9 #include "src/codegen.h" |
10 #include "src/ic/ic.h" | 10 #include "src/ic/ic.h" |
(...skipping 733 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
744 // Cache miss: Jump to runtime. | 744 // Cache miss: Jump to runtime. |
745 GenerateMiss(masm); | 745 GenerateMiss(masm); |
746 } | 746 } |
747 | 747 |
748 | 748 |
749 static void StoreIC_PushArgs(MacroAssembler* masm) { | 749 static void StoreIC_PushArgs(MacroAssembler* masm) { |
750 Register receiver = StoreDescriptor::ReceiverRegister(); | 750 Register receiver = StoreDescriptor::ReceiverRegister(); |
751 Register name = StoreDescriptor::NameRegister(); | 751 Register name = StoreDescriptor::NameRegister(); |
752 Register value = StoreDescriptor::ValueRegister(); | 752 Register value = StoreDescriptor::ValueRegister(); |
753 | 753 |
754 DCHECK(!ebx.is(receiver) && !ebx.is(name) && !ebx.is(value)); | 754 if (FLAG_vector_stores) { |
| 755 Register slot = VectorStoreICDescriptor::SlotRegister(); |
| 756 Register vector = VectorStoreICDescriptor::VectorRegister(); |
755 | 757 |
756 __ pop(ebx); | 758 __ xchg(receiver, Operand(esp, 0)); |
757 __ push(receiver); | 759 __ push(name); |
758 __ push(name); | 760 __ push(value); |
759 __ push(value); | 761 __ push(slot); |
760 __ push(ebx); | 762 __ push(vector); |
| 763 __ push(receiver); // Contains the return address. |
| 764 } else { |
| 765 DCHECK(!ebx.is(receiver) && !ebx.is(name) && !ebx.is(value)); |
| 766 __ pop(ebx); |
| 767 __ push(receiver); |
| 768 __ push(name); |
| 769 __ push(value); |
| 770 __ push(ebx); |
| 771 } |
761 } | 772 } |
762 | 773 |
763 | 774 |
764 void StoreIC::GenerateMiss(MacroAssembler* masm) { | 775 void StoreIC::GenerateMiss(MacroAssembler* masm) { |
765 // Return address is on the stack. | 776 // Return address is on the stack. |
766 StoreIC_PushArgs(masm); | 777 StoreIC_PushArgs(masm); |
767 | 778 |
768 // Perform tail call to the entry. | 779 // Perform tail call to the entry. |
769 __ TailCallRuntime(Runtime::kStoreIC_Miss, 3, 1); | 780 int args = FLAG_vector_stores ? 5 : 3; |
| 781 __ TailCallRuntime(Runtime::kStoreIC_Miss, args, 1); |
770 } | 782 } |
771 | 783 |
772 | 784 |
773 void StoreIC::GenerateNormal(MacroAssembler* masm) { | 785 void StoreIC::GenerateNormal(MacroAssembler* masm) { |
774 Label restore_miss; | 786 Label restore_miss; |
775 Register receiver = StoreDescriptor::ReceiverRegister(); | 787 Register receiver = StoreDescriptor::ReceiverRegister(); |
776 Register name = StoreDescriptor::NameRegister(); | 788 Register name = StoreDescriptor::NameRegister(); |
777 Register value = StoreDescriptor::ValueRegister(); | 789 Register value = StoreDescriptor::ValueRegister(); |
778 Register dictionary = ebx; | 790 Register dictionary = ebx; |
779 | 791 |
(...skipping 15 matching lines...) Expand all Loading... |
795 __ IncrementCounter(counters->store_normal_miss(), 1); | 807 __ IncrementCounter(counters->store_normal_miss(), 1); |
796 GenerateMiss(masm); | 808 GenerateMiss(masm); |
797 } | 809 } |
798 | 810 |
799 | 811 |
800 void KeyedStoreIC::GenerateMiss(MacroAssembler* masm) { | 812 void KeyedStoreIC::GenerateMiss(MacroAssembler* masm) { |
801 // Return address is on the stack. | 813 // Return address is on the stack. |
802 StoreIC_PushArgs(masm); | 814 StoreIC_PushArgs(masm); |
803 | 815 |
804 // Do tail-call to runtime routine. | 816 // Do tail-call to runtime routine. |
805 __ TailCallRuntime(Runtime::kKeyedStoreIC_Miss, 3, 1); | 817 int args = FLAG_vector_stores ? 5 : 3; |
| 818 __ TailCallRuntime(Runtime::kKeyedStoreIC_Miss, args, 1); |
806 } | 819 } |
807 | 820 |
808 | 821 |
809 #undef __ | 822 #undef __ |
810 | 823 |
811 | 824 |
812 Condition CompareIC::ComputeCondition(Token::Value op) { | 825 Condition CompareIC::ComputeCondition(Token::Value op) { |
813 switch (op) { | 826 switch (op) { |
814 case Token::EQ_STRICT: | 827 case Token::EQ_STRICT: |
815 case Token::EQ: | 828 case Token::EQ: |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
873 Condition cc = | 886 Condition cc = |
874 (check == ENABLE_INLINED_SMI_CHECK) | 887 (check == ENABLE_INLINED_SMI_CHECK) |
875 ? (*jmp_address == Assembler::kJncShortOpcode ? not_zero : zero) | 888 ? (*jmp_address == Assembler::kJncShortOpcode ? not_zero : zero) |
876 : (*jmp_address == Assembler::kJnzShortOpcode ? not_carry : carry); | 889 : (*jmp_address == Assembler::kJnzShortOpcode ? not_carry : carry); |
877 *jmp_address = static_cast<byte>(Assembler::kJccShortPrefix | cc); | 890 *jmp_address = static_cast<byte>(Assembler::kJccShortPrefix | cc); |
878 } | 891 } |
879 } // namespace internal | 892 } // namespace internal |
880 } // namespace v8 | 893 } // namespace v8 |
881 | 894 |
882 #endif // V8_TARGET_ARCH_IA32 | 895 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |