Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(40)

Side by Side Diff: src/full-codegen/mips/full-codegen-mips.cc

Issue 1592713002: Clean up dead code after spread desugaring (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix bug that visited dead AST node in for/of Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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_MIPS 5 #if V8_TARGET_ARCH_MIPS
6 6
7 // Note on Mips implementation: 7 // Note on Mips implementation:
8 // 8 //
9 // The result_register() for mips is the 'v0' register, which is defined 9 // The result_register() for mips is the 'v0' register, which is defined
10 // by the ABI to contain function return values. However, the first 10 // by the ABI to contain function return values. However, the first
(...skipping 1699 matching lines...) Expand 10 before | Expand all | Expand 10 after
1710 1710
1711 bool result_saved = false; // Is the result saved to the stack? 1711 bool result_saved = false; // Is the result saved to the stack?
1712 ZoneList<Expression*>* subexprs = expr->values(); 1712 ZoneList<Expression*>* subexprs = expr->values();
1713 int length = subexprs->length(); 1713 int length = subexprs->length();
1714 1714
1715 // Emit code to evaluate all the non-constant subexpressions and to store 1715 // Emit code to evaluate all the non-constant subexpressions and to store
1716 // them into the newly cloned array. 1716 // them into the newly cloned array.
1717 int array_index = 0; 1717 int array_index = 0;
1718 for (; array_index < length; array_index++) { 1718 for (; array_index < length; array_index++) {
1719 Expression* subexpr = subexprs->at(array_index); 1719 Expression* subexpr = subexprs->at(array_index);
1720 if (subexpr->IsSpread()) break; 1720 DCHECK(!subexpr->IsSpread());
1721 1721
1722 // If the subexpression is a literal or a simple materialized literal it 1722 // If the subexpression is a literal or a simple materialized literal it
1723 // is already set in the cloned array. 1723 // is already set in the cloned array.
1724 if (CompileTimeValue::IsCompileTimeValue(subexpr)) continue; 1724 if (CompileTimeValue::IsCompileTimeValue(subexpr)) continue;
1725 1725
1726 if (!result_saved) { 1726 if (!result_saved) {
1727 __ push(v0); // array literal 1727 __ push(v0); // array literal
1728 result_saved = true; 1728 result_saved = true;
1729 } 1729 }
1730 1730
(...skipping 16 matching lines...) Expand all
1747 // (inclusive) and these elements gets appended to the array. Note that the 1747 // (inclusive) and these elements gets appended to the array. Note that the
1748 // number elements an iterable produces is unknown ahead of time. 1748 // number elements an iterable produces is unknown ahead of time.
1749 if (array_index < length && result_saved) { 1749 if (array_index < length && result_saved) {
1750 __ Pop(v0); 1750 __ Pop(v0);
1751 result_saved = false; 1751 result_saved = false;
1752 } 1752 }
1753 for (; array_index < length; array_index++) { 1753 for (; array_index < length; array_index++) {
1754 Expression* subexpr = subexprs->at(array_index); 1754 Expression* subexpr = subexprs->at(array_index);
1755 1755
1756 __ Push(v0); 1756 __ Push(v0);
1757 if (subexpr->IsSpread()) { 1757 DCHECK(!subexpr->IsSpread());
1758 VisitForStackValue(subexpr->AsSpread()->expression()); 1758 VisitForStackValue(subexpr);
1759 __ InvokeBuiltin(Context::CONCAT_ITERABLE_TO_ARRAY_BUILTIN_INDEX, 1759 __ CallRuntime(Runtime::kAppendElement);
1760 CALL_FUNCTION);
1761 } else {
1762 VisitForStackValue(subexpr);
1763 __ CallRuntime(Runtime::kAppendElement);
1764 }
1765 1760
1766 PrepareForBailoutForId(expr->GetIdForElement(array_index), NO_REGISTERS); 1761 PrepareForBailoutForId(expr->GetIdForElement(array_index), NO_REGISTERS);
1767 } 1762 }
1768 1763
1769 if (result_saved) { 1764 if (result_saved) {
1770 context()->PlugTOS(); 1765 context()->PlugTOS();
1771 } else { 1766 } else {
1772 context()->Plug(v0); 1767 context()->Plug(v0);
1773 } 1768 }
1774 } 1769 }
(...skipping 3057 matching lines...) Expand 10 before | Expand all | Expand 10 after
4832 reinterpret_cast<uint32_t>( 4827 reinterpret_cast<uint32_t>(
4833 isolate->builtins()->OsrAfterStackCheck()->entry())); 4828 isolate->builtins()->OsrAfterStackCheck()->entry()));
4834 return OSR_AFTER_STACK_CHECK; 4829 return OSR_AFTER_STACK_CHECK;
4835 } 4830 }
4836 4831
4837 4832
4838 } // namespace internal 4833 } // namespace internal
4839 } // namespace v8 4834 } // namespace v8
4840 4835
4841 #endif // V8_TARGET_ARCH_MIPS 4836 #endif // V8_TARGET_ARCH_MIPS
OLDNEW
« no previous file with comments | « src/full-codegen/ia32/full-codegen-ia32.cc ('k') | src/full-codegen/mips64/full-codegen-mips64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698