| OLD | NEW |
| 1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 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_PPC | 5 #if V8_TARGET_ARCH_PPC |
| 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 1662 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1673 | 1673 |
| 1674 bool result_saved = false; // Is the result saved to the stack? | 1674 bool result_saved = false; // Is the result saved to the stack? |
| 1675 ZoneList<Expression*>* subexprs = expr->values(); | 1675 ZoneList<Expression*>* subexprs = expr->values(); |
| 1676 int length = subexprs->length(); | 1676 int length = subexprs->length(); |
| 1677 | 1677 |
| 1678 // Emit code to evaluate all the non-constant subexpressions and to store | 1678 // Emit code to evaluate all the non-constant subexpressions and to store |
| 1679 // them into the newly cloned array. | 1679 // them into the newly cloned array. |
| 1680 int array_index = 0; | 1680 int array_index = 0; |
| 1681 for (; array_index < length; array_index++) { | 1681 for (; array_index < length; array_index++) { |
| 1682 Expression* subexpr = subexprs->at(array_index); | 1682 Expression* subexpr = subexprs->at(array_index); |
| 1683 if (subexpr->IsSpread()) break; | 1683 DCHECK(!subexpr->IsSpread()); |
| 1684 // If the subexpression is a literal or a simple materialized literal it | 1684 // If the subexpression is a literal or a simple materialized literal it |
| 1685 // is already set in the cloned array. | 1685 // is already set in the cloned array. |
| 1686 if (CompileTimeValue::IsCompileTimeValue(subexpr)) continue; | 1686 if (CompileTimeValue::IsCompileTimeValue(subexpr)) continue; |
| 1687 | 1687 |
| 1688 if (!result_saved) { | 1688 if (!result_saved) { |
| 1689 __ push(r3); | 1689 __ push(r3); |
| 1690 result_saved = true; | 1690 result_saved = true; |
| 1691 } | 1691 } |
| 1692 VisitForAccumulatorValue(subexpr); | 1692 VisitForAccumulatorValue(subexpr); |
| 1693 | 1693 |
| (...skipping 14 matching lines...) Expand all Loading... |
| 1708 // (inclusive) and these elements gets appended to the array. Note that the | 1708 // (inclusive) and these elements gets appended to the array. Note that the |
| 1709 // number elements an iterable produces is unknown ahead of time. | 1709 // number elements an iterable produces is unknown ahead of time. |
| 1710 if (array_index < length && result_saved) { | 1710 if (array_index < length && result_saved) { |
| 1711 __ Pop(r3); | 1711 __ Pop(r3); |
| 1712 result_saved = false; | 1712 result_saved = false; |
| 1713 } | 1713 } |
| 1714 for (; array_index < length; array_index++) { | 1714 for (; array_index < length; array_index++) { |
| 1715 Expression* subexpr = subexprs->at(array_index); | 1715 Expression* subexpr = subexprs->at(array_index); |
| 1716 | 1716 |
| 1717 __ Push(r3); | 1717 __ Push(r3); |
| 1718 if (subexpr->IsSpread()) { | 1718 DCHECK(!subexpr->IsSpread()); |
| 1719 VisitForStackValue(subexpr->AsSpread()->expression()); | 1719 VisitForStackValue(subexpr); |
| 1720 __ InvokeBuiltin(Context::CONCAT_ITERABLE_TO_ARRAY_BUILTIN_INDEX, | 1720 __ CallRuntime(Runtime::kAppendElement); |
| 1721 CALL_FUNCTION); | |
| 1722 } else { | |
| 1723 VisitForStackValue(subexpr); | |
| 1724 __ CallRuntime(Runtime::kAppendElement); | |
| 1725 } | |
| 1726 | 1721 |
| 1727 PrepareForBailoutForId(expr->GetIdForElement(array_index), NO_REGISTERS); | 1722 PrepareForBailoutForId(expr->GetIdForElement(array_index), NO_REGISTERS); |
| 1728 } | 1723 } |
| 1729 | 1724 |
| 1730 if (result_saved) { | 1725 if (result_saved) { |
| 1731 context()->PlugTOS(); | 1726 context()->PlugTOS(); |
| 1732 } else { | 1727 } else { |
| 1733 context()->Plug(r3); | 1728 context()->Plug(r3); |
| 1734 } | 1729 } |
| 1735 } | 1730 } |
| (...skipping 3083 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4819 return ON_STACK_REPLACEMENT; | 4814 return ON_STACK_REPLACEMENT; |
| 4820 } | 4815 } |
| 4821 | 4816 |
| 4822 DCHECK(interrupt_address == | 4817 DCHECK(interrupt_address == |
| 4823 isolate->builtins()->OsrAfterStackCheck()->entry()); | 4818 isolate->builtins()->OsrAfterStackCheck()->entry()); |
| 4824 return OSR_AFTER_STACK_CHECK; | 4819 return OSR_AFTER_STACK_CHECK; |
| 4825 } | 4820 } |
| 4826 } // namespace internal | 4821 } // namespace internal |
| 4827 } // namespace v8 | 4822 } // namespace v8 |
| 4828 #endif // V8_TARGET_ARCH_PPC | 4823 #endif // V8_TARGET_ARCH_PPC |
| OLD | NEW |