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

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

Issue 2814973003: Extract ClosedWorldRefiner implementation from ClosedWorldImpl to ClosedWorldBase (Closed)
Patch Set: Created 3 years, 8 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 Future; 7 import 'dart:async' show Future;
8 8
9 import '../compiler_new.dart' as api; 9 import '../compiler_new.dart' as api;
10 import 'closure.dart' as closureMapping show ClosureTask; 10 import 'closure.dart' as closureMapping show ClosureTask;
(...skipping 818 matching lines...) Expand 10 before | Expand all | Expand 10 after
829 * the queues are empty (nothing was added after we stopped 829 * the queues are empty (nothing was added after we stopped
830 * processing the queues). Also compute the number of methods that 830 * processing the queues). Also compute the number of methods that
831 * were resolved, but not compiled (aka excess resolution). 831 * were resolved, but not compiled (aka excess resolution).
832 */ 832 */
833 checkQueues(Enqueuer resolutionEnqueuer, Enqueuer codegenEnqueuer) { 833 checkQueues(Enqueuer resolutionEnqueuer, Enqueuer codegenEnqueuer) {
834 for (Enqueuer enqueuer in [resolutionEnqueuer, codegenEnqueuer]) { 834 for (Enqueuer enqueuer in [resolutionEnqueuer, codegenEnqueuer]) {
835 enqueuer.checkQueueIsEmpty(); 835 enqueuer.checkQueueIsEmpty();
836 } 836 }
837 if (!REPORT_EXCESS_RESOLUTION) return; 837 if (!REPORT_EXCESS_RESOLUTION) return;
838 var resolved = new Set.from(resolutionEnqueuer.processedEntities); 838 var resolved = new Set.from(resolutionEnqueuer.processedEntities);
839 for (Element e in codegenEnqueuer.processedEntities) { 839 for (MemberEntity e in codegenEnqueuer.processedEntities) {
840 resolved.remove(e); 840 resolved.remove(e);
841 } 841 }
842 for (Element e in new Set.from(resolved)) { 842 for (MemberEntity e in new Set.from(resolved)) {
843 if (e.isClass || 843 if (e.isField) {
844 e.isField ||
845 e.isTypeVariable ||
846 e.isTypedef ||
847 identical(e.kind, ElementKind.ABSTRACT_FIELD)) {
848 resolved.remove(e); 844 resolved.remove(e);
849 } 845 }
850 if (identical(e.kind, ElementKind.GENERATIVE_CONSTRUCTOR)) { 846 if (e.isConstructor && (e as ConstructorEntity).isGenerativeConstructor) {
851 resolved.remove(e); 847 resolved.remove(e);
852 } 848 }
853 if (backend.isTargetSpecificLibrary(e.library)) { 849 if (backend.isTargetSpecificLibrary(e.library)) {
854 resolved.remove(e); 850 resolved.remove(e);
855 } 851 }
856 } 852 }
857 reporter.log('Excess resolution work: ${resolved.length}.'); 853 reporter.log('Excess resolution work: ${resolved.length}.');
858 for (Element e in resolved) { 854 for (MemberEntity e in resolved) {
859 reporter.reportWarningMessage(e, MessageKind.GENERIC, 855 reporter.reportWarningMessage(e, MessageKind.GENERIC,
860 {'text': 'Warning: $e resolved but not compiled.'}); 856 {'text': 'Warning: $e resolved but not compiled.'});
861 } 857 }
862 } 858 }
863 859
864 void showResolutionProgress(Enqueuer enqueuer) { 860 void showResolutionProgress(Enqueuer enqueuer) {
865 if (shouldPrintProgress) { 861 if (shouldPrintProgress) {
866 // TODO(ahe): Add structured diagnostics to the compiler API and 862 // TODO(ahe): Add structured diagnostics to the compiler API and
867 // use it to separate this from the --verbose option. 863 // use it to separate this from the --verbose option.
868 assert(phase == PHASE_RESOLVING); 864 assert(phase == PHASE_RESOLVING);
(...skipping 1133 matching lines...) Expand 10 before | Expand all | Expand 10 after
2002 ResolutionFunctionType getLocalFunctionType(LocalFunctionElement function) { 1998 ResolutionFunctionType getLocalFunctionType(LocalFunctionElement function) {
2003 return function.type; 1999 return function.type;
2004 } 2000 }
2005 2001
2006 @override 2002 @override
2007 ResolutionDartType getUnaliasedType(ResolutionDartType type) { 2003 ResolutionDartType getUnaliasedType(ResolutionDartType type) {
2008 type.computeUnaliased(_resolution); 2004 type.computeUnaliased(_resolution);
2009 return type.unaliased; 2005 return type.unaliased;
2010 } 2006 }
2011 } 2007 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698