| OLD | NEW |
| 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 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 82 import 'typechecker.dart' show TypeCheckerTask; | 82 import 'typechecker.dart' show TypeCheckerTask; |
| 83 import 'types/types.dart' as ti; | 83 import 'types/types.dart' as ti; |
| 84 import 'universe/call_structure.dart' show CallStructure; | 84 import 'universe/call_structure.dart' show CallStructure; |
| 85 import 'universe/selector.dart' show Selector; | 85 import 'universe/selector.dart' show Selector; |
| 86 import 'universe/universe.dart' show Universe; | 86 import 'universe/universe.dart' show Universe; |
| 87 import 'universe/use.dart' show StaticUse; | 87 import 'universe/use.dart' show StaticUse; |
| 88 import 'universe/world_impact.dart' show ImpactStrategy, WorldImpact; | 88 import 'universe/world_impact.dart' show ImpactStrategy, WorldImpact; |
| 89 import 'util/util.dart' show Link, Setlet; | 89 import 'util/util.dart' show Link, Setlet; |
| 90 import 'world.dart' show World; | 90 import 'world.dart' show World; |
| 91 | 91 |
| 92 abstract class Compiler implements LibraryLoaderListener, IdGenerator { | 92 abstract class Compiler implements LibraryLoaderListener { |
| 93 final Stopwatch totalCompileTime = new Stopwatch(); | 93 final Stopwatch totalCompileTime = new Stopwatch(); |
| 94 final IdGenerator idGenerator = new IdGenerator(); | 94 final IdGenerator idGenerator = new IdGenerator(); |
| 95 World world; | 95 World world; |
| 96 Types types; | 96 Types types; |
| 97 _CompilerCoreTypes _coreTypes; | 97 _CompilerCoreTypes _coreTypes; |
| 98 _CompilerDiagnosticReporter _reporter; | 98 _CompilerDiagnosticReporter _reporter; |
| 99 _CompilerResolution _resolution; | 99 _CompilerResolution _resolution; |
| 100 _CompilerParsing _parsing; | 100 _CompilerParsing _parsing; |
| 101 | 101 |
| 102 final CacheStrategy cacheStrategy; | 102 final CacheStrategy cacheStrategy; |
| (...skipping 281 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 384 Universe get resolverWorld => enqueuer.resolution.universe; | 384 Universe get resolverWorld => enqueuer.resolution.universe; |
| 385 Universe get codegenWorld => enqueuer.codegen.universe; | 385 Universe get codegenWorld => enqueuer.codegen.universe; |
| 386 | 386 |
| 387 bool get analyzeAll => options.analyzeAll || compileAll; | 387 bool get analyzeAll => options.analyzeAll || compileAll; |
| 388 | 388 |
| 389 bool get compileAll => false; | 389 bool get compileAll => false; |
| 390 | 390 |
| 391 bool get disableTypeInference => | 391 bool get disableTypeInference => |
| 392 options.disableTypeInference || compilationFailed; | 392 options.disableTypeInference || compilationFailed; |
| 393 | 393 |
| 394 // TODO(het): remove this and pass idGenerator directly instead | |
| 395 @deprecated | |
| 396 int getNextFreeId() => idGenerator.getNextFreeId(); | |
| 397 | |
| 398 void unimplemented(Spannable spannable, String methodName) { | 394 void unimplemented(Spannable spannable, String methodName) { |
| 399 reporter.internalError(spannable, "$methodName not implemented."); | 395 reporter.internalError(spannable, "$methodName not implemented."); |
| 400 } | 396 } |
| 401 | 397 |
| 402 // Compiles the dart script at [uri]. | 398 // Compiles the dart script at [uri]. |
| 403 // | 399 // |
| 404 // The resulting future will complete with true if the compilation | 400 // The resulting future will complete with true if the compilation |
| 405 // succeded. | 401 // succeded. |
| 406 Future<bool> run(Uri uri) { | 402 Future<bool> run(Uri uri) { |
| 407 totalCompileTime.start(); | 403 totalCompileTime.start(); |
| (...skipping 1665 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2073 _ElementScanner(this.scanner); | 2069 _ElementScanner(this.scanner); |
| 2074 void scanLibrary(LibraryElement library) => scanner.scanLibrary(library); | 2070 void scanLibrary(LibraryElement library) => scanner.scanLibrary(library); |
| 2075 void scanUnit(CompilationUnitElement unit) => scanner.scan(unit); | 2071 void scanUnit(CompilationUnitElement unit) => scanner.scan(unit); |
| 2076 } | 2072 } |
| 2077 | 2073 |
| 2078 class _EmptyEnvironment implements Environment { | 2074 class _EmptyEnvironment implements Environment { |
| 2079 const _EmptyEnvironment(); | 2075 const _EmptyEnvironment(); |
| 2080 | 2076 |
| 2081 String valueOf(String key) => null; | 2077 String valueOf(String key) => null; |
| 2082 } | 2078 } |
| OLD | NEW |