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

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

Issue 2590913002: Add WorkItemBuilder to abstract WorkItem creation from the enqueuers. (Closed)
Patch Set: Created 3 years, 12 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
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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.compiler_base; 5 library dart2js.compiler_base;
6 6
7 import 'dart:async' show EventSink, Future; 7 import 'dart:async' show EventSink, Future;
8 8
9 import '../compiler_new.dart' as api; 9 import '../compiler_new.dart' as api;
10 import 'cache_strategy.dart' show CacheStrategy; 10 import 'cache_strategy.dart' show CacheStrategy;
(...skipping 751 matching lines...) Expand 10 before | Expand all | Expand 10 after
762 void registerStaticUse(Element element) { 762 void registerStaticUse(Element element) {
763 impactBuilder.registerStaticUse(new StaticUse.directUse(element)); 763 impactBuilder.registerStaticUse(new StaticUse.directUse(element));
764 } 764 }
765 765
766 void registerElement(Element element) { 766 void registerElement(Element element) {
767 if (element.isClass) { 767 if (element.isClass) {
768 ClassElement cls = element; 768 ClassElement cls = element;
769 cls.ensureResolved(resolution); 769 cls.ensureResolved(resolution);
770 cls.forEachLocalMember(registerStaticUse); 770 cls.forEachLocalMember(registerStaticUse);
771 impactBuilder.registerTypeUse(new TypeUse.instantiation(cls.rawType)); 771 impactBuilder.registerTypeUse(new TypeUse.instantiation(cls.rawType));
772 } else if (element.isTypedef) {
Siggi Cherem (dart-lang) 2016/12/20 21:21:47 I feel I missed something: why typedefs are now ha
Johnni Winther 2016/12/21 10:19:37 Typedef should never have been added to the work-l
773 TypedefElement typdef = element;
774 typdef.ensureResolved(resolution);
772 } else { 775 } else {
773 registerStaticUse(element); 776 registerStaticUse(element);
774 } 777 }
775 } 778 }
776 779
777 library.implementation.forEachLocalMember(registerElement); 780 library.implementation.forEachLocalMember(registerElement);
778 781
779 library.imports.forEach((ImportElement import) { 782 library.imports.forEach((ImportElement import) {
780 if (import.isDeferred) { 783 if (import.isDeferred) {
781 // `import.prefix` and `loadLibrary` may be `null` when the deferred 784 // `import.prefix` and `loadLibrary` may be `null` when the deferred
(...skipping 1443 matching lines...) Expand 10 before | Expand all | Expand 10 after
2225 _ElementScanner(this.scanner); 2228 _ElementScanner(this.scanner);
2226 void scanLibrary(LibraryElement library) => scanner.scanLibrary(library); 2229 void scanLibrary(LibraryElement library) => scanner.scanLibrary(library);
2227 void scanUnit(CompilationUnitElement unit) => scanner.scan(unit); 2230 void scanUnit(CompilationUnitElement unit) => scanner.scan(unit);
2228 } 2231 }
2229 2232
2230 class _EmptyEnvironment implements Environment { 2233 class _EmptyEnvironment implements Environment {
2231 const _EmptyEnvironment(); 2234 const _EmptyEnvironment();
2232 2235
2233 String valueOf(String key) => null; 2236 String valueOf(String key) => null;
2234 } 2237 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698