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 /// Analysis to determine how to generate code for `LookupMap`s. | 5 /// Analysis to determine how to generate code for `LookupMap`s. |
6 library compiler.src.js_backend.lookup_map_analysis; | 6 library compiler.src.js_backend.lookup_map_analysis; |
7 | 7 |
8 import 'package:pub_semver/pub_semver.dart'; | 8 import 'package:pub_semver/pub_semver.dart'; |
9 | 9 |
10 import '../common.dart'; | 10 import '../common.dart'; |
11 import '../compiler.dart' show Compiler; | 11 import '../compiler.dart' show Compiler; |
12 import '../constants/values.dart' | 12 import '../constants/values.dart' |
13 show | 13 show |
14 ConstantValue, | 14 ConstantValue, |
15 ConstructedConstantValue, | 15 ConstructedConstantValue, |
16 ListConstantValue, | 16 ListConstantValue, |
17 NullConstantValue, | 17 NullConstantValue, |
18 StringConstantValue, | 18 StringConstantValue, |
19 TypeConstantValue; | 19 TypeConstantValue; |
20 import '../elements/resolution_types.dart' show ResolutionDartType; | |
21 import '../elements/resolution_types.dart' show ResolutionInterfaceType; | 20 import '../elements/resolution_types.dart' show ResolutionInterfaceType; |
22 import '../elements/elements.dart' | 21 import '../elements/elements.dart' |
23 show ClassElement, FieldElement, LibraryElement, VariableElement; | 22 show ClassElement, FieldElement, LibraryElement, VariableElement; |
24 import '../universe/use.dart' show StaticUse; | 23 import '../universe/use.dart' show StaticUse; |
25 import '../universe/world_impact.dart' | 24 import '../universe/world_impact.dart' |
26 show WorldImpact, StagedWorldImpactBuilder; | 25 show WorldImpact, StagedWorldImpactBuilder; |
27 import 'js_backend.dart' show JavaScriptBackend; | 26 import 'js_backend.dart' show JavaScriptBackend; |
28 | 27 |
29 /// An analysis and optimization to remove unused entries from a `LookupMap`. | 28 /// An analysis and optimization to remove unused entries from a `LookupMap`. |
30 /// | 29 /// |
(...skipping 417 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
448 original.fields[analysis.valueField] = keyValuePairs[1]; | 447 original.fields[analysis.valueField] = keyValuePairs[1]; |
449 } | 448 } |
450 } else { | 449 } else { |
451 original.fields[analysis.entriesField] = | 450 original.fields[analysis.entriesField] = |
452 new ListConstantValue(listType, keyValuePairs); | 451 new ListConstantValue(listType, keyValuePairs); |
453 } | 452 } |
454 } | 453 } |
455 } | 454 } |
456 | 455 |
457 final _validLookupMapVersionConstraint = new VersionConstraint.parse('^0.0.1'); | 456 final _validLookupMapVersionConstraint = new VersionConstraint.parse('^0.0.1'); |
OLD | NEW |