1.1 --- a/jitcraft/BytecodeCompiler.cpp Thu Jun 28 00:26:55 2012 -0700
1.2 +++ b/jitcraft/BytecodeCompiler.cpp Thu Jun 28 00:54:45 2012 -0700
1.3 @@ -270,6 +270,25 @@
1.4 }
1.5
1.6 void
1.7 +BytecodeCompiler::visit(WhileStatement *node)
1.8 +{
1.9 + Label header;
1.10 +
1.11 + __ bind(&header);
1.12 +
1.13 + if (node->token() == TOK_WHILE) {
1.14 + Label join;
1.15 + visitForTest(node->condition(), &join, false);
1.16 + node->body()->accept(this);
1.17 + __ jump(&header);
1.18 + __ bind(&join);
1.19 + } else {
1.20 + node->body()->accept(this);
1.21 + visitForTest(node->condition(), &header, true);
1.22 + }
1.23 +}
1.24 +
1.25 +void
1.26 BytecodeCompiler::visit(BlockStatement *node)
1.27 {
1.28 AutoEnterScope blockScope(this, node->scope());