| 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 part of dart2js; | 5 part of dart2js; |
| 6 | 6 |
| 7 /** | 7 /** |
| 8 * If true, print a warning for each method that was resolved, but not | 8 * If true, print a warning for each method that was resolved, but not |
| 9 * compiled. | 9 * compiled. |
| 10 */ | 10 */ |
| (...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 209 final bool enableTypeAssertions; | 209 final bool enableTypeAssertions; |
| 210 final bool enableUserAssertions; | 210 final bool enableUserAssertions; |
| 211 final bool enableConcreteTypeInference; | 211 final bool enableConcreteTypeInference; |
| 212 /** | 212 /** |
| 213 * The maximum size of a concrete type before it widens to dynamic during | 213 * The maximum size of a concrete type before it widens to dynamic during |
| 214 * concrete type inference. | 214 * concrete type inference. |
| 215 */ | 215 */ |
| 216 final int maxConcreteTypeSize; | 216 final int maxConcreteTypeSize; |
| 217 final bool analyzeAll; | 217 final bool analyzeAll; |
| 218 final bool analyzeOnly; | 218 final bool analyzeOnly; |
| 219 /** |
| 220 * If true, skip analysis of method bodies and field initializers. Implies |
| 221 * [analyzeOnly]. |
| 222 */ |
| 223 final bool analyzeSignaturesOnly; |
| 219 final bool enableNativeLiveTypeAnalysis; | 224 final bool enableNativeLiveTypeAnalysis; |
| 220 final bool rejectDeprecatedFeatures; | 225 final bool rejectDeprecatedFeatures; |
| 221 final bool checkDeprecationInSdk; | 226 final bool checkDeprecationInSdk; |
| 222 | 227 |
| 223 /** | 228 /** |
| 224 * If [:true:], comment tokens are collected in [commentMap] during scanning. | 229 * If [:true:], comment tokens are collected in [commentMap] during scanning. |
| 225 */ | 230 */ |
| 226 final bool preserveComments; | 231 final bool preserveComments; |
| 227 | 232 |
| 228 final api.CompilerOutputProvider outputProvider; | 233 final api.CompilerOutputProvider outputProvider; |
| (...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 346 this.enableTypeAssertions: false, | 351 this.enableTypeAssertions: false, |
| 347 this.enableUserAssertions: false, | 352 this.enableUserAssertions: false, |
| 348 this.enableConcreteTypeInference: false, | 353 this.enableConcreteTypeInference: false, |
| 349 this.maxConcreteTypeSize: 5, | 354 this.maxConcreteTypeSize: 5, |
| 350 this.enableMinification: false, | 355 this.enableMinification: false, |
| 351 this.enableNativeLiveTypeAnalysis: false, | 356 this.enableNativeLiveTypeAnalysis: false, |
| 352 bool emitJavaScript: true, | 357 bool emitJavaScript: true, |
| 353 bool generateSourceMap: true, | 358 bool generateSourceMap: true, |
| 354 bool disallowUnsafeEval: false, | 359 bool disallowUnsafeEval: false, |
| 355 this.analyzeAll: false, | 360 this.analyzeAll: false, |
| 356 this.analyzeOnly: false, | 361 bool analyzeOnly: false, |
| 362 bool analyzeSignaturesOnly: false, |
| 357 this.rejectDeprecatedFeatures: false, | 363 this.rejectDeprecatedFeatures: false, |
| 358 this.checkDeprecationInSdk: false, | 364 this.checkDeprecationInSdk: false, |
| 359 this.preserveComments: false, | 365 this.preserveComments: false, |
| 360 outputProvider, | 366 outputProvider, |
| 361 List<String> strips: const []}) | 367 List<String> strips: const []}) |
| 362 : libraries = new Map<String, LibraryElement>(), | 368 : libraries = new Map<String, LibraryElement>(), |
| 363 progress = new Stopwatch(), | 369 progress = new Stopwatch(), |
| 370 this.analyzeOnly = analyzeOnly || analyzeSignaturesOnly, |
| 371 this.analyzeSignaturesOnly = analyzeSignaturesOnly, |
| 364 this.outputProvider = | 372 this.outputProvider = |
| 365 (outputProvider == null) ? NullSink.outputProvider : outputProvider | 373 (outputProvider == null) ? NullSink.outputProvider : outputProvider |
| 374 |
| 366 { | 375 { |
| 367 progress.start(); | 376 progress.start(); |
| 368 world = new World(this); | 377 world = new World(this); |
| 369 | 378 |
| 370 closureMapping.ClosureNamer closureNamer; | 379 closureMapping.ClosureNamer closureNamer; |
| 371 if (emitJavaScript) { | 380 if (emitJavaScript) { |
| 372 js_backend.JavaScriptBackend jsBackend = | 381 js_backend.JavaScriptBackend jsBackend = |
| 373 new js_backend.JavaScriptBackend(this, generateSourceMap, | 382 new js_backend.JavaScriptBackend(this, generateSourceMap, |
| 374 disallowUnsafeEval); | 383 disallowUnsafeEval); |
| 375 closureNamer = jsBackend.namer; | 384 closureNamer = jsBackend.namer; |
| (...skipping 782 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1158 | 1167 |
| 1159 void close() {} | 1168 void close() {} |
| 1160 | 1169 |
| 1161 toString() => name; | 1170 toString() => name; |
| 1162 | 1171 |
| 1163 /// Convenience method for getting an [api.CompilerOutputProvider]. | 1172 /// Convenience method for getting an [api.CompilerOutputProvider]. |
| 1164 static NullSink outputProvider(String name, String extension) { | 1173 static NullSink outputProvider(String name, String extension) { |
| 1165 return new NullSink('$name.$extension'); | 1174 return new NullSink('$name.$extension'); |
| 1166 } | 1175 } |
| 1167 } | 1176 } |
| OLD | NEW |