Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(728)

Side by Side Diff: src/compiler/ast-graph-builder.cc

Issue 1399893002: [es7] implement |do| expressions proposal (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Less code duplication in Rewriter Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/compiler/ast-graph-builder.h" 5 #include "src/compiler/ast-graph-builder.h"
6 6
7 #include "src/compiler.h" 7 #include "src/compiler.h"
8 #include "src/compiler/ast-loop-assignment-analyzer.h" 8 #include "src/compiler/ast-loop-assignment-analyzer.h"
9 #include "src/compiler/control-builders.h" 9 #include "src/compiler/control-builders.h"
10 #include "src/compiler/js-type-feedback.h" 10 #include "src/compiler/js-type-feedback.h"
(...skipping 1638 matching lines...) Expand 10 before | Expand all | Expand 10 after
1649 } 1649 }
1650 ast_context()->ProduceValue(literal); 1650 ast_context()->ProduceValue(literal);
1651 } 1651 }
1652 1652
1653 1653
1654 void AstGraphBuilder::VisitNativeFunctionLiteral(NativeFunctionLiteral* expr) { 1654 void AstGraphBuilder::VisitNativeFunctionLiteral(NativeFunctionLiteral* expr) {
1655 UNREACHABLE(); 1655 UNREACHABLE();
1656 } 1656 }
1657 1657
1658 1658
1659 void AstGraphBuilder::VisitDoExpression(DoExpression* expr) {
1660 VisitBlock(expr->block());
1661 VisitVariableProxy(expr->result());
1662 }
1663
1664
1659 void AstGraphBuilder::VisitConditional(Conditional* expr) { 1665 void AstGraphBuilder::VisitConditional(Conditional* expr) {
1660 IfBuilder compare_if(this); 1666 IfBuilder compare_if(this);
1661 VisitForTest(expr->condition()); 1667 VisitForTest(expr->condition());
1662 Node* condition = environment()->Pop(); 1668 Node* condition = environment()->Pop();
1663 compare_if.If(condition); 1669 compare_if.If(condition);
1664 compare_if.Then(); 1670 compare_if.Then();
1665 Visit(expr->then_expression()); 1671 Visit(expr->then_expression());
1666 compare_if.Else(); 1672 compare_if.Else();
1667 Visit(expr->else_expression()); 1673 Visit(expr->else_expression());
1668 compare_if.End(); 1674 compare_if.End();
(...skipping 2618 matching lines...) Expand 10 before | Expand all | Expand 10 after
4287 // Phi does not exist yet, introduce one. 4293 // Phi does not exist yet, introduce one.
4288 value = NewPhi(inputs, value, control); 4294 value = NewPhi(inputs, value, control);
4289 value->ReplaceInput(inputs - 1, other); 4295 value->ReplaceInput(inputs - 1, other);
4290 } 4296 }
4291 return value; 4297 return value;
4292 } 4298 }
4293 4299
4294 } // namespace compiler 4300 } // namespace compiler
4295 } // namespace internal 4301 } // namespace internal
4296 } // namespace v8 4302 } // namespace v8
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698