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 Future; | 7 import 'dart:async' show Future; |
8 | 8 |
9 import '../compiler_new.dart' as api; | 9 import '../compiler_new.dart' as api; |
10 import 'backend_strategy.dart'; | 10 import 'backend_strategy.dart'; |
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
191 : outputProvider { | 191 : outputProvider { |
192 if (makeReporter != null) { | 192 if (makeReporter != null) { |
193 _reporter = makeReporter(this, options); | 193 _reporter = makeReporter(this, options); |
194 } else { | 194 } else { |
195 _reporter = new CompilerDiagnosticReporter(this, options); | 195 _reporter = new CompilerDiagnosticReporter(this, options); |
196 } | 196 } |
197 frontEndStrategy = options.loadFromDill | 197 frontEndStrategy = options.loadFromDill |
198 ? new KernelFrontEndStrategy(reporter, environment) | 198 ? new KernelFrontEndStrategy(reporter, environment) |
199 : new ResolutionFrontEndStrategy(this); | 199 : new ResolutionFrontEndStrategy(this); |
200 backendStrategy = options.loadFromDill | 200 backendStrategy = options.loadFromDill |
201 ? new KernelBackendStrategy() | 201 ? new KernelBackendStrategy(this) |
202 : new ElementBackendStrategy(this); | 202 : new ElementBackendStrategy(this); |
203 _resolution = createResolution(); | 203 _resolution = createResolution(); |
204 _elementEnvironment = frontEndStrategy.elementEnvironment; | 204 _elementEnvironment = frontEndStrategy.elementEnvironment; |
205 _commonElements = new CommonElements(_elementEnvironment); | 205 _commonElements = new CommonElements(_elementEnvironment); |
206 types = new Types(_resolution); | 206 types = new Types(_resolution); |
207 | 207 |
208 if (options.verbose) { | 208 if (options.verbose) { |
209 progress = new Stopwatch()..start(); | 209 progress = new Stopwatch()..start(); |
210 } | 210 } |
211 | 211 |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
254 } | 254 } |
255 | 255 |
256 /// Creates the backend. | 256 /// Creates the backend. |
257 /// | 257 /// |
258 /// Override this to mock the backend for testing. | 258 /// Override this to mock the backend for testing. |
259 JavaScriptBackend createBackend() { | 259 JavaScriptBackend createBackend() { |
260 return new JavaScriptBackend(this, | 260 return new JavaScriptBackend(this, |
261 generateSourceMap: options.generateSourceMap, | 261 generateSourceMap: options.generateSourceMap, |
262 useStartupEmitter: options.useStartupEmitter, | 262 useStartupEmitter: options.useStartupEmitter, |
263 useMultiSourceInfo: options.useMultiSourceInfo, | 263 useMultiSourceInfo: options.useMultiSourceInfo, |
264 useNewSourceInfo: options.useNewSourceInfo, | 264 useNewSourceInfo: options.useNewSourceInfo); |
265 useKernel: options.useKernel); | |
266 } | 265 } |
267 | 266 |
268 /// Creates the scanner task. | 267 /// Creates the scanner task. |
269 /// | 268 /// |
270 /// Override this to mock the scanner for testing. | 269 /// Override this to mock the scanner for testing. |
271 ScannerTask createScannerTask() => | 270 ScannerTask createScannerTask() => |
272 new ScannerTask(dietParser, reporter, measurer, | 271 new ScannerTask(dietParser, reporter, measurer, |
273 preserveComments: options.preserveComments, commentMap: commentMap); | 272 preserveComments: options.preserveComments, commentMap: commentMap); |
274 | 273 |
275 /// Creates the resolution object. | 274 /// Creates the resolution object. |
(...skipping 1299 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1575 _ElementScanner(this.scanner); | 1574 _ElementScanner(this.scanner); |
1576 void scanLibrary(LibraryElement library) => scanner.scanLibrary(library); | 1575 void scanLibrary(LibraryElement library) => scanner.scanLibrary(library); |
1577 void scanUnit(CompilationUnitElement unit) => scanner.scan(unit); | 1576 void scanUnit(CompilationUnitElement unit) => scanner.scan(unit); |
1578 } | 1577 } |
1579 | 1578 |
1580 class _EmptyEnvironment implements Environment { | 1579 class _EmptyEnvironment implements Environment { |
1581 const _EmptyEnvironment(); | 1580 const _EmptyEnvironment(); |
1582 | 1581 |
1583 String valueOf(String key) => null; | 1582 String valueOf(String key) => null; |
1584 } | 1583 } |
OLD | NEW |