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

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

Issue 2108193003: [modules] AST and parser rework. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@anonymous-declarations
Patch Set: . Created 4 years, 5 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/ast/scopes.h" 7 #include "src/ast/scopes.h"
8 #include "src/compiler.h" 8 #include "src/compiler.h"
9 #include "src/compiler/ast-loop-assignment-analyzer.h" 9 #include "src/compiler/ast-loop-assignment-analyzer.h"
10 #include "src/compiler/control-builders.h" 10 #include "src/compiler/control-builders.h"
(...skipping 1178 matching lines...) Expand 10 before | Expand all | Expand 10 after
1189 const Operator* op = 1189 const Operator* op =
1190 javascript()->CallRuntime(Runtime::kDeclareEvalFunction); 1190 javascript()->CallRuntime(Runtime::kDeclareEvalFunction);
1191 Node* store = NewNode(op, name, value); 1191 Node* store = NewNode(op, name, value);
1192 PrepareFrameState(store, decl->proxy()->id()); 1192 PrepareFrameState(store, decl->proxy()->id());
1193 break; 1193 break;
1194 } 1194 }
1195 } 1195 }
1196 } 1196 }
1197 1197
1198 1198
1199 void AstGraphBuilder::VisitImportDeclaration(ImportDeclaration* decl) {
1200 UNREACHABLE();
1201 }
1202
1203
1204 void AstGraphBuilder::VisitBlock(Block* stmt) { 1199 void AstGraphBuilder::VisitBlock(Block* stmt) {
1205 BlockBuilder block(this); 1200 BlockBuilder block(this);
1206 ControlScopeForBreakable scope(this, stmt, &block); 1201 ControlScopeForBreakable scope(this, stmt, &block);
1207 if (stmt->labels() != nullptr) block.BeginBlock(); 1202 if (stmt->labels() != nullptr) block.BeginBlock();
1208 if (stmt->scope() == nullptr) { 1203 if (stmt->scope() == nullptr) {
1209 // Visit statements in the same scope, no declarations. 1204 // Visit statements in the same scope, no declarations.
1210 VisitStatements(stmt->statements()); 1205 VisitStatements(stmt->statements());
1211 } else { 1206 } else {
1212 // Visit declarations and statements in a block scope. 1207 // Visit declarations and statements in a block scope.
1213 if (stmt->scope()->NeedsContext()) { 1208 if (stmt->scope()->NeedsContext()) {
(...skipping 3164 matching lines...) Expand 10 before | Expand all | Expand 10 after
4378 // Phi does not exist yet, introduce one. 4373 // Phi does not exist yet, introduce one.
4379 value = NewPhi(inputs, value, control); 4374 value = NewPhi(inputs, value, control);
4380 value->ReplaceInput(inputs - 1, other); 4375 value->ReplaceInput(inputs - 1, other);
4381 } 4376 }
4382 return value; 4377 return value;
4383 } 4378 }
4384 4379
4385 } // namespace compiler 4380 } // namespace compiler
4386 } // namespace internal 4381 } // namespace internal
4387 } // namespace v8 4382 } // namespace v8
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698