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

Side by Side Diff: tools/testing/dart/compiler_configuration.dart

Issue 1922163002: Initial support to test.dart for running precompiler tests on android devices (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Some fixes Created 4 years, 7 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 unified diff | Download patch
OLDNEW
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 10
(...skipping 328 matching lines...) Expand 10 before | Expand all | Expand 10 after
339 CommandBuilder commandBuilder, 339 CommandBuilder commandBuilder,
340 List arguments, 340 List arguments,
341 Map<String, String> environmentOverrides) { 341 Map<String, String> environmentOverrides) {
342 var exec = "$buildDir/dart_bootstrap"; 342 var exec = "$buildDir/dart_bootstrap";
343 var args = new List(); 343 var args = new List();
344 args.add("--gen-precompiled-snapshot=$tempDir"); 344 args.add("--gen-precompiled-snapshot=$tempDir");
345 if (useBlobs) { 345 if (useBlobs) {
346 args.add("--use_blobs"); 346 args.add("--use_blobs");
347 } 347 }
348 args.addAll(arguments); 348 args.addAll(arguments);
349 if (arch == 'arm') {
350 args.add('--no-sim-use-hardfp');
Bill Hesse 2016/04/27 12:22:32 I think this should be before the arguments parame
kustermann 2016/04/27 13:25:09 It is in the latest patchset.
351 }
349 352
350 return commandBuilder.getCompilationCommand('precompiler', tempDir, !useSdk, 353 return commandBuilder.getCompilationCommand('precompiler', tempDir, !useSdk,
351 bootstrapDependencies(buildDir), exec, args, environmentOverrides); 354 bootstrapDependencies(buildDir), exec, args, environmentOverrides);
352 } 355 }
353 356
354 CompilationCommand computeAssembleCommand( 357 CompilationCommand computeAssembleCommand(
355 String tempDir, 358 String tempDir,
356 String buildDir, 359 String buildDir,
357 CommandBuilder commandBuilder, 360 CommandBuilder commandBuilder,
358 List arguments, 361 List arguments,
359 Map<String, String> environmentOverrides) { 362 Map<String, String> environmentOverrides) {
360 var cc, cc_flags, shared, libname; 363 var cc, cc_flags, shared, libname;
361 if (Platform.isLinux) { 364 if (Platform.isLinux) {
362 cc = 'gcc'; 365 cc = 'gcc';
363 shared = '-shared'; 366 shared = '-shared';
364 libname = 'libprecompiled.so'; 367 libname = 'libprecompiled.so';
365 } else if (Platform.isMacOS) { 368 } else if (Platform.isMacOS) {
366 cc = 'clang'; 369 cc = 'clang';
367 shared = '-dynamiclib'; 370 shared = '-dynamiclib';
368 libname = 'libprecompiled.dylib'; 371 libname = 'libprecompiled.dylib';
369 } else { 372 } else {
370 throw "Platform not supported: ${Platform.operatingSystem}"; 373 throw "Platform not supported: ${Platform.operatingSystem}";
371 } 374 }
372 375
373 if (arch == 'x64') { 376 if (arch == 'x64') {
374 cc_flags = "-m64"; 377 cc_flags = "-m64";
375 } else if (arch == 'simarm64') { 378 } else if (arch == 'simarm64') {
376 cc_flags = "-m64"; 379 cc_flags = "-m64";
380 } else if (arch == 'ia32') {
381 cc_flags = "-m32";
377 } else if (arch == 'simarm') { 382 } else if (arch == 'simarm') {
378 cc_flags = "-m32"; 383 cc_flags = "-m32";
379 } else if (arch == 'simmips') { 384 } else if (arch == 'simmips') {
380 cc_flags = "-m32"; 385 cc_flags = "-m32";
381 } else if (arch == 'arm') { 386 } else if (arch == 'arm') {
387 // TODO: If we're not using "--use_blobs" we need to use the arm cross
388 // compiler instead of just 'gcc'.
382 cc_flags = ""; 389 cc_flags = "";
Bill Hesse 2016/04/27 12:22:32 Maybe use null here instead. Or find out the corr
kustermann 2016/04/27 13:25:09 Done.
383 } else if (arch == 'mips') { 390 } else if (arch == 'mips') {
384 cc_flags = "-EL"; 391 cc_flags = "-EL";
385 } else { 392 } else {
386 throw "Architecture not supported: $arch"; 393 throw "Architecture not supported: $arch";
387 } 394 }
388 395
389 var exec = cc; 396 var exec = cc;
390 var args = [ 397 var args = [ shared ];
391 shared, 398 if (cc_flags != null && cc_flags.length > 0) args.add(cc_flags);
Bill Hesse 2016/04/27 12:22:31 Decide which value to use for "none" in arch == 'a
kustermann 2016/04/27 13:25:09 Done.
392 cc_flags, 399 args.addAll([
393 '-o', 400 '-o',
394 '$tempDir/$libname', 401 '$tempDir/$libname',
395 '$tempDir/precompiled.S' 402 '$tempDir/precompiled.S'
396 ]; 403 ]);
397 404
398 return commandBuilder.getCompilationCommand('assemble', tempDir, !useSdk, 405 return commandBuilder.getCompilationCommand('assemble', tempDir, !useSdk,
399 bootstrapDependencies(buildDir), exec, args, environmentOverrides); 406 bootstrapDependencies(buildDir), exec, args, environmentOverrides);
400 } 407 }
401 408
402 // This step reduces the amount of space needed to run the precompilation 409 // This step reduces the amount of space needed to run the precompilation
403 // tests by 60%. 410 // tests by 60%.
404 CompilationCommand computeRemoveAssemblyCommand( 411 CompilationCommand computeRemoveAssemblyCommand(
405 String tempDir, 412 String tempDir,
406 String buildDir, 413 String buildDir,
(...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after
598 RuntimeConfiguration runtimeConfiguration, 605 RuntimeConfiguration runtimeConfiguration,
599 String buildDir, 606 String buildDir,
600 TestInformation info, 607 TestInformation info,
601 List<String> vmOptions, 608 List<String> vmOptions,
602 List<String> sharedOptions, 609 List<String> sharedOptions,
603 List<String> originalArguments, 610 List<String> originalArguments,
604 CommandArtifact artifact) { 611 CommandArtifact artifact) {
605 return <String>[]; 612 return <String>[];
606 } 613 }
607 } 614 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698