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

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: fix AST numbering issue + add simple TF impl 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
753 {
754 EnterBlockScopeIfNeeded block_scope_state(
755 this, expr->scope(), expr->EntryId(), expr->DeclsId(), expr->ExitId());
756 VisitStatements(expr->statements());
757 Comment cmnt(masm_, "[ Completion");
758 if (expr->result()->is_assigned()) {
759 EmitVariableLoad(expr->result());
760 } else {
761 context()->Plug(isolate()->factory()->undefined_value());
762 }
763 }
764 }
765
766
748 void FullCodeGenerator::VisitExpressionStatement(ExpressionStatement* stmt) { 767 void FullCodeGenerator::VisitExpressionStatement(ExpressionStatement* stmt) {
749 Comment cmnt(masm_, "[ ExpressionStatement"); 768 Comment cmnt(masm_, "[ ExpressionStatement");
750 SetStatementPosition(stmt); 769 SetStatementPosition(stmt);
751 VisitForEffect(stmt->expression()); 770 VisitForEffect(stmt->expression());
752 } 771 }
753 772
754 773
755 void FullCodeGenerator::VisitEmptyStatement(EmptyStatement* stmt) { 774 void FullCodeGenerator::VisitEmptyStatement(EmptyStatement* stmt) {
756 Comment cmnt(masm_, "[ EmptyStatement"); 775 Comment cmnt(masm_, "[ EmptyStatement");
757 SetStatementPosition(stmt); 776 SetStatementPosition(stmt);
(...skipping 850 matching lines...) Expand 10 before | Expand all | Expand 10 after
1608 return var->mode() == CONST_LEGACY || var->scope()->is_nonlinear() || 1627 return var->mode() == CONST_LEGACY || var->scope()->is_nonlinear() ||
1609 var->initializer_position() >= proxy->position(); 1628 var->initializer_position() >= proxy->position();
1610 } 1629 }
1611 1630
1612 1631
1613 #undef __ 1632 #undef __
1614 1633
1615 1634
1616 } // namespace internal 1635 } // namespace internal
1617 } // namespace v8 1636 } // namespace v8
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698