| 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 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 99 return types.nullType; | 99 return types.nullType; |
| 100 } | 100 } |
| 101 } | 101 } |
| 102 | 102 |
| 103 // Update the locals that are boxed in [locals]. These locals will | 103 // Update the locals that are boxed in [locals]. These locals will |
| 104 // be handled specially, in that we are computing their LUB at | 104 // be handled specially, in that we are computing their LUB at |
| 105 // each update, and reading them yields the type that was found in a | 105 // each update, and reading them yields the type that was found in a |
| 106 // previous analysis of [outermostElement]. | 106 // previous analysis of [outermostElement]. |
| 107 ClosureRepresentationInfo closureData = compiler | 107 ClosureRepresentationInfo closureData = compiler |
| 108 .backendStrategy.closureDataLookup | 108 .backendStrategy.closureDataLookup |
| 109 .getClosureRepresentationInfo(resolvedAst.element); | 109 .getClosureInfoForMember(outermostElement); |
| 110 closureData.forEachCapturedVariable((variable, field) { | 110 closureData.forEachCapturedVariable((variable, field) { |
| 111 locals.setCaptured(variable, field); | 111 locals.setCaptured(variable, field); |
| 112 }); | 112 }); |
| 113 closureData.forEachBoxedVariable((variable, field) { | 113 closureData.forEachBoxedVariable((variable, field) { |
| 114 locals.setCapturedAndBoxed(variable, field); | 114 locals.setCapturedAndBoxed(variable, field); |
| 115 }); | 115 }); |
| 116 | 116 |
| 117 if (analyzedNode is ir.Field) { | 117 if (analyzedNode is ir.Field) { |
| 118 return initializer.accept(this); | 118 return initializer.accept(this); |
| 119 } | 119 } |
| (...skipping 44 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 |