| 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 'closure.dart' as closureMapping show ClosureTask; | 10 import 'closure.dart' as closureMapping show ClosureTask; |
| (...skipping 25 matching lines...) Expand all Loading... |
| 36 import 'elements/resolution_types.dart' | 36 import 'elements/resolution_types.dart' |
| 37 show | 37 show |
| 38 ResolutionDartType, | 38 ResolutionDartType, |
| 39 ResolutionDynamicType, | 39 ResolutionDynamicType, |
| 40 ResolutionInterfaceType, | 40 ResolutionInterfaceType, |
| 41 Types; | 41 Types; |
| 42 import 'enqueue.dart' show Enqueuer, EnqueueTask, ResolutionEnqueuer; | 42 import 'enqueue.dart' show Enqueuer, EnqueueTask, ResolutionEnqueuer; |
| 43 import 'environment.dart'; | 43 import 'environment.dart'; |
| 44 import 'id_generator.dart'; | 44 import 'id_generator.dart'; |
| 45 import 'io/source_information.dart' show SourceInformation; | 45 import 'io/source_information.dart' show SourceInformation; |
| 46 import 'js_backend/js_backend.dart' as js_backend show JavaScriptBackend; | 46 import 'js_backend/backend.dart' show JavaScriptBackend; |
| 47 import 'library_loader.dart' | 47 import 'library_loader.dart' |
| 48 show | 48 show |
| 49 ElementScanner, | 49 ElementScanner, |
| 50 LibraryLoader, | 50 LibraryLoader, |
| 51 LibraryLoaderTask, | 51 LibraryLoaderTask, |
| 52 LoadedLibraries, | 52 LoadedLibraries, |
| 53 LibraryLoaderListener, | 53 LibraryLoaderListener, |
| 54 LibraryProvider, | 54 LibraryProvider, |
| 55 ScriptLoader; | 55 ScriptLoader; |
| 56 import 'mirrors_used.dart' show MirrorUsageAnalyzerTask; | 56 import 'mirrors_used.dart' show MirrorUsageAnalyzerTask; |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 144 ScannerTask scanner; | 144 ScannerTask scanner; |
| 145 DietParserTask dietParser; | 145 DietParserTask dietParser; |
| 146 ParserTask parser; | 146 ParserTask parser; |
| 147 PatchParserTask patchParser; | 147 PatchParserTask patchParser; |
| 148 LibraryLoaderTask libraryLoader; | 148 LibraryLoaderTask libraryLoader; |
| 149 SerializationTask serialization; | 149 SerializationTask serialization; |
| 150 ResolverTask resolver; | 150 ResolverTask resolver; |
| 151 closureMapping.ClosureTask closureToClassMapper; | 151 closureMapping.ClosureTask closureToClassMapper; |
| 152 TypeCheckerTask checker; | 152 TypeCheckerTask checker; |
| 153 GlobalTypeInferenceTask globalInference; | 153 GlobalTypeInferenceTask globalInference; |
| 154 js_backend.JavaScriptBackend backend; | 154 JavaScriptBackend backend; |
| 155 | 155 |
| 156 GenericTask selfTask; | 156 GenericTask selfTask; |
| 157 | 157 |
| 158 /// The constant environment for the frontend interpretation of compile-time | 158 /// The constant environment for the frontend interpretation of compile-time |
| 159 /// constants. | 159 /// constants. |
| 160 ConstantEnvironment constants; | 160 ConstantEnvironment constants; |
| 161 | 161 |
| 162 EnqueueTask enqueuer; | 162 EnqueueTask enqueuer; |
| 163 DeferredLoadTask deferredLoadTask; | 163 DeferredLoadTask deferredLoadTask; |
| 164 MirrorUsageAnalyzerTask mirrorUsageAnalyzerTask; | 164 MirrorUsageAnalyzerTask mirrorUsageAnalyzerTask; |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 243 | 243 |
| 244 _parsingContext = | 244 _parsingContext = |
| 245 new ParsingContext(reporter, parser, scanner, patchParser, backend); | 245 new ParsingContext(reporter, parser, scanner, patchParser, backend); |
| 246 | 246 |
| 247 tasks.addAll(backend.tasks); | 247 tasks.addAll(backend.tasks); |
| 248 } | 248 } |
| 249 | 249 |
| 250 /// Creates the backend. | 250 /// Creates the backend. |
| 251 /// | 251 /// |
| 252 /// Override this to mock the backend for testing. | 252 /// Override this to mock the backend for testing. |
| 253 js_backend.JavaScriptBackend createBackend() { | 253 JavaScriptBackend createBackend() { |
| 254 return new js_backend.JavaScriptBackend(this, | 254 return new JavaScriptBackend(this, |
| 255 generateSourceMap: options.generateSourceMap, | 255 generateSourceMap: options.generateSourceMap, |
| 256 useStartupEmitter: options.useStartupEmitter, | 256 useStartupEmitter: options.useStartupEmitter, |
| 257 useMultiSourceInfo: options.useMultiSourceInfo, | 257 useMultiSourceInfo: options.useMultiSourceInfo, |
| 258 useNewSourceInfo: options.useNewSourceInfo, | 258 useNewSourceInfo: options.useNewSourceInfo, |
| 259 useKernel: options.useKernel); | 259 useKernel: options.useKernel); |
| 260 } | 260 } |
| 261 | 261 |
| 262 /// Creates the scanner task. | 262 /// Creates the scanner task. |
| 263 /// | 263 /// |
| 264 /// Override this to mock the scanner for testing. | 264 /// Override this to mock the scanner for testing. |
| (...skipping 1367 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1632 @override | 1632 @override |
| 1633 ParsingContext get parsingContext => _compiler.parsingContext; | 1633 ParsingContext get parsingContext => _compiler.parsingContext; |
| 1634 | 1634 |
| 1635 @override | 1635 @override |
| 1636 CommonElements get commonElements => _compiler.commonElements; | 1636 CommonElements get commonElements => _compiler.commonElements; |
| 1637 | 1637 |
| 1638 @override | 1638 @override |
| 1639 Types get types => _compiler.types; | 1639 Types get types => _compiler.types; |
| 1640 | 1640 |
| 1641 @override | 1641 @override |
| 1642 Target get target => _compiler.backend; | 1642 Target get target => _compiler.backend.target; |
| 1643 | 1643 |
| 1644 @override | 1644 @override |
| 1645 ResolverTask get resolver => _compiler.resolver; | 1645 ResolverTask get resolver => _compiler.resolver; |
| 1646 | 1646 |
| 1647 @override | 1647 @override |
| 1648 ResolutionEnqueuer get enqueuer => _compiler.enqueuer.resolution; | 1648 ResolutionEnqueuer get enqueuer => _compiler.enqueuer.resolution; |
| 1649 | 1649 |
| 1650 @override | 1650 @override |
| 1651 CompilerOptions get options => _compiler.options; | 1651 CompilerOptions get options => _compiler.options; |
| 1652 | 1652 |
| (...skipping 384 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2037 if (library != null && library.isSynthesized) { | 2037 if (library != null && library.isSynthesized) { |
| 2038 return null; | 2038 return null; |
| 2039 } | 2039 } |
| 2040 if (library == null && required) { | 2040 if (library == null && required) { |
| 2041 throw new SpannableAssertionFailure( | 2041 throw new SpannableAssertionFailure( |
| 2042 library, "The library '${uri}' was not found."); | 2042 library, "The library '${uri}' was not found."); |
| 2043 } | 2043 } |
| 2044 return library; | 2044 return library; |
| 2045 } | 2045 } |
| 2046 } | 2046 } |
| OLD | NEW |