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.dart'; |
7 import '../common/codegen.dart' show CodegenRegistry, CodegenWorkItem; | 8 import '../common/codegen.dart' show CodegenRegistry, CodegenWorkItem; |
8 import '../common/tasks.dart' show CompilerTask; | 9 import '../common/tasks.dart' show CompilerTask; |
9 import '../compiler.dart'; | 10 import '../compiler.dart'; |
10 import '../diagnostics/spannable.dart'; | |
11 import '../elements/elements.dart'; | 11 import '../elements/elements.dart'; |
12 import '../io/source_information.dart'; | 12 import '../io/source_information.dart'; |
13 import '../js_backend/backend.dart' show JavaScriptBackend; | 13 import '../js_backend/backend.dart' show JavaScriptBackend; |
14 import '../kernel/kernel.dart'; | 14 import '../kernel/kernel.dart'; |
15 import '../kernel/kernel_visitor.dart'; | 15 import '../kernel/kernel_visitor.dart'; |
16 import '../resolution/tree_elements.dart'; | 16 import '../resolution/tree_elements.dart'; |
17 import '../tree/dartstring.dart'; | 17 import '../tree/dartstring.dart'; |
18 import '../types/masks.dart'; | 18 import '../types/masks.dart'; |
19 | 19 |
20 import 'graph_builder.dart'; | 20 import 'graph_builder.dart'; |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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( | 91 this.astAdapter = new KernelAstAdapter( |
92 compiler.backend, | 92 compiler.backend, |
93 resolvedAst, | 93 resolvedAst, |
94 visitor.nodeToAst, | 94 visitor.nodeToAst, |
95 visitor.nodeToElement, | 95 visitor.nodeToElement, |
96 kernel.functions, | 96 kernel.functions, |
| 97 kernel.classes, |
97 kernel.libraries); | 98 kernel.libraries); |
98 } | 99 } |
99 | 100 |
100 HGraph build() { | 101 HGraph build() { |
101 // TODO(het): no reason to do this here... | 102 // TODO(het): no reason to do this here... |
102 HInstruction.idCounter = 0; | 103 HInstruction.idCounter = 0; |
103 if (function.kind == ir.ProcedureKind.Method || | 104 if (function.kind == ir.ProcedureKind.Method || |
104 function.kind == ir.ProcedureKind.Operator) { | 105 function.kind == ir.ProcedureKind.Operator) { |
105 buildMethod(function, functionElement); | 106 buildMethod(function, functionElement); |
106 } else { | 107 } else { |
(...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
305 visitThisExpression(ir.ThisExpression thisExpression) { | 306 visitThisExpression(ir.ThisExpression thisExpression) { |
306 stack.add(localsHandler.readThis()); | 307 stack.add(localsHandler.readThis()); |
307 } | 308 } |
308 | 309 |
309 @override | 310 @override |
310 visitNot(ir.Not not) { | 311 visitNot(ir.Not not) { |
311 not.operand.accept(this); | 312 not.operand.accept(this); |
312 push(new HNot(popBoolified(), backend.boolType)); | 313 push(new HNot(popBoolified(), backend.boolType)); |
313 } | 314 } |
314 } | 315 } |
OLD | NEW |