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 import 'dart:io'; | 5 import 'dart:io'; |
6 | 6 |
| 7 import 'command.dart'; |
7 import 'configuration.dart'; | 8 import 'configuration.dart'; |
8 import 'runtime_configuration.dart'; | 9 import 'runtime_configuration.dart'; |
9 import 'test_runner.dart'; | |
10 import 'test_suite.dart'; | 10 import 'test_suite.dart'; |
11 import 'utils.dart'; | 11 import 'utils.dart'; |
12 | 12 |
13 List<String> replaceDartFileWith(List<String> list, String replacement) { | 13 List<String> replaceDartFileWith(List<String> list, String replacement) { |
14 var copy = new List<String>.from(list); | 14 var copy = new List<String>.from(list); |
15 for (var i = 0; i < copy.length; i++) { | 15 for (var i = 0; i < copy.length; i++) { |
16 if (copy[i].endsWith(".dart")) { | 16 if (copy[i].endsWith(".dart")) { |
17 copy[i] = replacement; | 17 copy[i] = replacement; |
18 } | 18 } |
19 } | 19 } |
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
136 | 136 |
137 bool get hasCompiler => true; | 137 bool get hasCompiler => true; |
138 | 138 |
139 String get executableScriptSuffix => Platform.isWindows ? '.bat' : ''; | 139 String get executableScriptSuffix => Platform.isWindows ? '.bat' : ''; |
140 | 140 |
141 // TODO(ahe): Remove this. | 141 // TODO(ahe): Remove this. |
142 bool get isCsp => false; | 142 bool get isCsp => false; |
143 | 143 |
144 List<Uri> bootstrapDependencies(String buildDir) => const <Uri>[]; | 144 List<Uri> bootstrapDependencies(String buildDir) => const <Uri>[]; |
145 | 145 |
146 CommandArtifact computeCompilationArtifact( | 146 CommandArtifact computeCompilationArtifact(String buildDir, String tempDir, |
147 String buildDir, | 147 List<String> arguments, Map<String, String> environmentOverrides) { |
148 String tempDir, | |
149 CommandBuilder commandBuilder, | |
150 List<String> arguments, | |
151 Map<String, String> environmentOverrides) { | |
152 return new CommandArtifact([], null, null); | 148 return new CommandArtifact([], null, null); |
153 } | 149 } |
154 | 150 |
155 List<String> computeCompilerArguments( | 151 List<String> computeCompilerArguments( |
156 List<String> vmOptions, List<String> sharedOptions, List<String> args) { | 152 List<String> vmOptions, List<String> sharedOptions, List<String> args) { |
157 return sharedOptions.toList()..addAll(args); | 153 return sharedOptions.toList()..addAll(args); |
158 } | 154 } |
159 | 155 |
160 List<String> computeRuntimeArguments( | 156 List<String> computeRuntimeArguments( |
161 RuntimeConfiguration runtimeConfiguration, | 157 RuntimeConfiguration runtimeConfiguration, |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
232 this.strong, | 228 this.strong, |
233 this.treeShake}) | 229 this.treeShake}) |
234 : super._subclass( | 230 : super._subclass( |
235 isChecked: isChecked, isHostChecked: isHostChecked, useSdk: useSdk); | 231 isChecked: isChecked, isHostChecked: isHostChecked, useSdk: useSdk); |
236 | 232 |
237 @override | 233 @override |
238 String computeCompilerPath(String buildDir) { | 234 String computeCompilerPath(String buildDir) { |
239 return 'tools/dartk_wrappers/dartk$executableScriptSuffix'; | 235 return 'tools/dartk_wrappers/dartk$executableScriptSuffix'; |
240 } | 236 } |
241 | 237 |
242 CompilationCommand computeCompilationCommand( | 238 Command computeCompilationCommand(String outputFileName, String buildDir, |
243 String outputFileName, | 239 List<String> arguments, Map<String, String> environmentOverrides) { |
244 String buildDir, | |
245 CommandBuilder commandBuilder, | |
246 List<String> arguments, | |
247 Map<String, String> environmentOverrides) { | |
248 Iterable<String> extraArguments = [ | 240 Iterable<String> extraArguments = [ |
249 '--sdk', | 241 '--sdk', |
250 '$buildDir/patched_sdk', | 242 '$buildDir/patched_sdk', |
251 '--link', | 243 '--link', |
252 '--target=vm', | 244 '--target=vm', |
253 treeShake ? '--tree-shake' : null, | 245 treeShake ? '--tree-shake' : null, |
254 strong ? '--strong' : null, | 246 strong ? '--strong' : null, |
255 verify ? '--verify-ir' : null, | 247 verify ? '--verify-ir' : null, |
256 '--out', | 248 '--out', |
257 outputFileName | 249 outputFileName |
258 ].where((x) => x != null); | 250 ].where((x) => x != null); |
259 return commandBuilder.getKernelCompilationCommand( | 251 return Command.kernelCompilation( |
260 'dartk', | |
261 outputFileName, | 252 outputFileName, |
262 true, | 253 true, |
263 bootstrapDependencies(buildDir), | 254 bootstrapDependencies(buildDir), |
264 computeCompilerPath(buildDir), | 255 computeCompilerPath(buildDir), |
265 <String>[]..addAll(arguments)..addAll(extraArguments), | 256 <String>[]..addAll(arguments)..addAll(extraArguments), |
266 environmentOverrides); | 257 environmentOverrides); |
267 } | 258 } |
268 | 259 |
269 CommandArtifact computeCompilationArtifact( | 260 CommandArtifact computeCompilationArtifact(String buildDir, String tempDir, |
270 String buildDir, | 261 List<String> arguments, Map<String, String> environmentOverrides) { |
271 String tempDir, | 262 return new CommandArtifact([ |
272 CommandBuilder commandBuilder, | 263 computeCompilationCommand( |
273 List<String> arguments, | 264 '$tempDir/out.dill', buildDir, arguments, environmentOverrides) |
274 Map<String, String> environmentOverrides) { | |
275 return new CommandArtifact(<Command>[ | |
276 computeCompilationCommand('$tempDir/out.dill', buildDir, | |
277 CommandBuilder.instance, arguments, environmentOverrides) | |
278 ], '$tempDir/out.dill', 'application/dart'); | 265 ], '$tempDir/out.dill', 'application/dart'); |
279 } | 266 } |
280 | 267 |
281 List<String> computeRuntimeArguments( | 268 List<String> computeRuntimeArguments( |
282 RuntimeConfiguration runtimeConfiguration, | 269 RuntimeConfiguration runtimeConfiguration, |
283 String buildDir, | 270 String buildDir, |
284 TestInformation info, | 271 TestInformation info, |
285 List<String> vmOptions, | 272 List<String> vmOptions, |
286 List<String> sharedOptions, | 273 List<String> sharedOptions, |
287 List<String> originalArguments, | 274 List<String> originalArguments, |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
344 List<String> globalArguments, String previousOutput) { | 331 List<String> globalArguments, String previousOutput) { |
345 return _argumentsFunction(globalArguments, previousOutput); | 332 return _argumentsFunction(globalArguments, previousOutput); |
346 } | 333 } |
347 } | 334 } |
348 | 335 |
349 class ComposedCompilerConfiguration extends CompilerConfiguration { | 336 class ComposedCompilerConfiguration extends CompilerConfiguration { |
350 final List<PipelineCommand> pipelineCommands; | 337 final List<PipelineCommand> pipelineCommands; |
351 | 338 |
352 ComposedCompilerConfiguration(this.pipelineCommands) : super._subclass(); | 339 ComposedCompilerConfiguration(this.pipelineCommands) : super._subclass(); |
353 | 340 |
354 CommandArtifact computeCompilationArtifact( | 341 CommandArtifact computeCompilationArtifact(String buildDir, String tempDir, |
355 String buildDir, | 342 List<String> globalArguments, Map<String, String> environmentOverrides) { |
356 String tempDir, | |
357 CommandBuilder commandBuilder, | |
358 List<String> globalArguments, | |
359 Map<String, String> environmentOverrides) { | |
360 List<Command> allCommands = []; | 343 List<Command> allCommands = []; |
361 | 344 |
362 // The first compilation command is as usual. | 345 // The first compilation command is as usual. |
363 var arguments = pipelineCommands[0].extractArguments(globalArguments, null); | 346 var arguments = pipelineCommands[0].extractArguments(globalArguments, null); |
364 CommandArtifact artifact = pipelineCommands[0] | 347 CommandArtifact artifact = pipelineCommands[0] |
365 .compilerConfiguration | 348 .compilerConfiguration |
366 .computeCompilationArtifact( | 349 .computeCompilationArtifact( |
367 buildDir, tempDir, commandBuilder, arguments, environmentOverrides); | 350 buildDir, tempDir, arguments, environmentOverrides); |
368 allCommands.addAll(artifact.commands); | 351 allCommands.addAll(artifact.commands); |
369 | 352 |
370 // The following compilation commands are based on the output of the | 353 // The following compilation commands are based on the output of the |
371 // previous one. | 354 // previous one. |
372 for (int i = 1; i < pipelineCommands.length; i++) { | 355 for (int i = 1; i < pipelineCommands.length; i++) { |
373 PipelineCommand pc = pipelineCommands[i]; | 356 PipelineCommand pc = pipelineCommands[i]; |
374 | 357 |
375 arguments = pc.extractArguments(globalArguments, artifact.filename); | 358 arguments = pc.extractArguments(globalArguments, artifact.filename); |
376 artifact = pc.compilerConfiguration.computeCompilationArtifact( | 359 artifact = pc.compilerConfiguration.computeCompilationArtifact( |
377 buildDir, tempDir, commandBuilder, arguments, environmentOverrides); | 360 buildDir, tempDir, arguments, environmentOverrides); |
378 | 361 |
379 allCommands.addAll(artifact.commands); | 362 allCommands.addAll(artifact.commands); |
380 } | 363 } |
381 | 364 |
382 return new CommandArtifact( | 365 return new CommandArtifact( |
383 allCommands, artifact.filename, artifact.mimeType); | 366 allCommands, artifact.filename, artifact.mimeType); |
384 } | 367 } |
385 | 368 |
386 List<String> computeCompilerArguments(vmOptions, sharedOptions, args) { | 369 List<String> computeCompilerArguments(vmOptions, sharedOptions, args) { |
387 // The result will be passed as an input to [extractArguments] | 370 // The result will be passed as an input to [extractArguments] |
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
482 // "$buildDir/dart-sdk/bin/" | 465 // "$buildDir/dart-sdk/bin/" |
483 return '$prefix/dart2js_developer$suffix'; | 466 return '$prefix/dart2js_developer$suffix'; |
484 } else { | 467 } else { |
485 if (useSdk) { | 468 if (useSdk) { |
486 prefix = '$buildDir/dart-sdk/bin'; | 469 prefix = '$buildDir/dart-sdk/bin'; |
487 } | 470 } |
488 return '$prefix/dart2js$suffix'; | 471 return '$prefix/dart2js$suffix'; |
489 } | 472 } |
490 } | 473 } |
491 | 474 |
492 CompilationCommand computeCompilationCommand( | 475 Command computeCompilationCommand(String outputFileName, String buildDir, |
493 String outputFileName, | 476 List<String> arguments, Map<String, String> environmentOverrides) { |
494 String buildDir, | |
495 CommandBuilder commandBuilder, | |
496 List<String> arguments, | |
497 Map<String, String> environmentOverrides) { | |
498 arguments = arguments.toList(); | 477 arguments = arguments.toList(); |
499 arguments.add('--out=$outputFileName'); | 478 arguments.add('--out=$outputFileName'); |
500 | 479 |
501 return commandBuilder.getCompilationCommand( | 480 return Command.compilation( |
502 moniker, | 481 moniker, |
503 outputFileName, | 482 outputFileName, |
504 !useSdk, | 483 !useSdk, |
505 bootstrapDependencies(buildDir), | 484 bootstrapDependencies(buildDir), |
506 computeCompilerPath(buildDir), | 485 computeCompilerPath(buildDir), |
507 arguments, | 486 arguments, |
508 environmentOverrides); | 487 environmentOverrides); |
509 } | 488 } |
510 | 489 |
511 List<Uri> bootstrapDependencies(String buildDir) { | 490 List<Uri> bootstrapDependencies(String buildDir) { |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
543 useSdk: useSdk); | 522 useSdk: useSdk); |
544 | 523 |
545 int get timeoutMultiplier { | 524 int get timeoutMultiplier { |
546 var multiplier = 1; | 525 var multiplier = 1; |
547 if (isDebug) multiplier *= 4; | 526 if (isDebug) multiplier *= 4; |
548 if (isChecked) multiplier *= 2; | 527 if (isChecked) multiplier *= 2; |
549 if (isHostChecked) multiplier *= 16; | 528 if (isHostChecked) multiplier *= 16; |
550 return multiplier; | 529 return multiplier; |
551 } | 530 } |
552 | 531 |
553 CommandArtifact computeCompilationArtifact( | 532 CommandArtifact computeCompilationArtifact(String buildDir, String tempDir, |
554 String buildDir, | 533 List<String> arguments, Map<String, String> environmentOverrides) { |
555 String tempDir, | |
556 CommandBuilder commandBuilder, | |
557 List<String> arguments, | |
558 Map<String, String> environmentOverrides) { | |
559 var compilerArguments = arguments.toList()..addAll(extraDart2jsOptions); | 534 var compilerArguments = arguments.toList()..addAll(extraDart2jsOptions); |
560 return new CommandArtifact([ | 535 return new CommandArtifact([ |
561 this.computeCompilationCommand('$tempDir/out.js', buildDir, | 536 computeCompilationCommand( |
562 CommandBuilder.instance, compilerArguments, environmentOverrides) | 537 '$tempDir/out.js', buildDir, compilerArguments, environmentOverrides) |
563 ], '$tempDir/out.js', 'application/javascript'); | 538 ], '$tempDir/out.js', 'application/javascript'); |
564 } | 539 } |
565 | 540 |
566 List<String> computeRuntimeArguments( | 541 List<String> computeRuntimeArguments( |
567 RuntimeConfiguration runtimeConfiguration, | 542 RuntimeConfiguration runtimeConfiguration, |
568 String buildDir, | 543 String buildDir, |
569 TestInformation info, | 544 TestInformation info, |
570 List<String> vmOptions, | 545 List<String> vmOptions, |
571 List<String> sharedOptions, | 546 List<String> sharedOptions, |
572 List<String> originalArguments, | 547 List<String> originalArguments, |
(...skipping 23 matching lines...) Expand all Loading... |
596 this.useDfe: false}) | 571 this.useDfe: false}) |
597 : super._subclass(isDebug: isDebug, isChecked: isChecked); | 572 : super._subclass(isDebug: isDebug, isChecked: isChecked); |
598 | 573 |
599 int get timeoutMultiplier { | 574 int get timeoutMultiplier { |
600 var multiplier = 2; | 575 var multiplier = 2; |
601 if (isDebug) multiplier *= 4; | 576 if (isDebug) multiplier *= 4; |
602 if (isChecked) multiplier *= 2; | 577 if (isChecked) multiplier *= 2; |
603 return multiplier; | 578 return multiplier; |
604 } | 579 } |
605 | 580 |
606 CommandArtifact computeCompilationArtifact( | 581 CommandArtifact computeCompilationArtifact(String buildDir, String tempDir, |
607 String buildDir, | 582 List<String> arguments, Map<String, String> environmentOverrides) { |
608 String tempDir, | |
609 CommandBuilder commandBuilder, | |
610 List<String> arguments, | |
611 Map<String, String> environmentOverrides) { | |
612 var commands = new List<Command>(); | 583 var commands = new List<Command>(); |
613 commands.add(this.computeCompilationCommand(tempDir, buildDir, | 584 commands.add(this.computeCompilationCommand( |
614 CommandBuilder.instance, arguments, environmentOverrides)); | 585 tempDir, buildDir, arguments, environmentOverrides)); |
615 if (!useBlobs) { | 586 if (!useBlobs) { |
616 commands.add(this.computeAssembleCommand(tempDir, buildDir, | 587 commands.add(this.computeAssembleCommand( |
617 CommandBuilder.instance, arguments, environmentOverrides)); | 588 tempDir, buildDir, arguments, environmentOverrides)); |
618 commands.add(this.computeRemoveAssemblyCommand(tempDir, buildDir, | 589 commands.add(this.computeRemoveAssemblyCommand( |
619 CommandBuilder.instance, arguments, environmentOverrides)); | 590 tempDir, buildDir, arguments, environmentOverrides)); |
620 } | 591 } |
621 return new CommandArtifact( | 592 return new CommandArtifact( |
622 commands, '$tempDir', 'application/dart-precompiled'); | 593 commands, '$tempDir', 'application/dart-precompiled'); |
623 } | 594 } |
624 | 595 |
625 CompilationCommand computeCompilationCommand( | 596 Command computeCompilationCommand(String tempDir, String buildDir, |
626 String tempDir, | 597 List<String> arguments, Map<String, String> environmentOverrides) { |
627 String buildDir, | |
628 CommandBuilder commandBuilder, | |
629 List<String> arguments, | |
630 Map<String, String> environmentOverrides) { | |
631 String exec; | 598 String exec; |
632 if (isAndroid) { | 599 if (isAndroid) { |
633 if (arch == Architecture.arm) { | 600 if (arch == Architecture.arm) { |
634 exec = "$buildDir/clang_x86/dart_bootstrap"; | 601 exec = "$buildDir/clang_x86/dart_bootstrap"; |
635 } else if (arch == Architecture.arm64) { | 602 } else if (arch == Architecture.arm64) { |
636 exec = "$buildDir/clang_x64/dart_bootstrap"; | 603 exec = "$buildDir/clang_x64/dart_bootstrap"; |
637 } | 604 } |
638 } else { | 605 } else { |
639 exec = "$buildDir/dart_bootstrap"; | 606 exec = "$buildDir/dart_bootstrap"; |
640 } | 607 } |
641 var args = <String>[]; | 608 var args = <String>[]; |
642 if (useDfe) { | 609 if (useDfe) { |
643 args.add('--dfe=utils/kernel-service/kernel-service.dart'); | 610 args.add('--dfe=utils/kernel-service/kernel-service.dart'); |
644 args.add('--platform=${buildDir}/patched_sdk/platform.dill'); | 611 args.add('--platform=${buildDir}/patched_sdk/platform.dill'); |
645 } | 612 } |
646 args.add("--snapshot-kind=app-aot"); | 613 args.add("--snapshot-kind=app-aot"); |
647 if (useBlobs) { | 614 if (useBlobs) { |
648 args.add("--snapshot=$tempDir/out.aotsnapshot"); | 615 args.add("--snapshot=$tempDir/out.aotsnapshot"); |
649 args.add("--use-blobs"); | 616 args.add("--use-blobs"); |
650 } else { | 617 } else { |
651 args.add("--snapshot=$tempDir/out.S"); | 618 args.add("--snapshot=$tempDir/out.S"); |
652 } | 619 } |
653 if (isAndroid && arch == Architecture.arm) { | 620 if (isAndroid && arch == Architecture.arm) { |
654 args.add('--no-sim-use-hardfp'); | 621 args.add('--no-sim-use-hardfp'); |
655 } | 622 } |
656 args.addAll(arguments); | 623 args.addAll(arguments); |
657 | 624 |
658 return commandBuilder.getCompilationCommand('precompiler', tempDir, !useSdk, | 625 return Command.compilation('precompiler', tempDir, !useSdk, |
659 bootstrapDependencies(buildDir), exec, args, environmentOverrides); | 626 bootstrapDependencies(buildDir), exec, args, environmentOverrides); |
660 } | 627 } |
661 | 628 |
662 CompilationCommand computeAssembleCommand( | 629 Command computeAssembleCommand(String tempDir, String buildDir, |
663 String tempDir, | 630 List arguments, Map<String, String> environmentOverrides) { |
664 String buildDir, | |
665 CommandBuilder commandBuilder, | |
666 List arguments, | |
667 Map<String, String> environmentOverrides) { | |
668 String cc, shared, ldFlags; | 631 String cc, shared, ldFlags; |
669 if (isAndroid) { | 632 if (isAndroid) { |
670 var ndk = "third_party/android_tools/ndk"; | 633 var ndk = "third_party/android_tools/ndk"; |
671 String triple; | 634 String triple; |
672 if (arch == Architecture.arm) { | 635 if (arch == Architecture.arm) { |
673 triple = "arm-linux-androideabi"; | 636 triple = "arm-linux-androideabi"; |
674 } else if (arch == Architecture.arm64) { | 637 } else if (arch == Architecture.arm64) { |
675 triple = "aarch64-linux-android"; | 638 triple = "aarch64-linux-android"; |
676 } | 639 } |
677 String host; | 640 String host; |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
719 var exec = cc; | 682 var exec = cc; |
720 var args = <String>[]; | 683 var args = <String>[]; |
721 if (ccFlags != null) args.add(ccFlags); | 684 if (ccFlags != null) args.add(ccFlags); |
722 if (ldFlags != null) args.add(ldFlags); | 685 if (ldFlags != null) args.add(ldFlags); |
723 args.add(shared); | 686 args.add(shared); |
724 args.add('-nostdlib'); | 687 args.add('-nostdlib'); |
725 args.add('-o'); | 688 args.add('-o'); |
726 args.add('$tempDir/out.aotsnapshot'); | 689 args.add('$tempDir/out.aotsnapshot'); |
727 args.add('$tempDir/out.S'); | 690 args.add('$tempDir/out.S'); |
728 | 691 |
729 return commandBuilder.getCompilationCommand('assemble', tempDir, !useSdk, | 692 return Command.compilation('assemble', tempDir, !useSdk, |
730 bootstrapDependencies(buildDir), exec, args, environmentOverrides); | 693 bootstrapDependencies(buildDir), exec, args, environmentOverrides); |
731 } | 694 } |
732 | 695 |
733 // This step reduces the amount of space needed to run the precompilation | 696 // This step reduces the amount of space needed to run the precompilation |
734 // tests by 60%. | 697 // tests by 60%. |
735 CompilationCommand computeRemoveAssemblyCommand( | 698 Command computeRemoveAssemblyCommand(String tempDir, String buildDir, |
736 String tempDir, | 699 List arguments, Map<String, String> environmentOverrides) { |
737 String buildDir, | |
738 CommandBuilder commandBuilder, | |
739 List arguments, | |
740 Map<String, String> environmentOverrides) { | |
741 var exec = 'rm'; | 700 var exec = 'rm'; |
742 var args = ['$tempDir/out.S']; | 701 var args = ['$tempDir/out.S']; |
743 | 702 |
744 return commandBuilder.getCompilationCommand( | 703 return Command.compilation('remove_assembly', tempDir, !useSdk, |
745 'remove_assembly', | 704 bootstrapDependencies(buildDir), exec, args, environmentOverrides); |
746 tempDir, | |
747 !useSdk, | |
748 bootstrapDependencies(buildDir), | |
749 exec, | |
750 args, | |
751 environmentOverrides); | |
752 } | 705 } |
753 | 706 |
754 List<String> filterVmOptions(List<String> vmOptions) { | 707 List<String> filterVmOptions(List<String> vmOptions) { |
755 var filtered = vmOptions.toList(); | 708 var filtered = vmOptions.toList(); |
756 filtered.removeWhere( | 709 filtered.removeWhere( |
757 (option) => option.startsWith("--optimization-counter-threshold")); | 710 (option) => option.startsWith("--optimization-counter-threshold")); |
758 filtered.removeWhere( | 711 filtered.removeWhere( |
759 (option) => option.startsWith("--optimization_counter_threshold")); | 712 (option) => option.startsWith("--optimization_counter_threshold")); |
760 return filtered; | 713 return filtered; |
761 } | 714 } |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
807 AppJitCompilerConfiguration({bool isDebug, bool isChecked}) | 760 AppJitCompilerConfiguration({bool isDebug, bool isChecked}) |
808 : super._subclass(isDebug: isDebug, isChecked: isChecked); | 761 : super._subclass(isDebug: isDebug, isChecked: isChecked); |
809 | 762 |
810 int get timeoutMultiplier { | 763 int get timeoutMultiplier { |
811 var multiplier = 1; | 764 var multiplier = 1; |
812 if (isDebug) multiplier *= 2; | 765 if (isDebug) multiplier *= 2; |
813 if (isChecked) multiplier *= 2; | 766 if (isChecked) multiplier *= 2; |
814 return multiplier; | 767 return multiplier; |
815 } | 768 } |
816 | 769 |
817 CommandArtifact computeCompilationArtifact( | 770 CommandArtifact computeCompilationArtifact(String buildDir, String tempDir, |
818 String buildDir, | 771 List<String> arguments, Map<String, String> environmentOverrides) { |
819 String tempDir, | |
820 CommandBuilder commandBuilder, | |
821 List<String> arguments, | |
822 Map<String, String> environmentOverrides) { | |
823 var snapshot = "$tempDir/out.jitsnapshot"; | 772 var snapshot = "$tempDir/out.jitsnapshot"; |
824 return new CommandArtifact(<Command>[ | 773 return new CommandArtifact([ |
825 this.computeCompilationCommand(tempDir, buildDir, CommandBuilder.instance, | 774 computeCompilationCommand( |
826 arguments, environmentOverrides) | 775 tempDir, buildDir, arguments, environmentOverrides) |
827 ], snapshot, 'application/dart-snapshot'); | 776 ], snapshot, 'application/dart-snapshot'); |
828 } | 777 } |
829 | 778 |
830 CompilationCommand computeCompilationCommand( | 779 Command computeCompilationCommand(String tempDir, String buildDir, |
831 String tempDir, | 780 List<String> arguments, Map<String, String> environmentOverrides) { |
832 String buildDir, | |
833 CommandBuilder commandBuilder, | |
834 List<String> arguments, | |
835 Map<String, String> environmentOverrides) { | |
836 var exec = "$buildDir/dart"; | 781 var exec = "$buildDir/dart"; |
837 var snapshot = "$tempDir/out.jitsnapshot"; | 782 var snapshot = "$tempDir/out.jitsnapshot"; |
838 var args = ["--snapshot=$snapshot", "--snapshot-kind=app-jit"]; | 783 var args = ["--snapshot=$snapshot", "--snapshot-kind=app-jit"]; |
839 args.addAll(arguments); | 784 args.addAll(arguments); |
840 | 785 |
841 return commandBuilder.getCompilationCommand('app_jit', tempDir, !useSdk, | 786 return Command.compilation('app_jit', tempDir, !useSdk, |
842 bootstrapDependencies(buildDir), exec, args, environmentOverrides); | 787 bootstrapDependencies(buildDir), exec, args, environmentOverrides); |
843 } | 788 } |
844 | 789 |
845 List<String> computeCompilerArguments( | 790 List<String> computeCompilerArguments( |
846 vmOptions, sharedOptions, originalArguments) { | 791 vmOptions, sharedOptions, originalArguments) { |
847 var args = <String>[]; | 792 var args = <String>[]; |
848 if (isChecked) { | 793 if (isChecked) { |
849 args.add('--enable_asserts'); | 794 args.add('--enable_asserts'); |
850 args.add('--enable_type_checks'); | 795 args.add('--enable_type_checks'); |
851 } | 796 } |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
905 // shipped SDK, that is the script is not installed in | 850 // shipped SDK, that is the script is not installed in |
906 // "$buildDir/dart-sdk/bin/" | 851 // "$buildDir/dart-sdk/bin/" |
907 return '$prefix/dartanalyzer_developer$suffix'; | 852 return '$prefix/dartanalyzer_developer$suffix'; |
908 } | 853 } |
909 if (useSdk) { | 854 if (useSdk) { |
910 prefix = '$buildDir/dart-sdk/bin'; | 855 prefix = '$buildDir/dart-sdk/bin'; |
911 } | 856 } |
912 return '$prefix/dartanalyzer$suffix'; | 857 return '$prefix/dartanalyzer$suffix'; |
913 } | 858 } |
914 | 859 |
915 CommandArtifact computeCompilationArtifact( | 860 CommandArtifact computeCompilationArtifact(String buildDir, String tempDir, |
916 String buildDir, | 861 List<String> arguments, Map<String, String> environmentOverrides) { |
917 String tempDir, | |
918 CommandBuilder commandBuilder, | |
919 List<String> arguments, | |
920 Map<String, String> environmentOverrides) { | |
921 arguments = arguments.toList(); | 862 arguments = arguments.toList(); |
922 if (isChecked || isStrong) { | 863 if (isChecked || isStrong) { |
923 arguments.add('--enable_type_checks'); | 864 arguments.add('--enable_type_checks'); |
924 } | 865 } |
925 if (isStrong) { | 866 if (isStrong) { |
926 arguments.add('--strong'); | 867 arguments.add('--strong'); |
927 } | 868 } |
928 return new CommandArtifact([ | 869 return new CommandArtifact([ |
929 commandBuilder.getAnalysisCommand('dart2analyzer', | 870 Command.analysis( |
930 computeCompilerPath(buildDir), arguments, environmentOverrides, | 871 computeCompilerPath(buildDir), arguments, environmentOverrides) |
931 flavor: 'dart2analyzer') | |
932 ], null, null); // Since this is not a real compilation, no artifacts are | 872 ], null, null); // Since this is not a real compilation, no artifacts are |
933 // produced. | 873 // produced. |
934 } | 874 } |
935 | 875 |
936 List<String> computeRuntimeArguments( | 876 List<String> computeRuntimeArguments( |
937 RuntimeConfiguration runtimeConfiguration, | 877 RuntimeConfiguration runtimeConfiguration, |
938 String buildDir, | 878 String buildDir, |
939 TestInformation info, | 879 TestInformation info, |
940 List<String> vmOptions, | 880 List<String> vmOptions, |
941 List<String> sharedOptions, | 881 List<String> sharedOptions, |
942 List<String> originalArguments, | 882 List<String> originalArguments, |
943 CommandArtifact artifact) { | 883 CommandArtifact artifact) { |
944 return <String>[]; | 884 return <String>[]; |
945 } | 885 } |
946 } | 886 } |
OLD | NEW |