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

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

Issue 881303002: [turbofan] Add missing deopt for the assignment in the for-in statement. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Add test. Created 5 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/compiler/ast-graph-builder.h ('k') | src/ia32/full-codegen-ia32.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 d37ca7eab2183fa1d97298f3ca764e680af9d2b1..1390eeb07c1bcee069719fb10861d888ee38d752 100644
--- a/src/compiler/ast-graph-builder.cc
+++ b/src/compiler/ast-graph-builder.cc
@@ -774,7 +774,7 @@ void AstGraphBuilder::VisitForInStatement(ForInStatement* stmt) {
}
value = environment()->Pop();
// Bind value and do loop body.
- VisitForInAssignment(stmt->each(), value);
+ VisitForInAssignment(stmt->each(), value, stmt->AssignmentId());
VisitIterationBody(stmt, &for_loop, 5);
for_loop.EndBody();
// Inc counter and continue.
@@ -1228,7 +1228,8 @@ void AstGraphBuilder::VisitArrayLiteral(ArrayLiteral* expr) {
}
-void AstGraphBuilder::VisitForInAssignment(Expression* expr, Node* value) {
+void AstGraphBuilder::VisitForInAssignment(Expression* expr, Node* value,
+ BailoutId bailout_id) {
DCHECK(expr->IsValidReferenceExpression());
// Left-hand side can only be a property, a global or a variable slot.
@@ -1239,8 +1240,7 @@ void AstGraphBuilder::VisitForInAssignment(Expression* expr, Node* value) {
switch (assign_type) {
case VARIABLE: {
Variable* var = expr->AsVariableProxy()->var();
- // TODO(jarin) Fill in the correct bailout id.
- BuildVariableAssignment(var, value, Token::ASSIGN, BailoutId::None());
+ BuildVariableAssignment(var, value, Token::ASSIGN, bailout_id);
break;
}
case NAMED_PROPERTY: {
@@ -1252,8 +1252,7 @@ void AstGraphBuilder::VisitForInAssignment(Expression* expr, Node* value) {
MakeUnique(property->key()->AsLiteral()->AsPropertyName());
Node* store =
NewNode(javascript()->StoreNamed(strict_mode(), name), object, value);
- // TODO(jarin) Fill in the correct bailout id.
- PrepareFrameState(store, BailoutId::None());
+ PrepareFrameState(store, bailout_id);
break;
}
case KEYED_PROPERTY: {
@@ -1265,8 +1264,7 @@ void AstGraphBuilder::VisitForInAssignment(Expression* expr, Node* value) {
value = environment()->Pop();
Node* store = NewNode(javascript()->StoreProperty(strict_mode()), object,
key, value);
- // TODO(jarin) Fill in the correct bailout id.
- PrepareFrameState(store, BailoutId::None());
+ PrepareFrameState(store, bailout_id);
break;
}
}
« no previous file with comments | « src/compiler/ast-graph-builder.h ('k') | src/ia32/full-codegen-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698