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

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

Issue 2647043002: Fix hints reported by analyzer. (Closed)
Patch Set: Address review comments. Created 3 years, 11 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/compiler/lib/src/compile_time_constants.dart ('k') | pkg/compiler/lib/src/dart2js.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) 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 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
60 import 'parser/parser_task.dart' show ParserTask; 60 import 'parser/parser_task.dart' show ParserTask;
61 import 'patch_parser.dart' show PatchParserTask; 61 import 'patch_parser.dart' show PatchParserTask;
62 import 'resolution/resolution.dart' show ResolverTask; 62 import 'resolution/resolution.dart' show ResolverTask;
63 import 'resolved_uri_translator.dart'; 63 import 'resolved_uri_translator.dart';
64 import 'scanner/scanner_task.dart' show ScannerTask; 64 import 'scanner/scanner_task.dart' show ScannerTask;
65 import 'script.dart' show Script; 65 import 'script.dart' show Script;
66 import 'serialization/task.dart' show SerializationTask; 66 import 'serialization/task.dart' show SerializationTask;
67 import 'ssa/nodes.dart' show HInstruction; 67 import 'ssa/nodes.dart' show HInstruction;
68 import 'tokens/token.dart' show StringToken, Token, TokenPair; 68 import 'tokens/token.dart' show StringToken, Token, TokenPair;
69 import 'tokens/token_map.dart' show TokenMap; 69 import 'tokens/token_map.dart' show TokenMap;
70 import 'tracer.dart' show Tracer;
71 import 'tree/tree.dart' show Node, TypeAnnotation; 70 import 'tree/tree.dart' show Node, TypeAnnotation;
72 import 'typechecker.dart' show TypeCheckerTask; 71 import 'typechecker.dart' show TypeCheckerTask;
73 import 'types/types.dart' show GlobalTypeInferenceTask; 72 import 'types/types.dart' show GlobalTypeInferenceTask;
74 import 'universe/selector.dart' show Selector; 73 import 'universe/selector.dart' show Selector;
75 import 'universe/world_builder.dart' 74 import 'universe/world_builder.dart'
76 show ResolutionWorldBuilder, CodegenWorldBuilder; 75 show ResolutionWorldBuilder, CodegenWorldBuilder;
77 import 'universe/use.dart' show StaticUse, TypeUse; 76 import 'universe/use.dart' show StaticUse, TypeUse;
78 import 'universe/world_impact.dart' 77 import 'universe/world_impact.dart'
79 show 78 show
80 ImpactStrategy, 79 ImpactStrategy,
81 WorldImpact, 80 WorldImpact,
82 WorldImpactBuilder,
83 WorldImpactBuilderImpl; 81 WorldImpactBuilderImpl;
84 import 'util/util.dart' show Link, Setlet; 82 import 'util/util.dart' show Link, Setlet;
85 import 'world.dart' show ClosedWorld, ClosedWorldRefiner, ClosedWorldImpl; 83 import 'world.dart' show ClosedWorld, ClosedWorldRefiner, ClosedWorldImpl;
86 84
87 typedef Backend MakeBackendFunction(Compiler compiler); 85 typedef Backend MakeBackendFunction(Compiler compiler);
88 86
89 typedef CompilerDiagnosticReporter MakeReporterFunction( 87 typedef CompilerDiagnosticReporter MakeReporterFunction(
90 Compiler compiler, CompilerOptions options); 88 Compiler compiler, CompilerOptions options);
91 89
92 abstract class Compiler implements LibraryLoaderListener { 90 abstract class Compiler implements LibraryLoaderListener {
(...skipping 1180 matching lines...) Expand 10 before | Expand all | Expand 10 after
1273 } 1271 }
1274 1272
1275 ClassElement _mirrorsUsedClass; 1273 ClassElement _mirrorsUsedClass;
1276 ClassElement get mirrorsUsedClass => 1274 ClassElement get mirrorsUsedClass =>
1277 _mirrorsUsedClass ??= _findRequired(mirrorsLibrary, 'MirrorsUsed'); 1275 _mirrorsUsedClass ??= _findRequired(mirrorsLibrary, 'MirrorsUsed');
1278 1276
1279 bool isMirrorsUsedConstructor(ConstructorElement element) => 1277 bool isMirrorsUsedConstructor(ConstructorElement element) =>
1280 mirrorsLibrary != null && mirrorsUsedClass == element.enclosingClass; 1278 mirrorsLibrary != null && mirrorsUsedClass == element.enclosingClass;
1281 1279
1282 ConstructorElement _mirrorsUsedConstructor; 1280 ConstructorElement _mirrorsUsedConstructor;
1283 @override 1281
1284 ConstructorElement get mirrorsUsedConstructor { 1282 ConstructorElement get mirrorsUsedConstructor {
1285 if (_mirrorsUsedConstructor == null) { 1283 if (_mirrorsUsedConstructor == null) {
1286 ClassElement cls = mirrorsUsedClass; 1284 ClassElement cls = mirrorsUsedClass;
1287 if (cls != null) { 1285 if (cls != null) {
1288 cls.ensureResolved(resolution); 1286 cls.ensureResolved(resolution);
1289 _mirrorsUsedConstructor = cls.constructors.head; 1287 _mirrorsUsedConstructor = cls.constructors.head;
1290 } 1288 }
1291 } 1289 }
1292 return _mirrorsUsedConstructor; 1290 return _mirrorsUsedConstructor;
1293 } 1291 }
(...skipping 657 matching lines...) Expand 10 before | Expand all | Expand 10 after
1951 @override 1949 @override
1952 IdGenerator get idGenerator => _compiler.idGenerator; 1950 IdGenerator get idGenerator => _compiler.idGenerator;
1953 1951
1954 @override 1952 @override
1955 ConstantEnvironment get constants => _compiler.constants; 1953 ConstantEnvironment get constants => _compiler.constants;
1956 1954
1957 @override 1955 @override
1958 MirrorUsageAnalyzerTask get mirrorUsageAnalyzerTask => 1956 MirrorUsageAnalyzerTask get mirrorUsageAnalyzerTask =>
1959 _compiler.mirrorUsageAnalyzerTask; 1957 _compiler.mirrorUsageAnalyzerTask;
1960 1958
1961 @override
1962 LibraryElement get coreLibrary => _compiler._commonElements.coreLibrary; 1959 LibraryElement get coreLibrary => _compiler._commonElements.coreLibrary;
1963 1960
1964 @override 1961 @override
1965 bool get wasProxyConstantComputedTestingOnly => _proxyConstant != null; 1962 bool get wasProxyConstantComputedTestingOnly => _proxyConstant != null;
1966 1963
1967 @override 1964 @override
1968 void registerClass(ClassElement cls) { 1965 void registerClass(ClassElement cls) {
1969 enqueuer.worldBuilder.registerClass(cls); 1966 enqueuer.worldBuilder.registerClass(cls);
1970 } 1967 }
1971 1968
(...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after
2232 _ElementScanner(this.scanner); 2229 _ElementScanner(this.scanner);
2233 void scanLibrary(LibraryElement library) => scanner.scanLibrary(library); 2230 void scanLibrary(LibraryElement library) => scanner.scanLibrary(library);
2234 void scanUnit(CompilationUnitElement unit) => scanner.scan(unit); 2231 void scanUnit(CompilationUnitElement unit) => scanner.scan(unit);
2235 } 2232 }
2236 2233
2237 class _EmptyEnvironment implements Environment { 2234 class _EmptyEnvironment implements Environment {
2238 const _EmptyEnvironment(); 2235 const _EmptyEnvironment();
2239 2236
2240 String valueOf(String key) => null; 2237 String valueOf(String key) => null;
2241 } 2238 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/compile_time_constants.dart ('k') | pkg/compiler/lib/src/dart2js.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698