OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 #if V8_TARGET_ARCH_ARM | 5 #if V8_TARGET_ARCH_ARM |
6 | 6 |
7 #include "src/ast/scopes.h" | 7 #include "src/ast/scopes.h" |
8 #include "src/code-factory.h" | 8 #include "src/code-factory.h" |
9 #include "src/code-stubs.h" | 9 #include "src/code-stubs.h" |
10 #include "src/codegen.h" | 10 #include "src/codegen.h" |
(...skipping 1706 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1717 | 1717 |
1718 bool result_saved = false; // Is the result saved to the stack? | 1718 bool result_saved = false; // Is the result saved to the stack? |
1719 ZoneList<Expression*>* subexprs = expr->values(); | 1719 ZoneList<Expression*>* subexprs = expr->values(); |
1720 int length = subexprs->length(); | 1720 int length = subexprs->length(); |
1721 | 1721 |
1722 // Emit code to evaluate all the non-constant subexpressions and to store | 1722 // Emit code to evaluate all the non-constant subexpressions and to store |
1723 // them into the newly cloned array. | 1723 // them into the newly cloned array. |
1724 int array_index = 0; | 1724 int array_index = 0; |
1725 for (; array_index < length; array_index++) { | 1725 for (; array_index < length; array_index++) { |
1726 Expression* subexpr = subexprs->at(array_index); | 1726 Expression* subexpr = subexprs->at(array_index); |
1727 if (subexpr->IsSpread()) break; | 1727 DCHECK(!subexpr->IsSpread()); |
1728 | 1728 |
1729 // If the subexpression is a literal or a simple materialized literal it | 1729 // If the subexpression is a literal or a simple materialized literal it |
1730 // is already set in the cloned array. | 1730 // is already set in the cloned array. |
1731 if (CompileTimeValue::IsCompileTimeValue(subexpr)) continue; | 1731 if (CompileTimeValue::IsCompileTimeValue(subexpr)) continue; |
1732 | 1732 |
1733 if (!result_saved) { | 1733 if (!result_saved) { |
1734 __ push(r0); | 1734 __ push(r0); |
1735 result_saved = true; | 1735 result_saved = true; |
1736 } | 1736 } |
1737 VisitForAccumulatorValue(subexpr); | 1737 VisitForAccumulatorValue(subexpr); |
(...skipping 14 matching lines...) Expand all Loading... |
1752 // (inclusive) and these elements gets appended to the array. Note that the | 1752 // (inclusive) and these elements gets appended to the array. Note that the |
1753 // number elements an iterable produces is unknown ahead of time. | 1753 // number elements an iterable produces is unknown ahead of time. |
1754 if (array_index < length && result_saved) { | 1754 if (array_index < length && result_saved) { |
1755 __ Pop(r0); | 1755 __ Pop(r0); |
1756 result_saved = false; | 1756 result_saved = false; |
1757 } | 1757 } |
1758 for (; array_index < length; array_index++) { | 1758 for (; array_index < length; array_index++) { |
1759 Expression* subexpr = subexprs->at(array_index); | 1759 Expression* subexpr = subexprs->at(array_index); |
1760 | 1760 |
1761 __ Push(r0); | 1761 __ Push(r0); |
1762 if (subexpr->IsSpread()) { | 1762 DCHECK(!subexpr->IsSpread()); |
1763 VisitForStackValue(subexpr->AsSpread()->expression()); | 1763 VisitForStackValue(subexpr); |
1764 __ InvokeBuiltin(Context::CONCAT_ITERABLE_TO_ARRAY_BUILTIN_INDEX, | 1764 __ CallRuntime(Runtime::kAppendElement); |
1765 CALL_FUNCTION); | |
1766 } else { | |
1767 VisitForStackValue(subexpr); | |
1768 __ CallRuntime(Runtime::kAppendElement); | |
1769 } | |
1770 | 1765 |
1771 PrepareForBailoutForId(expr->GetIdForElement(array_index), NO_REGISTERS); | 1766 PrepareForBailoutForId(expr->GetIdForElement(array_index), NO_REGISTERS); |
1772 } | 1767 } |
1773 | 1768 |
1774 if (result_saved) { | 1769 if (result_saved) { |
1775 context()->PlugTOS(); | 1770 context()->PlugTOS(); |
1776 } else { | 1771 } else { |
1777 context()->Plug(r0); | 1772 context()->Plug(r0); |
1778 } | 1773 } |
1779 } | 1774 } |
(...skipping 3103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4883 DCHECK(interrupt_address == | 4878 DCHECK(interrupt_address == |
4884 isolate->builtins()->OsrAfterStackCheck()->entry()); | 4879 isolate->builtins()->OsrAfterStackCheck()->entry()); |
4885 return OSR_AFTER_STACK_CHECK; | 4880 return OSR_AFTER_STACK_CHECK; |
4886 } | 4881 } |
4887 | 4882 |
4888 | 4883 |
4889 } // namespace internal | 4884 } // namespace internal |
4890 } // namespace v8 | 4885 } // namespace v8 |
4891 | 4886 |
4892 #endif // V8_TARGET_ARCH_ARM | 4887 #endif // V8_TARGET_ARCH_ARM |
OLD | NEW |