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

Unified 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 side-by-side diff with in-line comments
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 »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/full-codegen/mips64/full-codegen-mips64.cc
diff --git a/src/full-codegen/mips64/full-codegen-mips64.cc b/src/full-codegen/mips64/full-codegen-mips64.cc
index 44dd791a59b1ca1037b37886a9139241774a8a6e..1f60d0703d3ed4645c774bceed809dc326880b5d 100644
--- a/src/full-codegen/mips64/full-codegen-mips64.cc
+++ b/src/full-codegen/mips64/full-codegen-mips64.cc
@@ -1716,7 +1716,7 @@ void FullCodeGenerator::VisitArrayLiteral(ArrayLiteral* expr) {
int array_index = 0;
for (; array_index < length; array_index++) {
Expression* subexpr = subexprs->at(array_index);
- if (subexpr->IsSpread()) break;
+ DCHECK(!subexpr->IsSpread());
// If the subexpression is a literal or a simple materialized literal it
// is already set in the cloned array.
@@ -1753,14 +1753,9 @@ void FullCodeGenerator::VisitArrayLiteral(ArrayLiteral* expr) {
Expression* subexpr = subexprs->at(array_index);
__ Push(v0);
- if (subexpr->IsSpread()) {
- VisitForStackValue(subexpr->AsSpread()->expression());
- __ InvokeBuiltin(Context::CONCAT_ITERABLE_TO_ARRAY_BUILTIN_INDEX,
- CALL_FUNCTION);
- } else {
- VisitForStackValue(subexpr);
- __ CallRuntime(Runtime::kAppendElement);
- }
+ DCHECK(!subexpr->IsSpread());
+ VisitForStackValue(subexpr);
+ __ CallRuntime(Runtime::kAppendElement);
PrepareForBailoutForId(expr->GetIdForElement(array_index), NO_REGISTERS);
}
« 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