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

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

Issue 1154873002: [turbofan] Simplify handling of spreads in array literals. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@local_graph-builder-computed-property-names-deopt
Patch Set: Created 5 years, 7 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 | « no previous file | no next file » | 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 561cd50395740d974d5e19b1af69c1847ecd0dd6..20c9577f080f3173a5995d56ca5dc88f85f630ab 100644
--- a/src/compiler/ast-graph-builder.cc
+++ b/src/compiler/ast-graph-builder.cc
@@ -1996,15 +1996,11 @@ void AstGraphBuilder::VisitArrayLiteral(ArrayLiteral* expr) {
}
// 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
+ // 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.
- bool has_spread = array_index < expr->values()->length();
- if (has_spread) {
- environment()->Pop(); // Array literal index.
- }
-
+ environment()->Pop(); // Array literal index.
for (; array_index < expr->values()->length(); array_index++) {
Expression* subexpr = expr->values()->at(array_index);
Node* array = environment()->Pop();
@@ -2032,9 +2028,6 @@ void AstGraphBuilder::VisitArrayLiteral(ArrayLiteral* expr) {
environment()->Push(result);
}
- if (!has_spread) {
- environment()->Pop(); // Array literal index.
- }
ast_context()->ProduceValue(environment()->Pop());
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698