Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(844)

Side by Side Diff: pkg/kernel/lib/transformations/treeshaker.dart

Issue 2890933002: Use LibraryIndex in CoreTypes instead of extending it. (Closed)
Patch Set: Make everything lazy in CoreTypes. Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « pkg/kernel/lib/transformations/mixin_full_resolution.dart ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 204 matching lines...) Expand 10 before | Expand all | Expand 10 after
215 this._usedMembersWithHost = 215 this._usedMembersWithHost =
216 new List<Set<Member>>(hierarchy.classes.length), 216 new List<Set<Member>>(hierarchy.classes.length),
217 this._classRetention = new List<ClassRetention>.filled( 217 this._classRetention = new List<ClassRetention>.filled(
218 hierarchy.classes.length, ClassRetention.None) { 218 hierarchy.classes.length, ClassRetention.None) {
219 _visitor = new _TreeShakerVisitor(this); 219 _visitor = new _TreeShakerVisitor(this);
220 _covariantVisitor = new _ExternalTypeVisitor(this, isCovariant: true); 220 _covariantVisitor = new _ExternalTypeVisitor(this, isCovariant: true);
221 _contravariantVisitor = 221 _contravariantVisitor =
222 new _ExternalTypeVisitor(this, isContravariant: true); 222 new _ExternalTypeVisitor(this, isContravariant: true);
223 _invariantVisitor = new _ExternalTypeVisitor(this, 223 _invariantVisitor = new _ExternalTypeVisitor(this,
224 isCovariant: true, isContravariant: true); 224 isCovariant: true, isContravariant: true);
225 _mirrorsLibrary = coreTypes.tryGetLibrary('dart:mirrors'); 225 _mirrorsLibrary = coreTypes.mirrorsLibrary;
226 try { 226 try {
227 _build(); 227 _build();
228 } on _UsingMirrorsException { 228 } on _UsingMirrorsException {
229 isUsingMirrors = true; 229 isUsingMirrors = true;
230 } 230 }
231 } 231 }
232 232
233 void _build() { 233 void _build() {
234 if (program.mainMethod == null) { 234 if (program.mainMethod == null) {
235 throw 'Cannot perform tree shaking on a program without a main method'; 235 throw 'Cannot perform tree shaking on a program without a main method';
(...skipping 846 matching lines...) Expand 10 before | Expand all | Expand 10 after
1082 classNode == coreTypes.futureClass || 1082 classNode == coreTypes.futureClass ||
1083 classNode == coreTypes.streamClass || 1083 classNode == coreTypes.streamClass ||
1084 classNode == coreTypes.listClass || 1084 classNode == coreTypes.listClass ||
1085 classNode == coreTypes.mapClass; 1085 classNode == coreTypes.mapClass;
1086 } 1086 }
1087 } 1087 }
1088 1088
1089 /// Exception that is thrown to stop the tree shaking analysis when a use 1089 /// Exception that is thrown to stop the tree shaking analysis when a use
1090 /// of `dart:mirrors` is found. 1090 /// of `dart:mirrors` is found.
1091 class _UsingMirrorsException {} 1091 class _UsingMirrorsException {}
OLDNEW
« no previous file with comments | « pkg/kernel/lib/transformations/mixin_full_resolution.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698