| 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 851 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 862 | 862 |
| 863 // Pass the additional arguments. | 863 // Pass the additional arguments. |
| 864 Handle<CallHandlerInfo> api_call_info = optimization.api_call_info(); | 864 Handle<CallHandlerInfo> api_call_info = optimization.api_call_info(); |
| 865 Handle<Object> call_data(api_call_info->data(), masm->isolate()); | 865 Handle<Object> call_data(api_call_info->data(), masm->isolate()); |
| 866 if (masm->isolate()->heap()->InNewSpace(*call_data)) { | 866 if (masm->isolate()->heap()->InNewSpace(*call_data)) { |
| 867 __ Move(r0, api_call_info); | 867 __ Move(r0, api_call_info); |
| 868 __ ldr(r6, FieldMemOperand(r0, CallHandlerInfo::kDataOffset)); | 868 __ ldr(r6, FieldMemOperand(r0, CallHandlerInfo::kDataOffset)); |
| 869 } else { | 869 } else { |
| 870 __ Move(r6, call_data); | 870 __ Move(r6, call_data); |
| 871 } | 871 } |
| 872 __ mov(r7, Operand(ExternalReference::isolate_address(masm->isolate()))); | 872 __ mov(ip, Operand(ExternalReference::isolate_address(masm->isolate()))); |
| 873 // Store JS function, call data, isolate ReturnValue default and ReturnValue. | 873 // Store JS function, call data, isolate ReturnValue default and ReturnValue. |
| 874 __ stm(ib, sp, r5.bit() | r6.bit() | r7.bit()); | 874 __ stm(ib, sp, r5.bit() | r6.bit() | ip.bit()); |
| 875 __ LoadRoot(r5, Heap::kUndefinedValueRootIndex); | 875 __ LoadRoot(r5, Heap::kUndefinedValueRootIndex); |
| 876 __ str(r5, MemOperand(sp, 4 * kPointerSize)); | 876 __ str(r5, MemOperand(sp, 4 * kPointerSize)); |
| 877 __ str(r5, MemOperand(sp, 5 * kPointerSize)); | 877 __ str(r5, MemOperand(sp, 5 * kPointerSize)); |
| 878 | 878 |
| 879 // Prepare arguments. | 879 // Prepare arguments. |
| 880 __ add(r2, sp, Operand(5 * kPointerSize)); | 880 __ add(r2, sp, Operand(5 * kPointerSize)); |
| 881 | 881 |
| 882 // Allocate the v8::Arguments structure in the arguments' space since | 882 // Allocate the v8::Arguments structure in the arguments' space since |
| 883 // it's not controlled by GC. | 883 // it's not controlled by GC. |
| 884 const int kApiStackSpace = 4; | 884 const int kApiStackSpace = 4; |
| (...skipping 937 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1822 // Check for a smi. | 1822 // Check for a smi. |
| 1823 __ Drop(argc + 1); | 1823 __ Drop(argc + 1); |
| 1824 __ Ret(); | 1824 __ Ret(); |
| 1825 | 1825 |
| 1826 __ bind(&with_write_barrier); | 1826 __ bind(&with_write_barrier); |
| 1827 | 1827 |
| 1828 __ ldr(r3, FieldMemOperand(receiver, HeapObject::kMapOffset)); | 1828 __ ldr(r3, FieldMemOperand(receiver, HeapObject::kMapOffset)); |
| 1829 | 1829 |
| 1830 if (FLAG_smi_only_arrays && !FLAG_trace_elements_transitions) { | 1830 if (FLAG_smi_only_arrays && !FLAG_trace_elements_transitions) { |
| 1831 Label fast_object, not_fast_object; | 1831 Label fast_object, not_fast_object; |
| 1832 __ CheckFastObjectElements(r3, r7, ¬_fast_object); | 1832 __ CheckFastObjectElements(r3, r9, ¬_fast_object); |
| 1833 __ jmp(&fast_object); | 1833 __ jmp(&fast_object); |
| 1834 // In case of fast smi-only, convert to fast object, otherwise bail out. | 1834 // In case of fast smi-only, convert to fast object, otherwise bail out. |
| 1835 __ bind(¬_fast_object); | 1835 __ bind(¬_fast_object); |
| 1836 __ CheckFastSmiElements(r3, r7, &call_builtin); | 1836 __ CheckFastSmiElements(r3, r9, &call_builtin); |
| 1837 | 1837 |
| 1838 __ ldr(r7, FieldMemOperand(r4, HeapObject::kMapOffset)); | 1838 __ ldr(r9, FieldMemOperand(r4, HeapObject::kMapOffset)); |
| 1839 __ LoadRoot(ip, Heap::kHeapNumberMapRootIndex); | 1839 __ LoadRoot(ip, Heap::kHeapNumberMapRootIndex); |
| 1840 __ cmp(r7, ip); | 1840 __ cmp(r9, ip); |
| 1841 __ b(eq, &call_builtin); | 1841 __ b(eq, &call_builtin); |
| 1842 // edx: receiver | 1842 // edx: receiver |
| 1843 // r3: map | 1843 // r3: map |
| 1844 Label try_holey_map; | 1844 Label try_holey_map; |
| 1845 __ LoadTransitionedArrayMapConditional(FAST_SMI_ELEMENTS, | 1845 __ LoadTransitionedArrayMapConditional(FAST_SMI_ELEMENTS, |
| 1846 FAST_ELEMENTS, | 1846 FAST_ELEMENTS, |
| 1847 r3, | 1847 r3, |
| 1848 r7, | 1848 r9, |
| 1849 &try_holey_map); | 1849 &try_holey_map); |
| 1850 __ mov(r2, receiver); | 1850 __ mov(r2, receiver); |
| 1851 ElementsTransitionGenerator:: | 1851 ElementsTransitionGenerator:: |
| 1852 GenerateMapChangeElementsTransition(masm(), | 1852 GenerateMapChangeElementsTransition(masm(), |
| 1853 DONT_TRACK_ALLOCATION_SITE, | 1853 DONT_TRACK_ALLOCATION_SITE, |
| 1854 NULL); | 1854 NULL); |
| 1855 __ jmp(&fast_object); | 1855 __ jmp(&fast_object); |
| 1856 | 1856 |
| 1857 __ bind(&try_holey_map); | 1857 __ bind(&try_holey_map); |
| 1858 __ LoadTransitionedArrayMapConditional(FAST_HOLEY_SMI_ELEMENTS, | 1858 __ LoadTransitionedArrayMapConditional(FAST_HOLEY_SMI_ELEMENTS, |
| 1859 FAST_HOLEY_ELEMENTS, | 1859 FAST_HOLEY_ELEMENTS, |
| 1860 r3, | 1860 r3, |
| 1861 r7, | 1861 r9, |
| 1862 &call_builtin); | 1862 &call_builtin); |
| 1863 __ mov(r2, receiver); | 1863 __ mov(r2, receiver); |
| 1864 ElementsTransitionGenerator:: | 1864 ElementsTransitionGenerator:: |
| 1865 GenerateMapChangeElementsTransition(masm(), | 1865 GenerateMapChangeElementsTransition(masm(), |
| 1866 DONT_TRACK_ALLOCATION_SITE, | 1866 DONT_TRACK_ALLOCATION_SITE, |
| 1867 NULL); | 1867 NULL); |
| 1868 __ bind(&fast_object); | 1868 __ bind(&fast_object); |
| 1869 } else { | 1869 } else { |
| 1870 __ CheckFastObjectElements(r3, r3, &call_builtin); | 1870 __ CheckFastObjectElements(r3, r3, &call_builtin); |
| 1871 } | 1871 } |
| (...skipping 12 matching lines...) Expand all Loading... |
| 1884 r4, | 1884 r4, |
| 1885 kLRHasNotBeenSaved, | 1885 kLRHasNotBeenSaved, |
| 1886 kDontSaveFPRegs, | 1886 kDontSaveFPRegs, |
| 1887 EMIT_REMEMBERED_SET, | 1887 EMIT_REMEMBERED_SET, |
| 1888 OMIT_SMI_CHECK); | 1888 OMIT_SMI_CHECK); |
| 1889 __ Drop(argc + 1); | 1889 __ Drop(argc + 1); |
| 1890 __ Ret(); | 1890 __ Ret(); |
| 1891 | 1891 |
| 1892 __ bind(&attempt_to_grow_elements); | 1892 __ bind(&attempt_to_grow_elements); |
| 1893 // r0: array's length + 1. | 1893 // r0: array's length + 1. |
| 1894 // r4: elements' length. | |
| 1895 | 1894 |
| 1896 if (!FLAG_inline_new) { | 1895 if (!FLAG_inline_new) { |
| 1897 __ b(&call_builtin); | 1896 __ b(&call_builtin); |
| 1898 } | 1897 } |
| 1899 | 1898 |
| 1900 __ ldr(r2, MemOperand(sp, (argc - 1) * kPointerSize)); | 1899 __ ldr(r2, MemOperand(sp, (argc - 1) * kPointerSize)); |
| 1901 // Growing elements that are SMI-only requires special handling in case | 1900 // Growing elements that are SMI-only requires special handling in case |
| 1902 // the new element is non-Smi. For now, delegate to the builtin. | 1901 // the new element is non-Smi. For now, delegate to the builtin. |
| 1903 Label no_fast_elements_check; | 1902 Label no_fast_elements_check; |
| 1904 __ JumpIfSmi(r2, &no_fast_elements_check); | 1903 __ JumpIfSmi(r2, &no_fast_elements_check); |
| 1905 __ ldr(r7, FieldMemOperand(receiver, HeapObject::kMapOffset)); | 1904 __ ldr(r9, FieldMemOperand(receiver, HeapObject::kMapOffset)); |
| 1906 __ CheckFastObjectElements(r7, r7, &call_builtin); | 1905 __ CheckFastObjectElements(r9, r9, &call_builtin); |
| 1907 __ bind(&no_fast_elements_check); | 1906 __ bind(&no_fast_elements_check); |
| 1908 | 1907 |
| 1909 ExternalReference new_space_allocation_top = | 1908 ExternalReference new_space_allocation_top = |
| 1910 ExternalReference::new_space_allocation_top_address(isolate()); | 1909 ExternalReference::new_space_allocation_top_address(isolate()); |
| 1911 ExternalReference new_space_allocation_limit = | 1910 ExternalReference new_space_allocation_limit = |
| 1912 ExternalReference::new_space_allocation_limit_address(isolate()); | 1911 ExternalReference::new_space_allocation_limit_address(isolate()); |
| 1913 | 1912 |
| 1914 const int kAllocationDelta = 4; | 1913 const int kAllocationDelta = 4; |
| 1915 // Load top and check if it is the end of elements. | 1914 // Load top and check if it is the end of elements. |
| 1916 __ add(end_elements, elements, Operand::PointerOffsetFromSmiKey(r0)); | 1915 __ add(end_elements, elements, Operand::PointerOffsetFromSmiKey(r0)); |
| 1917 __ add(end_elements, end_elements, Operand(kEndElementsOffset)); | 1916 __ add(end_elements, end_elements, Operand(kEndElementsOffset)); |
| 1918 __ mov(r7, Operand(new_space_allocation_top)); | 1917 __ mov(r4, Operand(new_space_allocation_top)); |
| 1919 __ ldr(r3, MemOperand(r7)); | 1918 __ ldr(r3, MemOperand(r4)); |
| 1920 __ cmp(end_elements, r3); | 1919 __ cmp(end_elements, r3); |
| 1921 __ b(ne, &call_builtin); | 1920 __ b(ne, &call_builtin); |
| 1922 | 1921 |
| 1923 __ mov(r9, Operand(new_space_allocation_limit)); | 1922 __ mov(r9, Operand(new_space_allocation_limit)); |
| 1924 __ ldr(r9, MemOperand(r9)); | 1923 __ ldr(r9, MemOperand(r9)); |
| 1925 __ add(r3, r3, Operand(kAllocationDelta * kPointerSize)); | 1924 __ add(r3, r3, Operand(kAllocationDelta * kPointerSize)); |
| 1926 __ cmp(r3, r9); | 1925 __ cmp(r3, r9); |
| 1927 __ b(hi, &call_builtin); | 1926 __ b(hi, &call_builtin); |
| 1928 | 1927 |
| 1929 // We fit and could grow elements. | 1928 // We fit and could grow elements. |
| 1930 // Update new_space_allocation_top. | 1929 // Update new_space_allocation_top. |
| 1931 __ str(r3, MemOperand(r7)); | 1930 __ str(r3, MemOperand(r4)); |
| 1932 // Push the argument. | 1931 // Push the argument. |
| 1933 __ str(r2, MemOperand(end_elements)); | 1932 __ str(r2, MemOperand(end_elements)); |
| 1934 // Fill the rest with holes. | 1933 // Fill the rest with holes. |
| 1935 __ LoadRoot(r3, Heap::kTheHoleValueRootIndex); | 1934 __ LoadRoot(r3, Heap::kTheHoleValueRootIndex); |
| 1936 for (int i = 1; i < kAllocationDelta; i++) { | 1935 for (int i = 1; i < kAllocationDelta; i++) { |
| 1937 __ str(r3, MemOperand(end_elements, i * kPointerSize)); | 1936 __ str(r3, MemOperand(end_elements, i * kPointerSize)); |
| 1938 } | 1937 } |
| 1939 | 1938 |
| 1940 // Update elements' and array's sizes. | 1939 // Update elements' and array's sizes. |
| 1941 __ str(r0, FieldMemOperand(receiver, JSArray::kLengthOffset)); | 1940 __ str(r0, FieldMemOperand(receiver, JSArray::kLengthOffset)); |
| 1941 __ ldr(r4, FieldMemOperand(elements, FixedArray::kLengthOffset)); |
| 1942 __ add(r4, r4, Operand(Smi::FromInt(kAllocationDelta))); | 1942 __ add(r4, r4, Operand(Smi::FromInt(kAllocationDelta))); |
| 1943 __ str(r4, FieldMemOperand(elements, FixedArray::kLengthOffset)); | 1943 __ str(r4, FieldMemOperand(elements, FixedArray::kLengthOffset)); |
| 1944 | 1944 |
| 1945 // Elements are in new space, so write barrier is not required. | 1945 // Elements are in new space, so write barrier is not required. |
| 1946 __ Drop(argc + 1); | 1946 __ Drop(argc + 1); |
| 1947 __ Ret(); | 1947 __ Ret(); |
| 1948 } | 1948 } |
| 1949 __ bind(&call_builtin); | 1949 __ bind(&call_builtin); |
| 1950 __ TailCallExternalReference( | 1950 __ TailCallExternalReference( |
| 1951 ExternalReference(Builtins::c_ArrayPush, isolate()), argc + 1, 1); | 1951 ExternalReference(Builtins::c_ArrayPush, isolate()), argc + 1, 1); |
| (...skipping 1213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3165 // ----------------------------------- | 3165 // ----------------------------------- |
| 3166 TailCallBuiltin(masm, Builtins::kKeyedLoadIC_MissForceGeneric); | 3166 TailCallBuiltin(masm, Builtins::kKeyedLoadIC_MissForceGeneric); |
| 3167 } | 3167 } |
| 3168 | 3168 |
| 3169 | 3169 |
| 3170 #undef __ | 3170 #undef __ |
| 3171 | 3171 |
| 3172 } } // namespace v8::internal | 3172 } } // namespace v8::internal |
| 3173 | 3173 |
| 3174 #endif // V8_TARGET_ARCH_ARM | 3174 #endif // V8_TARGET_ARCH_ARM |
| OLD | NEW |