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