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

Side by Side Diff: src/full-codegen/full-codegen.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 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 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/full-codegen/full-codegen.h" 5 #include "src/full-codegen/full-codegen.h"
6 6
7 #include "src/ast.h" 7 #include "src/ast.h"
8 #include "src/ast-numbering.h" 8 #include "src/ast-numbering.h"
9 #include "src/code-factory.h" 9 #include "src/code-factory.h"
10 #include "src/codegen.h" 10 #include "src/codegen.h"
(...skipping 727 matching lines...) Expand 10 before | Expand all | Expand 10 after
738 738
739 { 739 {
740 EnterBlockScopeIfNeeded block_scope_state( 740 EnterBlockScopeIfNeeded block_scope_state(
741 this, stmt->scope(), stmt->EntryId(), stmt->DeclsId(), stmt->ExitId()); 741 this, stmt->scope(), stmt->EntryId(), stmt->DeclsId(), stmt->ExitId());
742 VisitStatements(stmt->statements()); 742 VisitStatements(stmt->statements());
743 __ bind(nested_block.break_label()); 743 __ bind(nested_block.break_label());
744 } 744 }
745 } 745 }
746 746
747 747
748 void FullCodeGenerator::VisitDoExpression(DoExpression* expr) {
749 Comment cmnt(masm_, "[ Do Expression");
750 NestedStatement nested_block(this);
751 SetExpressionPosition(expr);
752 VisitBlock(expr->block());
753 EmitVariableLoad(expr->result());
754 }
755
756
748 void FullCodeGenerator::VisitExpressionStatement(ExpressionStatement* stmt) { 757 void FullCodeGenerator::VisitExpressionStatement(ExpressionStatement* stmt) {
749 Comment cmnt(masm_, "[ ExpressionStatement"); 758 Comment cmnt(masm_, "[ ExpressionStatement");
750 SetStatementPosition(stmt); 759 SetStatementPosition(stmt);
751 VisitForEffect(stmt->expression()); 760 VisitForEffect(stmt->expression());
752 } 761 }
753 762
754 763
755 void FullCodeGenerator::VisitEmptyStatement(EmptyStatement* stmt) { 764 void FullCodeGenerator::VisitEmptyStatement(EmptyStatement* stmt) {
756 Comment cmnt(masm_, "[ EmptyStatement"); 765 Comment cmnt(masm_, "[ EmptyStatement");
757 SetStatementPosition(stmt); 766 SetStatementPosition(stmt);
(...skipping 850 matching lines...) Expand 10 before | Expand all | Expand 10 after
1608 return var->mode() == CONST_LEGACY || var->scope()->is_nonlinear() || 1617 return var->mode() == CONST_LEGACY || var->scope()->is_nonlinear() ||
1609 var->initializer_position() >= proxy->position(); 1618 var->initializer_position() >= proxy->position();
1610 } 1619 }
1611 1620
1612 1621
1613 #undef __ 1622 #undef __
1614 1623
1615 1624
1616 } // namespace internal 1625 } // namespace internal
1617 } // namespace v8 1626 } // namespace v8
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698