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

Side by Side Diff: src/full-codegen/mips64/full-codegen-mips64.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
« no previous file with comments | « src/full-codegen/mips/full-codegen-mips.cc ('k') | src/full-codegen/ppc/full-codegen-ppc.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_MIPS64 5 #if V8_TARGET_ARCH_MIPS64
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 1698 matching lines...) Expand 10 before | Expand all | Expand 10 after
1709 1709
1710 bool result_saved = false; // Is the result saved to the stack? 1710 bool result_saved = false; // Is the result saved to the stack?
1711 ZoneList<Expression*>* subexprs = expr->values(); 1711 ZoneList<Expression*>* subexprs = expr->values();
1712 int length = subexprs->length(); 1712 int length = subexprs->length();
1713 1713
1714 // Emit code to evaluate all the non-constant subexpressions and to store 1714 // Emit code to evaluate all the non-constant subexpressions and to store
1715 // them into the newly cloned array. 1715 // them into the newly cloned array.
1716 int array_index = 0; 1716 int array_index = 0;
1717 for (; array_index < length; array_index++) { 1717 for (; array_index < length; array_index++) {
1718 Expression* subexpr = subexprs->at(array_index); 1718 Expression* subexpr = subexprs->at(array_index);
1719 if (subexpr->IsSpread()) break; 1719 DCHECK(!subexpr->IsSpread());
1720 1720
1721 // If the subexpression is a literal or a simple materialized literal it 1721 // If the subexpression is a literal or a simple materialized literal it
1722 // is already set in the cloned array. 1722 // is already set in the cloned array.
1723 if (CompileTimeValue::IsCompileTimeValue(subexpr)) continue; 1723 if (CompileTimeValue::IsCompileTimeValue(subexpr)) continue;
1724 1724
1725 if (!result_saved) { 1725 if (!result_saved) {
1726 __ push(v0); // array literal 1726 __ push(v0); // array literal
1727 result_saved = true; 1727 result_saved = true;
1728 } 1728 }
1729 1729
(...skipping 16 matching lines...) Expand all
1746 // (inclusive) and these elements gets appended to the array. Note that the 1746 // (inclusive) and these elements gets appended to the array. Note that the
1747 // number elements an iterable produces is unknown ahead of time. 1747 // number elements an iterable produces is unknown ahead of time.
1748 if (array_index < length && result_saved) { 1748 if (array_index < length && result_saved) {
1749 __ Pop(v0); 1749 __ Pop(v0);
1750 result_saved = false; 1750 result_saved = false;
1751 } 1751 }
1752 for (; array_index < length; array_index++) { 1752 for (; array_index < length; array_index++) {
1753 Expression* subexpr = subexprs->at(array_index); 1753 Expression* subexpr = subexprs->at(array_index);
1754 1754
1755 __ Push(v0); 1755 __ Push(v0);
1756 if (subexpr->IsSpread()) { 1756 DCHECK(!subexpr->IsSpread());
1757 VisitForStackValue(subexpr->AsSpread()->expression()); 1757 VisitForStackValue(subexpr);
1758 __ InvokeBuiltin(Context::CONCAT_ITERABLE_TO_ARRAY_BUILTIN_INDEX, 1758 __ CallRuntime(Runtime::kAppendElement);
1759 CALL_FUNCTION);
1760 } else {
1761 VisitForStackValue(subexpr);
1762 __ CallRuntime(Runtime::kAppendElement);
1763 }
1764 1759
1765 PrepareForBailoutForId(expr->GetIdForElement(array_index), NO_REGISTERS); 1760 PrepareForBailoutForId(expr->GetIdForElement(array_index), NO_REGISTERS);
1766 } 1761 }
1767 1762
1768 if (result_saved) { 1763 if (result_saved) {
1769 context()->PlugTOS(); 1764 context()->PlugTOS();
1770 } else { 1765 } else {
1771 context()->Plug(v0); 1766 context()->Plug(v0);
1772 } 1767 }
1773 } 1768 }
(...skipping 3071 matching lines...) Expand 10 before | Expand all | Expand 10 after
4845 reinterpret_cast<uint64_t>( 4840 reinterpret_cast<uint64_t>(
4846 isolate->builtins()->OsrAfterStackCheck()->entry())); 4841 isolate->builtins()->OsrAfterStackCheck()->entry()));
4847 return OSR_AFTER_STACK_CHECK; 4842 return OSR_AFTER_STACK_CHECK;
4848 } 4843 }
4849 4844
4850 4845
4851 } // namespace internal 4846 } // namespace internal
4852 } // namespace v8 4847 } // namespace v8
4853 4848
4854 #endif // V8_TARGET_ARCH_MIPS64 4849 #endif // V8_TARGET_ARCH_MIPS64
OLDNEW
« no previous file with comments | « src/full-codegen/mips/full-codegen-mips.cc ('k') | src/full-codegen/ppc/full-codegen-ppc.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698