| OLD | NEW |
| 1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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 1665 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1676 int flags = expr->fast_elements() | 1676 int flags = expr->fast_elements() |
| 1677 ? ObjectLiteral::kFastElements | 1677 ? ObjectLiteral::kFastElements |
| 1678 : ObjectLiteral::kNoFlags; | 1678 : ObjectLiteral::kNoFlags; |
| 1679 flags |= expr->has_function() | 1679 flags |= expr->has_function() |
| 1680 ? ObjectLiteral::kHasFunction | 1680 ? ObjectLiteral::kHasFunction |
| 1681 : ObjectLiteral::kNoFlags; | 1681 : ObjectLiteral::kNoFlags; |
| 1682 __ Mov(x0, Smi::FromInt(flags)); | 1682 __ Mov(x0, Smi::FromInt(flags)); |
| 1683 int properties_count = constant_properties->length() / 2; | 1683 int properties_count = constant_properties->length() / 2; |
| 1684 const int max_cloned_properties = | 1684 const int max_cloned_properties = |
| 1685 FastCloneShallowObjectStub::kMaximumClonedProperties; | 1685 FastCloneShallowObjectStub::kMaximumClonedProperties; |
| 1686 if (expr->may_store_doubles() || expr->depth() > 1 || Serializer::enabled() || | 1686 if (expr->may_store_doubles() || expr->depth() > 1 || |
| 1687 flags != ObjectLiteral::kFastElements || | 1687 Serializer::enabled(isolate()) || flags != ObjectLiteral::kFastElements || |
| 1688 properties_count > max_cloned_properties) { | 1688 properties_count > max_cloned_properties) { |
| 1689 __ Push(x3, x2, x1, x0); | 1689 __ Push(x3, x2, x1, x0); |
| 1690 __ CallRuntime(Runtime::kHiddenCreateObjectLiteral, 4); | 1690 __ CallRuntime(Runtime::kHiddenCreateObjectLiteral, 4); |
| 1691 } else { | 1691 } else { |
| 1692 FastCloneShallowObjectStub stub(isolate(), properties_count); | 1692 FastCloneShallowObjectStub stub(isolate(), properties_count); |
| 1693 __ CallStub(&stub); | 1693 __ CallStub(&stub); |
| 1694 } | 1694 } |
| 1695 | 1695 |
| 1696 // If result_saved is true the result is on top of the stack. If | 1696 // If result_saved is true the result is on top of the stack. If |
| 1697 // result_saved is false the result is in x0. | 1697 // result_saved is false the result is in x0. |
| (...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1827 if (has_fast_elements && constant_elements_values->map() == | 1827 if (has_fast_elements && constant_elements_values->map() == |
| 1828 isolate()->heap()->fixed_cow_array_map()) { | 1828 isolate()->heap()->fixed_cow_array_map()) { |
| 1829 FastCloneShallowArrayStub stub( | 1829 FastCloneShallowArrayStub stub( |
| 1830 isolate(), | 1830 isolate(), |
| 1831 FastCloneShallowArrayStub::COPY_ON_WRITE_ELEMENTS, | 1831 FastCloneShallowArrayStub::COPY_ON_WRITE_ELEMENTS, |
| 1832 allocation_site_mode, | 1832 allocation_site_mode, |
| 1833 length); | 1833 length); |
| 1834 __ CallStub(&stub); | 1834 __ CallStub(&stub); |
| 1835 __ IncrementCounter( | 1835 __ IncrementCounter( |
| 1836 isolate()->counters()->cow_arrays_created_stub(), 1, x10, x11); | 1836 isolate()->counters()->cow_arrays_created_stub(), 1, x10, x11); |
| 1837 } else if ((expr->depth() > 1) || Serializer::enabled() || | 1837 } else if ((expr->depth() > 1) || Serializer::enabled(isolate()) || |
| 1838 length > FastCloneShallowArrayStub::kMaximumClonedLength) { | 1838 length > FastCloneShallowArrayStub::kMaximumClonedLength) { |
| 1839 __ Mov(x0, Smi::FromInt(flags)); | 1839 __ Mov(x0, Smi::FromInt(flags)); |
| 1840 __ Push(x3, x2, x1, x0); | 1840 __ Push(x3, x2, x1, x0); |
| 1841 __ CallRuntime(Runtime::kHiddenCreateArrayLiteral, 4); | 1841 __ CallRuntime(Runtime::kHiddenCreateArrayLiteral, 4); |
| 1842 } else { | 1842 } else { |
| 1843 ASSERT(IsFastSmiOrObjectElementsKind(constant_elements_kind) || | 1843 ASSERT(IsFastSmiOrObjectElementsKind(constant_elements_kind) || |
| 1844 FLAG_smi_only_arrays); | 1844 FLAG_smi_only_arrays); |
| 1845 FastCloneShallowArrayStub::Mode mode = | 1845 FastCloneShallowArrayStub::Mode mode = |
| 1846 FastCloneShallowArrayStub::CLONE_ANY_ELEMENTS; | 1846 FastCloneShallowArrayStub::CLONE_ANY_ELEMENTS; |
| 1847 | 1847 |
| (...skipping 3157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5005 return previous_; | 5005 return previous_; |
| 5006 } | 5006 } |
| 5007 | 5007 |
| 5008 | 5008 |
| 5009 #undef __ | 5009 #undef __ |
| 5010 | 5010 |
| 5011 | 5011 |
| 5012 } } // namespace v8::internal | 5012 } } // namespace v8::internal |
| 5013 | 5013 |
| 5014 #endif // V8_TARGET_ARCH_ARM64 | 5014 #endif // V8_TARGET_ARCH_ARM64 |
| OLD | NEW |