| 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 | 7 import 'dart:io' show |
| 8 Platform; | 8 Platform; |
| 9 | 9 |
| 10 import 'runtime_configuration.dart' show | 10 import 'runtime_configuration.dart' show |
| (...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 246 isHostChecked: isHostChecked, useSdk: useSdk); | 246 isHostChecked: isHostChecked, useSdk: useSdk); |
| 247 | 247 |
| 248 int computeTimeoutMultiplier() { | 248 int computeTimeoutMultiplier() { |
| 249 int multiplier = 1; | 249 int multiplier = 1; |
| 250 if (isDebug) multiplier *= 4; | 250 if (isDebug) multiplier *= 4; |
| 251 if (isChecked) multiplier *= 2; | 251 if (isChecked) multiplier *= 2; |
| 252 if (isHostChecked) multiplier *= 16; | 252 if (isHostChecked) multiplier *= 16; |
| 253 return multiplier; | 253 return multiplier; |
| 254 } | 254 } |
| 255 | 255 |
| 256 Map<String, String> envWithCpsFlag(Map<String, String> env) { | |
| 257 if (env != environmentOverridesCacheObject || cpsFlagCache == null) { | |
| 258 cpsFlagCache = { 'DART_VM_OPTIONS' : '-DUSE_CPS_IR=true' }; | |
| 259 if (env != null) { | |
| 260 cpsFlagCache.addAll(env); | |
| 261 } | |
| 262 environmentOverridesCacheObject = env; | |
| 263 } | |
| 264 return cpsFlagCache; | |
| 265 } | |
| 266 | |
| 267 CommandArtifact computeCompilationArtifact( | 256 CommandArtifact computeCompilationArtifact( |
| 268 String buildDir, | 257 String buildDir, |
| 269 String tempDir, | 258 String tempDir, |
| 270 CommandBuilder commandBuilder, | 259 CommandBuilder commandBuilder, |
| 271 List arguments, | 260 List arguments, |
| 272 Map<String, String> environmentOverrides) { | 261 Map<String, String> environmentOverrides) { |
| 273 var env = useCps ? envWithCpsFlag(environmentOverrides) : | 262 List compilerArguments = new List.from(arguments) |
| 274 environmentOverrides; | 263 ..addAll(extraDart2jsOptions); |
| 275 return new CommandArtifact( | 264 return new CommandArtifact( |
| 276 <Command>[ | 265 <Command>[ |
| 277 this.computeCompilationCommand( | 266 this.computeCompilationCommand( |
| 278 '$tempDir/out.js', | 267 '$tempDir/out.js', |
| 279 buildDir, | 268 buildDir, |
| 280 CommandBuilder.instance, | 269 CommandBuilder.instance, |
| 281 []..addAll(arguments)..addAll(extraDart2jsOptions), | 270 compilerArguments, |
| 282 env)], | 271 environmentOverrides)], |
| 283 '$tempDir/out.js', | 272 '$tempDir/out.js', |
| 284 'application/javascript'); | 273 'application/javascript'); |
| 285 } | 274 } |
| 286 | 275 |
| 287 List<String> computeRuntimeArguments( | 276 List<String> computeRuntimeArguments( |
| 288 RuntimeConfiguration runtimeConfiguration, | 277 RuntimeConfiguration runtimeConfiguration, |
| 289 String buildDir, | 278 String buildDir, |
| 290 TestInformation info, | 279 TestInformation info, |
| 291 List<String> vmOptions, | 280 List<String> vmOptions, |
| 292 List<String> sharedOptions, | 281 List<String> sharedOptions, |
| (...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 422 // shipped SDK, that is the script is not installed in | 411 // shipped SDK, that is the script is not installed in |
| 423 // "$buildDir/dart-sdk/bin/" | 412 // "$buildDir/dart-sdk/bin/" |
| 424 return '$prefix/dartanalyzer_developer$suffix'; | 413 return '$prefix/dartanalyzer_developer$suffix'; |
| 425 } | 414 } |
| 426 if (useSdk) { | 415 if (useSdk) { |
| 427 prefix = '$buildDir/dart-sdk/bin'; | 416 prefix = '$buildDir/dart-sdk/bin'; |
| 428 } | 417 } |
| 429 return '$prefix/dartanalyzer$suffix'; | 418 return '$prefix/dartanalyzer$suffix'; |
| 430 } | 419 } |
| 431 } | 420 } |
| OLD | NEW |