Index: src/full-codegen.cc |
diff --git a/src/full-codegen.cc b/src/full-codegen.cc |
index 7509628eb5d0be7b273d25cb8442027df42ea2c2..96307a302d5ccfc81671d6590c9d0dec861f8264 100644 |
--- a/src/full-codegen.cc |
+++ b/src/full-codegen.cc |
@@ -761,6 +761,7 @@ void FullCodeGenerator::EmitLogicalOperation(BinaryOperation* expr) { |
context()->EmitLogicalLeft(expr, &eval_right, &done); |
+ PrepareForBailoutForId(expr->RightId(), NO_REGISTERS); |
Kasper Lund
2010/12/16 08:32:38
I wonder if it would make sense to somehow split t
|
__ bind(&eval_right); |
if (context()->IsTest()) ForwardBailoutToChild(expr); |
context()->HandleExpression(expr->right()); |
@@ -925,16 +926,21 @@ void FullCodeGenerator::VisitIfStatement(IfStatement* stmt) { |
if (stmt->HasElseStatement()) { |
VisitForControl(stmt->condition(), &then_part, &else_part, &then_part); |
+ PrepareForBailoutForId(stmt->ThenId(), NO_REGISTERS); |
__ bind(&then_part); |
Visit(stmt->then_statement()); |
__ jmp(&done); |
+ PrepareForBailoutForId(stmt->ElseId(), NO_REGISTERS); |
__ bind(&else_part); |
Visit(stmt->else_statement()); |
} else { |
VisitForControl(stmt->condition(), &then_part, &done, &then_part); |
+ PrepareForBailoutForId(stmt->ThenId(), NO_REGISTERS); |
__ bind(&then_part); |
Visit(stmt->then_statement()); |
+ |
+ PrepareForBailoutForId(stmt->ElseId(), NO_REGISTERS); |
} |
__ bind(&done); |
PrepareForBailoutForId(stmt->id(), NO_REGISTERS); |
@@ -1053,12 +1059,13 @@ void FullCodeGenerator::VisitDoWhileStatement(DoWhileStatement* stmt) { |
&stack_check); |
// Check stack before looping. |
+ PrepareForBailoutForId(stmt->BackEdgeId(), NO_REGISTERS); |
__ bind(&stack_check); |
EmitStackCheck(stmt); |
__ jmp(&body); |
- __ bind(loop_statement.break_target()); |
PrepareForBailoutForId(stmt->ExitId(), NO_REGISTERS); |
+ __ bind(loop_statement.break_target()); |
decrement_loop_depth(); |
} |
@@ -1073,6 +1080,7 @@ void FullCodeGenerator::VisitWhileStatement(WhileStatement* stmt) { |
// Emit the test at the bottom of the loop. |
__ jmp(&test); |
+ PrepareForBailoutForId(stmt->BodyId(), NO_REGISTERS); |
__ bind(&body); |
Visit(stmt->body()); |
@@ -1090,8 +1098,8 @@ void FullCodeGenerator::VisitWhileStatement(WhileStatement* stmt) { |
loop_statement.break_target(), |
loop_statement.break_target()); |
- __ bind(loop_statement.break_target()); |
PrepareForBailoutForId(stmt->ExitId(), NO_REGISTERS); |
+ __ bind(loop_statement.break_target()); |
decrement_loop_depth(); |
} |
@@ -1109,12 +1117,12 @@ void FullCodeGenerator::VisitForStatement(ForStatement* stmt) { |
// Emit the test at the bottom of the loop (even if empty). |
__ jmp(&test); |
+ PrepareForBailoutForId(stmt->BodyId(), NO_REGISTERS); |
__ bind(&body); |
Visit(stmt->body()); |
- __ bind(loop_statement.continue_target()); |
PrepareForBailoutForId(stmt->ContinueId(), NO_REGISTERS); |
- |
+ __ bind(loop_statement.continue_target()); |
SetStatementPosition(stmt); |
if (stmt->next() != NULL) { |
Visit(stmt->next()); |
@@ -1137,8 +1145,8 @@ void FullCodeGenerator::VisitForStatement(ForStatement* stmt) { |
__ jmp(&body); |
} |
- __ bind(loop_statement.break_target()); |
PrepareForBailoutForId(stmt->ExitId(), NO_REGISTERS); |
+ __ bind(loop_statement.break_target()); |
decrement_loop_depth(); |
} |
@@ -1269,6 +1277,7 @@ void FullCodeGenerator::VisitConditional(Conditional* expr) { |
Label true_case, false_case, done; |
VisitForControl(expr->condition(), &true_case, &false_case, &true_case); |
+ PrepareForBailoutForId(expr->ThenId(), NO_REGISTERS); |
__ bind(&true_case); |
SetExpressionPosition(expr->then_expression(), |
expr->then_expression_position()); |
@@ -1283,6 +1292,7 @@ void FullCodeGenerator::VisitConditional(Conditional* expr) { |
__ jmp(&done); |
} |
+ PrepareForBailoutForId(expr->ElseId(), NO_REGISTERS); |
__ bind(&false_case); |
if (context()->IsTest()) ForwardBailoutToChild(expr); |
SetExpressionPosition(expr->else_expression(), |