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 856 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
867 Handle<Object> call_data(api_call_info->data(), masm->isolate()); | 867 Handle<Object> call_data(api_call_info->data(), masm->isolate()); |
868 if (masm->isolate()->heap()->InNewSpace(*call_data)) { | 868 if (masm->isolate()->heap()->InNewSpace(*call_data)) { |
869 __ Move(r0, api_call_info); | 869 __ Move(r0, api_call_info); |
870 __ ldr(r6, FieldMemOperand(r0, CallHandlerInfo::kDataOffset)); | 870 __ ldr(r6, FieldMemOperand(r0, CallHandlerInfo::kDataOffset)); |
871 } else { | 871 } else { |
872 __ Move(r6, call_data); | 872 __ Move(r6, call_data); |
873 } | 873 } |
874 // Store call data. | 874 // Store call data. |
875 __ str(r6, MemOperand(sp, 3 * kPointerSize)); | 875 __ str(r6, MemOperand(sp, 3 * kPointerSize)); |
876 // Store isolate. | 876 // Store isolate. |
877 __ mov(r7, Operand(ExternalReference::isolate_address(masm->isolate()))); | 877 __ mov(r5, Operand(ExternalReference::isolate_address(masm->isolate()))); |
ulan
2013/09/23 12:57:13
Changed this to r5 from ip, since r5 is reloaded l
| |
878 __ str(r7, MemOperand(sp, 4 * kPointerSize)); | 878 __ str(r5, MemOperand(sp, 4 * kPointerSize)); |
879 // Store ReturnValue default and ReturnValue. | 879 // Store ReturnValue default and ReturnValue. |
880 __ LoadRoot(r5, Heap::kUndefinedValueRootIndex); | 880 __ LoadRoot(r5, Heap::kUndefinedValueRootIndex); |
881 __ str(r5, MemOperand(sp, 5 * kPointerSize)); | 881 __ str(r5, MemOperand(sp, 5 * kPointerSize)); |
882 __ str(r5, MemOperand(sp, 6 * kPointerSize)); | 882 __ str(r5, MemOperand(sp, 6 * kPointerSize)); |
883 | 883 |
884 // Prepare arguments. | 884 // Prepare arguments. |
885 __ add(r2, sp, Operand((kFastApiCallArguments - 1) * kPointerSize)); | 885 __ add(r2, sp, Operand((kFastApiCallArguments - 1) * kPointerSize)); |
886 | 886 |
887 // Allocate the v8::Arguments structure in the arguments' space since | 887 // Allocate the v8::Arguments structure in the arguments' space since |
888 // it's not controlled by GC. | 888 // it's not controlled by GC. |
(...skipping 959 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1848 // Check for a smi. | 1848 // Check for a smi. |
1849 __ Drop(argc + 1); | 1849 __ Drop(argc + 1); |
1850 __ Ret(); | 1850 __ Ret(); |
1851 | 1851 |
1852 __ bind(&with_write_barrier); | 1852 __ bind(&with_write_barrier); |
1853 | 1853 |
1854 __ ldr(r3, FieldMemOperand(receiver, HeapObject::kMapOffset)); | 1854 __ ldr(r3, FieldMemOperand(receiver, HeapObject::kMapOffset)); |
1855 | 1855 |
1856 if (FLAG_smi_only_arrays && !FLAG_trace_elements_transitions) { | 1856 if (FLAG_smi_only_arrays && !FLAG_trace_elements_transitions) { |
1857 Label fast_object, not_fast_object; | 1857 Label fast_object, not_fast_object; |
1858 __ CheckFastObjectElements(r3, r7, ¬_fast_object); | 1858 __ CheckFastObjectElements(r3, r9, ¬_fast_object); |
1859 __ jmp(&fast_object); | 1859 __ jmp(&fast_object); |
1860 // In case of fast smi-only, convert to fast object, otherwise bail out. | 1860 // In case of fast smi-only, convert to fast object, otherwise bail out. |
1861 __ bind(¬_fast_object); | 1861 __ bind(¬_fast_object); |
1862 __ CheckFastSmiElements(r3, r7, &call_builtin); | 1862 __ CheckFastSmiElements(r3, r9, &call_builtin); |
1863 | 1863 |
1864 __ ldr(r7, FieldMemOperand(r4, HeapObject::kMapOffset)); | 1864 __ ldr(r9, FieldMemOperand(r4, HeapObject::kMapOffset)); |
1865 __ LoadRoot(ip, Heap::kHeapNumberMapRootIndex); | 1865 __ LoadRoot(ip, Heap::kHeapNumberMapRootIndex); |
1866 __ cmp(r7, ip); | 1866 __ cmp(r9, ip); |
1867 __ b(eq, &call_builtin); | 1867 __ b(eq, &call_builtin); |
1868 // edx: receiver | 1868 // edx: receiver |
1869 // r3: map | 1869 // r3: map |
1870 Label try_holey_map; | 1870 Label try_holey_map; |
1871 __ LoadTransitionedArrayMapConditional(FAST_SMI_ELEMENTS, | 1871 __ LoadTransitionedArrayMapConditional(FAST_SMI_ELEMENTS, |
1872 FAST_ELEMENTS, | 1872 FAST_ELEMENTS, |
1873 r3, | 1873 r3, |
1874 r7, | 1874 r9, |
1875 &try_holey_map); | 1875 &try_holey_map); |
1876 __ mov(r2, receiver); | 1876 __ mov(r2, receiver); |
1877 ElementsTransitionGenerator:: | 1877 ElementsTransitionGenerator:: |
1878 GenerateMapChangeElementsTransition(masm(), | 1878 GenerateMapChangeElementsTransition(masm(), |
1879 DONT_TRACK_ALLOCATION_SITE, | 1879 DONT_TRACK_ALLOCATION_SITE, |
1880 NULL); | 1880 NULL); |
1881 __ jmp(&fast_object); | 1881 __ jmp(&fast_object); |
1882 | 1882 |
1883 __ bind(&try_holey_map); | 1883 __ bind(&try_holey_map); |
1884 __ LoadTransitionedArrayMapConditional(FAST_HOLEY_SMI_ELEMENTS, | 1884 __ LoadTransitionedArrayMapConditional(FAST_HOLEY_SMI_ELEMENTS, |
1885 FAST_HOLEY_ELEMENTS, | 1885 FAST_HOLEY_ELEMENTS, |
1886 r3, | 1886 r3, |
1887 r7, | 1887 r9, |
1888 &call_builtin); | 1888 &call_builtin); |
1889 __ mov(r2, receiver); | 1889 __ mov(r2, receiver); |
1890 ElementsTransitionGenerator:: | 1890 ElementsTransitionGenerator:: |
1891 GenerateMapChangeElementsTransition(masm(), | 1891 GenerateMapChangeElementsTransition(masm(), |
1892 DONT_TRACK_ALLOCATION_SITE, | 1892 DONT_TRACK_ALLOCATION_SITE, |
1893 NULL); | 1893 NULL); |
1894 __ bind(&fast_object); | 1894 __ bind(&fast_object); |
1895 } else { | 1895 } else { |
1896 __ CheckFastObjectElements(r3, r3, &call_builtin); | 1896 __ CheckFastObjectElements(r3, r3, &call_builtin); |
1897 } | 1897 } |
(...skipping 12 matching lines...) Expand all Loading... | |
1910 r4, | 1910 r4, |
1911 kLRHasNotBeenSaved, | 1911 kLRHasNotBeenSaved, |
1912 kDontSaveFPRegs, | 1912 kDontSaveFPRegs, |
1913 EMIT_REMEMBERED_SET, | 1913 EMIT_REMEMBERED_SET, |
1914 OMIT_SMI_CHECK); | 1914 OMIT_SMI_CHECK); |
1915 __ Drop(argc + 1); | 1915 __ Drop(argc + 1); |
1916 __ Ret(); | 1916 __ Ret(); |
1917 | 1917 |
1918 __ bind(&attempt_to_grow_elements); | 1918 __ bind(&attempt_to_grow_elements); |
1919 // r0: array's length + 1. | 1919 // r0: array's length + 1. |
1920 // r4: elements' length. | |
1921 | 1920 |
1922 if (!FLAG_inline_new) { | 1921 if (!FLAG_inline_new) { |
1923 __ b(&call_builtin); | 1922 __ b(&call_builtin); |
1924 } | 1923 } |
1925 | 1924 |
1926 __ ldr(r2, MemOperand(sp, (argc - 1) * kPointerSize)); | 1925 __ ldr(r2, MemOperand(sp, (argc - 1) * kPointerSize)); |
1927 // Growing elements that are SMI-only requires special handling in case | 1926 // Growing elements that are SMI-only requires special handling in case |
1928 // the new element is non-Smi. For now, delegate to the builtin. | 1927 // the new element is non-Smi. For now, delegate to the builtin. |
1929 Label no_fast_elements_check; | 1928 Label no_fast_elements_check; |
1930 __ JumpIfSmi(r2, &no_fast_elements_check); | 1929 __ JumpIfSmi(r2, &no_fast_elements_check); |
1931 __ ldr(r7, FieldMemOperand(receiver, HeapObject::kMapOffset)); | 1930 __ ldr(r9, FieldMemOperand(receiver, HeapObject::kMapOffset)); |
1932 __ CheckFastObjectElements(r7, r7, &call_builtin); | 1931 __ CheckFastObjectElements(r9, r9, &call_builtin); |
1933 __ bind(&no_fast_elements_check); | 1932 __ bind(&no_fast_elements_check); |
1934 | 1933 |
1935 ExternalReference new_space_allocation_top = | 1934 ExternalReference new_space_allocation_top = |
1936 ExternalReference::new_space_allocation_top_address(isolate()); | 1935 ExternalReference::new_space_allocation_top_address(isolate()); |
1937 ExternalReference new_space_allocation_limit = | 1936 ExternalReference new_space_allocation_limit = |
1938 ExternalReference::new_space_allocation_limit_address(isolate()); | 1937 ExternalReference::new_space_allocation_limit_address(isolate()); |
1939 | 1938 |
1940 const int kAllocationDelta = 4; | 1939 const int kAllocationDelta = 4; |
1941 // Load top and check if it is the end of elements. | 1940 // Load top and check if it is the end of elements. |
1942 __ add(end_elements, elements, Operand::PointerOffsetFromSmiKey(r0)); | 1941 __ add(end_elements, elements, Operand::PointerOffsetFromSmiKey(r0)); |
1943 __ add(end_elements, end_elements, Operand(kEndElementsOffset)); | 1942 __ add(end_elements, end_elements, Operand(kEndElementsOffset)); |
1944 __ mov(r7, Operand(new_space_allocation_top)); | 1943 __ mov(r4, Operand(new_space_allocation_top)); |
1945 __ ldr(r3, MemOperand(r7)); | 1944 __ ldr(r3, MemOperand(r4)); |
1946 __ cmp(end_elements, r3); | 1945 __ cmp(end_elements, r3); |
1947 __ b(ne, &call_builtin); | 1946 __ b(ne, &call_builtin); |
1948 | 1947 |
1949 __ mov(r9, Operand(new_space_allocation_limit)); | 1948 __ mov(r9, Operand(new_space_allocation_limit)); |
1950 __ ldr(r9, MemOperand(r9)); | 1949 __ ldr(r9, MemOperand(r9)); |
1951 __ add(r3, r3, Operand(kAllocationDelta * kPointerSize)); | 1950 __ add(r3, r3, Operand(kAllocationDelta * kPointerSize)); |
1952 __ cmp(r3, r9); | 1951 __ cmp(r3, r9); |
1953 __ b(hi, &call_builtin); | 1952 __ b(hi, &call_builtin); |
1954 | 1953 |
1955 // We fit and could grow elements. | 1954 // We fit and could grow elements. |
1956 // Update new_space_allocation_top. | 1955 // Update new_space_allocation_top. |
1957 __ str(r3, MemOperand(r7)); | 1956 __ str(r3, MemOperand(r4)); |
1958 // Push the argument. | 1957 // Push the argument. |
1959 __ str(r2, MemOperand(end_elements)); | 1958 __ str(r2, MemOperand(end_elements)); |
1960 // Fill the rest with holes. | 1959 // Fill the rest with holes. |
1961 __ LoadRoot(r3, Heap::kTheHoleValueRootIndex); | 1960 __ LoadRoot(r3, Heap::kTheHoleValueRootIndex); |
1962 for (int i = 1; i < kAllocationDelta; i++) { | 1961 for (int i = 1; i < kAllocationDelta; i++) { |
1963 __ str(r3, MemOperand(end_elements, i * kPointerSize)); | 1962 __ str(r3, MemOperand(end_elements, i * kPointerSize)); |
1964 } | 1963 } |
1965 | 1964 |
1966 // Update elements' and array's sizes. | 1965 // Update elements' and array's sizes. |
1967 __ str(r0, FieldMemOperand(receiver, JSArray::kLengthOffset)); | 1966 __ str(r0, FieldMemOperand(receiver, JSArray::kLengthOffset)); |
1967 __ ldr(r4, FieldMemOperand(elements, FixedArray::kLengthOffset)); | |
1968 __ add(r4, r4, Operand(Smi::FromInt(kAllocationDelta))); | 1968 __ add(r4, r4, Operand(Smi::FromInt(kAllocationDelta))); |
1969 __ str(r4, FieldMemOperand(elements, FixedArray::kLengthOffset)); | 1969 __ str(r4, FieldMemOperand(elements, FixedArray::kLengthOffset)); |
1970 | 1970 |
1971 // Elements are in new space, so write barrier is not required. | 1971 // Elements are in new space, so write barrier is not required. |
1972 __ Drop(argc + 1); | 1972 __ Drop(argc + 1); |
1973 __ Ret(); | 1973 __ Ret(); |
1974 } | 1974 } |
1975 __ bind(&call_builtin); | 1975 __ bind(&call_builtin); |
1976 __ TailCallExternalReference( | 1976 __ TailCallExternalReference( |
1977 ExternalReference(Builtins::c_ArrayPush, isolate()), argc + 1, 1); | 1977 ExternalReference(Builtins::c_ArrayPush, isolate()), argc + 1, 1); |
(...skipping 1213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3191 // ----------------------------------- | 3191 // ----------------------------------- |
3192 TailCallBuiltin(masm, Builtins::kKeyedLoadIC_MissForceGeneric); | 3192 TailCallBuiltin(masm, Builtins::kKeyedLoadIC_MissForceGeneric); |
3193 } | 3193 } |
3194 | 3194 |
3195 | 3195 |
3196 #undef __ | 3196 #undef __ |
3197 | 3197 |
3198 } } // namespace v8::internal | 3198 } } // namespace v8::internal |
3199 | 3199 |
3200 #endif // V8_TARGET_ARCH_ARM | 3200 #endif // V8_TARGET_ARCH_ARM |
OLD | NEW |