OLD | NEW |
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 1214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1225 const Operator* op = | 1225 const Operator* op = |
1226 javascript()->CallRuntime(Runtime::kDeclareEvalFunction); | 1226 javascript()->CallRuntime(Runtime::kDeclareEvalFunction); |
1227 Node* store = NewNode(op, name, value); | 1227 Node* store = NewNode(op, name, value); |
1228 PrepareFrameState(store, decl->proxy()->id()); | 1228 PrepareFrameState(store, decl->proxy()->id()); |
1229 break; | 1229 break; |
1230 } | 1230 } |
1231 } | 1231 } |
1232 } | 1232 } |
1233 | 1233 |
1234 | 1234 |
1235 void AstGraphBuilder::VisitImportDeclaration(ImportDeclaration* decl) { | |
1236 UNREACHABLE(); | |
1237 } | |
1238 | |
1239 | |
1240 void AstGraphBuilder::VisitBlock(Block* stmt) { | 1235 void AstGraphBuilder::VisitBlock(Block* stmt) { |
1241 BlockBuilder block(this); | 1236 BlockBuilder block(this); |
1242 ControlScopeForBreakable scope(this, stmt, &block); | 1237 ControlScopeForBreakable scope(this, stmt, &block); |
1243 if (stmt->labels() != nullptr) block.BeginBlock(); | 1238 if (stmt->labels() != nullptr) block.BeginBlock(); |
1244 if (stmt->scope() == nullptr) { | 1239 if (stmt->scope() == nullptr) { |
1245 // Visit statements in the same scope, no declarations. | 1240 // Visit statements in the same scope, no declarations. |
1246 VisitStatements(stmt->statements()); | 1241 VisitStatements(stmt->statements()); |
1247 } else { | 1242 } else { |
1248 // Visit declarations and statements in a block scope. | 1243 // Visit declarations and statements in a block scope. |
1249 if (stmt->scope()->NeedsContext()) { | 1244 if (stmt->scope()->NeedsContext()) { |
(...skipping 3166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4416 // Phi does not exist yet, introduce one. | 4411 // Phi does not exist yet, introduce one. |
4417 value = NewPhi(inputs, value, control); | 4412 value = NewPhi(inputs, value, control); |
4418 value->ReplaceInput(inputs - 1, other); | 4413 value->ReplaceInput(inputs - 1, other); |
4419 } | 4414 } |
4420 return value; | 4415 return value; |
4421 } | 4416 } |
4422 | 4417 |
4423 } // namespace compiler | 4418 } // namespace compiler |
4424 } // namespace internal | 4419 } // namespace internal |
4425 } // namespace v8 | 4420 } // namespace v8 |
OLD | NEW |