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 749 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
760 | 760 |
761 // Dictionary load failed, go slow (but don't miss). | 761 // Dictionary load failed, go slow (but don't miss). |
762 __ bind(&slow); | 762 __ bind(&slow); |
763 GenerateRuntimeGetProperty(masm); | 763 GenerateRuntimeGetProperty(masm); |
764 } | 764 } |
765 | 765 |
766 | 766 |
767 static void LoadIC_PushArgs(MacroAssembler* masm) { | 767 static void LoadIC_PushArgs(MacroAssembler* masm) { |
768 Register receiver = LoadDescriptor::ReceiverRegister(); | 768 Register receiver = LoadDescriptor::ReceiverRegister(); |
769 Register name = LoadDescriptor::NameRegister(); | 769 Register name = LoadDescriptor::NameRegister(); |
| 770 if (FLAG_vector_ics) { |
| 771 Register slot = VectorLoadICDescriptor::SlotRegister(); |
| 772 Register vector = VectorLoadICDescriptor::VectorRegister(); |
| 773 DCHECK(!edi.is(receiver) && !edi.is(name) && !edi.is(slot) && |
| 774 !edi.is(vector)); |
| 775 |
| 776 __ pop(edi); |
| 777 __ push(receiver); |
| 778 __ push(name); |
| 779 __ push(slot); |
| 780 __ push(vector); |
| 781 __ push(edi); |
| 782 } else { |
| 783 DCHECK(!ebx.is(receiver) && !ebx.is(name)); |
| 784 |
| 785 __ pop(ebx); |
| 786 __ push(receiver); |
| 787 __ push(name); |
| 788 __ push(ebx); |
| 789 } |
| 790 } |
| 791 |
| 792 |
| 793 void LoadIC::GenerateMiss(MacroAssembler* masm) { |
| 794 // Return address is on the stack. |
| 795 __ IncrementCounter(masm->isolate()->counters()->load_miss(), 1); |
| 796 LoadIC_PushArgs(masm); |
| 797 |
| 798 // Perform tail call to the entry. |
| 799 ExternalReference ref = |
| 800 ExternalReference(IC_Utility(kLoadIC_Miss), masm->isolate()); |
| 801 int arg_count = FLAG_vector_ics ? 4 : 2; |
| 802 __ TailCallExternalReference(ref, arg_count, 1); |
| 803 } |
| 804 |
| 805 |
| 806 void LoadIC::GenerateRuntimeGetProperty(MacroAssembler* masm) { |
| 807 // Return address is on the stack. |
| 808 Register receiver = LoadDescriptor::ReceiverRegister(); |
| 809 Register name = LoadDescriptor::NameRegister(); |
770 DCHECK(!ebx.is(receiver) && !ebx.is(name)); | 810 DCHECK(!ebx.is(receiver) && !ebx.is(name)); |
771 | 811 |
772 __ pop(ebx); | 812 __ pop(ebx); |
773 __ push(receiver); | 813 __ push(receiver); |
774 __ push(name); | 814 __ push(name); |
775 __ push(ebx); | 815 __ push(ebx); |
776 } | |
777 | |
778 | |
779 void LoadIC::GenerateMiss(MacroAssembler* masm) { | |
780 // Return address is on the stack. | |
781 __ IncrementCounter(masm->isolate()->counters()->load_miss(), 1); | |
782 | |
783 LoadIC_PushArgs(masm); | |
784 | |
785 // Perform tail call to the entry. | |
786 ExternalReference ref = | |
787 ExternalReference(IC_Utility(kLoadIC_Miss), masm->isolate()); | |
788 __ TailCallExternalReference(ref, 2, 1); | |
789 } | |
790 | |
791 | |
792 void LoadIC::GenerateRuntimeGetProperty(MacroAssembler* masm) { | |
793 // Return address is on the stack. | |
794 LoadIC_PushArgs(masm); | |
795 | 816 |
796 // Perform tail call to the entry. | 817 // Perform tail call to the entry. |
797 __ TailCallRuntime(Runtime::kGetProperty, 2, 1); | 818 __ TailCallRuntime(Runtime::kGetProperty, 2, 1); |
798 } | 819 } |
799 | 820 |
800 | 821 |
801 void KeyedLoadIC::GenerateMiss(MacroAssembler* masm) { | 822 void KeyedLoadIC::GenerateMiss(MacroAssembler* masm) { |
802 // Return address is on the stack. | 823 // Return address is on the stack. |
803 __ IncrementCounter(masm->isolate()->counters()->keyed_load_miss(), 1); | 824 __ IncrementCounter(masm->isolate()->counters()->keyed_load_miss(), 1); |
804 | 825 |
805 LoadIC_PushArgs(masm); | 826 LoadIC_PushArgs(masm); |
806 | 827 |
807 // Perform tail call to the entry. | 828 // Perform tail call to the entry. |
808 ExternalReference ref = | 829 ExternalReference ref = |
809 ExternalReference(IC_Utility(kKeyedLoadIC_Miss), masm->isolate()); | 830 ExternalReference(IC_Utility(kKeyedLoadIC_Miss), masm->isolate()); |
810 __ TailCallExternalReference(ref, 2, 1); | 831 int arg_count = FLAG_vector_ics ? 4 : 2; |
| 832 __ TailCallExternalReference(ref, arg_count, 1); |
811 } | 833 } |
812 | 834 |
813 | 835 |
814 void KeyedLoadIC::GenerateRuntimeGetProperty(MacroAssembler* masm) { | 836 void KeyedLoadIC::GenerateRuntimeGetProperty(MacroAssembler* masm) { |
815 // Return address is on the stack. | 837 // Return address is on the stack. |
816 LoadIC_PushArgs(masm); | 838 Register receiver = LoadDescriptor::ReceiverRegister(); |
| 839 Register name = LoadDescriptor::NameRegister(); |
| 840 DCHECK(!ebx.is(receiver) && !ebx.is(name)); |
| 841 |
| 842 __ pop(ebx); |
| 843 __ push(receiver); |
| 844 __ push(name); |
| 845 __ push(ebx); |
817 | 846 |
818 // Perform tail call to the entry. | 847 // Perform tail call to the entry. |
819 __ TailCallRuntime(Runtime::kKeyedGetProperty, 2, 1); | 848 __ TailCallRuntime(Runtime::kKeyedGetProperty, 2, 1); |
820 } | 849 } |
821 | 850 |
822 | 851 |
823 void StoreIC::GenerateMegamorphic(MacroAssembler* masm) { | 852 void StoreIC::GenerateMegamorphic(MacroAssembler* masm) { |
824 // Return address is on the stack. | 853 // Return address is on the stack. |
825 Code::Flags flags = Code::RemoveTypeAndHolderFromFlags( | 854 Code::Flags flags = Code::RemoveTypeAndHolderFromFlags( |
826 Code::ComputeHandlerFlags(Code::STORE_IC)); | 855 Code::ComputeHandlerFlags(Code::STORE_IC)); |
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
964 Condition cc = | 993 Condition cc = |
965 (check == ENABLE_INLINED_SMI_CHECK) | 994 (check == ENABLE_INLINED_SMI_CHECK) |
966 ? (*jmp_address == Assembler::kJncShortOpcode ? not_zero : zero) | 995 ? (*jmp_address == Assembler::kJncShortOpcode ? not_zero : zero) |
967 : (*jmp_address == Assembler::kJnzShortOpcode ? not_carry : carry); | 996 : (*jmp_address == Assembler::kJnzShortOpcode ? not_carry : carry); |
968 *jmp_address = static_cast<byte>(Assembler::kJccShortPrefix | cc); | 997 *jmp_address = static_cast<byte>(Assembler::kJccShortPrefix | cc); |
969 } | 998 } |
970 } | 999 } |
971 } // namespace v8::internal | 1000 } // namespace v8::internal |
972 | 1001 |
973 #endif // V8_TARGET_ARCH_IA32 | 1002 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |