| OLD | NEW |
| 1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "v8.h" | 5 #include "v8.h" |
| 6 | 6 |
| 7 #if V8_TARGET_ARCH_ARM64 | 7 #if V8_TARGET_ARCH_ARM64 |
| 8 | 8 |
| 9 #include "code-stubs.h" | 9 #include "code-stubs.h" |
| 10 #include "codegen.h" | 10 #include "codegen.h" |
| (...skipping 1642 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1653 int flags = expr->fast_elements() | 1653 int flags = expr->fast_elements() |
| 1654 ? ObjectLiteral::kFastElements | 1654 ? ObjectLiteral::kFastElements |
| 1655 : ObjectLiteral::kNoFlags; | 1655 : ObjectLiteral::kNoFlags; |
| 1656 flags |= expr->has_function() | 1656 flags |= expr->has_function() |
| 1657 ? ObjectLiteral::kHasFunction | 1657 ? ObjectLiteral::kHasFunction |
| 1658 : ObjectLiteral::kNoFlags; | 1658 : ObjectLiteral::kNoFlags; |
| 1659 __ Mov(x0, Smi::FromInt(flags)); | 1659 __ Mov(x0, Smi::FromInt(flags)); |
| 1660 int properties_count = constant_properties->length() / 2; | 1660 int properties_count = constant_properties->length() / 2; |
| 1661 const int max_cloned_properties = | 1661 const int max_cloned_properties = |
| 1662 FastCloneShallowObjectStub::kMaximumClonedProperties; | 1662 FastCloneShallowObjectStub::kMaximumClonedProperties; |
| 1663 if (expr->may_store_doubles() || expr->depth() > 1 || Serializer::enabled() || | 1663 if (expr->may_store_doubles() || expr->depth() > 1 || |
| 1664 flags != ObjectLiteral::kFastElements || | 1664 Serializer::enabled(isolate()) || flags != ObjectLiteral::kFastElements || |
| 1665 properties_count > max_cloned_properties) { | 1665 properties_count > max_cloned_properties) { |
| 1666 __ Push(x3, x2, x1, x0); | 1666 __ Push(x3, x2, x1, x0); |
| 1667 __ CallRuntime(Runtime::kHiddenCreateObjectLiteral, 4); | 1667 __ CallRuntime(Runtime::kHiddenCreateObjectLiteral, 4); |
| 1668 } else { | 1668 } else { |
| 1669 FastCloneShallowObjectStub stub(isolate(), properties_count); | 1669 FastCloneShallowObjectStub stub(isolate(), properties_count); |
| 1670 __ CallStub(&stub); | 1670 __ CallStub(&stub); |
| 1671 } | 1671 } |
| 1672 | 1672 |
| 1673 // If result_saved is true the result is on top of the stack. If | 1673 // If result_saved is true the result is on top of the stack. If |
| 1674 // result_saved is false the result is in x0. | 1674 // result_saved is false the result is in x0. |
| (...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1804 if (has_fast_elements && constant_elements_values->map() == | 1804 if (has_fast_elements && constant_elements_values->map() == |
| 1805 isolate()->heap()->fixed_cow_array_map()) { | 1805 isolate()->heap()->fixed_cow_array_map()) { |
| 1806 FastCloneShallowArrayStub stub( | 1806 FastCloneShallowArrayStub stub( |
| 1807 isolate(), | 1807 isolate(), |
| 1808 FastCloneShallowArrayStub::COPY_ON_WRITE_ELEMENTS, | 1808 FastCloneShallowArrayStub::COPY_ON_WRITE_ELEMENTS, |
| 1809 allocation_site_mode, | 1809 allocation_site_mode, |
| 1810 length); | 1810 length); |
| 1811 __ CallStub(&stub); | 1811 __ CallStub(&stub); |
| 1812 __ IncrementCounter( | 1812 __ IncrementCounter( |
| 1813 isolate()->counters()->cow_arrays_created_stub(), 1, x10, x11); | 1813 isolate()->counters()->cow_arrays_created_stub(), 1, x10, x11); |
| 1814 } else if ((expr->depth() > 1) || Serializer::enabled() || | 1814 } else if ((expr->depth() > 1) || Serializer::enabled(isolate()) || |
| 1815 length > FastCloneShallowArrayStub::kMaximumClonedLength) { | 1815 length > FastCloneShallowArrayStub::kMaximumClonedLength) { |
| 1816 __ Mov(x0, Smi::FromInt(flags)); | 1816 __ Mov(x0, Smi::FromInt(flags)); |
| 1817 __ Push(x3, x2, x1, x0); | 1817 __ Push(x3, x2, x1, x0); |
| 1818 __ CallRuntime(Runtime::kHiddenCreateArrayLiteral, 4); | 1818 __ CallRuntime(Runtime::kHiddenCreateArrayLiteral, 4); |
| 1819 } else { | 1819 } else { |
| 1820 ASSERT(IsFastSmiOrObjectElementsKind(constant_elements_kind) || | 1820 ASSERT(IsFastSmiOrObjectElementsKind(constant_elements_kind) || |
| 1821 FLAG_smi_only_arrays); | 1821 FLAG_smi_only_arrays); |
| 1822 FastCloneShallowArrayStub::Mode mode = | 1822 FastCloneShallowArrayStub::Mode mode = |
| 1823 FastCloneShallowArrayStub::CLONE_ANY_ELEMENTS; | 1823 FastCloneShallowArrayStub::CLONE_ANY_ELEMENTS; |
| 1824 | 1824 |
| (...skipping 3157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4982 return previous_; | 4982 return previous_; |
| 4983 } | 4983 } |
| 4984 | 4984 |
| 4985 | 4985 |
| 4986 #undef __ | 4986 #undef __ |
| 4987 | 4987 |
| 4988 | 4988 |
| 4989 } } // namespace v8::internal | 4989 } } // namespace v8::internal |
| 4990 | 4990 |
| 4991 #endif // V8_TARGET_ARCH_ARM64 | 4991 #endif // V8_TARGET_ARCH_ARM64 |
| OLD | NEW |