Index: src/interpreter/bytecode-generator.cc |
diff --git a/src/interpreter/bytecode-generator.cc b/src/interpreter/bytecode-generator.cc |
index 5f640854f751764938498f4fe2b33a00fc4c9543..63b00d610e7a0ef308ace07cf9efa760b54250ed 100644 |
--- a/src/interpreter/bytecode-generator.cc |
+++ b/src/interpreter/bytecode-generator.cc |
@@ -894,7 +894,21 @@ void BytecodeGenerator::VisitForInStatement(ForInStatement* stmt) { |
void BytecodeGenerator::VisitForOfStatement(ForOfStatement* stmt) { |
- UNIMPLEMENTED(); |
+ LoopBuilder loop_builder(builder()); |
+ ControlScopeForIteration control_scope(this, stmt, &loop_builder); |
+ |
+ VisitForEffect(stmt->assign_iterator()); |
+ |
+ loop_builder.LoopHeader(); |
+ loop_builder.Next(); |
+ VisitForEffect(stmt->next_result()); |
+ VisitForAccumulatorValue(stmt->result_done()); |
+ loop_builder.BreakIfTrue(); |
+ |
+ VisitForEffect(stmt->assign_each()); |
+ Visit(stmt->body()); |
+ loop_builder.JumpToHeader(); |
+ loop_builder.EndLoop(); |
} |