Index: src/full-codegen.cc |
diff --git a/src/full-codegen.cc b/src/full-codegen.cc |
index 088a9c9a7ed1409ba31667608a3ecdd8b1e8f6a2..3c2feee3522edc7f38e37de67cca34dc18e1f2ad 100644 |
--- a/src/full-codegen.cc |
+++ b/src/full-codegen.cc |
@@ -854,11 +854,6 @@ void FullCodeGenerator::SetExpressionPosition(Expression* expr) { |
} |
-void FullCodeGenerator::SetStatementPosition(int pos) { |
- CodeGenerator::RecordPositions(masm_, pos); |
-} |
- |
- |
void FullCodeGenerator::SetSourcePosition(int pos) { |
if (pos != RelocInfo::kNoPosition) { |
masm_->positions_recorder()->RecordPosition(pos); |
@@ -1283,31 +1278,28 @@ void FullCodeGenerator::VisitDoWhileStatement(DoWhileStatement* stmt) { |
void FullCodeGenerator::VisitWhileStatement(WhileStatement* stmt) { |
Comment cmnt(masm_, "[ WhileStatement"); |
- Label test, body; |
+ Label loop, body; |
Iteration loop_statement(this, stmt); |
increment_loop_depth(); |
- // Emit the test at the bottom of the loop. |
- __ jmp(&test); |
+ __ bind(&loop); |
+ |
+ SetExpressionPosition(stmt->cond()); |
+ VisitForControl(stmt->cond(), |
+ &body, |
+ loop_statement.break_label(), |
+ &body); |
PrepareForBailoutForId(stmt->BodyId(), NO_REGISTERS); |
__ bind(&body); |
Visit(stmt->body()); |
- // Emit the statement position here as this is where the while |
- // statement code starts. |
__ bind(loop_statement.continue_label()); |
- SetStatementPosition(stmt); |
// Check stack before looping. |
- EmitBackEdgeBookkeeping(stmt, &body); |
- |
- __ bind(&test); |
- VisitForControl(stmt->cond(), |
- &body, |
- loop_statement.break_label(), |
- loop_statement.break_label()); |
+ EmitBackEdgeBookkeeping(stmt, &loop); |
+ __ jmp(&loop); |
PrepareForBailoutForId(stmt->ExitId(), NO_REGISTERS); |
__ bind(loop_statement.break_label()); |