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