| OLD | NEW |
| 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 import 'runtime_configuration.dart' show DartPrecompiledAdbRuntimeConfiguration; | 10 import 'runtime_configuration.dart' show DartPrecompiledAdbRuntimeConfiguration; |
| (...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 159 | 159 |
| 160 CommandArtifact computeCompilationArtifact( | 160 CommandArtifact computeCompilationArtifact( |
| 161 String buildDir, | 161 String buildDir, |
| 162 String tempDir, | 162 String tempDir, |
| 163 CommandBuilder commandBuilder, | 163 CommandBuilder commandBuilder, |
| 164 List<String> arguments, | 164 List<String> arguments, |
| 165 Map<String, String> environmentOverrides) { | 165 Map<String, String> environmentOverrides) { |
| 166 return new CommandArtifact([], null, null); | 166 return new CommandArtifact([], null, null); |
| 167 } | 167 } |
| 168 | 168 |
| 169 List<String> computeCompilerArguments(vmOptions, sharedOptions, args) { | 169 List<String> computeCompilerArguments( |
| 170 return new List<String>()..addAll(sharedOptions)..addAll(args); | 170 List<String> vmOptions, List<String> sharedOptions, List<String> args) { |
| 171 return sharedOptions.toList()..addAll(args); |
| 171 } | 172 } |
| 172 | 173 |
| 173 List<String> computeRuntimeArguments( | 174 List<String> computeRuntimeArguments( |
| 174 RuntimeConfiguration runtimeConfiguration, | 175 RuntimeConfiguration runtimeConfiguration, |
| 175 String buildDir, | 176 String buildDir, |
| 176 TestInformation info, | 177 TestInformation info, |
| 177 List<String> vmOptions, | 178 List<String> vmOptions, |
| 178 List<String> sharedOptions, | 179 List<String> sharedOptions, |
| 179 List<String> originalArguments, | 180 List<String> originalArguments, |
| 180 CommandArtifact artifact) { | 181 CommandArtifact artifact) { |
| 181 return <String>[artifact.filename]; | 182 return [artifact.filename]; |
| 182 } | 183 } |
| 183 } | 184 } |
| 184 | 185 |
| 185 /// The "none" compiler. | 186 /// The "none" compiler. |
| 186 class NoneCompilerConfiguration extends CompilerConfiguration { | 187 class NoneCompilerConfiguration extends CompilerConfiguration { |
| 187 final bool hotReload; | 188 final bool hotReload; |
| 188 final bool hotReloadRollback; | 189 final bool hotReloadRollback; |
| 189 final bool useDFE; | 190 final bool useDFE; |
| 190 | 191 |
| 191 NoneCompilerConfiguration( | 192 NoneCompilerConfiguration( |
| (...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 361 | 362 |
| 362 class ComposedCompilerConfiguration extends CompilerConfiguration { | 363 class ComposedCompilerConfiguration extends CompilerConfiguration { |
| 363 final List<PipelineCommand> pipelineCommands; | 364 final List<PipelineCommand> pipelineCommands; |
| 364 | 365 |
| 365 ComposedCompilerConfiguration(this.pipelineCommands) : super._subclass(); | 366 ComposedCompilerConfiguration(this.pipelineCommands) : super._subclass(); |
| 366 | 367 |
| 367 CommandArtifact computeCompilationArtifact( | 368 CommandArtifact computeCompilationArtifact( |
| 368 String buildDir, | 369 String buildDir, |
| 369 String tempDir, | 370 String tempDir, |
| 370 CommandBuilder commandBuilder, | 371 CommandBuilder commandBuilder, |
| 371 List globalArguments, | 372 List<String> globalArguments, |
| 372 Map<String, String> environmentOverrides) { | 373 Map<String, String> environmentOverrides) { |
| 373 List<Command> allCommands = []; | 374 List<Command> allCommands = []; |
| 374 | 375 |
| 375 // The first compilation command is as usual. | 376 // The first compilation command is as usual. |
| 376 var arguments = pipelineCommands[0].extractArguments(globalArguments, null); | 377 var arguments = pipelineCommands[0].extractArguments(globalArguments, null); |
| 377 CommandArtifact artifact = pipelineCommands[0] | 378 CommandArtifact artifact = pipelineCommands[0] |
| 378 .compilerConfiguration | 379 .compilerConfiguration |
| 379 .computeCompilationArtifact( | 380 .computeCompilationArtifact( |
| 380 buildDir, tempDir, commandBuilder, arguments, environmentOverrides); | 381 buildDir, tempDir, commandBuilder, arguments, environmentOverrides); |
| 381 allCommands.addAll(artifact.commands); | 382 allCommands.addAll(artifact.commands); |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 425 static ComposedCompilerConfiguration createDartKPConfiguration( | 426 static ComposedCompilerConfiguration createDartKPConfiguration( |
| 426 {bool isChecked, | 427 {bool isChecked, |
| 427 bool isHostChecked, | 428 bool isHostChecked, |
| 428 String arch, | 429 String arch, |
| 429 bool useBlobs, | 430 bool useBlobs, |
| 430 bool isAndroid, | 431 bool isAndroid, |
| 431 bool useSdk, | 432 bool useSdk, |
| 432 bool verify, | 433 bool verify, |
| 433 bool strong, | 434 bool strong, |
| 434 bool treeShake}) { | 435 bool treeShake}) { |
| 435 var nested = []; | 436 return new ComposedCompilerConfiguration([ |
| 437 // Compile with dartk. |
| 438 new PipelineCommand.runWithGlobalArguments(new DartKCompilerConfiguration( |
| 439 isChecked: isChecked, |
| 440 isHostChecked: isHostChecked, |
| 441 useSdk: useSdk, |
| 442 verify: verify, |
| 443 strong: strong, |
| 444 treeShake: treeShake)), |
| 436 | 445 |
| 437 // Compile with dartk. | 446 // Run the normal precompiler. |
| 438 nested.add(new PipelineCommand.runWithGlobalArguments( | 447 new PipelineCommand.runWithPreviousKernelOutput( |
| 439 new DartKCompilerConfiguration( | 448 new PrecompilerCompilerConfiguration( |
| 440 isChecked: isChecked, | 449 isChecked: isChecked, |
| 441 isHostChecked: isHostChecked, | 450 arch: arch, |
| 442 useSdk: useSdk, | 451 useBlobs: useBlobs, |
| 443 verify: verify, | 452 isAndroid: isAndroid)) |
| 444 strong: strong, | 453 ]); |
| 445 treeShake: treeShake))); | |
| 446 | |
| 447 // Run the normal precompiler. | |
| 448 nested.add(new PipelineCommand.runWithPreviousKernelOutput( | |
| 449 new PrecompilerCompilerConfiguration( | |
| 450 isChecked: isChecked, | |
| 451 arch: arch, | |
| 452 useBlobs: useBlobs, | |
| 453 isAndroid: isAndroid))); | |
| 454 | |
| 455 return new ComposedCompilerConfiguration(nested); | |
| 456 } | 454 } |
| 457 | 455 |
| 458 static ComposedCompilerConfiguration createDartKConfiguration( | 456 static ComposedCompilerConfiguration createDartKConfiguration( |
| 459 {bool isChecked, | 457 {bool isChecked, |
| 460 bool isHostChecked, | 458 bool isHostChecked, |
| 461 bool useSdk, | 459 bool useSdk, |
| 462 bool verify, | 460 bool verify, |
| 463 bool strong, | 461 bool strong, |
| 464 bool treeShake}) { | 462 bool treeShake}) { |
| 465 var nested = []; | 463 return new ComposedCompilerConfiguration([ |
| 466 | 464 // Compile with dartk. |
| 467 // Compile with dartk. | 465 new PipelineCommand.runWithGlobalArguments(new DartKCompilerConfiguration( |
| 468 nested.add(new PipelineCommand.runWithGlobalArguments( | 466 isChecked: isChecked, |
| 469 new DartKCompilerConfiguration( | 467 isHostChecked: isHostChecked, |
| 470 isChecked: isChecked, | 468 useSdk: useSdk, |
| 471 isHostChecked: isHostChecked, | 469 verify: verify, |
| 472 useSdk: useSdk, | 470 strong: strong, |
| 473 verify: verify, | 471 treeShake: treeShake)) |
| 474 strong: strong, | 472 ]); |
| 475 treeShake: treeShake))); | |
| 476 | |
| 477 return new ComposedCompilerConfiguration(nested); | |
| 478 } | 473 } |
| 479 } | 474 } |
| 480 | 475 |
| 481 /// Common configuration for dart2js-based tools, such as, dart2js | 476 /// Common configuration for dart2js-based tools, such as, dart2js |
| 482 class Dart2xCompilerConfiguration extends CompilerConfiguration { | 477 class Dart2xCompilerConfiguration extends CompilerConfiguration { |
| 483 final String moniker; | 478 final String moniker; |
| 484 static Map<String, List<Uri>> _bootstrapDependenciesCache = | 479 static Map<String, List<Uri>> _bootstrapDependenciesCache = |
| 485 new Map<String, List<Uri>>(); | 480 new Map<String, List<Uri>>(); |
| 486 | 481 |
| 487 Dart2xCompilerConfiguration(this.moniker, | 482 Dart2xCompilerConfiguration(this.moniker, |
| (...skipping 17 matching lines...) Expand all Loading... |
| 505 prefix = '$buildDir/dart-sdk/bin'; | 500 prefix = '$buildDir/dart-sdk/bin'; |
| 506 } | 501 } |
| 507 return '$prefix/dart2js$suffix'; | 502 return '$prefix/dart2js$suffix'; |
| 508 } | 503 } |
| 509 } | 504 } |
| 510 | 505 |
| 511 CompilationCommand computeCompilationCommand( | 506 CompilationCommand computeCompilationCommand( |
| 512 String outputFileName, | 507 String outputFileName, |
| 513 String buildDir, | 508 String buildDir, |
| 514 CommandBuilder commandBuilder, | 509 CommandBuilder commandBuilder, |
| 515 List arguments, | 510 List<String> arguments, |
| 516 Map<String, String> environmentOverrides) { | 511 Map<String, String> environmentOverrides) { |
| 517 arguments = new List.from(arguments); | 512 arguments = arguments.toList(); |
| 518 arguments.add('--out=$outputFileName'); | 513 arguments.add('--out=$outputFileName'); |
| 519 | 514 |
| 520 return commandBuilder.getCompilationCommand( | 515 return commandBuilder.getCompilationCommand( |
| 521 moniker, | 516 moniker, |
| 522 outputFileName, | 517 outputFileName, |
| 523 !useSdk, | 518 !useSdk, |
| 524 bootstrapDependencies(buildDir), | 519 bootstrapDependencies(buildDir), |
| 525 computeCompilerPath(buildDir), | 520 computeCompilerPath(buildDir), |
| 526 arguments, | 521 arguments, |
| 527 environmentOverrides); | 522 environmentOverrides); |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 571 if (isDebug) multiplier *= 4; | 566 if (isDebug) multiplier *= 4; |
| 572 if (isChecked) multiplier *= 2; | 567 if (isChecked) multiplier *= 2; |
| 573 if (isHostChecked) multiplier *= 16; | 568 if (isHostChecked) multiplier *= 16; |
| 574 return multiplier; | 569 return multiplier; |
| 575 } | 570 } |
| 576 | 571 |
| 577 CommandArtifact computeCompilationArtifact( | 572 CommandArtifact computeCompilationArtifact( |
| 578 String buildDir, | 573 String buildDir, |
| 579 String tempDir, | 574 String tempDir, |
| 580 CommandBuilder commandBuilder, | 575 CommandBuilder commandBuilder, |
| 581 List arguments, | 576 List<String> arguments, |
| 582 Map<String, String> environmentOverrides) { | 577 Map<String, String> environmentOverrides) { |
| 583 List compilerArguments = new List.from(arguments) | 578 var compilerArguments = arguments.toList()..addAll(extraDart2jsOptions); |
| 584 ..addAll(extraDart2jsOptions); | 579 return new CommandArtifact([ |
| 585 return new CommandArtifact(<Command>[ | |
| 586 this.computeCompilationCommand('$tempDir/out.js', buildDir, | 580 this.computeCompilationCommand('$tempDir/out.js', buildDir, |
| 587 CommandBuilder.instance, compilerArguments, environmentOverrides) | 581 CommandBuilder.instance, compilerArguments, environmentOverrides) |
| 588 ], '$tempDir/out.js', 'application/javascript'); | 582 ], '$tempDir/out.js', 'application/javascript'); |
| 589 } | 583 } |
| 590 | 584 |
| 591 List<String> computeRuntimeArguments( | 585 List<String> computeRuntimeArguments( |
| 592 RuntimeConfiguration runtimeConfiguration, | 586 RuntimeConfiguration runtimeConfiguration, |
| 593 String buildDir, | 587 String buildDir, |
| 594 TestInformation info, | 588 TestInformation info, |
| 595 List<String> vmOptions, | 589 List<String> vmOptions, |
| (...skipping 29 matching lines...) Expand all Loading... |
| 625 int multiplier = 2; | 619 int multiplier = 2; |
| 626 if (isDebug) multiplier *= 4; | 620 if (isDebug) multiplier *= 4; |
| 627 if (isChecked) multiplier *= 2; | 621 if (isChecked) multiplier *= 2; |
| 628 return multiplier; | 622 return multiplier; |
| 629 } | 623 } |
| 630 | 624 |
| 631 CommandArtifact computeCompilationArtifact( | 625 CommandArtifact computeCompilationArtifact( |
| 632 String buildDir, | 626 String buildDir, |
| 633 String tempDir, | 627 String tempDir, |
| 634 CommandBuilder commandBuilder, | 628 CommandBuilder commandBuilder, |
| 635 List arguments, | 629 List<String> arguments, |
| 636 Map<String, String> environmentOverrides) { | 630 Map<String, String> environmentOverrides) { |
| 637 var commands = new List<Command>(); | 631 var commands = new List<Command>(); |
| 638 commands.add(this.computeCompilationCommand(tempDir, buildDir, | 632 commands.add(this.computeCompilationCommand(tempDir, buildDir, |
| 639 CommandBuilder.instance, arguments, environmentOverrides)); | 633 CommandBuilder.instance, arguments, environmentOverrides)); |
| 640 if (!useBlobs) { | 634 if (!useBlobs) { |
| 641 commands.add(this.computeAssembleCommand(tempDir, buildDir, | 635 commands.add(this.computeAssembleCommand(tempDir, buildDir, |
| 642 CommandBuilder.instance, arguments, environmentOverrides)); | 636 CommandBuilder.instance, arguments, environmentOverrides)); |
| 643 commands.add(this.computeRemoveAssemblyCommand(tempDir, buildDir, | 637 commands.add(this.computeRemoveAssemblyCommand(tempDir, buildDir, |
| 644 CommandBuilder.instance, arguments, environmentOverrides)); | 638 CommandBuilder.instance, arguments, environmentOverrides)); |
| 645 } | 639 } |
| 646 return new CommandArtifact( | 640 return new CommandArtifact( |
| 647 commands, '$tempDir', 'application/dart-precompiled'); | 641 commands, '$tempDir', 'application/dart-precompiled'); |
| 648 } | 642 } |
| 649 | 643 |
| 650 CompilationCommand computeCompilationCommand( | 644 CompilationCommand computeCompilationCommand( |
| 651 String tempDir, | 645 String tempDir, |
| 652 String buildDir, | 646 String buildDir, |
| 653 CommandBuilder commandBuilder, | 647 CommandBuilder commandBuilder, |
| 654 List arguments, | 648 List<String> arguments, |
| 655 Map<String, String> environmentOverrides) { | 649 Map<String, String> environmentOverrides) { |
| 656 var exec; | 650 String exec; |
| 657 if (isAndroid) { | 651 if (isAndroid) { |
| 658 if (arch == "arm") { | 652 if (arch == "arm") { |
| 659 exec = "$buildDir/clang_x86/dart_bootstrap"; | 653 exec = "$buildDir/clang_x86/dart_bootstrap"; |
| 660 } else if (arch == "arm64") { | 654 } else if (arch == "arm64") { |
| 661 exec = "$buildDir/clang_x64/dart_bootstrap"; | 655 exec = "$buildDir/clang_x64/dart_bootstrap"; |
| 662 } | 656 } |
| 663 } else { | 657 } else { |
| 664 exec = "$buildDir/dart_bootstrap"; | 658 exec = "$buildDir/dart_bootstrap"; |
| 665 } | 659 } |
| 666 var args = new List(); | 660 var args = <String>[]; |
| 667 if (useDFE) { | 661 if (useDFE) { |
| 668 args.add('--dfe=utils/kernel-service/kernel-service.dart'); | 662 args.add('--dfe=utils/kernel-service/kernel-service.dart'); |
| 669 args.add('--platform=${buildDir}/patched_sdk/platform.dill'); | 663 args.add('--platform=${buildDir}/patched_sdk/platform.dill'); |
| 670 } | 664 } |
| 671 args.add("--snapshot-kind=app-aot"); | 665 args.add("--snapshot-kind=app-aot"); |
| 672 if (useBlobs) { | 666 if (useBlobs) { |
| 673 args.add("--snapshot=$tempDir/out.aotsnapshot"); | 667 args.add("--snapshot=$tempDir/out.aotsnapshot"); |
| 674 args.add("--use-blobs"); | 668 args.add("--use-blobs"); |
| 675 } else { | 669 } else { |
| 676 args.add("--snapshot=$tempDir/out.S"); | 670 args.add("--snapshot=$tempDir/out.S"); |
| 677 } | 671 } |
| 678 if (isAndroid && arch == 'arm') { | 672 if (isAndroid && arch == 'arm') { |
| 679 args.add('--no-sim-use-hardfp'); | 673 args.add('--no-sim-use-hardfp'); |
| 680 } | 674 } |
| 681 args.addAll(arguments); | 675 args.addAll(arguments); |
| 682 | 676 |
| 683 return commandBuilder.getCompilationCommand('precompiler', tempDir, !useSdk, | 677 return commandBuilder.getCompilationCommand('precompiler', tempDir, !useSdk, |
| 684 bootstrapDependencies(buildDir), exec, args, environmentOverrides); | 678 bootstrapDependencies(buildDir), exec, args, environmentOverrides); |
| 685 } | 679 } |
| 686 | 680 |
| 687 CompilationCommand computeAssembleCommand( | 681 CompilationCommand computeAssembleCommand( |
| 688 String tempDir, | 682 String tempDir, |
| 689 String buildDir, | 683 String buildDir, |
| 690 CommandBuilder commandBuilder, | 684 CommandBuilder commandBuilder, |
| 691 List arguments, | 685 List arguments, |
| 692 Map<String, String> environmentOverrides) { | 686 Map<String, String> environmentOverrides) { |
| 693 var cc, shared, ld_flags; | 687 String cc, shared, ld_flags; |
| 694 if (isAndroid) { | 688 if (isAndroid) { |
| 695 var ndk = "third_party/android_tools/ndk"; | 689 var ndk = "third_party/android_tools/ndk"; |
| 696 var triple; | 690 String triple; |
| 697 if (arch == "arm") { | 691 if (arch == "arm") { |
| 698 triple = "arm-linux-androideabi"; | 692 triple = "arm-linux-androideabi"; |
| 699 } else if (arch == "arm64") { | 693 } else if (arch == "arm64") { |
| 700 triple = "aarch64-linux-android"; | 694 triple = "aarch64-linux-android"; |
| 701 } | 695 } |
| 702 var host; | 696 String host; |
| 703 if (Platform.isLinux) { | 697 if (Platform.isLinux) { |
| 704 host = "linux"; | 698 host = "linux"; |
| 705 } else if (Platform.isMacOS) { | 699 } else if (Platform.isMacOS) { |
| 706 host = "darwin"; | 700 host = "darwin"; |
| 707 } | 701 } |
| 708 cc = "$ndk/toolchains/$triple-4.9/prebuilt/$host-x86_64/bin/$triple-gcc"; | 702 cc = "$ndk/toolchains/$triple-4.9/prebuilt/$host-x86_64/bin/$triple-gcc"; |
| 709 shared = '-shared'; | 703 shared = '-shared'; |
| 710 } else if (Platform.isLinux) { | 704 } else if (Platform.isLinux) { |
| 711 cc = 'gcc'; | 705 cc = 'gcc'; |
| 712 shared = '-shared'; | 706 shared = '-shared'; |
| 713 } else if (Platform.isMacOS) { | 707 } else if (Platform.isMacOS) { |
| 714 cc = 'clang'; | 708 cc = 'clang'; |
| 715 shared = '-dynamiclib'; | 709 shared = '-dynamiclib'; |
| 716 // Tell Mac linker to give up generating eh_frame from dwarf. | 710 // Tell Mac linker to give up generating eh_frame from dwarf. |
| 717 ld_flags = '-Wl,-no_compact_unwind'; | 711 ld_flags = '-Wl,-no_compact_unwind'; |
| 718 } else { | 712 } else { |
| 719 throw "Platform not supported: ${Platform.operatingSystem}"; | 713 throw "Platform not supported: ${Platform.operatingSystem}"; |
| 720 } | 714 } |
| 721 | 715 |
| 722 var cc_flags; | 716 String cc_flags; |
| 723 if (arch == 'x64') { | 717 if (arch == 'x64') { |
| 724 cc_flags = "-m64"; | 718 cc_flags = "-m64"; |
| 725 } else if (arch == 'simarm64') { | 719 } else if (arch == 'simarm64') { |
| 726 cc_flags = "-m64"; | 720 cc_flags = "-m64"; |
| 727 } else if (arch == 'ia32') { | 721 } else if (arch == 'ia32') { |
| 728 cc_flags = "-m32"; | 722 cc_flags = "-m32"; |
| 729 } else if (arch == 'simarm') { | 723 } else if (arch == 'simarm') { |
| 730 cc_flags = "-m32"; | 724 cc_flags = "-m32"; |
| 731 } else if (arch == 'simmips') { | 725 } else if (arch == 'simmips') { |
| 732 cc_flags = "-m32"; | 726 cc_flags = "-m32"; |
| 733 } else if (arch == 'arm') { | 727 } else if (arch == 'arm') { |
| 734 cc_flags = null; | 728 cc_flags = null; |
| 735 } else if (arch == 'arm64') { | 729 } else if (arch == 'arm64') { |
| 736 cc_flags = null; | 730 cc_flags = null; |
| 737 } else if (arch == 'mips') { | 731 } else if (arch == 'mips') { |
| 738 cc_flags = "-EL"; | 732 cc_flags = "-EL"; |
| 739 } else { | 733 } else { |
| 740 throw "Architecture not supported: $arch"; | 734 throw "Architecture not supported: $arch"; |
| 741 } | 735 } |
| 742 | 736 |
| 743 var exec = cc; | 737 var exec = cc; |
| 744 var args = []; | 738 var args = <String>[]; |
| 745 if (cc_flags != null) args.add(cc_flags); | 739 if (cc_flags != null) args.add(cc_flags); |
| 746 if (ld_flags != null) args.add(ld_flags); | 740 if (ld_flags != null) args.add(ld_flags); |
| 747 args.add(shared); | 741 args.add(shared); |
| 748 args.add('-nostdlib'); | 742 args.add('-nostdlib'); |
| 749 args.add('-o'); | 743 args.add('-o'); |
| 750 args.add('$tempDir/out.aotsnapshot'); | 744 args.add('$tempDir/out.aotsnapshot'); |
| 751 args.add('$tempDir/out.S'); | 745 args.add('$tempDir/out.S'); |
| 752 | 746 |
| 753 return commandBuilder.getCompilationCommand('assemble', tempDir, !useSdk, | 747 return commandBuilder.getCompilationCommand('assemble', tempDir, !useSdk, |
| 754 bootstrapDependencies(buildDir), exec, args, environmentOverrides); | 748 bootstrapDependencies(buildDir), exec, args, environmentOverrides); |
| (...skipping 14 matching lines...) Expand all Loading... |
| 769 'remove_assembly', | 763 'remove_assembly', |
| 770 tempDir, | 764 tempDir, |
| 771 !useSdk, | 765 !useSdk, |
| 772 bootstrapDependencies(buildDir), | 766 bootstrapDependencies(buildDir), |
| 773 exec, | 767 exec, |
| 774 args, | 768 args, |
| 775 environmentOverrides); | 769 environmentOverrides); |
| 776 } | 770 } |
| 777 | 771 |
| 778 List<String> filterVmOptions(List<String> vmOptions) { | 772 List<String> filterVmOptions(List<String> vmOptions) { |
| 779 var filtered = new List.from(vmOptions); | 773 var filtered = vmOptions.toList(); |
| 780 filtered.removeWhere( | 774 filtered.removeWhere( |
| 781 (option) => option.startsWith("--optimization-counter-threshold")); | 775 (option) => option.startsWith("--optimization-counter-threshold")); |
| 782 filtered.removeWhere( | 776 filtered.removeWhere( |
| 783 (option) => option.startsWith("--optimization_counter_threshold")); | 777 (option) => option.startsWith("--optimization_counter_threshold")); |
| 784 return filtered; | 778 return filtered; |
| 785 } | 779 } |
| 786 | 780 |
| 787 List<String> computeCompilerArguments( | 781 List<String> computeCompilerArguments( |
| 788 vmOptions, sharedOptions, originalArguments) { | 782 vmOptions, sharedOptions, originalArguments) { |
| 789 List<String> args = []; | 783 List<String> args = []; |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 835 int multiplier = 1; | 829 int multiplier = 1; |
| 836 if (isDebug) multiplier *= 2; | 830 if (isDebug) multiplier *= 2; |
| 837 if (isChecked) multiplier *= 2; | 831 if (isChecked) multiplier *= 2; |
| 838 return multiplier; | 832 return multiplier; |
| 839 } | 833 } |
| 840 | 834 |
| 841 CommandArtifact computeCompilationArtifact( | 835 CommandArtifact computeCompilationArtifact( |
| 842 String buildDir, | 836 String buildDir, |
| 843 String tempDir, | 837 String tempDir, |
| 844 CommandBuilder commandBuilder, | 838 CommandBuilder commandBuilder, |
| 845 List arguments, | 839 List<String> arguments, |
| 846 Map<String, String> environmentOverrides) { | 840 Map<String, String> environmentOverrides) { |
| 847 var snapshot = "$tempDir/out.jitsnapshot"; | 841 var snapshot = "$tempDir/out.jitsnapshot"; |
| 848 return new CommandArtifact(<Command>[ | 842 return new CommandArtifact(<Command>[ |
| 849 this.computeCompilationCommand(tempDir, buildDir, CommandBuilder.instance, | 843 this.computeCompilationCommand(tempDir, buildDir, CommandBuilder.instance, |
| 850 arguments, environmentOverrides) | 844 arguments, environmentOverrides) |
| 851 ], snapshot, 'application/dart-snapshot'); | 845 ], snapshot, 'application/dart-snapshot'); |
| 852 } | 846 } |
| 853 | 847 |
| 854 CompilationCommand computeCompilationCommand( | 848 CompilationCommand computeCompilationCommand( |
| 855 String tempDir, | 849 String tempDir, |
| 856 String buildDir, | 850 String buildDir, |
| 857 CommandBuilder commandBuilder, | 851 CommandBuilder commandBuilder, |
| 858 List arguments, | 852 List<String> arguments, |
| 859 Map<String, String> environmentOverrides) { | 853 Map<String, String> environmentOverrides) { |
| 860 var exec = "$buildDir/dart"; | 854 var exec = "$buildDir/dart"; |
| 861 var args = new List(); | |
| 862 var snapshot = "$tempDir/out.jitsnapshot"; | 855 var snapshot = "$tempDir/out.jitsnapshot"; |
| 863 args.add("--snapshot=$snapshot"); | 856 var args = ["--snapshot=$snapshot", "--snapshot-kind=app-jit"]; |
| 864 args.add("--snapshot-kind=app-jit"); | |
| 865 args.addAll(arguments); | 857 args.addAll(arguments); |
| 866 | 858 |
| 867 return commandBuilder.getCompilationCommand('app_jit', tempDir, !useSdk, | 859 return commandBuilder.getCompilationCommand('app_jit', tempDir, !useSdk, |
| 868 bootstrapDependencies(buildDir), exec, args, environmentOverrides); | 860 bootstrapDependencies(buildDir), exec, args, environmentOverrides); |
| 869 } | 861 } |
| 870 | 862 |
| 871 List<String> computeCompilerArguments( | 863 List<String> computeCompilerArguments( |
| 872 vmOptions, sharedOptions, originalArguments) { | 864 vmOptions, sharedOptions, originalArguments) { |
| 873 List<String> args = []; | 865 var args = <String>[]; |
| 874 if (isChecked) { | 866 if (isChecked) { |
| 875 args.add('--enable_asserts'); | 867 args.add('--enable_asserts'); |
| 876 args.add('--enable_type_checks'); | 868 args.add('--enable_type_checks'); |
| 877 } | 869 } |
| 878 return args | 870 return args |
| 879 ..addAll(vmOptions) | 871 ..addAll(vmOptions) |
| 880 ..addAll(sharedOptions) | 872 ..addAll(sharedOptions) |
| 881 ..addAll(originalArguments); | 873 ..addAll(originalArguments); |
| 882 } | 874 } |
| 883 | 875 |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 937 if (useSdk) { | 929 if (useSdk) { |
| 938 prefix = '$buildDir/dart-sdk/bin'; | 930 prefix = '$buildDir/dart-sdk/bin'; |
| 939 } | 931 } |
| 940 return '$prefix/dartanalyzer$suffix'; | 932 return '$prefix/dartanalyzer$suffix'; |
| 941 } | 933 } |
| 942 | 934 |
| 943 CommandArtifact computeCompilationArtifact( | 935 CommandArtifact computeCompilationArtifact( |
| 944 String buildDir, | 936 String buildDir, |
| 945 String tempDir, | 937 String tempDir, |
| 946 CommandBuilder commandBuilder, | 938 CommandBuilder commandBuilder, |
| 947 List arguments, | 939 List<String> arguments, |
| 948 Map<String, String> environmentOverrides) { | 940 Map<String, String> environmentOverrides) { |
| 949 arguments = new List.from(arguments); | 941 arguments = arguments.toList(); |
| 950 if (isChecked || isStrong) { | 942 if (isChecked || isStrong) { |
| 951 arguments.add('--enable_type_checks'); | 943 arguments.add('--enable_type_checks'); |
| 952 } | 944 } |
| 953 if (isStrong) { | 945 if (isStrong) { |
| 954 arguments.add('--strong'); | 946 arguments.add('--strong'); |
| 955 } | 947 } |
| 956 return new CommandArtifact(<Command>[ | 948 return new CommandArtifact([ |
| 957 commandBuilder.getAnalysisCommand('dart2analyzer', | 949 commandBuilder.getAnalysisCommand('dart2analyzer', |
| 958 computeCompilerPath(buildDir), arguments, environmentOverrides, | 950 computeCompilerPath(buildDir), arguments, environmentOverrides, |
| 959 flavor: 'dart2analyzer') | 951 flavor: 'dart2analyzer') |
| 960 ], null, null); // Since this is not a real compilation, no artifacts are | 952 ], null, null); // Since this is not a real compilation, no artifacts are |
| 961 // produced. | 953 // produced. |
| 962 } | 954 } |
| 963 | 955 |
| 964 List<String> computeRuntimeArguments( | 956 List<String> computeRuntimeArguments( |
| 965 RuntimeConfiguration runtimeConfiguration, | 957 RuntimeConfiguration runtimeConfiguration, |
| 966 String buildDir, | 958 String buildDir, |
| 967 TestInformation info, | 959 TestInformation info, |
| 968 List<String> vmOptions, | 960 List<String> vmOptions, |
| 969 List<String> sharedOptions, | 961 List<String> sharedOptions, |
| 970 List<String> originalArguments, | 962 List<String> originalArguments, |
| 971 CommandArtifact artifact) { | 963 CommandArtifact artifact) { |
| 972 return <String>[]; | 964 return <String>[]; |
| 973 } | 965 } |
| 974 } | 966 } |
| OLD | NEW |