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

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

Issue 1947783003: Simplify command line options for creating snapshots. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: 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
« no previous file with comments | « runtime/bin/main.cc ('k') | tools/testing/dart/runtime_configuration.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 324 matching lines...) Expand 10 before | Expand all | Expand 10 after
335 } 335 }
336 336
337 CompilationCommand computeCompilationCommand( 337 CompilationCommand computeCompilationCommand(
338 String tempDir, 338 String tempDir,
339 String buildDir, 339 String buildDir,
340 CommandBuilder commandBuilder, 340 CommandBuilder commandBuilder,
341 List arguments, 341 List arguments,
342 Map<String, String> environmentOverrides) { 342 Map<String, String> environmentOverrides) {
343 var exec = "$buildDir/dart_bootstrap"; 343 var exec = "$buildDir/dart_bootstrap";
344 var args = new List(); 344 var args = new List();
345 args.add("--gen-precompiled-snapshot=$tempDir"); 345 args.add("--snapshot=$tempDir");
346 args.add("--snapshot-kind=app-aot");
346 if (useBlobs) { 347 if (useBlobs) {
347 args.add("--use_blobs"); 348 args.add("--use-blobs");
348 } 349 }
349 if (isAndroid && arch == 'arm') { 350 if (isAndroid && arch == 'arm') {
350 args.add('--no-sim-use-hardfp'); 351 args.add('--no-sim-use-hardfp');
351 } 352 }
352 args.addAll(arguments); 353 args.addAll(arguments);
353 354
354 return commandBuilder.getCompilationCommand('precompiler', tempDir, !useSdk, 355 return commandBuilder.getCompilationCommand('precompiler', tempDir, !useSdk,
355 bootstrapDependencies(buildDir), exec, args, environmentOverrides); 356 bootstrapDependencies(buildDir), exec, args, environmentOverrides);
356 } 357 }
357 358
(...skipping 10 matching lines...) Expand all
368 shared = '-shared'; 369 shared = '-shared';
369 libname = 'libprecompiled.so'; 370 libname = 'libprecompiled.so';
370 } else if (Platform.isMacOS) { 371 } else if (Platform.isMacOS) {
371 cc = 'clang'; 372 cc = 'clang';
372 shared = '-dynamiclib'; 373 shared = '-dynamiclib';
373 libname = 'libprecompiled.dylib'; 374 libname = 'libprecompiled.dylib';
374 } else { 375 } else {
375 throw "Platform not supported: ${Platform.operatingSystem}"; 376 throw "Platform not supported: ${Platform.operatingSystem}";
376 } 377 }
377 if (isAndroid) { 378 if (isAndroid) {
378 // TODO: If we're not using "--use_blobs" we need to use the arm cross 379 // TODO: If we're not using "--use-blobs" we need to use the arm cross
379 // compiler instead of just 'gcc' for . 380 // compiler instead of just 'gcc' for .
380 } 381 }
381 382
382 var cc_flags; 383 var cc_flags;
383 if (arch == 'x64') { 384 if (arch == 'x64') {
384 cc_flags = "-m64"; 385 cc_flags = "-m64";
385 } else if (arch == 'simarm64') { 386 } else if (arch == 'simarm64') {
386 cc_flags = "-m64"; 387 cc_flags = "-m64";
387 } else if (arch == 'ia32') { 388 } else if (arch == 'ia32') {
388 cc_flags = "-m32"; 389 cc_flags = "-m32";
389 } else if (arch == 'simarm') { 390 } else if (arch == 'simarm') {
390 cc_flags = "-m32"; 391 cc_flags = "-m32";
391 } else if (arch == 'simmips') { 392 } else if (arch == 'simmips') {
392 cc_flags = "-m32"; 393 cc_flags = "-m32";
393 } else if (arch == 'arm') { 394 } else if (arch == 'arm') {
394 cc_flags = null; 395 cc_flags = null;
395 } else if (arch == 'mips') { 396 } else if (arch == 'mips') {
396 cc_flags = "-EL"; 397 cc_flags = "-EL";
397 } else { 398 } else {
398 throw "Architecture not supported: $arch"; 399 throw "Architecture not supported: $arch";
399 } 400 }
400 401
401 var exec = cc; 402 var exec = cc;
402 var args = (cc_flags != null) ? [ shared, cc_flags ] : [ shared ]; 403 var args = (cc_flags != null) ? [ shared, cc_flags ] : [ shared ];
403 args.addAll([ 404 args.addAll([
404 '-o', 405 '-o',
405 '$tempDir/$libname', 406 '$tempDir/$libname',
406 '$tempDir/precompiled.S' 407 '$tempDir/snapshot.S'
407 ]); 408 ]);
408 409
409 return commandBuilder.getCompilationCommand('assemble', tempDir, !useSdk, 410 return commandBuilder.getCompilationCommand('assemble', tempDir, !useSdk,
410 bootstrapDependencies(buildDir), exec, args, environmentOverrides); 411 bootstrapDependencies(buildDir), exec, args, environmentOverrides);
411 } 412 }
412 413
413 // This step reduces the amount of space needed to run the precompilation 414 // This step reduces the amount of space needed to run the precompilation
414 // tests by 60%. 415 // tests by 60%.
415 CompilationCommand computeRemoveAssemblyCommand( 416 CompilationCommand computeRemoveAssemblyCommand(
416 String tempDir, 417 String tempDir,
417 String buildDir, 418 String buildDir,
418 CommandBuilder commandBuilder, 419 CommandBuilder commandBuilder,
419 List arguments, 420 List arguments,
420 Map<String, String> environmentOverrides) { 421 Map<String, String> environmentOverrides) {
421 var exec = 'rm'; 422 var exec = 'rm';
422 var args = ['$tempDir/precompiled.S']; 423 var args = ['$tempDir/snapshot.S'];
423 424
424 return commandBuilder.getCompilationCommand( 425 return commandBuilder.getCompilationCommand(
425 'remove_assembly', 426 'remove_assembly',
426 tempDir, 427 tempDir,
427 !useSdk, 428 !useSdk,
428 bootstrapDependencies(buildDir), 429 bootstrapDependencies(buildDir),
429 exec, 430 exec,
430 args, 431 args,
431 environmentOverrides); 432 environmentOverrides);
432 } 433 }
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
483 if (isChecked) multiplier *= 2; 484 if (isChecked) multiplier *= 2;
484 return multiplier; 485 return multiplier;
485 } 486 }
486 487
487 CommandArtifact computeCompilationArtifact( 488 CommandArtifact computeCompilationArtifact(
488 String buildDir, 489 String buildDir,
489 String tempDir, 490 String tempDir,
490 CommandBuilder commandBuilder, 491 CommandBuilder commandBuilder,
491 List arguments, 492 List arguments,
492 Map<String, String> environmentOverrides) { 493 Map<String, String> environmentOverrides) {
493 String outputName = computeOutputName(tempDir);
494 return new CommandArtifact(<Command>[ 494 return new CommandArtifact(<Command>[
495 this.computeCompilationCommand(outputName, buildDir, 495 this.computeCompilationCommand(tempDir, buildDir,
496 CommandBuilder.instance, arguments, environmentOverrides) 496 CommandBuilder.instance, arguments, environmentOverrides)
497 ], outputName, 'application/dart-snapshot'); 497 ], tempDir, 'application/dart-snapshot');
498 }
499
500 String computeOutputName(String tempDir) {
501 var randName = TestUtils.getRandomNumber().toString();
502 return '$tempDir/test.$randName';
503 } 498 }
504 499
505 CompilationCommand computeCompilationCommand( 500 CompilationCommand computeCompilationCommand(
506 String outputName, 501 String tempDir,
507 String buildDir, 502 String buildDir,
508 CommandBuilder commandBuilder, 503 CommandBuilder commandBuilder,
509 List arguments, 504 List arguments,
510 Map<String, String> environmentOverrides) { 505 Map<String, String> environmentOverrides) {
511 var exec = "$buildDir/dart_bootstrap"; 506 var exec = "$buildDir/dart_bootstrap";
512 var args = new List(); 507 var args = new List();
513 args.add("--full-snapshot-after-run=$outputName"); 508 args.add("--snapshot=$tempDir");
509 args.add("--snapshot-kind=app-after-run");
514 args.addAll(arguments); 510 args.addAll(arguments);
515 511
516 return commandBuilder.getCompilationCommand( 512 return commandBuilder.getCompilationCommand(
517 'dart2snapshot', 513 'dart2snapshot',
518 outputName, 514 tempDir,
519 !useSdk, 515 !useSdk,
520 bootstrapDependencies(buildDir), 516 bootstrapDependencies(buildDir),
521 exec, 517 exec,
522 args, 518 args,
523 environmentOverrides); 519 environmentOverrides);
524 } 520 }
525 521
526 List<String> computeCompilerArguments( 522 List<String> computeCompilerArguments(
527 vmOptions, sharedOptions, originalArguments) { 523 vmOptions, sharedOptions, originalArguments) {
528 List<String> args = []; 524 List<String> args = [];
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
609 RuntimeConfiguration runtimeConfiguration, 605 RuntimeConfiguration runtimeConfiguration,
610 String buildDir, 606 String buildDir,
611 TestInformation info, 607 TestInformation info,
612 List<String> vmOptions, 608 List<String> vmOptions,
613 List<String> sharedOptions, 609 List<String> sharedOptions,
614 List<String> originalArguments, 610 List<String> originalArguments,
615 CommandArtifact artifact) { 611 CommandArtifact artifact) {
616 return <String>[]; 612 return <String>[];
617 } 613 }
618 } 614 }
OLDNEW
« no previous file with comments | « runtime/bin/main.cc ('k') | tools/testing/dart/runtime_configuration.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698