| 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 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 verifyKernel = configuration['verify-ir']; | 70 bool verifyKernel = configuration['verify-ir']; |
| 71 bool useStandaloneDartK = configuration['use-standalone-dartk']; |
| 71 | 72 |
| 72 switch (compiler) { | 73 switch (compiler) { |
| 73 case 'dart2analyzer': | 74 case 'dart2analyzer': |
| 74 return new AnalyzerCompilerConfiguration( | 75 return new AnalyzerCompilerConfiguration( |
| 75 isDebug: isDebug, | 76 isDebug: isDebug, |
| 76 isChecked: isChecked, | 77 isChecked: isChecked, |
| 77 isStrong: isStrong, | 78 isStrong: isStrong, |
| 78 isHostChecked: isHostChecked, | 79 isHostChecked: isHostChecked, |
| 79 useSdk: useSdk); | 80 useSdk: useSdk); |
| 80 case 'dart2js': | 81 case 'dart2js': |
| (...skipping 11 matching lines...) Expand all Loading... |
| 92 return new Dart2AppSnapshotCompilerConfiguration( | 93 return new Dart2AppSnapshotCompilerConfiguration( |
| 93 isDebug: isDebug, isChecked: isChecked); | 94 isDebug: isDebug, isChecked: isChecked); |
| 94 case 'precompiler': | 95 case 'precompiler': |
| 95 return new PrecompilerCompilerConfiguration( | 96 return new PrecompilerCompilerConfiguration( |
| 96 isDebug: isDebug, | 97 isDebug: isDebug, |
| 97 isChecked: isChecked, | 98 isChecked: isChecked, |
| 98 arch: configuration['arch'], | 99 arch: configuration['arch'], |
| 99 useBlobs: useBlobs, | 100 useBlobs: useBlobs, |
| 100 isAndroid: configuration['system'] == 'android'); | 101 isAndroid: configuration['system'] == 'android'); |
| 101 case 'dartk': | 102 case 'dartk': |
| 102 return ComposedCompilerConfiguration.createDartKConfiguration( | 103 if (useStandaloneDartK) { |
| 103 isChecked: isChecked, | 104 return ComposedCompilerConfiguration.createDartKConfiguration( |
| 104 isHostChecked: isHostChecked, | 105 isChecked: isChecked, |
| 105 useSdk: useSdk, | 106 isHostChecked: isHostChecked, |
| 106 verify: verifyKernel, | 107 useSdk: useSdk, |
| 107 strong: isStrong); | 108 verify: verifyKernel, |
| 109 strong: isStrong); |
| 110 } |
| 111 |
| 112 return new NoneCompilerConfiguration( |
| 113 isDebug: isDebug, |
| 114 isChecked: isChecked, |
| 115 isHostChecked: isHostChecked, |
| 116 useSdk: useSdk, |
| 117 hotReload: hotReload, |
| 118 hotReloadRollback: hotReloadRollback, |
| 119 useDFEIsolate: true); |
| 120 |
| 108 case 'dartkp': | 121 case 'dartkp': |
| 109 return ComposedCompilerConfiguration.createDartKPConfiguration( | 122 return ComposedCompilerConfiguration.createDartKPConfiguration( |
| 110 isChecked: isChecked, | 123 isChecked: isChecked, |
| 111 isHostChecked: isHostChecked, | 124 isHostChecked: isHostChecked, |
| 112 arch: configuration['arch'], | 125 arch: configuration['arch'], |
| 113 useBlobs: useBlobs, | 126 useBlobs: useBlobs, |
| 114 isAndroid: configuration['system'] == 'android', | 127 isAndroid: configuration['system'] == 'android', |
| 115 useSdk: useSdk, | 128 useSdk: useSdk, |
| 116 verify: verifyKernel, | 129 verify: verifyKernel, |
| 117 strong: isStrong); | 130 strong: isStrong); |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 178 List<String> originalArguments, | 191 List<String> originalArguments, |
| 179 CommandArtifact artifact) { | 192 CommandArtifact artifact) { |
| 180 return <String>[artifact.filename]; | 193 return <String>[artifact.filename]; |
| 181 } | 194 } |
| 182 } | 195 } |
| 183 | 196 |
| 184 /// The "none" compiler. | 197 /// The "none" compiler. |
| 185 class NoneCompilerConfiguration extends CompilerConfiguration { | 198 class NoneCompilerConfiguration extends CompilerConfiguration { |
| 186 final bool hotReload; | 199 final bool hotReload; |
| 187 final bool hotReloadRollback; | 200 final bool hotReloadRollback; |
| 201 final bool useDFEIsolate; |
| 188 | 202 |
| 189 NoneCompilerConfiguration( | 203 NoneCompilerConfiguration( |
| 190 {bool isDebug, bool isChecked, bool isHostChecked, bool useSdk, | 204 {bool isDebug, bool isChecked, bool isHostChecked, bool useSdk, |
| 191 bool hotReload, | 205 bool this.hotReload, |
| 192 bool hotReloadRollback}) | 206 bool this.hotReloadRollback, |
| 207 bool this.useDFEIsolate: false}) |
| 193 : super._subclass( | 208 : super._subclass( |
| 194 isDebug: isDebug, | 209 isDebug: isDebug, |
| 195 isChecked: isChecked, | 210 isChecked: isChecked, |
| 196 isHostChecked: isHostChecked, | 211 isHostChecked: isHostChecked, |
| 197 useSdk: useSdk), | 212 useSdk: useSdk); |
| 198 this.hotReload = hotReload, | |
| 199 this.hotReloadRollback = hotReloadRollback; | |
| 200 | 213 |
| 201 bool get hasCompiler => false; | 214 bool get hasCompiler => false; |
| 202 | 215 |
| 203 List<String> computeRuntimeArguments( | 216 List<String> computeRuntimeArguments( |
| 204 RuntimeConfiguration runtimeConfiguration, | 217 RuntimeConfiguration runtimeConfiguration, |
| 205 String buildDir, | 218 String buildDir, |
| 206 TestInformation info, | 219 TestInformation info, |
| 207 List<String> vmOptions, | 220 List<String> vmOptions, |
| 208 List<String> sharedOptions, | 221 List<String> sharedOptions, |
| 209 List<String> originalArguments, | 222 List<String> originalArguments, |
| 210 CommandArtifact artifact) { | 223 CommandArtifact artifact) { |
| 211 List<String> args = []; | 224 List<String> args = []; |
| 225 if (useDFEIsolate) { |
| 226 args.add('--dfe=runtime/tools/kernel-service.dart'); |
| 227 } |
| 212 if (isChecked) { | 228 if (isChecked) { |
| 213 args.add('--enable_asserts'); | 229 args.add('--enable_asserts'); |
| 214 args.add('--enable_type_checks'); | 230 args.add('--enable_type_checks'); |
| 215 } | 231 } |
| 216 if (hotReload) { | 232 if (hotReload) { |
| 217 args.add('--hot-reload-test-mode'); | 233 args.add('--hot-reload-test-mode'); |
| 218 } else if (hotReloadRollback) { | 234 } else if (hotReloadRollback) { |
| 219 args.add('--hot-reload-rollback-test-mode'); | 235 args.add('--hot-reload-rollback-test-mode'); |
| 220 } | 236 } |
| 221 return args | 237 return args |
| (...skipping 676 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 898 RuntimeConfiguration runtimeConfiguration, | 914 RuntimeConfiguration runtimeConfiguration, |
| 899 String buildDir, | 915 String buildDir, |
| 900 TestInformation info, | 916 TestInformation info, |
| 901 List<String> vmOptions, | 917 List<String> vmOptions, |
| 902 List<String> sharedOptions, | 918 List<String> sharedOptions, |
| 903 List<String> originalArguments, | 919 List<String> originalArguments, |
| 904 CommandArtifact artifact) { | 920 CommandArtifact artifact) { |
| 905 return <String>[]; | 921 return <String>[]; |
| 906 } | 922 } |
| 907 } | 923 } |
| OLD | NEW |