Index: src/ia32/full-codegen-ia32.cc |
diff --git a/src/ia32/full-codegen-ia32.cc b/src/ia32/full-codegen-ia32.cc |
index 2437c8fb7ebb53c55183c0f7372edb34d62e0b58..d6ca29e3d706f9772b4b7e6fe399369be32216a6 100644 |
--- a/src/ia32/full-codegen-ia32.cc |
+++ b/src/ia32/full-codegen-ia32.cc |
@@ -951,7 +951,9 @@ void FullCodeGenerator::VisitForInStatement(ForInStatement* stmt) { |
__ bind(&update_each); |
__ mov(result_register(), ebx); |
// 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()); |
@@ -1518,7 +1520,7 @@ void FullCodeGenerator::VisitAssignment(Assignment* expr) { |
// For property compound assignments we need another deoptimization |
// point after the property load. |
if (property != NULL) { |
- PrepareForBailoutForId(expr->compound_bailout_id(), TOS_REG); |
+ PrepareForBailoutForId(expr->CompoundLoadId(), TOS_REG); |
} |
Token::Value op = expr->binary_op(); |
@@ -1561,6 +1563,8 @@ void FullCodeGenerator::VisitAssignment(Assignment* expr) { |
case VARIABLE: |
EmitVariableAssignment(expr->target()->AsVariableProxy()->var(), |
expr->op()); |
+ PrepareForBailoutForId(expr->AssignmentId(), TOS_REG); |
+ context()->Plug(eax); |
break; |
case NAMED_PROPERTY: |
EmitNamedPropertyAssignment(expr); |
@@ -1902,7 +1906,7 @@ void FullCodeGenerator::EmitBinaryOp(Token::Value op, |
} |
-void FullCodeGenerator::EmitAssignment(Expression* expr) { |
+void FullCodeGenerator::EmitAssignment(Expression* expr, int bailout_ast_id) { |
// Invalid left-hand sides are rewritten to have a 'throw |
// ReferenceError' on the left-hand side. |
if (!expr->IsValidLeftHandSide()) { |
@@ -1950,6 +1954,8 @@ void FullCodeGenerator::EmitAssignment(Expression* expr) { |
break; |
} |
} |
+ PrepareForBailoutForId(bailout_ast_id, TOS_REG); |
+ context()->Plug(eax); |
} |
@@ -2022,8 +2028,6 @@ void FullCodeGenerator::EmitVariableAssignment(Variable* var, |
} |
__ bind(&done); |
} |
- |
- context()->Plug(eax); |
} |
@@ -2060,10 +2064,10 @@ void FullCodeGenerator::EmitNamedPropertyAssignment(Assignment* expr) { |
__ push(Operand(esp, kPointerSize)); // Receiver is under value. |
__ CallRuntime(Runtime::kToFastProperties, 1); |
__ pop(eax); |
- context()->DropAndPlug(1, eax); |
- } else { |
- context()->Plug(eax); |
+ __ Drop(1); |
} |
+ PrepareForBailoutForId(expr->AssignmentId(), TOS_REG); |
+ context()->Plug(eax); |
} |
@@ -2101,6 +2105,7 @@ void FullCodeGenerator::EmitKeyedPropertyAssignment(Assignment* expr) { |
__ pop(eax); |
} |
+ PrepareForBailoutForId(expr->AssignmentId(), TOS_REG); |
context()->Plug(eax); |
} |
@@ -3805,6 +3810,8 @@ void FullCodeGenerator::VisitCountOperation(CountOperation* expr) { |
{ EffectContext context(this); |
EmitVariableAssignment(expr->expression()->AsVariableProxy()->var(), |
Token::ASSIGN); |
+ PrepareForBailoutForId(expr->AssignmentId(), TOS_REG); |
+ context.Plug(eax); |
} |
// For all contexts except EffectContext We have the result on |
// top of the stack. |
@@ -3815,6 +3822,8 @@ void FullCodeGenerator::VisitCountOperation(CountOperation* expr) { |
// Perform the assignment as if via '='. |
EmitVariableAssignment(expr->expression()->AsVariableProxy()->var(), |
Token::ASSIGN); |
+ PrepareForBailoutForId(expr->AssignmentId(), TOS_REG); |
+ context()->Plug(eax); |
} |
break; |
case NAMED_PROPERTY: { |
@@ -3822,6 +3831,7 @@ void FullCodeGenerator::VisitCountOperation(CountOperation* expr) { |
__ pop(edx); |
Handle<Code> ic(Builtins::builtin(Builtins::StoreIC_Initialize)); |
EmitCallIC(ic, RelocInfo::CODE_TARGET); |
+ PrepareForBailoutForId(expr->AssignmentId(), TOS_REG); |
if (expr->is_postfix()) { |
if (!context()->IsEffect()) { |
context()->PlugTOS(); |
@@ -3836,6 +3846,7 @@ void FullCodeGenerator::VisitCountOperation(CountOperation* expr) { |
__ pop(edx); |
Handle<Code> ic(Builtins::builtin(Builtins::KeyedStoreIC_Initialize)); |
EmitCallIC(ic, RelocInfo::CODE_TARGET); |
+ PrepareForBailoutForId(expr->AssignmentId(), TOS_REG); |
if (expr->is_postfix()) { |
// Result is on the stack |
if (!context()->IsEffect()) { |