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

Unified Diff: src/compiler/ast-graph-builder.cc

Issue 2324013002: [cleanup] Remove dead code for handling pre-desugaring spread implementation (Closed)
Patch Set: Created 4 years, 3 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/ast/ast.cc ('k') | src/full-codegen/arm/full-codegen-arm.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/ast-graph-builder.cc
diff --git a/src/compiler/ast-graph-builder.cc b/src/compiler/ast-graph-builder.cc
index 898f2b3b238836d1d9ba2ae6d22cddf764b403b3..c96ef1b17c2ee40194fe6fb20d6f30dda8f41dbd 100644
--- a/src/compiler/ast-graph-builder.cc
+++ b/src/compiler/ast-graph-builder.cc
@@ -1948,8 +1948,8 @@ void AstGraphBuilder::VisitArrayLiteral(ArrayLiteral* expr) {
// Create nodes to evaluate all the non-constant subexpressions and to store
// them into the newly cloned array.
- int array_index = 0;
- for (; array_index < expr->values()->length(); array_index++) {
+ for (int array_index = 0; array_index < expr->values()->length();
+ array_index++) {
Expression* subexpr = expr->values()->at(array_index);
DCHECK(!subexpr->IsSpread());
if (CompileTimeValue::IsCompileTimeValue(subexpr)) continue;
@@ -1964,26 +1964,6 @@ void AstGraphBuilder::VisitArrayLiteral(ArrayLiteral* expr) {
OutputFrameStateCombine::Ignore());
}
- // In case the array literal contains spread expressions it has two parts. The
- // first part is the "static" array which has a literal index is handled
- // above. The second part is the part after the first spread expression
- // (inclusive) and these elements gets appended to the array. Note that the
- // number elements an iterable produces is unknown ahead of time.
- for (; array_index < expr->values()->length(); array_index++) {
- Expression* subexpr = expr->values()->at(array_index);
- DCHECK(!subexpr->IsSpread());
-
- VisitForValue(subexpr);
- {
- Node* value = environment()->Pop();
- Node* array = environment()->Pop();
- const Operator* op = javascript()->CallRuntime(Runtime::kAppendElement);
- Node* result = NewNode(op, array, value);
- PrepareFrameState(result, expr->GetIdForElement(array_index));
- environment()->Push(result);
- }
- }
-
ast_context()->ProduceValue(expr, environment()->Pop());
}
« no previous file with comments | « src/ast/ast.cc ('k') | src/full-codegen/arm/full-codegen-arm.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698