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

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

Issue 1455953002: [turbofan] Fix deoptimization from array literal spread. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Skip ignition. Created 5 years, 1 month 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 | test/mjsunit/mjsunit.status » ('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 432387eedf138eb861924d92488cdc9e8b6600ea..01a372eeaa5344f17c9fd22ffd3fe1c2911a1b5c 100644
--- a/src/compiler/ast-graph-builder.cc
+++ b/src/compiler/ast-graph-builder.cc
@@ -1951,7 +1951,6 @@ void AstGraphBuilder::VisitArrayLiteral(ArrayLiteral* expr) {
environment()->Pop(); // Array literal index.
for (; array_index < expr->values()->length(); array_index++) {
Expression* subexpr = expr->values()->at(array_index);
- Node* array = environment()->Pop();
Node* result;
if (subexpr->IsSpread()) {
@@ -1959,6 +1958,7 @@ void AstGraphBuilder::VisitArrayLiteral(ArrayLiteral* expr) {
FrameStateBeforeAndAfter states(this,
subexpr->AsSpread()->expression()->id());
Node* iterable = environment()->Pop();
+ Node* array = environment()->Pop();
Node* function = BuildLoadNativeContextField(
Context::CONCAT_ITERABLE_TO_ARRAY_BUILTIN_INDEX);
result = NewNode(javascript()->CallFunction(3, language_mode()), function,
@@ -1967,6 +1967,7 @@ void AstGraphBuilder::VisitArrayLiteral(ArrayLiteral* expr) {
} else {
VisitForValue(subexpr);
Node* value = environment()->Pop();
+ Node* array = environment()->Pop();
const Operator* op =
javascript()->CallRuntime(Runtime::kAppendElement, 2);
result = NewNode(op, array, value);
« no previous file with comments | « no previous file | test/mjsunit/mjsunit.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698