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 | 7 import 'dart:async' show |
8 EventSink, | 8 EventSink, |
9 Future; | 9 Future; |
10 | 10 |
(...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
181 final bool enableTypeAssertions; | 181 final bool enableTypeAssertions; |
182 final bool enableUserAssertions; | 182 final bool enableUserAssertions; |
183 final bool trustTypeAnnotations; | 183 final bool trustTypeAnnotations; |
184 final bool trustPrimitives; | 184 final bool trustPrimitives; |
185 final bool enableConcreteTypeInference; | 185 final bool enableConcreteTypeInference; |
186 final bool disableTypeInferenceFlag; | 186 final bool disableTypeInferenceFlag; |
187 final Uri deferredMapUri; | 187 final Uri deferredMapUri; |
188 final bool dumpInfo; | 188 final bool dumpInfo; |
189 final bool useContentSecurityPolicy; | 189 final bool useContentSecurityPolicy; |
190 final bool enableExperimentalMirrors; | 190 final bool enableExperimentalMirrors; |
| 191 final bool allowAssertMessage; |
191 | 192 |
192 /** | 193 /** |
193 * The maximum size of a concrete type before it widens to dynamic during | 194 * The maximum size of a concrete type before it widens to dynamic during |
194 * concrete type inference. | 195 * concrete type inference. |
195 */ | 196 */ |
196 final int maxConcreteTypeSize; | 197 final int maxConcreteTypeSize; |
197 final bool analyzeAllFlag; | 198 final bool analyzeAllFlag; |
198 final bool analyzeOnly; | 199 final bool analyzeOnly; |
199 | 200 |
200 /// If true, disable tree-shaking for the main script. | 201 /// If true, disable tree-shaking for the main script. |
(...skipping 311 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
512 bool useStartupEmitter: false, | 513 bool useStartupEmitter: false, |
513 this.useContentSecurityPolicy: false, | 514 this.useContentSecurityPolicy: false, |
514 this.suppressWarnings: false, | 515 this.suppressWarnings: false, |
515 this.fatalWarnings: false, | 516 this.fatalWarnings: false, |
516 bool hasIncrementalSupport: false, | 517 bool hasIncrementalSupport: false, |
517 this.enableExperimentalMirrors: false, | 518 this.enableExperimentalMirrors: false, |
518 this.allowNativeExtensions: false, | 519 this.allowNativeExtensions: false, |
519 this.generateCodeWithCompileTimeErrors: false, | 520 this.generateCodeWithCompileTimeErrors: false, |
520 this.testMode: false, | 521 this.testMode: false, |
521 api.CompilerOutput outputProvider, | 522 api.CompilerOutput outputProvider, |
522 List<String> strips: const []}) | 523 List<String> strips: const [], |
| 524 this.allowAssertMessage: false}) |
523 : this.disableTypeInferenceFlag = | 525 : this.disableTypeInferenceFlag = |
524 disableTypeInferenceFlag || !emitJavaScript, | 526 disableTypeInferenceFlag || !emitJavaScript, |
525 this.analyzeOnly = | 527 this.analyzeOnly = |
526 analyzeOnly || analyzeSignaturesOnly || analyzeAllFlag, | 528 analyzeOnly || analyzeSignaturesOnly || analyzeAllFlag, |
527 this.analyzeSignaturesOnly = analyzeSignaturesOnly, | 529 this.analyzeSignaturesOnly = analyzeSignaturesOnly, |
528 this.analyzeAllFlag = analyzeAllFlag, | 530 this.analyzeAllFlag = analyzeAllFlag, |
529 this.hasIncrementalSupport = hasIncrementalSupport, | 531 this.hasIncrementalSupport = hasIncrementalSupport, |
530 cacheStrategy = new CacheStrategy(hasIncrementalSupport), | 532 cacheStrategy = new CacheStrategy(hasIncrementalSupport), |
531 this.userOutputProvider = outputProvider == null | 533 this.userOutputProvider = outputProvider == null |
532 ? const NullCompilerOutput() : outputProvider { | 534 ? const NullCompilerOutput() : outputProvider { |
| 535 print("COMPILER: $allowAssertMessage"); |
533 if (hasIncrementalSupport) { | 536 if (hasIncrementalSupport) { |
534 // TODO(ahe): This is too much. Any method from platform and package | 537 // TODO(ahe): This is too much. Any method from platform and package |
535 // libraries can be inlined. | 538 // libraries can be inlined. |
536 disableInlining = true; | 539 disableInlining = true; |
537 } | 540 } |
538 world = new World(this); | 541 world = new World(this); |
539 // TODO(johnniwinther): Initialize core types in [initializeCoreClasses] and | 542 // TODO(johnniwinther): Initialize core types in [initializeCoreClasses] and |
540 // make its field final. | 543 // make its field final. |
541 _coreTypes = new _CompilerCoreTypes(this); | 544 _coreTypes = new _CompilerCoreTypes(this); |
542 types = new Types(this); | 545 types = new Types(this); |
(...skipping 1210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1753 | 1756 |
1754 @override | 1757 @override |
1755 InterfaceType streamType([DartType elementType]) { | 1758 InterfaceType streamType([DartType elementType]) { |
1756 InterfaceType type = streamClass.computeType(compiler); | 1759 InterfaceType type = streamClass.computeType(compiler); |
1757 if (elementType == null) { | 1760 if (elementType == null) { |
1758 return streamClass.rawType; | 1761 return streamClass.rawType; |
1759 } | 1762 } |
1760 return type.createInstantiation([elementType]); | 1763 return type.createInstantiation([elementType]); |
1761 } | 1764 } |
1762 } | 1765 } |
OLD | NEW |