Chromium Code Reviews| Index: tools/testing/dart/compiler_configuration.dart |
| diff --git a/tools/testing/dart/compiler_configuration.dart b/tools/testing/dart/compiler_configuration.dart |
| index 70c1264d9c921beaa15159ab90589525b2341767..296f61535757e4d7ad52222d3f52f30e5c1017fa 100644 |
| --- a/tools/testing/dart/compiler_configuration.dart |
| +++ b/tools/testing/dart/compiler_configuration.dart |
| @@ -73,6 +73,9 @@ abstract class CompilerConfiguration { |
| isHostChecked: isHostChecked, useCps: useCps, useSdk: useSdk, |
| isCsp: isCsp, extraDart2jsOptions: |
| TestUtils.getExtraOptions(configuration, 'dart2js_options')); |
| + case 'dart2snapshot': |
|
siva
2016/02/09 18:59:50
As discussed offline maybe dartproduction or dartd
|
| + return new Dart2SnapshotCompilerConfiguration( |
| + isDebug: isDebug, isChecked: isChecked); |
| case 'precompiler': |
| return new PrecompilerCompilerConfiguration( |
| isDebug: isDebug, isChecked: isChecked); |
| @@ -394,6 +397,93 @@ class PrecompilerCompilerConfiguration extends CompilerConfiguration { |
| } |
| +class Dart2SnapshotCompilerConfiguration extends CompilerConfiguration { |
| + Dart2SnapshotCompilerConfiguration({ |
| + bool isDebug, |
| + bool isChecked}) |
| + : super._subclass(isDebug: isDebug, isChecked: isChecked); |
| + |
| + int computeTimeoutMultiplier() { |
| + int multiplier = 2; |
| + if (isDebug) multiplier *= 4; |
| + if (isChecked) multiplier *= 2; |
| + return multiplier; |
| + } |
| + |
| + CommandArtifact computeCompilationArtifact( |
| + String buildDir, |
| + String tempDir, |
| + CommandBuilder commandBuilder, |
| + List arguments, |
| + Map<String, String> environmentOverrides) { |
| + return new CommandArtifact( |
| + <Command>[ |
| + this.computeCompilationCommand( |
| + tempDir, |
| + buildDir, |
| + CommandBuilder.instance, |
| + arguments, |
| + environmentOverrides)], |
| + computeOutputName(tempDir), |
| + 'application/dart-snapshot'); |
| + } |
| + |
| + String computeOutputName(String tempDir) { |
| + return '$tempDir/test.snapshot'; |
| + } |
| + |
| + CompilationCommand computeCompilationCommand( |
| + String tempDir, |
| + String buildDir, |
| + CommandBuilder commandBuilder, |
| + List arguments, |
| + Map<String, String> environmentOverrides) { |
| + var exec = "$buildDir/dart_no_snapshot"; |
| + var args = new List(); |
| + args.add("--full-snapshot-after-run=${computeOutputName(tempDir)}"); |
| + args.addAll(arguments); |
| + |
| + return commandBuilder.getCompilationCommand( |
| + 'dart2snapshot', computeOutputName(tempDir), !useSdk, |
| + bootstrapDependencies(buildDir), |
| + exec, args, environmentOverrides); |
| + } |
| + |
| + List<String> computeCompilerArguments(vmOptions, |
| + sharedOptions, |
| + originalArguments) { |
| + List<String> args = []; |
| + if (isChecked) { |
| + args.add('--enable_asserts'); |
| + args.add('--enable_type_checks'); |
| + } |
| + return args |
| + ..addAll(vmOptions) |
| + ..addAll(sharedOptions) |
| + ..addAll(originalArguments); |
| + } |
| + |
| + List<String> computeRuntimeArguments( |
| + RuntimeConfiguration runtimeConfiguration, |
| + String buildDir, |
| + TestInformation info, |
| + List<String> vmOptions, |
| + List<String> sharedOptions, |
| + List<String> originalArguments, |
| + CommandArtifact artifact) { |
| + List<String> args = []; |
| + if (isChecked) { |
| + args.add('--enable_asserts'); |
| + args.add('--enable_type_checks'); |
| + } |
| + return args |
| + ..addAll(vmOptions) |
| + ..addAll(sharedOptions) |
| + ..addAll(originalArguments); |
| + } |
| +} |
| + |
| + |
| class AnalyzerCompilerConfiguration extends CompilerConfiguration { |
| AnalyzerCompilerConfiguration( |
| {bool isDebug, |