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 1816 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1827 // If the only customer of allocation sites is transitioning, then | 1827 // If the only customer of allocation sites is transitioning, then |
1828 // we can turn it off if we don't have anywhere else to transition to. | 1828 // we can turn it off if we don't have anywhere else to transition to. |
1829 allocation_site_mode = DONT_TRACK_ALLOCATION_SITE; | 1829 allocation_site_mode = DONT_TRACK_ALLOCATION_SITE; |
1830 } | 1830 } |
1831 | 1831 |
1832 __ mov(a0, result_register()); | 1832 __ mov(a0, result_register()); |
1833 __ lw(a3, MemOperand(fp, JavaScriptFrameConstants::kFunctionOffset)); | 1833 __ lw(a3, MemOperand(fp, JavaScriptFrameConstants::kFunctionOffset)); |
1834 __ lw(a3, FieldMemOperand(a3, JSFunction::kLiteralsOffset)); | 1834 __ lw(a3, FieldMemOperand(a3, JSFunction::kLiteralsOffset)); |
1835 __ li(a2, Operand(Smi::FromInt(expr->literal_index()))); | 1835 __ li(a2, Operand(Smi::FromInt(expr->literal_index()))); |
1836 __ li(a1, Operand(constant_elements)); | 1836 __ li(a1, Operand(constant_elements)); |
1837 if (has_fast_elements && constant_elements_values->map() == | 1837 if (expr->depth() > 1) { |
1838 isolate()->heap()->fixed_cow_array_map()) { | |
1839 FastCloneShallowArrayStub stub( | |
1840 isolate(), | |
1841 FastCloneShallowArrayStub::COPY_ON_WRITE_ELEMENTS, | |
1842 allocation_site_mode, | |
1843 length); | |
1844 __ CallStub(&stub); | |
1845 __ IncrementCounter(isolate()->counters()->cow_arrays_created_stub(), | |
1846 1, a1, a2); | |
1847 } else if (expr->depth() > 1 || Serializer::enabled() || | |
1848 length > FastCloneShallowArrayStub::kMaximumInlinedCloneLength) { | |
1849 __ li(a0, Operand(Smi::FromInt(flags))); | 1838 __ li(a0, Operand(Smi::FromInt(flags))); |
1850 __ Push(a3, a2, a1, a0); | 1839 __ Push(a3, a2, a1, a0); |
1851 __ CallRuntime(Runtime::kHiddenCreateArrayLiteral, 4); | 1840 __ CallRuntime(Runtime::kHiddenCreateArrayLiteral, 4); |
1852 } else { | 1841 } else { |
1853 ASSERT(IsFastSmiOrObjectElementsKind(constant_elements_kind) || | 1842 FastCloneShallowArrayStub stub(isolate(), allocation_site_mode); |
1854 FLAG_smi_only_arrays); | |
1855 FastCloneShallowArrayStub::Mode mode = | |
1856 FastCloneShallowArrayStub::CLONE_ANY_ELEMENTS; | |
1857 | |
1858 if (has_fast_elements) { | |
1859 mode = FastCloneShallowArrayStub::CLONE_ELEMENTS; | |
1860 } | |
1861 | |
1862 FastCloneShallowArrayStub stub(isolate(), mode, allocation_site_mode, | |
1863 length); | |
1864 __ CallStub(&stub); | 1843 __ CallStub(&stub); |
1865 } | 1844 } |
1866 | 1845 |
1867 bool result_saved = false; // Is the result saved to the stack? | 1846 bool result_saved = false; // Is the result saved to the stack? |
1868 | 1847 |
1869 // Emit code to evaluate all the non-constant subexpressions and to store | 1848 // Emit code to evaluate all the non-constant subexpressions and to store |
1870 // them into the newly cloned array. | 1849 // them into the newly cloned array. |
1871 for (int i = 0; i < length; i++) { | 1850 for (int i = 0; i < length; i++) { |
1872 Expression* subexpr = subexprs->at(i); | 1851 Expression* subexpr = subexprs->at(i); |
1873 // If the subexpression is a literal or a simple materialized literal it | 1852 // If the subexpression is a literal or a simple materialized literal it |
(...skipping 3092 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4966 Assembler::target_address_at(pc_immediate_load_address)) == | 4945 Assembler::target_address_at(pc_immediate_load_address)) == |
4967 reinterpret_cast<uint32_t>( | 4946 reinterpret_cast<uint32_t>( |
4968 isolate->builtins()->OsrAfterStackCheck()->entry())); | 4947 isolate->builtins()->OsrAfterStackCheck()->entry())); |
4969 return OSR_AFTER_STACK_CHECK; | 4948 return OSR_AFTER_STACK_CHECK; |
4970 } | 4949 } |
4971 | 4950 |
4972 | 4951 |
4973 } } // namespace v8::internal | 4952 } } // namespace v8::internal |
4974 | 4953 |
4975 #endif // V8_TARGET_ARCH_MIPS | 4954 #endif // V8_TARGET_ARCH_MIPS |
OLD | NEW |