| 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 806 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 817 __ cmp(key, FieldOperand(receiver, JSArray::kLengthOffset)); // Compare smis. | 817 __ cmp(key, FieldOperand(receiver, JSArray::kLengthOffset)); // Compare smis. |
| 818 __ j(above_equal, &extra); | 818 __ j(above_equal, &extra); |
| 819 | 819 |
| 820 KeyedStoreGenerateGenericHelper(masm, &fast_object, &fast_double, &slow, | 820 KeyedStoreGenerateGenericHelper(masm, &fast_object, &fast_double, &slow, |
| 821 kCheckMap, kDontIncrementLength); | 821 kCheckMap, kDontIncrementLength); |
| 822 KeyedStoreGenerateGenericHelper(masm, &fast_object_grow, &fast_double_grow, | 822 KeyedStoreGenerateGenericHelper(masm, &fast_object_grow, &fast_double_grow, |
| 823 &slow, kDontCheckMap, kIncrementLength); | 823 &slow, kDontCheckMap, kIncrementLength); |
| 824 } | 824 } |
| 825 | 825 |
| 826 | 826 |
| 827 void LoadIC::GenerateMegamorphic(MacroAssembler* masm) { | |
| 828 // The return address is on the stack. | |
| 829 Register receiver = LoadDescriptor::ReceiverRegister(); | |
| 830 Register name = LoadDescriptor::NameRegister(); | |
| 831 DCHECK(receiver.is(edx)); | |
| 832 DCHECK(name.is(ecx)); | |
| 833 | |
| 834 // Probe the stub cache. | |
| 835 Code::Flags flags = Code::RemoveTypeAndHolderFromFlags( | |
| 836 Code::ComputeHandlerFlags(Code::LOAD_IC)); | |
| 837 masm->isolate()->stub_cache()->GenerateProbe(masm, flags, receiver, name, ebx, | |
| 838 eax); | |
| 839 | |
| 840 // Cache miss: Jump to runtime. | |
| 841 GenerateMiss(masm); | |
| 842 } | |
| 843 | |
| 844 | |
| 845 void LoadIC::GenerateNormal(MacroAssembler* masm) { | 827 void LoadIC::GenerateNormal(MacroAssembler* masm) { |
| 846 Register dictionary = eax; | 828 Register dictionary = eax; |
| 847 DCHECK(!dictionary.is(LoadDescriptor::ReceiverRegister())); | 829 DCHECK(!dictionary.is(LoadDescriptor::ReceiverRegister())); |
| 848 DCHECK(!dictionary.is(LoadDescriptor::NameRegister())); | 830 DCHECK(!dictionary.is(LoadDescriptor::NameRegister())); |
| 849 | 831 |
| 850 Label slow; | 832 Label slow; |
| 851 | 833 |
| 852 __ mov(dictionary, FieldOperand(LoadDescriptor::ReceiverRegister(), | 834 __ mov(dictionary, FieldOperand(LoadDescriptor::ReceiverRegister(), |
| 853 JSObject::kPropertiesOffset)); | 835 JSObject::kPropertiesOffset)); |
| 854 GenerateDictionaryLoad(masm, &slow, dictionary, | 836 GenerateDictionaryLoad(masm, &slow, dictionary, |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 915 // Perform tail call to the entry. | 897 // Perform tail call to the entry. |
| 916 __ TailCallRuntime(Runtime::kKeyedGetProperty, 2, 1); | 898 __ TailCallRuntime(Runtime::kKeyedGetProperty, 2, 1); |
| 917 } | 899 } |
| 918 | 900 |
| 919 | 901 |
| 920 void StoreIC::GenerateMegamorphic(MacroAssembler* masm) { | 902 void StoreIC::GenerateMegamorphic(MacroAssembler* masm) { |
| 921 // Return address is on the stack. | 903 // Return address is on the stack. |
| 922 Code::Flags flags = Code::RemoveTypeAndHolderFromFlags( | 904 Code::Flags flags = Code::RemoveTypeAndHolderFromFlags( |
| 923 Code::ComputeHandlerFlags(Code::STORE_IC)); | 905 Code::ComputeHandlerFlags(Code::STORE_IC)); |
| 924 masm->isolate()->stub_cache()->GenerateProbe( | 906 masm->isolate()->stub_cache()->GenerateProbe( |
| 925 masm, flags, StoreDescriptor::ReceiverRegister(), | 907 masm, flags, false, StoreDescriptor::ReceiverRegister(), |
| 926 StoreDescriptor::NameRegister(), ebx, no_reg); | 908 StoreDescriptor::NameRegister(), ebx, no_reg); |
| 927 | 909 |
| 928 // Cache miss: Jump to runtime. | 910 // Cache miss: Jump to runtime. |
| 929 GenerateMiss(masm); | 911 GenerateMiss(masm); |
| 930 } | 912 } |
| 931 | 913 |
| 932 | 914 |
| 933 static void StoreIC_PushArgs(MacroAssembler* masm) { | 915 static void StoreIC_PushArgs(MacroAssembler* masm) { |
| 934 Register receiver = StoreDescriptor::ReceiverRegister(); | 916 Register receiver = StoreDescriptor::ReceiverRegister(); |
| 935 Register name = StoreDescriptor::NameRegister(); | 917 Register name = StoreDescriptor::NameRegister(); |
| (...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1061 Condition cc = | 1043 Condition cc = |
| 1062 (check == ENABLE_INLINED_SMI_CHECK) | 1044 (check == ENABLE_INLINED_SMI_CHECK) |
| 1063 ? (*jmp_address == Assembler::kJncShortOpcode ? not_zero : zero) | 1045 ? (*jmp_address == Assembler::kJncShortOpcode ? not_zero : zero) |
| 1064 : (*jmp_address == Assembler::kJnzShortOpcode ? not_carry : carry); | 1046 : (*jmp_address == Assembler::kJnzShortOpcode ? not_carry : carry); |
| 1065 *jmp_address = static_cast<byte>(Assembler::kJccShortPrefix | cc); | 1047 *jmp_address = static_cast<byte>(Assembler::kJccShortPrefix | cc); |
| 1066 } | 1048 } |
| 1067 } | 1049 } |
| 1068 } // namespace v8::internal | 1050 } // namespace v8::internal |
| 1069 | 1051 |
| 1070 #endif // V8_TARGET_ARCH_IA32 | 1052 #endif // V8_TARGET_ARCH_IA32 |
| OLD | NEW |