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

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

Issue 2410303008: Revert "Use a single file for app snapshots." (Closed)
Patch Set: Created 4 years, 2 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/vm/snapshot.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 351 matching lines...) Expand 10 before | Expand all | Expand 10 after
362 } 362 }
363 363
364 CompilationCommand computeCompilationCommand( 364 CompilationCommand computeCompilationCommand(
365 String tempDir, 365 String tempDir,
366 String buildDir, 366 String buildDir,
367 CommandBuilder commandBuilder, 367 CommandBuilder commandBuilder,
368 List arguments, 368 List arguments,
369 Map<String, String> environmentOverrides) { 369 Map<String, String> environmentOverrides) {
370 var exec = "$buildDir/dart_bootstrap"; 370 var exec = "$buildDir/dart_bootstrap";
371 var args = new List(); 371 var args = new List();
372 args.add("--snapshot=$tempDir");
372 args.add("--snapshot-kind=app-aot"); 373 args.add("--snapshot-kind=app-aot");
373 if (useBlobs) { 374 if (useBlobs) {
374 args.add("--snapshot=$tempDir/out.aotsnapshot");
375 args.add("--use-blobs"); 375 args.add("--use-blobs");
376 } else {
377 args.add("--snapshot=$tempDir/out.S");
378 } 376 }
379 if (isAndroid && arch == 'arm') { 377 if (isAndroid && arch == 'arm') {
380 args.add('--no-sim-use-hardfp'); 378 args.add('--no-sim-use-hardfp');
381 } 379 }
382 args.addAll(arguments); 380 args.addAll(arguments);
383 381
384 return commandBuilder.getCompilationCommand('precompiler', tempDir, !useSdk, 382 return commandBuilder.getCompilationCommand('precompiler', tempDir, !useSdk,
385 bootstrapDependencies(buildDir), exec, args, environmentOverrides); 383 bootstrapDependencies(buildDir), exec, args, environmentOverrides);
386 } 384 }
387 385
388 CompilationCommand computeAssembleCommand( 386 CompilationCommand computeAssembleCommand(
389 String tempDir, 387 String tempDir,
390 String buildDir, 388 String buildDir,
391 CommandBuilder commandBuilder, 389 CommandBuilder commandBuilder,
392 List arguments, 390 List arguments,
393 Map<String, String> environmentOverrides) { 391 Map<String, String> environmentOverrides) {
394 392
395 var cc, shared; 393 var cc, shared, libname;
396 if (Platform.isLinux) { 394 if (Platform.isLinux) {
397 cc = 'gcc'; 395 cc = 'gcc';
398 shared = '-shared'; 396 shared = '-shared';
397 libname = 'libprecompiled.so';
399 } else if (Platform.isMacOS) { 398 } else if (Platform.isMacOS) {
400 cc = 'clang'; 399 cc = 'clang';
401 shared = '-dynamiclib'; 400 shared = '-dynamiclib';
401 libname = 'libprecompiled.dylib';
402 } else { 402 } else {
403 throw "Platform not supported: ${Platform.operatingSystem}"; 403 throw "Platform not supported: ${Platform.operatingSystem}";
404 } 404 }
405 if (isAndroid) { 405 if (isAndroid) {
406 // TODO: If we're not using "--use-blobs" we need to use the arm cross 406 // TODO: If we're not using "--use-blobs" we need to use the arm cross
407 // compiler instead of just 'gcc' for . 407 // compiler instead of just 'gcc' for .
408 } 408 }
409 409
410 var cc_flags; 410 var cc_flags;
411 if (arch == 'x64') { 411 if (arch == 'x64') {
(...skipping 11 matching lines...) Expand all
423 } else if (arch == 'mips') { 423 } else if (arch == 'mips') {
424 cc_flags = "-EL"; 424 cc_flags = "-EL";
425 } else { 425 } else {
426 throw "Architecture not supported: $arch"; 426 throw "Architecture not supported: $arch";
427 } 427 }
428 428
429 var exec = cc; 429 var exec = cc;
430 var args = (cc_flags != null) ? [ shared, cc_flags ] : [ shared ]; 430 var args = (cc_flags != null) ? [ shared, cc_flags ] : [ shared ];
431 args.addAll([ 431 args.addAll([
432 '-o', 432 '-o',
433 '$tempDir/out.aotsnapshot', 433 '$tempDir/$libname',
434 '$tempDir/out.S' 434 '$tempDir/snapshot.S'
435 ]); 435 ]);
436 436
437 return commandBuilder.getCompilationCommand('assemble', tempDir, !useSdk, 437 return commandBuilder.getCompilationCommand('assemble', tempDir, !useSdk,
438 bootstrapDependencies(buildDir), exec, args, environmentOverrides); 438 bootstrapDependencies(buildDir), exec, args, environmentOverrides);
439 } 439 }
440 440
441 // This step reduces the amount of space needed to run the precompilation 441 // This step reduces the amount of space needed to run the precompilation
442 // tests by 60%. 442 // tests by 60%.
443 CompilationCommand computeRemoveAssemblyCommand( 443 CompilationCommand computeRemoveAssemblyCommand(
444 String tempDir, 444 String tempDir,
445 String buildDir, 445 String buildDir,
446 CommandBuilder commandBuilder, 446 CommandBuilder commandBuilder,
447 List arguments, 447 List arguments,
448 Map<String, String> environmentOverrides) { 448 Map<String, String> environmentOverrides) {
449 var exec = 'rm'; 449 var exec = 'rm';
450 var args = ['$tempDir/out.S']; 450 var args = ['$tempDir/snapshot.S'];
451 451
452 return commandBuilder.getCompilationCommand( 452 return commandBuilder.getCompilationCommand(
453 'remove_assembly', 453 'remove_assembly',
454 tempDir, 454 tempDir,
455 !useSdk, 455 !useSdk,
456 bootstrapDependencies(buildDir), 456 bootstrapDependencies(buildDir),
457 exec, 457 exec,
458 args, 458 args,
459 environmentOverrides); 459 environmentOverrides);
460 } 460 }
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
525 } 525 }
526 526
527 CompilationCommand computeCompilationCommand( 527 CompilationCommand computeCompilationCommand(
528 String tempDir, 528 String tempDir,
529 String buildDir, 529 String buildDir,
530 CommandBuilder commandBuilder, 530 CommandBuilder commandBuilder,
531 List arguments, 531 List arguments,
532 Map<String, String> environmentOverrides) { 532 Map<String, String> environmentOverrides) {
533 var exec = "$buildDir/dart_bootstrap"; 533 var exec = "$buildDir/dart_bootstrap";
534 var args = new List(); 534 var args = new List();
535 args.add("--snapshot=$tempDir/out.jitsnapshot"); 535 args.add("--snapshot=$tempDir");
536 args.add("--snapshot-kind=app-after-run"); 536 args.add("--snapshot-kind=app-after-run");
537 args.addAll(arguments); 537 args.addAll(arguments);
538 538
539 return commandBuilder.getCompilationCommand( 539 return commandBuilder.getCompilationCommand(
540 'dart2snapshot', 540 'dart2snapshot',
541 tempDir, 541 tempDir,
542 !useSdk, 542 !useSdk,
543 bootstrapDependencies(buildDir), 543 bootstrapDependencies(buildDir),
544 exec, 544 exec,
545 args, 545 args,
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
585 : super(isDebug: isDebug, isChecked: isChecked), this.useBlobs = useBlobs; 585 : super(isDebug: isDebug, isChecked: isChecked), this.useBlobs = useBlobs;
586 586
587 CompilationCommand computeCompilationCommand( 587 CompilationCommand computeCompilationCommand(
588 String tempDir, 588 String tempDir,
589 String buildDir, 589 String buildDir,
590 CommandBuilder commandBuilder, 590 CommandBuilder commandBuilder,
591 List arguments, 591 List arguments,
592 Map<String, String> environmentOverrides) { 592 Map<String, String> environmentOverrides) {
593 var exec = "$buildDir/dart"; 593 var exec = "$buildDir/dart";
594 var args = new List(); 594 var args = new List();
595 args.add("--snapshot=$tempDir/out.jitsnapshot"); 595 args.add("--snapshot=$tempDir");
596 args.add("--snapshot-kind=app-jit-after-run"); 596 args.add("--snapshot-kind=app-jit-after-run");
597 if (useBlobs) { 597 if (useBlobs) {
598 args.add("--use-blobs"); 598 args.add("--use-blobs");
599 } 599 }
600 args.addAll(arguments); 600 args.addAll(arguments);
601 601
602 return commandBuilder.getCompilationCommand( 602 return commandBuilder.getCompilationCommand(
603 'dart2snapshot', 603 'dart2snapshot',
604 tempDir, 604 tempDir,
605 !useSdk, 605 !useSdk,
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
668 RuntimeConfiguration runtimeConfiguration, 668 RuntimeConfiguration runtimeConfiguration,
669 String buildDir, 669 String buildDir,
670 TestInformation info, 670 TestInformation info,
671 List<String> vmOptions, 671 List<String> vmOptions,
672 List<String> sharedOptions, 672 List<String> sharedOptions,
673 List<String> originalArguments, 673 List<String> originalArguments,
674 CommandArtifact artifact) { 674 CommandArtifact artifact) {
675 return <String>[]; 675 return <String>[];
676 } 676 }
677 } 677 }
OLDNEW
« no previous file with comments | « runtime/vm/snapshot.cc ('k') | tools/testing/dart/runtime_configuration.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698