| 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-inl.h" | 10 #include "src/ic-inl.h" |
| (...skipping 786 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 797 | 797 |
| 798 // Value is a double. Transition FAST_SMI_ELEMENTS -> FAST_DOUBLE_ELEMENTS | 798 // Value is a double. Transition FAST_SMI_ELEMENTS -> FAST_DOUBLE_ELEMENTS |
| 799 // and complete the store. | 799 // and complete the store. |
| 800 __ LoadTransitionedArrayMapConditional(FAST_SMI_ELEMENTS, | 800 __ LoadTransitionedArrayMapConditional(FAST_SMI_ELEMENTS, |
| 801 FAST_DOUBLE_ELEMENTS, | 801 FAST_DOUBLE_ELEMENTS, |
| 802 ebx, | 802 ebx, |
| 803 edi, | 803 edi, |
| 804 slow); | 804 slow); |
| 805 AllocationSiteMode mode = AllocationSite::GetMode(FAST_SMI_ELEMENTS, | 805 AllocationSiteMode mode = AllocationSite::GetMode(FAST_SMI_ELEMENTS, |
| 806 FAST_DOUBLE_ELEMENTS); | 806 FAST_DOUBLE_ELEMENTS); |
| 807 ElementsTransitionGenerator::GenerateSmiToDouble(masm, mode, slow); | 807 ElementsTransitionGenerator::GenerateSmiToDouble( |
| 808 masm, receiver, key, value, ebx, mode, slow); |
| 808 __ mov(ebx, FieldOperand(receiver, JSObject::kElementsOffset)); | 809 __ mov(ebx, FieldOperand(receiver, JSObject::kElementsOffset)); |
| 809 __ jmp(&fast_double_without_map_check); | 810 __ jmp(&fast_double_without_map_check); |
| 810 | 811 |
| 811 __ bind(&non_double_value); | 812 __ bind(&non_double_value); |
| 812 // Value is not a double, FAST_SMI_ELEMENTS -> FAST_ELEMENTS | 813 // Value is not a double, FAST_SMI_ELEMENTS -> FAST_ELEMENTS |
| 813 __ LoadTransitionedArrayMapConditional(FAST_SMI_ELEMENTS, | 814 __ LoadTransitionedArrayMapConditional(FAST_SMI_ELEMENTS, |
| 814 FAST_ELEMENTS, | 815 FAST_ELEMENTS, |
| 815 ebx, | 816 ebx, |
| 816 edi, | 817 edi, |
| 817 slow); | 818 slow); |
| 818 mode = AllocationSite::GetMode(FAST_SMI_ELEMENTS, FAST_ELEMENTS); | 819 mode = AllocationSite::GetMode(FAST_SMI_ELEMENTS, FAST_ELEMENTS); |
| 819 ElementsTransitionGenerator::GenerateMapChangeElementsTransition(masm, mode, | 820 ElementsTransitionGenerator::GenerateMapChangeElementsTransition( |
| 820 slow); | 821 masm, receiver, key, value, ebx, mode, slow); |
| 821 __ mov(ebx, FieldOperand(receiver, JSObject::kElementsOffset)); | 822 __ mov(ebx, FieldOperand(receiver, JSObject::kElementsOffset)); |
| 822 __ jmp(&finish_object_store); | 823 __ jmp(&finish_object_store); |
| 823 | 824 |
| 824 __ bind(&transition_double_elements); | 825 __ bind(&transition_double_elements); |
| 825 // Elements are FAST_DOUBLE_ELEMENTS, but value is an Object that's not a | 826 // Elements are FAST_DOUBLE_ELEMENTS, but value is an Object that's not a |
| 826 // HeapNumber. Make sure that the receiver is a Array with FAST_ELEMENTS and | 827 // HeapNumber. Make sure that the receiver is a Array with FAST_ELEMENTS and |
| 827 // transition array from FAST_DOUBLE_ELEMENTS to FAST_ELEMENTS | 828 // transition array from FAST_DOUBLE_ELEMENTS to FAST_ELEMENTS |
| 828 __ mov(ebx, FieldOperand(receiver, HeapObject::kMapOffset)); | 829 __ mov(ebx, FieldOperand(receiver, HeapObject::kMapOffset)); |
| 829 __ LoadTransitionedArrayMapConditional(FAST_DOUBLE_ELEMENTS, | 830 __ LoadTransitionedArrayMapConditional(FAST_DOUBLE_ELEMENTS, |
| 830 FAST_ELEMENTS, | 831 FAST_ELEMENTS, |
| 831 ebx, | 832 ebx, |
| 832 edi, | 833 edi, |
| 833 slow); | 834 slow); |
| 834 mode = AllocationSite::GetMode(FAST_DOUBLE_ELEMENTS, FAST_ELEMENTS); | 835 mode = AllocationSite::GetMode(FAST_DOUBLE_ELEMENTS, FAST_ELEMENTS); |
| 835 ElementsTransitionGenerator::GenerateDoubleToObject(masm, mode, slow); | 836 ElementsTransitionGenerator::GenerateDoubleToObject( |
| 837 masm, receiver, key, value, ebx, mode, slow); |
| 836 __ mov(ebx, FieldOperand(receiver, JSObject::kElementsOffset)); | 838 __ mov(ebx, FieldOperand(receiver, JSObject::kElementsOffset)); |
| 837 __ jmp(&finish_object_store); | 839 __ jmp(&finish_object_store); |
| 838 } | 840 } |
| 839 | 841 |
| 840 | 842 |
| 841 void KeyedStoreIC::GenerateGeneric(MacroAssembler* masm, | 843 void KeyedStoreIC::GenerateGeneric(MacroAssembler* masm, |
| 842 StrictMode strict_mode) { | 844 StrictMode strict_mode) { |
| 843 // Return address is on the stack. | 845 // Return address is on the stack. |
| 844 Label slow, fast_object, fast_object_grow; | 846 Label slow, fast_object, fast_object_grow; |
| 845 Label fast_double, fast_double_grow; | 847 Label fast_double, fast_double_grow; |
| (...skipping 405 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1251 Condition cc = (check == ENABLE_INLINED_SMI_CHECK) | 1253 Condition cc = (check == ENABLE_INLINED_SMI_CHECK) |
| 1252 ? (*jmp_address == Assembler::kJncShortOpcode ? not_zero : zero) | 1254 ? (*jmp_address == Assembler::kJncShortOpcode ? not_zero : zero) |
| 1253 : (*jmp_address == Assembler::kJnzShortOpcode ? not_carry : carry); | 1255 : (*jmp_address == Assembler::kJnzShortOpcode ? not_carry : carry); |
| 1254 *jmp_address = static_cast<byte>(Assembler::kJccShortPrefix | cc); | 1256 *jmp_address = static_cast<byte>(Assembler::kJccShortPrefix | cc); |
| 1255 } | 1257 } |
| 1256 | 1258 |
| 1257 | 1259 |
| 1258 } } // namespace v8::internal | 1260 } } // namespace v8::internal |
| 1259 | 1261 |
| 1260 #endif // V8_TARGET_ARCH_IA32 | 1262 #endif // V8_TARGET_ARCH_IA32 |
| OLD | NEW |