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

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

Issue 1424923004: Add StaticUse for more precise registration of statically known element use. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Updated cf. comments. 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
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 7 import 'dart:async' show
8 EventSink, 8 EventSink,
9 Future; 9 Future;
10 10
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
125 TypeAnnotation; 125 TypeAnnotation;
126 import 'typechecker.dart' show 126 import 'typechecker.dart' show
127 TypeCheckerTask; 127 TypeCheckerTask;
128 import 'types/types.dart' as ti; 128 import 'types/types.dart' as ti;
129 import 'universe/call_structure.dart' show 129 import 'universe/call_structure.dart' show
130 CallStructure; 130 CallStructure;
131 import 'universe/selector.dart' show 131 import 'universe/selector.dart' show
132 Selector; 132 Selector;
133 import 'universe/universe.dart' show 133 import 'universe/universe.dart' show
134 Universe; 134 Universe;
135 import 'universe/use.dart' show
136 StaticUse;
135 import 'universe/world_impact.dart' show 137 import 'universe/world_impact.dart' show
136 WorldImpact; 138 WorldImpact;
137 import 'util/util.dart' show 139 import 'util/util.dart' show
138 Link, 140 Link,
139 Setlet; 141 Setlet;
140 import 'world.dart' show 142 import 'world.dart' show
141 World; 143 World;
142 144
143 abstract class Compiler { 145 abstract class Compiler {
144 146
(...skipping 753 matching lines...) Expand 10 before | Expand all | Expand 10 after
898 if (parameters.requiredParameterCount > 2) { 900 if (parameters.requiredParameterCount > 2) {
899 int index = 0; 901 int index = 0;
900 parameters.orderedForEachParameter((Element parameter) { 902 parameters.orderedForEachParameter((Element parameter) {
901 if (index++ < 2) return; 903 if (index++ < 2) return;
902 errorElement = new ErroneousElementX( 904 errorElement = new ErroneousElementX(
903 MessageKind.MAIN_WITH_EXTRA_PARAMETER, {'main': Identifiers.main}, 905 MessageKind.MAIN_WITH_EXTRA_PARAMETER, {'main': Identifiers.main},
904 Identifiers.main, 906 Identifiers.main,
905 parameter); 907 parameter);
906 mainFunction = backend.helperForMainArity(); 908 mainFunction = backend.helperForMainArity();
907 // Don't warn about main not being used: 909 // Don't warn about main not being used:
908 enqueuer.resolution.registerStaticUse(main); 910 enqueuer.resolution.registerStaticUse(new StaticUse.foreignUse(main));
909 }); 911 });
910 } 912 }
911 } 913 }
912 if (mainFunction == null) { 914 if (mainFunction == null) {
913 if (errorElement == null && !analyzeOnly && !analyzeAll) { 915 if (errorElement == null && !analyzeOnly && !analyzeAll) {
914 reporter.internalError(mainApp, "Problem with '${Identifiers.main}'."); 916 reporter.internalError(mainApp, "Problem with '${Identifiers.main}'.");
915 } else { 917 } else {
916 mainFunction = errorElement; 918 mainFunction = errorElement;
917 } 919 }
918 } 920 }
(...skipping 1128 matching lines...) Expand 10 before | Expand all | Expand 10 after
2047 if (_otherDependencies == null) { 2049 if (_otherDependencies == null) {
2048 _otherDependencies = new Setlet<Element>(); 2050 _otherDependencies = new Setlet<Element>();
2049 } 2051 }
2050 _otherDependencies.add(element.implementation); 2052 _otherDependencies.add(element.implementation);
2051 } 2053 }
2052 2054
2053 Iterable<Element> get otherDependencies { 2055 Iterable<Element> get otherDependencies {
2054 return _otherDependencies != null ? _otherDependencies : const <Element>[]; 2056 return _otherDependencies != null ? _otherDependencies : const <Element>[];
2055 } 2057 }
2056 } 2058 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/common/registry.dart ('k') | pkg/compiler/lib/src/dart_backend/backend.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698