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 83fcfbe20143d7f50f496363ca147276868e236a..f755cb886d2d7c0774e26be0bda712fb2c11b08f 100644 |
| --- a/tools/testing/dart/compiler_configuration.dart |
| +++ b/tools/testing/dart/compiler_configuration.dart |
| @@ -78,6 +78,9 @@ abstract class CompilerConfiguration { |
| isHostChecked: isHostChecked, useCps: useCps, useSdk: useSdk, |
| isCsp: isCsp, extraDart2jsOptions: |
| TestUtils.getExtraOptions(configuration, 'dart2js_options')); |
| + case 'precompiler': |
| + return new PrecompilerCompilerConfiguration( |
| + isDebug: isDebug, isChecked: isChecked); |
| case 'none': |
| return new NoneCompilerConfiguration( |
| isDebug: isDebug, isChecked: isChecked, |
| @@ -123,6 +126,12 @@ abstract class CompilerConfiguration { |
| return new CommandArtifact([], null, null); |
| } |
| + List<String> computeCompilerArguments(vmOptions, sharedOptions, args) { |
| + return new List<String>() |
| + ..addAll(sharedOptions) |
| + ..addAll(args); |
| + } |
| + |
| List<String> computeRuntimeArguments( |
| RuntimeConfiguration runtimeConfiguration, |
| String buildDir, |
| @@ -298,6 +307,92 @@ class Dart2jsCompilerConfiguration extends Dart2xCompilerConfiguration { |
| } |
| } |
| + |
| +class PrecompilerCompilerConfiguration extends CompilerConfiguration { |
| + PrecompilerCompilerConfiguration({ |
| + 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)], |
| + '$tempDir', |
| + 'application/dart-precompiled'); |
| + } |
| + |
| + CompilationCommand computeCompilationCommand( |
| + String outputFileName, |
|
Florian Schneider
2015/12/17 12:53:25
This is really the directory, right?
s/outputFile
rmacnak
2015/12/17 19:20:51
Yes.
|
| + String buildDir, |
| + CommandBuilder commandBuilder, |
| + List arguments, |
| + Map<String, String> environmentOverrides) { |
| + var exec = "$buildDir/dart"; |
| + var args = new List(); |
| + args.add("tools/precompilation/precompiler.dart"); |
| + args.add("$buildDir/dart_no_snapshot"); |
| + args.add("--gen-precompiled-snapshot=$outputFileName"); |
| + args.addAll(arguments); |
| + |
| + return commandBuilder.getCompilationCommand( |
| + 'precompiler.dart', outputFileName, !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); |
| + } |
| +} |
| + |
| + |
| /// Common configuration for analyzer-based tools, such as, dartanalyzer. |
| class AnalyzerCompilerConfiguration extends CompilerConfiguration { |
| final String moniker; |