Chromium Code Reviews| Index: src/compiler/ast-graph-builder.cc |
| diff --git a/src/compiler/ast-graph-builder.cc b/src/compiler/ast-graph-builder.cc |
| index f2e10ecfe5354e71c159f151c40dd48fccfb48a7..8e98ea4d04f71c0f4180685eb87091ac90aa47db 100644 |
| --- a/src/compiler/ast-graph-builder.cc |
| +++ b/src/compiler/ast-graph-builder.cc |
| @@ -1657,6 +1657,28 @@ void AstGraphBuilder::VisitNativeFunctionLiteral(NativeFunctionLiteral* expr) { |
| } |
| +void AstGraphBuilder::VisitDoExpression(DoExpression* expr) { |
| + BlockBuilder block(this); |
| + ControlScopeForBreakable scope( |
| + this, reinterpret_cast<BreakableStatement*>(expr), &block); |
| + // Visit declarations and statements in a block scope. |
| + if (expr->scope()->NeedsContext()) { |
| + Node* context = BuildLocalBlockContext(expr->scope()); |
| + ContextScope scope(this, expr->scope(), context); |
| + VisitDeclarations(expr->scope()->declarations()); |
| + VisitStatements(expr->statements()); |
| + } else { |
| + VisitDeclarations(expr->scope()->declarations()); |
| + VisitStatements(expr->statements()); |
| + } |
| + if (expr->result()->is_assigned()) { |
|
rossberg
2015/10/12 13:52:39
It's better to avoid this case distinction in back
caitp (gmail)
2015/10/12 18:22:59
Done.
It seems like it could potentially save a b
rossberg
2015/10/13 10:44:32
Such an optimsation comes for free with SSA form.
|
| + VisitVariableProxy(expr->result()); |
| + } else { |
| + ast_context()->ProduceValue(jsgraph()->UndefinedConstant()); |
| + } |
| +} |
| + |
| + |
| void AstGraphBuilder::VisitConditional(Conditional* expr) { |
| IfBuilder compare_if(this); |
| VisitForTest(expr->condition()); |