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 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 700 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 711 * If true, stop compilation after type inference is complete. Used for | 711 * If true, stop compilation after type inference is complete. Used for |
| 712 * debugging and testing purposes only. | 712 * debugging and testing purposes only. |
| 713 */ | 713 */ |
| 714 bool stopAfterTypeInference = false; | 714 bool stopAfterTypeInference = false; |
| 715 | 715 |
| 716 /** | 716 /** |
| 717 * If [:true:], comment tokens are collected in [commentMap] during scanning. | 717 * If [:true:], comment tokens are collected in [commentMap] during scanning. |
| 718 */ | 718 */ |
| 719 final bool preserveComments; | 719 final bool preserveComments; |
| 720 | 720 |
| 721 /// Use the cew CPS based backend end. This flag works for the Dart and JS | |
|
Johnni Winther
2015/04/16 09:17:05
'cew' -> 'new'
'flag works for the Dart' -> 'flag
karlklose
2015/04/16 11:21:46
Done.
| |
| 722 /// backend. | |
| 723 final bool useCpsIr; | |
| 724 | |
| 721 /** | 725 /** |
| 722 * Is the compiler in verbose mode. | 726 * Is the compiler in verbose mode. |
| 723 */ | 727 */ |
| 724 final bool verbose; | 728 final bool verbose; |
| 725 | 729 |
| 726 /** | 730 /** |
| 727 * URI of the main source map if the compiler is generating source | 731 * URI of the main source map if the compiler is generating source |
| 728 * maps. | 732 * maps. |
| 729 */ | 733 */ |
| 730 final Uri sourceMapUri; | 734 final Uri sourceMapUri; |
| (...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 993 this.preserveUris: false, | 997 this.preserveUris: false, |
| 994 this.enableNativeLiveTypeAnalysis: false, | 998 this.enableNativeLiveTypeAnalysis: false, |
| 995 bool emitJavaScript: true, | 999 bool emitJavaScript: true, |
| 996 bool dart2dartMultiFile: false, | 1000 bool dart2dartMultiFile: false, |
| 997 bool generateSourceMap: true, | 1001 bool generateSourceMap: true, |
| 998 bool analyzeAllFlag: false, | 1002 bool analyzeAllFlag: false, |
| 999 bool analyzeOnly: false, | 1003 bool analyzeOnly: false, |
| 1000 this.analyzeMain: false, | 1004 this.analyzeMain: false, |
| 1001 bool analyzeSignaturesOnly: false, | 1005 bool analyzeSignaturesOnly: false, |
| 1002 this.preserveComments: false, | 1006 this.preserveComments: false, |
| 1007 this.useCpsIr: false, | |
| 1003 this.verbose: false, | 1008 this.verbose: false, |
| 1004 this.sourceMapUri: null, | 1009 this.sourceMapUri: null, |
| 1005 this.outputUri: null, | 1010 this.outputUri: null, |
| 1006 this.buildId: UNDETERMINED_BUILD_ID, | 1011 this.buildId: UNDETERMINED_BUILD_ID, |
| 1007 this.terseDiagnostics: false, | 1012 this.terseDiagnostics: false, |
| 1008 this.deferredMapUri: null, | 1013 this.deferredMapUri: null, |
| 1009 this.dumpInfo: false, | 1014 this.dumpInfo: false, |
| 1010 this.showPackageWarnings: false, | 1015 this.showPackageWarnings: false, |
| 1011 this.useContentSecurityPolicy: false, | 1016 this.useContentSecurityPolicy: false, |
| 1012 this.suppressWarnings: false, | 1017 this.suppressWarnings: false, |
| (...skipping 450 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1463 mainApp = library; | 1468 mainApp = library; |
| 1464 }); | 1469 }); |
| 1465 } | 1470 } |
| 1466 }).then((_) { | 1471 }).then((_) { |
| 1467 compileLoadedLibraries(); | 1472 compileLoadedLibraries(); |
| 1468 }); | 1473 }); |
| 1469 } | 1474 } |
| 1470 | 1475 |
| 1471 bool irEnabled() { | 1476 bool irEnabled() { |
| 1472 // TODO(sigurdm,kmillikin): Support checked-mode checks. | 1477 // TODO(sigurdm,kmillikin): Support checked-mode checks. |
| 1473 return const bool.fromEnvironment('USE_NEW_BACKEND') && | 1478 return useCpsIr && |
| 1474 backend is DartBackend && | 1479 backend is DartBackend && |
| 1475 !enableTypeAssertions && | 1480 !enableTypeAssertions && |
| 1476 !enableConcreteTypeInference; | 1481 !enableConcreteTypeInference; |
| 1477 } | 1482 } |
| 1478 | 1483 |
| 1479 void computeMain() { | 1484 void computeMain() { |
| 1480 if (mainApp == null) return; | 1485 if (mainApp == null) return; |
| 1481 | 1486 |
| 1482 Element main = mainApp.findExported(MAIN); | 1487 Element main = mainApp.findExported(MAIN); |
| 1483 ErroneousElement errorElement = null; | 1488 ErroneousElement errorElement = null; |
| (...skipping 932 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2416 return futureClass.computeType(compiler).createInstantiation([elementType]); | 2421 return futureClass.computeType(compiler).createInstantiation([elementType]); |
| 2417 } | 2422 } |
| 2418 | 2423 |
| 2419 @override | 2424 @override |
| 2420 InterfaceType streamType([DartType elementType = const DynamicType()]) { | 2425 InterfaceType streamType([DartType elementType = const DynamicType()]) { |
| 2421 return streamClass.computeType(compiler).createInstantiation([elementType]); | 2426 return streamClass.computeType(compiler).createInstantiation([elementType]); |
| 2422 } | 2427 } |
| 2423 } | 2428 } |
| 2424 | 2429 |
| 2425 typedef void InternalErrorFunction(Spannable location, String message); | 2430 typedef void InternalErrorFunction(Spannable location, String message); |
| OLD | NEW |