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 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
96 // Eagerly bailout, because computing the closure data only | 96 // Eagerly bailout, because computing the closure data only |
97 // works for functions and field assignments. | 97 // works for functions and field assignments. |
98 return types.nullType; | 98 return types.nullType; |
99 } | 99 } |
100 } | 100 } |
101 | 101 |
102 // Update the locals that are boxed in [locals]. These locals will | 102 // Update the locals that are boxed in [locals]. These locals will |
103 // be handled specially, in that we are computing their LUB at | 103 // be handled specially, in that we are computing their LUB at |
104 // each update, and reading them yields the type that was found in a | 104 // each update, and reading them yields the type that was found in a |
105 // previous analysis of [outermostElement]. | 105 // previous analysis of [outermostElement]. |
106 ClosureClassMap closureData = compiler.closureToClassMapper | 106 ClosureRepresentationInfo closureData = compiler.closureToClassMapper |
107 .getClosureToClassMapping(resolvedAst.element); | 107 .getClosureRepresentationInfo(resolvedAst.element); |
108 closureData.forEachCapturedVariable((variable, field) { | 108 closureData.forEachCapturedVariable((variable, field) { |
109 locals.setCaptured(variable, field); | 109 locals.setCaptured(variable, field); |
110 }); | 110 }); |
111 closureData.forEachBoxedVariable((variable, field) { | 111 closureData.forEachBoxedVariable((variable, field) { |
112 locals.setCapturedAndBoxed(variable, field); | 112 locals.setCapturedAndBoxed(variable, field); |
113 }); | 113 }); |
114 | 114 |
115 if (analyzedNode is ir.Field) { | 115 if (analyzedNode is ir.Field) { |
116 return initializer.accept(this); | 116 return initializer.accept(this); |
117 } | 117 } |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
162 : types.simplifyPhi(null, null, elementType); | 162 : types.simplifyPhi(null, null, elementType); |
163 TypeInformation containerType = | 163 TypeInformation containerType = |
164 listLiteral.isConst ? types.constListType : types.growableListType; | 164 listLiteral.isConst ? types.constListType : types.growableListType; |
165 // TODO(efortuna): Change signature of allocateList and the rest of | 165 // TODO(efortuna): Change signature of allocateList and the rest of |
166 // type_system to deal with Kernel elements. | 166 // type_system to deal with Kernel elements. |
167 return types.allocateList(containerType, astAdapter.getNode(listLiteral), | 167 return types.allocateList(containerType, astAdapter.getNode(listLiteral), |
168 outermostElement, elementType, length); | 168 outermostElement, elementType, length); |
169 }); | 169 }); |
170 } | 170 } |
171 } | 171 } |
OLD | NEW |