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 | 10 |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
71 return new Dart2jsCompilerConfiguration( | 71 return new Dart2jsCompilerConfiguration( |
72 isDebug: isDebug, | 72 isDebug: isDebug, |
73 isChecked: isChecked, | 73 isChecked: isChecked, |
74 isHostChecked: isHostChecked, | 74 isHostChecked: isHostChecked, |
75 useCps: useCps, | 75 useCps: useCps, |
76 useSdk: useSdk, | 76 useSdk: useSdk, |
77 isCsp: isCsp, | 77 isCsp: isCsp, |
78 useFastStartup: useFastStartup, | 78 useFastStartup: useFastStartup, |
79 extraDart2jsOptions: | 79 extraDart2jsOptions: |
80 TestUtils.getExtraOptions(configuration, 'dart2js_options')); | 80 TestUtils.getExtraOptions(configuration, 'dart2js_options')); |
| 81 case 'dart2appjit': |
81 case 'dart2app': | 82 case 'dart2app': |
82 return new Dart2AppSnapshotCompilerConfiguration( | 83 return new Dart2AppSnapshotCompilerConfiguration( |
83 isDebug: isDebug, isChecked: isChecked); | |
84 case 'dart2appjit': | |
85 return new Dart2AppJitSnapshotCompilerConfiguration( | |
86 isDebug: isDebug, isChecked: isChecked, useBlobs: useBlobs); | 84 isDebug: isDebug, isChecked: isChecked, useBlobs: useBlobs); |
87 case 'precompiler': | 85 case 'precompiler': |
88 return new PrecompilerCompilerConfiguration( | 86 return new PrecompilerCompilerConfiguration( |
89 isDebug: isDebug, | 87 isDebug: isDebug, |
90 isChecked: isChecked, | 88 isChecked: isChecked, |
91 arch: configuration['arch'], | 89 arch: configuration['arch'], |
92 useBlobs: useBlobs, | 90 useBlobs: useBlobs, |
93 isAndroid: configuration['system'] == 'android'); | 91 isAndroid: configuration['system'] == 'android'); |
94 case 'none': | 92 case 'none': |
95 return new NoneCompilerConfiguration( | 93 return new NoneCompilerConfiguration( |
(...skipping 399 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
495 args.add('--enable_type_checks'); | 493 args.add('--enable_type_checks'); |
496 } | 494 } |
497 return args | 495 return args |
498 ..addAll(vmOptions) | 496 ..addAll(vmOptions) |
499 ..addAll(sharedOptions) | 497 ..addAll(sharedOptions) |
500 ..addAll(originalArguments); | 498 ..addAll(originalArguments); |
501 } | 499 } |
502 } | 500 } |
503 | 501 |
504 class Dart2AppSnapshotCompilerConfiguration extends CompilerConfiguration { | 502 class Dart2AppSnapshotCompilerConfiguration extends CompilerConfiguration { |
505 Dart2AppSnapshotCompilerConfiguration({bool isDebug, bool isChecked}) | 503 final bool useBlobs; |
506 : super._subclass(isDebug: isDebug, isChecked: isChecked); | 504 Dart2AppSnapshotCompilerConfiguration({bool isDebug, bool isChecked, bool useB
lobs}) |
| 505 : super._subclass(isDebug: isDebug, isChecked: isChecked), this.useBlobs =
useBlobs; |
507 | 506 |
508 int computeTimeoutMultiplier() { | 507 int computeTimeoutMultiplier() { |
509 int multiplier = 2; | 508 int multiplier = 2; |
510 if (isDebug) multiplier *= 4; | 509 if (isDebug) multiplier *= 4; |
511 if (isChecked) multiplier *= 2; | 510 if (isChecked) multiplier *= 2; |
512 return multiplier; | 511 return multiplier; |
513 } | 512 } |
514 | 513 |
515 CommandArtifact computeCompilationArtifact( | 514 CommandArtifact computeCompilationArtifact( |
516 String buildDir, | 515 String buildDir, |
517 String tempDir, | 516 String tempDir, |
518 CommandBuilder commandBuilder, | 517 CommandBuilder commandBuilder, |
519 List arguments, | 518 List arguments, |
520 Map<String, String> environmentOverrides) { | 519 Map<String, String> environmentOverrides) { |
521 return new CommandArtifact(<Command>[ | 520 return new CommandArtifact(<Command>[ |
522 this.computeCompilationCommand(tempDir, buildDir, | 521 this.computeCompilationCommand(tempDir, buildDir, |
523 CommandBuilder.instance, arguments, environmentOverrides) | 522 CommandBuilder.instance, arguments, environmentOverrides) |
524 ], tempDir, 'application/dart-snapshot'); | 523 ], tempDir, 'application/dart-snapshot'); |
525 } | 524 } |
526 | 525 |
527 CompilationCommand computeCompilationCommand( | 526 CompilationCommand computeCompilationCommand( |
528 String tempDir, | 527 String tempDir, |
529 String buildDir, | 528 String buildDir, |
530 CommandBuilder commandBuilder, | 529 CommandBuilder commandBuilder, |
531 List arguments, | 530 List arguments, |
532 Map<String, String> environmentOverrides) { | 531 Map<String, String> environmentOverrides) { |
533 var exec = "$buildDir/dart_bootstrap"; | 532 var exec = "$buildDir/dart"; |
534 var args = new List(); | 533 var args = new List(); |
535 args.add("--snapshot=$tempDir/out.jitsnapshot"); | 534 args.add("--snapshot=$tempDir/out.jitsnapshot"); |
536 args.add("--snapshot-kind=app-after-run"); | 535 args.add("--snapshot-kind=app-jit"); |
| 536 if (useBlobs) { |
| 537 args.add("--use-blobs"); |
| 538 } |
537 args.addAll(arguments); | 539 args.addAll(arguments); |
538 | 540 |
539 return commandBuilder.getCompilationCommand( | 541 return commandBuilder.getCompilationCommand( |
540 'dart2snapshot', | 542 'dart2snapshot', |
541 tempDir, | 543 tempDir, |
542 !useSdk, | 544 !useSdk, |
543 bootstrapDependencies(buildDir), | 545 bootstrapDependencies(buildDir), |
544 exec, | 546 exec, |
545 args, | 547 args, |
546 environmentOverrides); | 548 environmentOverrides); |
(...skipping 25 matching lines...) Expand all Loading... |
572 args.add('--enable_asserts'); | 574 args.add('--enable_asserts'); |
573 args.add('--enable_type_checks'); | 575 args.add('--enable_type_checks'); |
574 } | 576 } |
575 return args | 577 return args |
576 ..addAll(vmOptions) | 578 ..addAll(vmOptions) |
577 ..addAll(sharedOptions) | 579 ..addAll(sharedOptions) |
578 ..addAll(originalArguments); | 580 ..addAll(originalArguments); |
579 } | 581 } |
580 } | 582 } |
581 | 583 |
582 class Dart2AppJitSnapshotCompilerConfiguration extends Dart2AppSnapshotCompilerC
onfiguration { | |
583 final bool useBlobs; | |
584 Dart2AppJitSnapshotCompilerConfiguration({bool isDebug, bool isChecked, bool u
seBlobs}) | |
585 : super(isDebug: isDebug, isChecked: isChecked), this.useBlobs = useBlobs; | |
586 | |
587 CompilationCommand computeCompilationCommand( | |
588 String tempDir, | |
589 String buildDir, | |
590 CommandBuilder commandBuilder, | |
591 List arguments, | |
592 Map<String, String> environmentOverrides) { | |
593 var exec = "$buildDir/dart"; | |
594 var args = new List(); | |
595 args.add("--snapshot=$tempDir/out.jitsnapshot"); | |
596 args.add("--snapshot-kind=app-jit-after-run"); | |
597 if (useBlobs) { | |
598 args.add("--use-blobs"); | |
599 } | |
600 args.addAll(arguments); | |
601 | |
602 return commandBuilder.getCompilationCommand( | |
603 'dart2snapshot', | |
604 tempDir, | |
605 !useSdk, | |
606 bootstrapDependencies(buildDir), | |
607 exec, | |
608 args, | |
609 environmentOverrides); | |
610 } | |
611 } | |
612 | |
613 class AnalyzerCompilerConfiguration extends CompilerConfiguration { | 584 class AnalyzerCompilerConfiguration extends CompilerConfiguration { |
614 AnalyzerCompilerConfiguration( | 585 AnalyzerCompilerConfiguration( |
615 {bool isDebug, bool isChecked, bool isStrong, bool isHostChecked, bool | 586 {bool isDebug, bool isChecked, bool isStrong, bool isHostChecked, bool |
616 useSdk}) | 587 useSdk}) |
617 : super._subclass( | 588 : super._subclass( |
618 isDebug: isDebug, | 589 isDebug: isDebug, |
619 isChecked: isChecked, | 590 isChecked: isChecked, |
620 isStrong: isStrong, | 591 isStrong: isStrong, |
621 isHostChecked: isHostChecked, | 592 isHostChecked: isHostChecked, |
622 useSdk: useSdk); | 593 useSdk: useSdk); |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
668 RuntimeConfiguration runtimeConfiguration, | 639 RuntimeConfiguration runtimeConfiguration, |
669 String buildDir, | 640 String buildDir, |
670 TestInformation info, | 641 TestInformation info, |
671 List<String> vmOptions, | 642 List<String> vmOptions, |
672 List<String> sharedOptions, | 643 List<String> sharedOptions, |
673 List<String> originalArguments, | 644 List<String> originalArguments, |
674 CommandArtifact artifact) { | 645 CommandArtifact artifact) { |
675 return <String>[]; | 646 return <String>[]; |
676 } | 647 } |
677 } | 648 } |
OLD | NEW |