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

Unified 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 side-by-side diff with in-line comments
Download patch
Index: src/full-codegen/full-codegen.cc
diff --git a/src/full-codegen/full-codegen.cc b/src/full-codegen/full-codegen.cc
index 063f3167939e156484ae3c500ca022e6a87f7c9c..5e9a714a67963565d8e3af5339ec8b150931eac1 100644
--- a/src/full-codegen/full-codegen.cc
+++ b/src/full-codegen/full-codegen.cc
@@ -745,6 +745,25 @@ void FullCodeGenerator::VisitBlock(Block* stmt) {
}
+void FullCodeGenerator::VisitDoExpression(DoExpression* expr) {
+ Comment cmnt(masm_, "[ Do Expression");
+ NestedStatement nested_block(this);
+ SetExpressionPosition(expr);
+
+ {
+ EnterBlockScopeIfNeeded block_scope_state(
+ this, expr->scope(), expr->EntryId(), expr->DeclsId(), expr->ExitId());
+ VisitStatements(expr->statements());
+ Comment cmnt(masm_, "[ Completion");
+ if (expr->result()->is_assigned()) {
+ EmitVariableLoad(expr->result());
+ } else {
+ context()->Plug(isolate()->factory()->undefined_value());
+ }
+ }
+}
+
+
void FullCodeGenerator::VisitExpressionStatement(ExpressionStatement* stmt) {
Comment cmnt(masm_, "[ ExpressionStatement");
SetStatementPosition(stmt);

Powered by Google App Engine
This is Rietveld 408576698