| 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 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 67 isChecked: isChecked, | 67 isChecked: isChecked, |
| 68 isHostChecked: isHostChecked, | 68 isHostChecked: isHostChecked, |
| 69 useCps: useCps, | 69 useCps: useCps, |
| 70 useSdk: useSdk, | 70 useSdk: useSdk, |
| 71 isCsp: isCsp, | 71 isCsp: isCsp, |
| 72 extraDart2jsOptions: | 72 extraDart2jsOptions: |
| 73 TestUtils.getExtraOptions(configuration, 'dart2js_options')); | 73 TestUtils.getExtraOptions(configuration, 'dart2js_options')); |
| 74 case 'dart2app': | 74 case 'dart2app': |
| 75 return new Dart2AppSnapshotCompilerConfiguration( | 75 return new Dart2AppSnapshotCompilerConfiguration( |
| 76 isDebug: isDebug, isChecked: isChecked); | 76 isDebug: isDebug, isChecked: isChecked); |
| 77 case 'dart2appjit': |
| 78 return new Dart2AppJitSnapshotCompilerConfiguration( |
| 79 isDebug: isDebug, isChecked: isChecked, useBlobs: useBlobs); |
| 77 case 'precompiler': | 80 case 'precompiler': |
| 78 return new PrecompilerCompilerConfiguration( | 81 return new PrecompilerCompilerConfiguration( |
| 79 isDebug: isDebug, | 82 isDebug: isDebug, |
| 80 isChecked: isChecked, | 83 isChecked: isChecked, |
| 81 arch: configuration['arch'], | 84 arch: configuration['arch'], |
| 82 useBlobs: useBlobs, | 85 useBlobs: useBlobs, |
| 83 isAndroid: configuration['system'] == 'android'); | 86 isAndroid: configuration['system'] == 'android'); |
| 84 case 'none': | 87 case 'none': |
| 85 return new NoneCompilerConfiguration( | 88 return new NoneCompilerConfiguration( |
| 86 isDebug: isDebug, | 89 isDebug: isDebug, |
| (...skipping 458 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 545 args.add('--enable_asserts'); | 548 args.add('--enable_asserts'); |
| 546 args.add('--enable_type_checks'); | 549 args.add('--enable_type_checks'); |
| 547 } | 550 } |
| 548 return args | 551 return args |
| 549 ..addAll(vmOptions) | 552 ..addAll(vmOptions) |
| 550 ..addAll(sharedOptions) | 553 ..addAll(sharedOptions) |
| 551 ..addAll(originalArguments); | 554 ..addAll(originalArguments); |
| 552 } | 555 } |
| 553 } | 556 } |
| 554 | 557 |
| 558 class Dart2AppJitSnapshotCompilerConfiguration extends Dart2AppSnapshotCompilerC
onfiguration { |
| 559 final bool useBlobs; |
| 560 Dart2AppJitSnapshotCompilerConfiguration({bool isDebug, bool isChecked, bool u
seBlobs}) |
| 561 : super(isDebug: isDebug, isChecked: isChecked), this.useBlobs = useBlobs; |
| 562 |
| 563 CompilationCommand computeCompilationCommand( |
| 564 String tempDir, |
| 565 String buildDir, |
| 566 CommandBuilder commandBuilder, |
| 567 List arguments, |
| 568 Map<String, String> environmentOverrides) { |
| 569 var exec = "$buildDir/dart"; |
| 570 var args = new List(); |
| 571 args.add("--snapshot=$tempDir"); |
| 572 args.add("--snapshot-kind=app-jit-after-run"); |
| 573 if (useBlobs) { |
| 574 args.add("--use-blobs"); |
| 575 } |
| 576 args.addAll(arguments); |
| 577 |
| 578 return commandBuilder.getCompilationCommand( |
| 579 'dart2snapshot', |
| 580 tempDir, |
| 581 !useSdk, |
| 582 bootstrapDependencies(buildDir), |
| 583 exec, |
| 584 args, |
| 585 environmentOverrides); |
| 586 } |
| 587 } |
| 588 |
| 555 class AnalyzerCompilerConfiguration extends CompilerConfiguration { | 589 class AnalyzerCompilerConfiguration extends CompilerConfiguration { |
| 556 AnalyzerCompilerConfiguration( | 590 AnalyzerCompilerConfiguration( |
| 557 {bool isDebug, bool isChecked, bool isHostChecked, bool useSdk}) | 591 {bool isDebug, bool isChecked, bool isHostChecked, bool useSdk}) |
| 558 : super._subclass( | 592 : super._subclass( |
| 559 isDebug: isDebug, | 593 isDebug: isDebug, |
| 560 isChecked: isChecked, | 594 isChecked: isChecked, |
| 561 isHostChecked: isHostChecked, | 595 isHostChecked: isHostChecked, |
| 562 useSdk: useSdk); | 596 useSdk: useSdk); |
| 563 | 597 |
| 564 int computeTimeoutMultiplier() { | 598 int computeTimeoutMultiplier() { |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 605 RuntimeConfiguration runtimeConfiguration, | 639 RuntimeConfiguration runtimeConfiguration, |
| 606 String buildDir, | 640 String buildDir, |
| 607 TestInformation info, | 641 TestInformation info, |
| 608 List<String> vmOptions, | 642 List<String> vmOptions, |
| 609 List<String> sharedOptions, | 643 List<String> sharedOptions, |
| 610 List<String> originalArguments, | 644 List<String> originalArguments, |
| 611 CommandArtifact artifact) { | 645 CommandArtifact artifact) { |
| 612 return <String>[]; | 646 return <String>[]; |
| 613 } | 647 } |
| 614 } | 648 } |
| OLD | NEW |