diff --git a/src/compiler.cc b/src/compiler.cc index bac0a25096..6be922ceed 100644 --- a/src/compiler.cc +++ b/src/compiler.cc @@ -708,12 +708,20 @@ void CodeGenSelector::VisitSwitchStatement(SwitchStatement* stmt) { void CodeGenSelector::VisitDoWhileStatement(DoWhileStatement* stmt) { - BAILOUT("DoWhileStatement"); + // We do not handle loops with breaks or continue statements in their + // body. We will bailout when we hit those statements in the body. + ProcessExpression(stmt->cond(), Expression::kTest); + CHECK_BAILOUT; + Visit(stmt->body()); } void CodeGenSelector::VisitWhileStatement(WhileStatement* stmt) { - BAILOUT("WhileStatement"); + // We do not handle loops with breaks or continue statements in their + // body. We will bailout when we hit those statements in the body. + ProcessExpression(stmt->cond(), Expression::kTest); + CHECK_BAILOUT; + Visit(stmt->body()); } diff --git a/src/fast-codegen.cc b/src/fast-codegen.cc index bb5ed8ab08..1c69e21fff 100644 --- a/src/fast-codegen.cc +++ b/src/fast-codegen.cc @@ -320,6 +320,8 @@ void FastCodeGenerator::VisitDoWhileStatement(DoWhileStatement* stmt) { false_label_ = &exit; ASSERT(stmt->cond()->context() == Expression::kTest); Visit(stmt->cond()); + true_label_ = NULL; + false_label_ = NULL; __ bind(&exit); @@ -347,6 +349,8 @@ void FastCodeGenerator::VisitWhileStatement(WhileStatement* stmt) { false_label_ = &exit; ASSERT(stmt->cond()->context() == Expression::kTest); Visit(stmt->cond()); + true_label_ = NULL; + false_label_ = NULL; __ bind(&exit);