OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 817 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
828 &non_double_value, | 828 &non_double_value, |
829 DONT_DO_SMI_CHECK); | 829 DONT_DO_SMI_CHECK); |
830 | 830 |
831 // Value is a double. Transition FAST_SMI_ELEMENTS -> FAST_DOUBLE_ELEMENTS | 831 // Value is a double. Transition FAST_SMI_ELEMENTS -> FAST_DOUBLE_ELEMENTS |
832 // and complete the store. | 832 // and complete the store. |
833 __ LoadTransitionedArrayMapConditional(FAST_SMI_ELEMENTS, | 833 __ LoadTransitionedArrayMapConditional(FAST_SMI_ELEMENTS, |
834 FAST_DOUBLE_ELEMENTS, | 834 FAST_DOUBLE_ELEMENTS, |
835 ebx, | 835 ebx, |
836 edi, | 836 edi, |
837 slow); | 837 slow); |
838 ElementsTransitionGenerator::GenerateSmiToDouble(masm, slow); | 838 AllocationSiteMode mode = AllocationSiteInfo::GetMode(FAST_SMI_ELEMENTS, |
| 839 FAST_DOUBLE_ELEMENTS); |
| 840 ElementsTransitionGenerator::GenerateSmiToDouble(masm, mode, slow); |
839 __ mov(ebx, FieldOperand(edx, JSObject::kElementsOffset)); | 841 __ mov(ebx, FieldOperand(edx, JSObject::kElementsOffset)); |
840 __ jmp(&fast_double_without_map_check); | 842 __ jmp(&fast_double_without_map_check); |
841 | 843 |
842 __ bind(&non_double_value); | 844 __ bind(&non_double_value); |
843 // Value is not a double, FAST_SMI_ELEMENTS -> FAST_ELEMENTS | 845 // Value is not a double, FAST_SMI_ELEMENTS -> FAST_ELEMENTS |
844 __ LoadTransitionedArrayMapConditional(FAST_SMI_ELEMENTS, | 846 __ LoadTransitionedArrayMapConditional(FAST_SMI_ELEMENTS, |
845 FAST_ELEMENTS, | 847 FAST_ELEMENTS, |
846 ebx, | 848 ebx, |
847 edi, | 849 edi, |
848 slow); | 850 slow); |
849 ElementsTransitionGenerator::GenerateMapChangeElementsTransition(masm); | 851 mode = AllocationSiteInfo::GetMode(FAST_SMI_ELEMENTS, FAST_ELEMENTS); |
| 852 ElementsTransitionGenerator::GenerateMapChangeElementsTransition(masm, mode, |
| 853 slow); |
850 __ mov(ebx, FieldOperand(edx, JSObject::kElementsOffset)); | 854 __ mov(ebx, FieldOperand(edx, JSObject::kElementsOffset)); |
851 __ jmp(&finish_object_store); | 855 __ jmp(&finish_object_store); |
852 | 856 |
853 __ bind(&transition_double_elements); | 857 __ bind(&transition_double_elements); |
854 // Elements are FAST_DOUBLE_ELEMENTS, but value is an Object that's not a | 858 // Elements are FAST_DOUBLE_ELEMENTS, but value is an Object that's not a |
855 // HeapNumber. Make sure that the receiver is a Array with FAST_ELEMENTS and | 859 // HeapNumber. Make sure that the receiver is a Array with FAST_ELEMENTS and |
856 // transition array from FAST_DOUBLE_ELEMENTS to FAST_ELEMENTS | 860 // transition array from FAST_DOUBLE_ELEMENTS to FAST_ELEMENTS |
857 __ mov(ebx, FieldOperand(edx, HeapObject::kMapOffset)); | 861 __ mov(ebx, FieldOperand(edx, HeapObject::kMapOffset)); |
858 __ LoadTransitionedArrayMapConditional(FAST_DOUBLE_ELEMENTS, | 862 __ LoadTransitionedArrayMapConditional(FAST_DOUBLE_ELEMENTS, |
859 FAST_ELEMENTS, | 863 FAST_ELEMENTS, |
860 ebx, | 864 ebx, |
861 edi, | 865 edi, |
862 slow); | 866 slow); |
863 ElementsTransitionGenerator::GenerateDoubleToObject(masm, slow); | 867 mode = AllocationSiteInfo::GetMode(FAST_DOUBLE_ELEMENTS, FAST_ELEMENTS); |
| 868 ElementsTransitionGenerator::GenerateDoubleToObject(masm, mode, slow); |
864 __ mov(ebx, FieldOperand(edx, JSObject::kElementsOffset)); | 869 __ mov(ebx, FieldOperand(edx, JSObject::kElementsOffset)); |
865 __ jmp(&finish_object_store); | 870 __ jmp(&finish_object_store); |
866 } | 871 } |
867 | 872 |
868 | 873 |
869 void KeyedStoreIC::GenerateGeneric(MacroAssembler* masm, | 874 void KeyedStoreIC::GenerateGeneric(MacroAssembler* masm, |
870 StrictModeFlag strict_mode) { | 875 StrictModeFlag strict_mode) { |
871 // ----------- S t a t e ------------- | 876 // ----------- S t a t e ------------- |
872 // -- eax : value | 877 // -- eax : value |
873 // -- ecx : key | 878 // -- ecx : key |
(...skipping 769 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1643 | 1648 |
1644 void KeyedStoreIC::GenerateTransitionElementsSmiToDouble(MacroAssembler* masm) { | 1649 void KeyedStoreIC::GenerateTransitionElementsSmiToDouble(MacroAssembler* masm) { |
1645 // ----------- S t a t e ------------- | 1650 // ----------- S t a t e ------------- |
1646 // -- ebx : target map | 1651 // -- ebx : target map |
1647 // -- edx : receiver | 1652 // -- edx : receiver |
1648 // -- esp[0] : return address | 1653 // -- esp[0] : return address |
1649 // ----------------------------------- | 1654 // ----------------------------------- |
1650 // Must return the modified receiver in eax. | 1655 // Must return the modified receiver in eax. |
1651 if (!FLAG_trace_elements_transitions) { | 1656 if (!FLAG_trace_elements_transitions) { |
1652 Label fail; | 1657 Label fail; |
1653 ElementsTransitionGenerator::GenerateSmiToDouble(masm, &fail); | 1658 AllocationSiteMode mode = AllocationSiteInfo::GetMode(FAST_SMI_ELEMENTS, |
| 1659 FAST_DOUBLE_ELEMENTS); |
| 1660 ElementsTransitionGenerator::GenerateSmiToDouble(masm, mode, &fail); |
1654 __ mov(eax, edx); | 1661 __ mov(eax, edx); |
1655 __ Ret(); | 1662 __ Ret(); |
1656 __ bind(&fail); | 1663 __ bind(&fail); |
1657 } | 1664 } |
1658 | 1665 |
1659 __ pop(ebx); | 1666 __ pop(ebx); |
1660 __ push(edx); | 1667 __ push(edx); |
1661 __ push(ebx); // return address | 1668 __ push(ebx); // return address |
1662 // Leaving the code managed by the register allocator and return to the | 1669 // Leaving the code managed by the register allocator and return to the |
1663 // convention of using esi as context register. | 1670 // convention of using esi as context register. |
1664 __ mov(esi, Operand(ebp, StandardFrameConstants::kContextOffset)); | 1671 __ mov(esi, Operand(ebp, StandardFrameConstants::kContextOffset)); |
1665 __ TailCallRuntime(Runtime::kTransitionElementsSmiToDouble, 1, 1); | 1672 __ TailCallRuntime(Runtime::kTransitionElementsSmiToDouble, 1, 1); |
1666 } | 1673 } |
1667 | 1674 |
1668 | 1675 |
1669 void KeyedStoreIC::GenerateTransitionElementsDoubleToObject( | 1676 void KeyedStoreIC::GenerateTransitionElementsDoubleToObject( |
1670 MacroAssembler* masm) { | 1677 MacroAssembler* masm) { |
1671 // ----------- S t a t e ------------- | 1678 // ----------- S t a t e ------------- |
1672 // -- ebx : target map | 1679 // -- ebx : target map |
1673 // -- edx : receiver | 1680 // -- edx : receiver |
1674 // -- esp[0] : return address | 1681 // -- esp[0] : return address |
1675 // ----------------------------------- | 1682 // ----------------------------------- |
1676 // Must return the modified receiver in eax. | 1683 // Must return the modified receiver in eax. |
1677 if (!FLAG_trace_elements_transitions) { | 1684 if (!FLAG_trace_elements_transitions) { |
1678 Label fail; | 1685 Label fail; |
1679 ElementsTransitionGenerator::GenerateDoubleToObject(masm, &fail); | 1686 AllocationSiteMode mode = AllocationSiteInfo::GetMode(FAST_DOUBLE_ELEMENTS, |
| 1687 FAST_ELEMENTS); |
| 1688 ElementsTransitionGenerator::GenerateDoubleToObject(masm, mode, &fail); |
1680 __ mov(eax, edx); | 1689 __ mov(eax, edx); |
1681 __ Ret(); | 1690 __ Ret(); |
1682 __ bind(&fail); | 1691 __ bind(&fail); |
1683 } | 1692 } |
1684 | 1693 |
1685 __ pop(ebx); | 1694 __ pop(ebx); |
1686 __ push(edx); | 1695 __ push(edx); |
1687 __ push(ebx); // return address | 1696 __ push(ebx); // return address |
1688 // Leaving the code managed by the register allocator and return to the | 1697 // Leaving the code managed by the register allocator and return to the |
1689 // convention of using esi as context register. | 1698 // convention of using esi as context register. |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1759 Condition cc = (check == ENABLE_INLINED_SMI_CHECK) | 1768 Condition cc = (check == ENABLE_INLINED_SMI_CHECK) |
1760 ? (*jmp_address == Assembler::kJncShortOpcode ? not_zero : zero) | 1769 ? (*jmp_address == Assembler::kJncShortOpcode ? not_zero : zero) |
1761 : (*jmp_address == Assembler::kJnzShortOpcode ? not_carry : carry); | 1770 : (*jmp_address == Assembler::kJnzShortOpcode ? not_carry : carry); |
1762 *jmp_address = static_cast<byte>(Assembler::kJccShortPrefix | cc); | 1771 *jmp_address = static_cast<byte>(Assembler::kJccShortPrefix | cc); |
1763 } | 1772 } |
1764 | 1773 |
1765 | 1774 |
1766 } } // namespace v8::internal | 1775 } } // namespace v8::internal |
1767 | 1776 |
1768 #endif // V8_TARGET_ARCH_IA32 | 1777 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |