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

Side by Side Diff: pkg/compiler/lib/src/deferred_load.dart

Issue 1435853002: Register closures using StaticUse. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Updated cf. comment Created 5 years, 1 month 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/compiler/lib/src/common/codegen.dart ('k') | pkg/compiler/lib/src/enqueue.dart » ('j') | 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) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, 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 deferred_load; 5 library deferred_load;
6 6
7 import 'common.dart'; 7 import 'common.dart';
8 import 'common/backend_api.dart' show 8 import 'common/backend_api.dart' show
9 Backend; 9 Backend;
10 import 'common/tasks.dart' show 10 import 'common/tasks.dart' show
(...skipping 301 matching lines...) Expand 10 before | Expand all | Expand 10 after
312 AstElement analyzableElement = element.analyzableElement.declaration; 312 AstElement analyzableElement = element.analyzableElement.declaration;
313 if (!compiler.enqueuer.resolution.hasBeenProcessed(analyzableElement)) { 313 if (!compiler.enqueuer.resolution.hasBeenProcessed(analyzableElement)) {
314 return; 314 return;
315 } 315 }
316 316
317 WorldImpact worldImpact = 317 WorldImpact worldImpact =
318 compiler.resolution.getWorldImpact(analyzableElement); 318 compiler.resolution.getWorldImpact(analyzableElement);
319 worldImpact.staticUses.forEach((StaticUse staticUse) { 319 worldImpact.staticUses.forEach((StaticUse staticUse) {
320 elements.add(staticUse.element); 320 elements.add(staticUse.element);
321 }); 321 });
322 elements.addAll(worldImpact.closures);
323 for (TypeUse typeUse in worldImpact.typeUses) { 322 for (TypeUse typeUse in worldImpact.typeUses) {
324 DartType type = typeUse.type; 323 DartType type = typeUse.type;
325 switch (typeUse.kind) { 324 switch (typeUse.kind) {
326 case TypeUseKind.TYPE_LITERAL: 325 case TypeUseKind.TYPE_LITERAL:
327 if (type.isTypedef || type.isInterfaceType) { 326 if (type.isTypedef || type.isInterfaceType) {
328 elements.add(type.element); 327 elements.add(type.element);
329 } 328 }
330 break; 329 break;
331 case TypeUseKind.INSTANTIATION: 330 case TypeUseKind.INSTANTIATION:
332 case TypeUseKind.IS_CHECK: 331 case TypeUseKind.IS_CHECK:
(...skipping 664 matching lines...) Expand 10 before | Expand all | Expand 10 after
997 return result; 996 return result;
998 } 997 }
999 998
1000 bool operator ==(other) { 999 bool operator ==(other) {
1001 if (other is! _DeclaredDeferredImport) return false; 1000 if (other is! _DeclaredDeferredImport) return false;
1002 return declaration == other.declaration; 1001 return declaration == other.declaration;
1003 } 1002 }
1004 1003
1005 int get hashCode => declaration.hashCode * 17; 1004 int get hashCode => declaration.hashCode * 17;
1006 } 1005 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/common/codegen.dart ('k') | pkg/compiler/lib/src/enqueue.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698