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 1801 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1812 if (has_fast_elements && !FLAG_allocation_site_pretenuring) { | 1812 if (has_fast_elements && !FLAG_allocation_site_pretenuring) { |
1813 // If the only customer of allocation sites is transitioning, then | 1813 // If the only customer of allocation sites is transitioning, then |
1814 // we can turn it off if we don't have anywhere else to transition to. | 1814 // we can turn it off if we don't have anywhere else to transition to. |
1815 allocation_site_mode = DONT_TRACK_ALLOCATION_SITE; | 1815 allocation_site_mode = DONT_TRACK_ALLOCATION_SITE; |
1816 } | 1816 } |
1817 | 1817 |
1818 __ ldr(r3, MemOperand(fp, JavaScriptFrameConstants::kFunctionOffset)); | 1818 __ ldr(r3, MemOperand(fp, JavaScriptFrameConstants::kFunctionOffset)); |
1819 __ ldr(r3, FieldMemOperand(r3, JSFunction::kLiteralsOffset)); | 1819 __ ldr(r3, FieldMemOperand(r3, JSFunction::kLiteralsOffset)); |
1820 __ mov(r2, Operand(Smi::FromInt(expr->literal_index()))); | 1820 __ mov(r2, Operand(Smi::FromInt(expr->literal_index()))); |
1821 __ mov(r1, Operand(constant_elements)); | 1821 __ mov(r1, Operand(constant_elements)); |
1822 if (has_fast_elements && constant_elements_values->map() == | 1822 if (expr->depth() > 1) { |
1823 isolate()->heap()->fixed_cow_array_map()) { | |
1824 FastCloneShallowArrayStub stub( | |
1825 FastCloneShallowArrayStub::COPY_ON_WRITE_ELEMENTS, | |
1826 allocation_site_mode, | |
1827 length); | |
1828 __ CallStub(&stub); | |
1829 __ IncrementCounter( | |
1830 isolate()->counters()->cow_arrays_created_stub(), 1, r1, r2); | |
1831 } else if (expr->depth() > 1 || Serializer::enabled() || | |
1832 length > FastCloneShallowArrayStub::kMaximumClonedLength) { | |
1833 __ mov(r0, Operand(Smi::FromInt(flags))); | 1823 __ mov(r0, Operand(Smi::FromInt(flags))); |
1834 __ Push(r3, r2, r1, r0); | 1824 __ Push(r3, r2, r1, r0); |
1835 __ CallRuntime(Runtime::kHiddenCreateArrayLiteral, 4); | 1825 __ CallRuntime(Runtime::kHiddenCreateArrayLiteral, 4); |
1836 } else { | 1826 } else { |
1837 ASSERT(IsFastSmiOrObjectElementsKind(constant_elements_kind) || | 1827 FastCloneShallowArrayStub stub(allocation_site_mode); |
1838 FLAG_smi_only_arrays); | |
1839 FastCloneShallowArrayStub::Mode mode = | |
1840 FastCloneShallowArrayStub::CLONE_ANY_ELEMENTS; | |
1841 | |
1842 if (has_fast_elements) { | |
1843 mode = FastCloneShallowArrayStub::CLONE_ELEMENTS; | |
1844 } | |
1845 | |
1846 FastCloneShallowArrayStub stub(mode, allocation_site_mode, length); | |
1847 __ CallStub(&stub); | 1828 __ CallStub(&stub); |
1848 } | 1829 } |
1849 | 1830 |
1850 bool result_saved = false; // Is the result saved to the stack? | 1831 bool result_saved = false; // Is the result saved to the stack? |
1851 | 1832 |
1852 // Emit code to evaluate all the non-constant subexpressions and to store | 1833 // Emit code to evaluate all the non-constant subexpressions and to store |
1853 // them into the newly cloned array. | 1834 // them into the newly cloned array. |
1854 for (int i = 0; i < length; i++) { | 1835 for (int i = 0; i < length; i++) { |
1855 Expression* subexpr = subexprs->at(i); | 1836 Expression* subexpr = subexprs->at(i); |
1856 // If the subexpression is a literal or a simple materialized literal it | 1837 // If the subexpression is a literal or a simple materialized literal it |
(...skipping 3075 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4932 | 4913 |
4933 ASSERT(interrupt_address == | 4914 ASSERT(interrupt_address == |
4934 isolate->builtins()->OsrAfterStackCheck()->entry()); | 4915 isolate->builtins()->OsrAfterStackCheck()->entry()); |
4935 return OSR_AFTER_STACK_CHECK; | 4916 return OSR_AFTER_STACK_CHECK; |
4936 } | 4917 } |
4937 | 4918 |
4938 | 4919 |
4939 } } // namespace v8::internal | 4920 } } // namespace v8::internal |
4940 | 4921 |
4941 #endif // V8_TARGET_ARCH_ARM | 4922 #endif // V8_TARGET_ARCH_ARM |
OLD | NEW |