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

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

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

Powered by Google App Engine
This is Rietveld 408576698