OLD | NEW |
1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 import 'package:kernel/ast.dart' as ir; | 5 import 'package:kernel/ast.dart' as ir; |
6 | 6 |
7 import '../common/codegen.dart' show CodegenRegistry, CodegenWorkItem; | 7 import '../common/codegen.dart' show CodegenRegistry, CodegenWorkItem; |
8 import '../common/tasks.dart' show CompilerTask; | 8 import '../common/tasks.dart' show CompilerTask; |
9 import '../compiler.dart'; | 9 import '../compiler.dart'; |
10 import '../diagnostics/spannable.dart'; | 10 import '../diagnostics/spannable.dart'; |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
81 KernelVisitor visitor, | 81 KernelVisitor visitor, |
82 Kernel kernel) { | 82 Kernel kernel) { |
83 graph.element = functionElement; | 83 graph.element = functionElement; |
84 // TODO(het): Should sourceInformationBuilder be in GraphBuilder? | 84 // TODO(het): Should sourceInformationBuilder be in GraphBuilder? |
85 this.sourceInformationBuilder = | 85 this.sourceInformationBuilder = |
86 sourceInformationFactory.createBuilderForContext(resolvedAst); | 86 sourceInformationFactory.createBuilderForContext(resolvedAst); |
87 graph.sourceInformation = | 87 graph.sourceInformation = |
88 sourceInformationBuilder.buildVariableDeclaration(); | 88 sourceInformationBuilder.buildVariableDeclaration(); |
89 this.localsHandler = | 89 this.localsHandler = |
90 new LocalsHandler(this, functionElement, null, compiler); | 90 new LocalsHandler(this, functionElement, null, compiler); |
91 this.astAdapter = new KernelAstAdapter(compiler.backend, resolvedAst, | 91 this.astAdapter = new KernelAstAdapter( |
92 visitor.nodeToAst, visitor.nodeToElement, kernel.functions); | 92 compiler.backend, |
| 93 resolvedAst, |
| 94 visitor.nodeToAst, |
| 95 visitor.nodeToElement, |
| 96 kernel.functions, |
| 97 kernel.libraries); |
93 } | 98 } |
94 | 99 |
95 HGraph build() { | 100 HGraph build() { |
96 // TODO(het): no reason to do this here... | 101 // TODO(het): no reason to do this here... |
97 HInstruction.idCounter = 0; | 102 HInstruction.idCounter = 0; |
98 if (function.kind == ir.ProcedureKind.Method || | 103 if (function.kind == ir.ProcedureKind.Method || |
99 function.kind == ir.ProcedureKind.Operator) { | 104 function.kind == ir.ProcedureKind.Operator) { |
100 buildMethod(function, functionElement); | 105 buildMethod(function, functionElement); |
101 } else { | 106 } else { |
102 compiler.reporter.internalError( | 107 compiler.reporter.internalError( |
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
268 visitThisExpression(ir.ThisExpression thisExpression) { | 273 visitThisExpression(ir.ThisExpression thisExpression) { |
269 stack.add(localsHandler.readThis()); | 274 stack.add(localsHandler.readThis()); |
270 } | 275 } |
271 | 276 |
272 @override | 277 @override |
273 visitExpressionStatement(ir.ExpressionStatement exprStatement) { | 278 visitExpressionStatement(ir.ExpressionStatement exprStatement) { |
274 exprStatement.expression.accept(this); | 279 exprStatement.expression.accept(this); |
275 pop(); | 280 pop(); |
276 } | 281 } |
277 } | 282 } |
OLD | NEW |