OLD | NEW |
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, 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 library dart2js.serialization.impact; | 5 library dart2js.serialization.impact; |
6 | 6 |
7 import '../dart_types.dart'; | 7 import '../dart_types.dart'; |
8 import '../common/resolution.dart'; | 8 import '../common/resolution.dart'; |
9 import '../constants/expressions.dart'; | 9 import '../constants/expressions.dart'; |
10 import '../elements/elements.dart'; | 10 import '../elements/elements.dart'; |
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
182 ObjectDecoder useDecoder = listLiteralDecoder.getObject(i); | 182 ObjectDecoder useDecoder = listLiteralDecoder.getObject(i); |
183 DartType type = useDecoder.getType(Key.TYPE); | 183 DartType type = useDecoder.getType(Key.TYPE); |
184 bool isConstant = useDecoder.getBool(Key.IS_CONST); | 184 bool isConstant = useDecoder.getBool(Key.IS_CONST); |
185 bool isEmpty = useDecoder.getBool(Key.IS_EMPTY); | 185 bool isEmpty = useDecoder.getBool(Key.IS_EMPTY); |
186 listLiterals.add(new ListLiteralUse( | 186 listLiterals.add(new ListLiteralUse( |
187 type, isConstant: isConstant, isEmpty: isEmpty)); | 187 type, isConstant: isConstant, isEmpty: isEmpty)); |
188 } | 188 } |
189 } | 189 } |
190 | 190 |
191 ListDecoder mapLiteralDecoder = | 191 ListDecoder mapLiteralDecoder = |
192 objectDecoder.getList(Key.LISTS, isOptional: true); | 192 objectDecoder.getList(Key.MAPS, isOptional: true); |
193 List<MapLiteralUse> mapLiterals = const <MapLiteralUse>[]; | 193 List<MapLiteralUse> mapLiterals = const <MapLiteralUse>[]; |
194 if (listLiteralDecoder != null) { | 194 if (mapLiteralDecoder != null) { |
195 mapLiterals = <MapLiteralUse>[]; | 195 mapLiterals = <MapLiteralUse>[]; |
196 for (int i = 0; i < mapLiteralDecoder.length; i++) { | 196 for (int i = 0; i < mapLiteralDecoder.length; i++) { |
197 ObjectDecoder useDecoder = mapLiteralDecoder.getObject(i); | 197 ObjectDecoder useDecoder = mapLiteralDecoder.getObject(i); |
198 DartType type = useDecoder.getType(Key.TYPE); | 198 DartType type = useDecoder.getType(Key.TYPE); |
199 bool isConstant = useDecoder.getBool(Key.IS_CONST); | 199 bool isConstant = useDecoder.getBool(Key.IS_CONST); |
200 bool isEmpty = useDecoder.getBool(Key.IS_EMPTY); | 200 bool isEmpty = useDecoder.getBool(Key.IS_EMPTY); |
201 mapLiterals.add(new MapLiteralUse( | 201 mapLiterals.add(new MapLiteralUse( |
202 type, isConstant: isConstant, isEmpty: isEmpty)); | 202 type, isConstant: isConstant, isEmpty: isEmpty)); |
203 } | 203 } |
204 } | 204 } |
205 | 205 |
206 return new DeserializedResolutionImpact( | 206 return new DeserializedResolutionImpact( |
207 constSymbolNames: constSymbolNames, | 207 constSymbolNames: constSymbolNames, |
208 constantLiterals: constantLiterals, | 208 constantLiterals: constantLiterals, |
209 dynamicUses: dynamicUses, | 209 dynamicUses: dynamicUses, |
210 features: features, | 210 features: features, |
211 listLiterals: listLiterals, | 211 listLiterals: listLiterals, |
212 mapLiterals: mapLiterals, | 212 mapLiterals: mapLiterals, |
213 staticUses: staticUses, | 213 staticUses: staticUses, |
214 typeUses: typeUses); | 214 typeUses: typeUses); |
215 } | 215 } |
216 } | 216 } |
OLD | NEW |