OLD | NEW |
1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2016, 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 kernel.tree_shaker; | 5 library kernel.tree_shaker; |
6 | 6 |
7 import '../ast.dart'; | 7 import '../ast.dart'; |
8 import '../class_hierarchy.dart'; | 8 import '../class_hierarchy.dart'; |
9 import '../core_types.dart'; | 9 import '../core_types.dart'; |
10 import '../type_environment.dart'; | 10 import '../type_environment.dart'; |
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
120 /// Map from classes to the set of members that are reachable with that | 120 /// Map from classes to the set of members that are reachable with that |
121 /// class as host. | 121 /// class as host. |
122 /// | 122 /// |
123 /// The map is implemented as a list, indexed according to | 123 /// The map is implemented as a list, indexed according to |
124 /// [ClassHierarchy.getClassIndex]. | 124 /// [ClassHierarchy.getClassIndex]. |
125 final List<Set<Member>> _usedMembersWithHost; | 125 final List<Set<Member>> _usedMembersWithHost; |
126 | 126 |
127 /// Map from used members (regardless of host) to a summary object describing | 127 /// Map from used members (regardless of host) to a summary object describing |
128 /// how the member invokes other members on `this`. | 128 /// how the member invokes other members on `this`. |
129 /// | 129 /// |
130 /// The summary object is a heterogenous list containing the [Member]s that | 130 /// The summary object is a heterogeneous list containing the [Member]s that |
131 /// are invoked using `super` and the [Name]s that are dispatched on `this`. | 131 /// are invoked using `super` and the [Name]s that are dispatched on `this`. |
132 /// | 132 /// |
133 /// Names that are dispatched as a setter are preceded by the | 133 /// Names that are dispatched as a setter are preceded by the |
134 /// [_setterSentinel] object, to distinguish them from getter/call names. | 134 /// [_setterSentinel] object, to distinguish them from getter/call names. |
135 final Map<Member, List<Node>> _usedMembers = <Member, List<Node>>{}; | 135 final Map<Member, List<Node>> _usedMembers = <Member, List<Node>>{}; |
136 | 136 |
137 /// The level to which a class must be retained after tree shaking. | 137 /// The level to which a class must be retained after tree shaking. |
138 /// | 138 /// |
139 /// See [ClassRetention]. | 139 /// See [ClassRetention]. |
140 final List<ClassRetention> _classRetention; | 140 final List<ClassRetention> _classRetention; |
(...skipping 939 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1080 classNode == coreTypes.futureClass || | 1080 classNode == coreTypes.futureClass || |
1081 classNode == coreTypes.streamClass || | 1081 classNode == coreTypes.streamClass || |
1082 classNode == coreTypes.listClass || | 1082 classNode == coreTypes.listClass || |
1083 classNode == coreTypes.mapClass; | 1083 classNode == coreTypes.mapClass; |
1084 } | 1084 } |
1085 } | 1085 } |
1086 | 1086 |
1087 /// Exception that is thrown to stop the tree shaking analysis when a use | 1087 /// Exception that is thrown to stop the tree shaking analysis when a use |
1088 /// of `dart:mirrors` is found. | 1088 /// of `dart:mirrors` is found. |
1089 class _UsingMirrorsException {} | 1089 class _UsingMirrorsException {} |
OLD | NEW |