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 1715 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1726 } else if (expr->depth() > 1) { | 1726 } else if (expr->depth() > 1) { |
1727 __ CallRuntime(Runtime::kCreateArrayLiteral, 3); | 1727 __ CallRuntime(Runtime::kCreateArrayLiteral, 3); |
1728 } else if (length > FastCloneShallowArrayStub::kMaximumClonedLength) { | 1728 } else if (length > FastCloneShallowArrayStub::kMaximumClonedLength) { |
1729 __ CallRuntime(Runtime::kCreateArrayLiteralShallow, 3); | 1729 __ CallRuntime(Runtime::kCreateArrayLiteralShallow, 3); |
1730 } else { | 1730 } else { |
1731 ASSERT(IsFastSmiOrObjectElementsKind(constant_elements_kind) || | 1731 ASSERT(IsFastSmiOrObjectElementsKind(constant_elements_kind) || |
1732 FLAG_smi_only_arrays); | 1732 FLAG_smi_only_arrays); |
1733 FastCloneShallowArrayStub::Mode mode = has_fast_elements | 1733 FastCloneShallowArrayStub::Mode mode = has_fast_elements |
1734 ? FastCloneShallowArrayStub::CLONE_ELEMENTS | 1734 ? FastCloneShallowArrayStub::CLONE_ELEMENTS |
1735 : FastCloneShallowArrayStub::CLONE_ANY_ELEMENTS; | 1735 : FastCloneShallowArrayStub::CLONE_ANY_ELEMENTS; |
| 1736 |
| 1737 // Tracking allocation info allows us to pre-transition later if it makes |
| 1738 // sense. |
| 1739 if (mode == FastCloneShallowArrayStub::CLONE_ANY_ELEMENTS && |
| 1740 FLAG_track_allocation_sites) { |
| 1741 mode = FastCloneShallowArrayStub:: |
| 1742 CLONE_ANY_ELEMENTS_WITH_ALLOCATION_SITE_INFO; |
| 1743 } |
| 1744 |
1736 FastCloneShallowArrayStub stub(mode, length); | 1745 FastCloneShallowArrayStub stub(mode, length); |
1737 __ CallStub(&stub); | 1746 __ CallStub(&stub); |
1738 } | 1747 } |
1739 | 1748 |
1740 bool result_saved = false; // Is the result saved to the stack? | 1749 bool result_saved = false; // Is the result saved to the stack? |
1741 | 1750 |
1742 // Emit code to evaluate all the non-constant subexpressions and to store | 1751 // Emit code to evaluate all the non-constant subexpressions and to store |
1743 // them into the newly cloned array. | 1752 // them into the newly cloned array. |
1744 for (int i = 0; i < length; i++) { | 1753 for (int i = 0; i < length; i++) { |
1745 Expression* subexpr = subexprs->at(i); | 1754 Expression* subexpr = subexprs->at(i); |
(...skipping 2807 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4553 *context_length = 0; | 4562 *context_length = 0; |
4554 return previous_; | 4563 return previous_; |
4555 } | 4564 } |
4556 | 4565 |
4557 | 4566 |
4558 #undef __ | 4567 #undef __ |
4559 | 4568 |
4560 } } // namespace v8::internal | 4569 } } // namespace v8::internal |
4561 | 4570 |
4562 #endif // V8_TARGET_ARCH_ARM | 4571 #endif // V8_TARGET_ARCH_ARM |
OLD | NEW |