Index: src/x64/full-codegen-x64.cc |
diff --git a/src/x64/full-codegen-x64.cc b/src/x64/full-codegen-x64.cc |
index 574688c14df0c171d6e16ed7711cc0a30b620080..355cf9166266b04f8211d8edc63d5a1a5a8907a1 100644 |
--- a/src/x64/full-codegen-x64.cc |
+++ b/src/x64/full-codegen-x64.cc |
@@ -839,7 +839,9 @@ void FullCodeGenerator::VisitForInStatement(ForInStatement* stmt) { |
__ bind(&update_each); |
__ movq(result_register(), rbx); |
// Perform the assignment as if via '='. |
- EmitAssignment(stmt->each()); |
+ { EffectContext context(this); |
+ EmitAssignment(stmt->each(), stmt->AssignmentId()); |
+ } |
// Generate code for the body of the loop. |
Visit(stmt->body()); |
@@ -1521,7 +1523,7 @@ void FullCodeGenerator::EmitBinaryOp(Token::Value op, |
} |
-void FullCodeGenerator::EmitAssignment(Expression* expr) { |
+void FullCodeGenerator::EmitAssignment(Expression* expr, int bailout_id) { |
// Invalid left-hand sides are rewritten to have a 'throw |
// ReferenceError' on the left-hand side. |
if (!expr->IsValidLeftHandSide()) { |
@@ -1569,6 +1571,7 @@ void FullCodeGenerator::EmitAssignment(Expression* expr) { |
break; |
} |
} |
+ context()->Plug(rax); |
} |
@@ -1641,8 +1644,6 @@ void FullCodeGenerator::EmitVariableAssignment(Variable* var, |
} |
__ bind(&done); |
} |
- |
- context()->Plug(rax); |
} |
@@ -1679,10 +1680,9 @@ void FullCodeGenerator::EmitNamedPropertyAssignment(Assignment* expr) { |
__ push(Operand(rsp, kPointerSize)); // Receiver is under value. |
__ CallRuntime(Runtime::kToFastProperties, 1); |
__ pop(rax); |
- context()->DropAndPlug(1, rax); |
- } else { |
- context()->Plug(rax); |
+ __ Drop(1); |
} |
+ context()->Plug(rax); |
} |
@@ -3127,6 +3127,7 @@ void FullCodeGenerator::VisitCountOperation(CountOperation* expr) { |
{ EffectContext context(this); |
EmitVariableAssignment(expr->expression()->AsVariableProxy()->var(), |
Token::ASSIGN); |
+ context.Plug(rax); |
} |
// For all contexts except kEffect: We have the result on |
// top of the stack. |
@@ -3137,6 +3138,7 @@ void FullCodeGenerator::VisitCountOperation(CountOperation* expr) { |
// Perform the assignment as if via '='. |
EmitVariableAssignment(expr->expression()->AsVariableProxy()->var(), |
Token::ASSIGN); |
+ context()->Plug(rax); |
} |
break; |
case NAMED_PROPERTY: { |