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 1726 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1737 } else if (expr->depth() > 1) { | 1737 } else if (expr->depth() > 1) { |
1738 __ CallRuntime(Runtime::kCreateArrayLiteral, 3); | 1738 __ CallRuntime(Runtime::kCreateArrayLiteral, 3); |
1739 } else if (length > FastCloneShallowArrayStub::kMaximumClonedLength) { | 1739 } else if (length > FastCloneShallowArrayStub::kMaximumClonedLength) { |
1740 __ CallRuntime(Runtime::kCreateArrayLiteralShallow, 3); | 1740 __ CallRuntime(Runtime::kCreateArrayLiteralShallow, 3); |
1741 } else { | 1741 } else { |
1742 ASSERT(IsFastSmiOrObjectElementsKind(constant_elements_kind) || | 1742 ASSERT(IsFastSmiOrObjectElementsKind(constant_elements_kind) || |
1743 FLAG_smi_only_arrays); | 1743 FLAG_smi_only_arrays); |
1744 FastCloneShallowArrayStub::Mode mode = has_fast_elements | 1744 FastCloneShallowArrayStub::Mode mode = has_fast_elements |
1745 ? FastCloneShallowArrayStub::CLONE_ELEMENTS | 1745 ? FastCloneShallowArrayStub::CLONE_ELEMENTS |
1746 : FastCloneShallowArrayStub::CLONE_ANY_ELEMENTS; | 1746 : FastCloneShallowArrayStub::CLONE_ANY_ELEMENTS; |
| 1747 |
| 1748 // Tracking allocation info allows us to pre-transition later if it makes |
| 1749 // sense. |
| 1750 if (mode == FastCloneShallowArrayStub::CLONE_ANY_ELEMENTS && |
| 1751 FLAG_track_allocation_sites) { |
| 1752 mode = FastCloneShallowArrayStub:: |
| 1753 CLONE_ANY_ELEMENTS_WITH_ALLOCATION_SITE_INFO; |
| 1754 } |
| 1755 |
1747 FastCloneShallowArrayStub stub(mode, length); | 1756 FastCloneShallowArrayStub stub(mode, length); |
1748 __ CallStub(&stub); | 1757 __ CallStub(&stub); |
1749 } | 1758 } |
1750 | 1759 |
1751 bool result_saved = false; // Is the result saved to the stack? | 1760 bool result_saved = false; // Is the result saved to the stack? |
1752 | 1761 |
1753 // Emit code to evaluate all the non-constant subexpressions and to store | 1762 // Emit code to evaluate all the non-constant subexpressions and to store |
1754 // them into the newly cloned array. | 1763 // them into the newly cloned array. |
1755 for (int i = 0; i < length; i++) { | 1764 for (int i = 0; i < length; i++) { |
1756 Expression* subexpr = subexprs->at(i); | 1765 Expression* subexpr = subexprs->at(i); |
(...skipping 2819 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4576 *context_length = 0; | 4585 *context_length = 0; |
4577 return previous_; | 4586 return previous_; |
4578 } | 4587 } |
4579 | 4588 |
4580 | 4589 |
4581 #undef __ | 4590 #undef __ |
4582 | 4591 |
4583 } } // namespace v8::internal | 4592 } } // namespace v8::internal |
4584 | 4593 |
4585 #endif // V8_TARGET_ARCH_MIPS | 4594 #endif // V8_TARGET_ARCH_MIPS |
OLD | NEW |