OLD | NEW |
1 // Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2017, 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 '../closure.dart'; | 7 import '../closure.dart'; |
8 import '../compiler.dart'; | 8 import '../compiler.dart'; |
9 import '../elements/elements.dart'; | 9 import '../elements/elements.dart'; |
10 import '../elements/entities.dart'; | 10 import '../elements/entities.dart'; |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
58 if (resolvedAst.kind == ResolvedAstKind.PARSED) { | 58 if (resolvedAst.kind == ResolvedAstKind.PARSED) { |
59 node = resolvedAst.node; | 59 node = resolvedAst.node; |
60 } | 60 } |
61 FieldInitializationScope fieldScope = (analyzedNode is ir.Constructor) | 61 FieldInitializationScope fieldScope = (analyzedNode is ir.Constructor) |
62 ? new FieldInitializationScope(types) | 62 ? new FieldInitializationScope(types) |
63 : null; | 63 : null; |
64 locals = | 64 locals = |
65 new LocalsHandler(inferrer, types, compiler.options, node, fieldScope); | 65 new LocalsHandler(inferrer, types, compiler.options, node, fieldScope); |
66 } | 66 } |
67 | 67 |
68 factory KernelTypeGraphBuilder(MemberElement element, ResolvedAst resolvedAst, | 68 factory KernelTypeGraphBuilder( |
69 Compiler compiler, InferrerEngine inferrer, | 69 MemberElement element, Compiler compiler, InferrerEngine inferrer, |
70 [LocalsHandler handler]) { | 70 [LocalsHandler handler]) { |
71 var adapter = _createKernelAdapter(compiler, resolvedAst); | 71 var adapter = _createKernelAdapter(compiler, element.resolvedAst); |
72 var node = adapter.getMemberNode(element); | 72 var node = adapter.getMemberNode(element); |
73 return new KernelTypeGraphBuilder.internal( | 73 return new KernelTypeGraphBuilder.internal( |
74 element, | 74 element, |
75 resolvedAst, | 75 element.resolvedAst, |
76 element.outermostEnclosingMemberOrTopLevel.implementation, | 76 element.outermostEnclosingMemberOrTopLevel.implementation, |
77 inferrer, | 77 inferrer, |
78 compiler, | 78 compiler, |
79 handler, | 79 handler, |
80 adapter, | 80 adapter, |
81 node); | 81 node); |
82 } | 82 } |
83 | 83 |
84 static KernelAstAdapter _createKernelAdapter( | 84 static KernelAstAdapter _createKernelAdapter( |
85 Compiler compiler, ResolvedAst resolvedAst) { | 85 Compiler compiler, ResolvedAst resolvedAst) { |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
164 : types.simplifyPhi(null, null, elementType); | 164 : types.simplifyPhi(null, null, elementType); |
165 TypeInformation containerType = | 165 TypeInformation containerType = |
166 listLiteral.isConst ? types.constListType : types.growableListType; | 166 listLiteral.isConst ? types.constListType : types.growableListType; |
167 // TODO(efortuna): Change signature of allocateList and the rest of | 167 // TODO(efortuna): Change signature of allocateList and the rest of |
168 // type_system to deal with Kernel elements. | 168 // type_system to deal with Kernel elements. |
169 return types.allocateList(containerType, astAdapter.getNode(listLiteral), | 169 return types.allocateList(containerType, astAdapter.getNode(listLiteral), |
170 outermostElement, elementType, length); | 170 outermostElement, elementType, length); |
171 }); | 171 }); |
172 } | 172 } |
173 } | 173 } |
OLD | NEW |