Chromium Code Reviews| 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; |
| 11 import 'common/backend_api.dart' show Backend; | |
| 12 import 'common/names.dart' show Selectors; | 11 import 'common/names.dart' show Selectors; |
| 13 import 'common/names.dart' show Identifiers, Uris; | 12 import 'common/names.dart' show Identifiers, Uris; |
| 14 import 'common/resolution.dart' | 13 import 'common/resolution.dart' |
| 15 show | 14 show |
| 16 ParsingContext, | 15 ParsingContext, |
| 17 Resolution, | 16 Resolution, |
| 18 ResolutionWorkItem, | 17 ResolutionWorkItem, |
| 19 ResolutionImpact, | 18 ResolutionImpact, |
| 20 Target; | 19 Target; |
| 21 import 'common/tasks.dart' show CompilerTask, GenericTask, Measurer; | 20 import 'common/tasks.dart' show CompilerTask, GenericTask, Measurer; |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 74 import 'types/types.dart' show GlobalTypeInferenceTask; | 73 import 'types/types.dart' show GlobalTypeInferenceTask; |
| 75 import 'universe/selector.dart' show Selector; | 74 import 'universe/selector.dart' show Selector; |
| 76 import 'universe/world_builder.dart' | 75 import 'universe/world_builder.dart' |
| 77 show ResolutionWorldBuilder, CodegenWorldBuilder; | 76 show ResolutionWorldBuilder, CodegenWorldBuilder; |
| 78 import 'universe/use.dart' show StaticUse, TypeUse; | 77 import 'universe/use.dart' show StaticUse, TypeUse; |
| 79 import 'universe/world_impact.dart' | 78 import 'universe/world_impact.dart' |
| 80 show ImpactStrategy, WorldImpact, WorldImpactBuilderImpl; | 79 show ImpactStrategy, WorldImpact, WorldImpactBuilderImpl; |
| 81 import 'util/util.dart' show Link, Setlet; | 80 import 'util/util.dart' show Link, Setlet; |
| 82 import 'world.dart' show ClosedWorld, ClosedWorldRefiner, ClosedWorldImpl; | 81 import 'world.dart' show ClosedWorld, ClosedWorldRefiner, ClosedWorldImpl; |
| 83 | 82 |
| 84 typedef Backend MakeBackendFunction(Compiler compiler); | 83 typedef js_backend.JavaScriptBackend MakeBackendFunction(Compiler compiler); |
|
Siggi Cherem (dart-lang)
2017/02/08 00:10:03
we might want to add a todo to remove this, we sho
Johnni Winther
2017/02/08 09:46:35
Done.
| |
| 85 | 84 |
| 86 typedef CompilerDiagnosticReporter MakeReporterFunction( | 85 typedef CompilerDiagnosticReporter MakeReporterFunction( |
| 87 Compiler compiler, CompilerOptions options); | 86 Compiler compiler, CompilerOptions options); |
| 88 | 87 |
| 89 abstract class Compiler implements LibraryLoaderListener { | 88 abstract class Compiler implements LibraryLoaderListener { |
| 90 Measurer get measurer; | 89 Measurer get measurer; |
| 91 | 90 |
| 92 final IdGenerator idGenerator = new IdGenerator(); | 91 final IdGenerator idGenerator = new IdGenerator(); |
| 93 Types types; | 92 Types types; |
| 94 _CompilerCommonElements _commonElements; | 93 _CompilerCommonElements _commonElements; |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 156 ScannerTask scanner; | 155 ScannerTask scanner; |
| 157 DietParserTask dietParser; | 156 DietParserTask dietParser; |
| 158 ParserTask parser; | 157 ParserTask parser; |
| 159 PatchParserTask patchParser; | 158 PatchParserTask patchParser; |
| 160 LibraryLoaderTask libraryLoader; | 159 LibraryLoaderTask libraryLoader; |
| 161 SerializationTask serialization; | 160 SerializationTask serialization; |
| 162 ResolverTask resolver; | 161 ResolverTask resolver; |
| 163 closureMapping.ClosureTask closureToClassMapper; | 162 closureMapping.ClosureTask closureToClassMapper; |
| 164 TypeCheckerTask checker; | 163 TypeCheckerTask checker; |
| 165 GlobalTypeInferenceTask globalInference; | 164 GlobalTypeInferenceTask globalInference; |
| 166 Backend backend; | 165 js_backend.JavaScriptBackend backend; |
| 167 | 166 |
| 168 GenericTask selfTask; | 167 GenericTask selfTask; |
| 169 | 168 |
| 170 /// The constant environment for the frontend interpretation of compile-time | 169 /// The constant environment for the frontend interpretation of compile-time |
| 171 /// constants. | 170 /// constants. |
| 172 ConstantEnvironment constants; | 171 ConstantEnvironment constants; |
| 173 | 172 |
| 174 EnqueueTask enqueuer; | 173 EnqueueTask enqueuer; |
| 175 DeferredLoadTask deferredLoadTask; | 174 DeferredLoadTask deferredLoadTask; |
| 176 MirrorUsageAnalyzerTask mirrorUsageAnalyzerTask; | 175 MirrorUsageAnalyzerTask mirrorUsageAnalyzerTask; |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 264 | 263 |
| 265 _parsingContext = | 264 _parsingContext = |
| 266 new ParsingContext(reporter, parser, scanner, patchParser, backend); | 265 new ParsingContext(reporter, parser, scanner, patchParser, backend); |
| 267 | 266 |
| 268 tasks.addAll(backend.tasks); | 267 tasks.addAll(backend.tasks); |
| 269 } | 268 } |
| 270 | 269 |
| 271 /// Creates the backend. | 270 /// Creates the backend. |
| 272 /// | 271 /// |
| 273 /// Override this to mock the backend for testing. | 272 /// Override this to mock the backend for testing. |
| 274 Backend createBackend() { | 273 js_backend.JavaScriptBackend createBackend() { |
| 275 return new js_backend.JavaScriptBackend(this, | 274 return new js_backend.JavaScriptBackend(this, |
| 276 generateSourceMap: options.generateSourceMap, | 275 generateSourceMap: options.generateSourceMap, |
| 277 useStartupEmitter: options.useStartupEmitter, | 276 useStartupEmitter: options.useStartupEmitter, |
| 278 useNewSourceInfo: options.useNewSourceInfo, | 277 useNewSourceInfo: options.useNewSourceInfo, |
| 279 useKernel: options.useKernel); | 278 useKernel: options.useKernel); |
| 280 } | 279 } |
| 281 | 280 |
| 282 /// Creates the scanner task. | 281 /// Creates the scanner task. |
| 283 /// | 282 /// |
| 284 /// Override this to mock the scanner for testing. | 283 /// Override this to mock the scanner for testing. |
| (...skipping 1813 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2098 if (library != null && library.isSynthesized) { | 2097 if (library != null && library.isSynthesized) { |
| 2099 return null; | 2098 return null; |
| 2100 } | 2099 } |
| 2101 if (library == null && required) { | 2100 if (library == null && required) { |
| 2102 throw new SpannableAssertionFailure( | 2101 throw new SpannableAssertionFailure( |
| 2103 library, "The library '${uri}' was not found."); | 2102 library, "The library '${uri}' was not found."); |
| 2104 } | 2103 } |
| 2105 return library; | 2104 return library; |
| 2106 } | 2105 } |
| 2107 } | 2106 } |
| OLD | NEW |