| OLD | NEW |
| 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, 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 compiler_configuration; | 5 library compiler_configuration; |
| 6 | 6 |
| 7 import 'dart:io' show Platform; | 7 import 'dart:io' show Platform; |
| 8 | 8 |
| 9 import 'runtime_configuration.dart' show RuntimeConfiguration; | 9 import 'runtime_configuration.dart' show RuntimeConfiguration; |
| 10 import 'runtime_configuration.dart' show DartPrecompiledAdbRuntimeConfiguration; | 10 import 'runtime_configuration.dart' show DartPrecompiledAdbRuntimeConfiguration; |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 60 bool isChecked = configuration['checked']; | 60 bool isChecked = configuration['checked']; |
| 61 bool isStrong = configuration['strong']; | 61 bool isStrong = configuration['strong']; |
| 62 bool isHostChecked = configuration['host_checked']; | 62 bool isHostChecked = configuration['host_checked']; |
| 63 bool useSdk = configuration['use_sdk']; | 63 bool useSdk = configuration['use_sdk']; |
| 64 bool isCsp = configuration['csp']; | 64 bool isCsp = configuration['csp']; |
| 65 bool useCps = configuration['cps_ir']; | 65 bool useCps = configuration['cps_ir']; |
| 66 bool useBlobs = configuration['use_blobs']; | 66 bool useBlobs = configuration['use_blobs']; |
| 67 bool hotReload = configuration['hot_reload']; | 67 bool hotReload = configuration['hot_reload']; |
| 68 bool hotReloadRollback = configuration['hot_reload_rollback']; | 68 bool hotReloadRollback = configuration['hot_reload_rollback']; |
| 69 bool useFastStartup = configuration['fast_startup']; | 69 bool useFastStartup = configuration['fast_startup']; |
| 70 bool useKernelInDart2js = configuration['dart2js_with_kernel']; |
| 70 bool verifyKernel = configuration['verify-ir']; | 71 bool verifyKernel = configuration['verify-ir']; |
| 71 bool useDFE = configuration['useDFE']; | 72 bool useDFE = configuration['useDFE']; |
| 72 bool useFasta = configuration['useFasta']; | 73 bool useFasta = configuration['useFasta']; |
| 73 bool treeShake = !configuration['no-tree-shake']; | 74 bool treeShake = !configuration['no-tree-shake']; |
| 74 | 75 |
| 75 switch (compiler) { | 76 switch (compiler) { |
| 76 case 'dart2analyzer': | 77 case 'dart2analyzer': |
| 77 return new AnalyzerCompilerConfiguration( | 78 return new AnalyzerCompilerConfiguration( |
| 78 isDebug: isDebug, | 79 isDebug: isDebug, |
| 79 isChecked: isChecked, | 80 isChecked: isChecked, |
| 80 isStrong: isStrong, | 81 isStrong: isStrong, |
| 81 isHostChecked: isHostChecked, | 82 isHostChecked: isHostChecked, |
| 82 useSdk: useSdk); | 83 useSdk: useSdk); |
| 83 case 'dart2js': | 84 case 'dart2js': |
| 84 return new Dart2jsCompilerConfiguration( | 85 return new Dart2jsCompilerConfiguration( |
| 85 isDebug: isDebug, | 86 isDebug: isDebug, |
| 86 isChecked: isChecked, | 87 isChecked: isChecked, |
| 87 isHostChecked: isHostChecked, | 88 isHostChecked: isHostChecked, |
| 88 useCps: useCps, | 89 useCps: useCps, |
| 89 useSdk: useSdk, | 90 useSdk: useSdk, |
| 90 isCsp: isCsp, | 91 isCsp: isCsp, |
| 91 useFastStartup: useFastStartup, | 92 useFastStartup: useFastStartup, |
| 93 useKernel: useKernelInDart2js, |
| 92 extraDart2jsOptions: | 94 extraDart2jsOptions: |
| 93 TestUtils.getExtraOptions(configuration, 'dart2js_options')); | 95 TestUtils.getExtraOptions(configuration, 'dart2js_options')); |
| 94 case 'app_jit': | 96 case 'app_jit': |
| 95 return new Dart2AppSnapshotCompilerConfiguration( | 97 return new Dart2AppSnapshotCompilerConfiguration( |
| 96 isDebug: isDebug, isChecked: isChecked); | 98 isDebug: isDebug, isChecked: isChecked); |
| 97 case 'precompiler': | 99 case 'precompiler': |
| 98 return new PrecompilerCompilerConfiguration( | 100 return new PrecompilerCompilerConfiguration( |
| 99 isDebug: isDebug, | 101 isDebug: isDebug, |
| 100 isChecked: isChecked, | 102 isChecked: isChecked, |
| 101 arch: configuration['arch'], | 103 arch: configuration['arch'], |
| (...skipping 426 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 528 .resolve('dart-sdk/bin/snapshots/dart2js.dart.snapshot') | 530 .resolve('dart-sdk/bin/snapshots/dart2js.dart.snapshot') |
| 529 ]); | 531 ]); |
| 530 } | 532 } |
| 531 } | 533 } |
| 532 | 534 |
| 533 /// Configuration for dart2js compiler. | 535 /// Configuration for dart2js compiler. |
| 534 class Dart2jsCompilerConfiguration extends Dart2xCompilerConfiguration { | 536 class Dart2jsCompilerConfiguration extends Dart2xCompilerConfiguration { |
| 535 final bool isCsp; | 537 final bool isCsp; |
| 536 final bool useCps; | 538 final bool useCps; |
| 537 final bool useFastStartup; | 539 final bool useFastStartup; |
| 540 final bool useKernel; |
| 538 final List<String> extraDart2jsOptions; | 541 final List<String> extraDart2jsOptions; |
| 539 // We cache the extended environment to save memory. | 542 // We cache the extended environment to save memory. |
| 540 static Map<String, String> cpsFlagCache; | 543 static Map<String, String> cpsFlagCache; |
| 541 static Map<String, String> environmentOverridesCacheObject; | 544 static Map<String, String> environmentOverridesCacheObject; |
| 542 | 545 |
| 543 Dart2jsCompilerConfiguration( | 546 Dart2jsCompilerConfiguration( |
| 544 {bool isDebug, | 547 {bool isDebug, |
| 545 bool isChecked, | 548 bool isChecked, |
| 546 bool isHostChecked, | 549 bool isHostChecked, |
| 547 bool useSdk, | 550 bool useSdk, |
| 548 bool this.useCps, | 551 bool this.useCps, |
| 549 bool this.isCsp, | 552 bool this.isCsp, |
| 550 bool this.useFastStartup, | 553 bool this.useFastStartup, |
| 554 this.useKernel, |
| 551 this.extraDart2jsOptions}) | 555 this.extraDart2jsOptions}) |
| 552 : super('dart2js', | 556 : super('dart2js', |
| 553 isDebug: isDebug, | 557 isDebug: isDebug, |
| 554 isChecked: isChecked, | 558 isChecked: isChecked, |
| 555 isHostChecked: isHostChecked, | 559 isHostChecked: isHostChecked, |
| 556 useSdk: useSdk); | 560 useSdk: useSdk); |
| 557 | 561 |
| 558 int computeTimeoutMultiplier() { | 562 int computeTimeoutMultiplier() { |
| 559 int multiplier = 1; | 563 int multiplier = 1; |
| 560 if (isDebug) multiplier *= 4; | 564 if (isDebug) multiplier *= 4; |
| (...skipping 367 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 928 RuntimeConfiguration runtimeConfiguration, | 932 RuntimeConfiguration runtimeConfiguration, |
| 929 String buildDir, | 933 String buildDir, |
| 930 TestInformation info, | 934 TestInformation info, |
| 931 List<String> vmOptions, | 935 List<String> vmOptions, |
| 932 List<String> sharedOptions, | 936 List<String> sharedOptions, |
| 933 List<String> originalArguments, | 937 List<String> originalArguments, |
| 934 CommandArtifact artifact) { | 938 CommandArtifact artifact) { |
| 935 return <String>[]; | 939 return <String>[]; |
| 936 } | 940 } |
| 937 } | 941 } |
| OLD | NEW |