| 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 1685 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1696 } else if (length > FastCloneShallowArrayStub::kMaximumClonedLength) { | 1696 } else if (length > FastCloneShallowArrayStub::kMaximumClonedLength) { |
| 1697 __ CallRuntime(Runtime::kCreateArrayLiteralShallow, 3); | 1697 __ CallRuntime(Runtime::kCreateArrayLiteralShallow, 3); |
| 1698 } else { | 1698 } else { |
| 1699 ASSERT(IsFastSmiOrObjectElementsKind(constant_elements_kind) || | 1699 ASSERT(IsFastSmiOrObjectElementsKind(constant_elements_kind) || |
| 1700 FLAG_smi_only_arrays); | 1700 FLAG_smi_only_arrays); |
| 1701 // If the elements are already FAST_*_ELEMENTS, the boilerplate cannot | 1701 // If the elements are already FAST_*_ELEMENTS, the boilerplate cannot |
| 1702 // change, so it's possible to specialize the stub in advance. | 1702 // change, so it's possible to specialize the stub in advance. |
| 1703 FastCloneShallowArrayStub::Mode mode = has_constant_fast_elements | 1703 FastCloneShallowArrayStub::Mode mode = has_constant_fast_elements |
| 1704 ? FastCloneShallowArrayStub::CLONE_ELEMENTS | 1704 ? FastCloneShallowArrayStub::CLONE_ELEMENTS |
| 1705 : FastCloneShallowArrayStub::CLONE_ANY_ELEMENTS; | 1705 : FastCloneShallowArrayStub::CLONE_ANY_ELEMENTS; |
| 1706 |
| 1707 // Tracking allocation info allows us to pre-transition later if it makes |
| 1708 // sense. |
| 1709 if (mode == FastCloneShallowArrayStub::CLONE_ANY_ELEMENTS && |
| 1710 FLAG_use_allocation_site_info) { |
| 1711 mode = FastCloneShallowArrayStub::CLONE_ANY_ELEMENTS_WITH_ALLOCATION_INFO; |
| 1712 } |
| 1713 |
| 1706 FastCloneShallowArrayStub stub(mode, length); | 1714 FastCloneShallowArrayStub stub(mode, length); |
| 1707 __ CallStub(&stub); | 1715 __ CallStub(&stub); |
| 1708 } | 1716 } |
| 1709 | 1717 |
| 1710 bool result_saved = false; // Is the result saved to the stack? | 1718 bool result_saved = false; // Is the result saved to the stack? |
| 1711 | 1719 |
| 1712 // Emit code to evaluate all the non-constant subexpressions and to store | 1720 // Emit code to evaluate all the non-constant subexpressions and to store |
| 1713 // them into the newly cloned array. | 1721 // them into the newly cloned array. |
| 1714 for (int i = 0; i < length; i++) { | 1722 for (int i = 0; i < length; i++) { |
| 1715 Expression* subexpr = subexprs->at(i); | 1723 Expression* subexpr = subexprs->at(i); |
| (...skipping 2802 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4518 *context_length = 0; | 4526 *context_length = 0; |
| 4519 return previous_; | 4527 return previous_; |
| 4520 } | 4528 } |
| 4521 | 4529 |
| 4522 | 4530 |
| 4523 #undef __ | 4531 #undef __ |
| 4524 | 4532 |
| 4525 } } // namespace v8::internal | 4533 } } // namespace v8::internal |
| 4526 | 4534 |
| 4527 #endif // V8_TARGET_ARCH_X64 | 4535 #endif // V8_TARGET_ARCH_X64 |
| OLD | NEW |