Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(51)

Unified Diff: tools/testing/dart/compiler_configuration.dart

Issue 1085803002: Add a --cps-ir flag to the testing script to allow us to run with the new cps based backend in dart… (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: more foobar Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | tools/testing/dart/test_options.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/testing/dart/compiler_configuration.dart
diff --git a/tools/testing/dart/compiler_configuration.dart b/tools/testing/dart/compiler_configuration.dart
index 668804a361ae5f852b267da6d1aa989aa6664a93..1200392d147219c76aa1bd2adae1c80eb81cc1cc 100644
--- a/tools/testing/dart/compiler_configuration.dart
+++ b/tools/testing/dart/compiler_configuration.dart
@@ -60,6 +60,7 @@ abstract class CompilerConfiguration {
bool isHostChecked = configuration['host_checked'];
bool useSdk = configuration['use_sdk'];
bool isCsp = configuration['csp'];
+ bool useCps = configuration['cps_ir'];
switch (compiler) {
case 'dartanalyzer':
@@ -73,8 +74,8 @@ abstract class CompilerConfiguration {
case 'dart2js':
return new Dart2jsCompilerConfiguration(
isDebug: isDebug, isChecked: isChecked,
- isHostChecked: isHostChecked, useSdk: useSdk, isCsp: isCsp,
- extraDart2jsOptions:
+ isHostChecked: isHostChecked, useCps: useCps, useSdk: useSdk,
+ isCsp: isCsp, extraDart2jsOptions:
TestUtils.getExtraOptions(configuration, 'dart2js_options'));
case 'dart2dart':
return new Dart2dartCompilerConfiguration(
@@ -225,13 +226,18 @@ class Dart2xCompilerConfiguration extends CompilerConfiguration {
/// Configuration for dart2js compiler.
class Dart2jsCompilerConfiguration extends Dart2xCompilerConfiguration {
final bool isCsp;
+ final bool useCps;
final List<String> extraDart2jsOptions;
+ // We cache the extended environment to save memory.
+ static Map<String, String> cpsFlagCache;
+ static Map<String, String> environmentOverridesCacheObject;
Dart2jsCompilerConfiguration({
bool isDebug,
bool isChecked,
bool isHostChecked,
bool useSdk,
+ bool this.useCps,
bool this.isCsp,
this.extraDart2jsOptions})
: super(
@@ -247,12 +253,25 @@ class Dart2jsCompilerConfiguration extends Dart2xCompilerConfiguration {
return multiplier;
}
+ Map<String, String> envWithCpsFlag(Map<String, String> env) {
+ if (env != environmentOverridesCacheObject || cpsFlagCache == null) {
+ cpsFlagCache = { 'DART_VM_OPTIONS' : '-DUSE_CPS_IR=true' };
+ if (env != null) {
+ cpsFlagCache.addAll(env);
+ }
+ environmentOverridesCacheObject = env;
+ }
+ return cpsFlagCache;
+ }
+
CommandArtifact computeCompilationArtifact(
String buildDir,
String tempDir,
CommandBuilder commandBuilder,
List arguments,
Map<String, String> environmentOverrides) {
+ var env = useCps ? envWithCpsFlag(environmentOverrides) :
+ environmentOverrides;
return new CommandArtifact(
<Command>[
this.computeCompilationCommand(
@@ -260,7 +279,7 @@ class Dart2jsCompilerConfiguration extends Dart2xCompilerConfiguration {
buildDir,
CommandBuilder.instance,
[]..addAll(arguments)..addAll(extraDart2jsOptions),
- environmentOverrides)],
+ env)],
'$tempDir/out.js',
'application/javascript');
}
« no previous file with comments | « no previous file | tools/testing/dart/test_options.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698