Skip to content

Commit d1ed915

Browse files
mkustermanncommit-bot@chromium.org
authored andcommitted
Use batch mode compilation for normal -cdartkp
Issue #31585 Change-Id: I70790a33cfbfbc7c2c48c6e77074f955d6de7e01 Reviewed-on: https://dart-review.googlesource.com/28280 Commit-Queue: Martin Kustermann <[email protected]> Reviewed-by: Vyacheslav Egorov <[email protected]>
1 parent 756c298 commit d1ed915

File tree

2 files changed

+22
-23
lines changed

2 files changed

+22
-23
lines changed

pkg/vm/tool/gen_kernel

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ CUR_DIR="$(cd "${PROG_NAME%/*}" ; pwd -P)"
2525

2626
SDK_DIR="$CUR_DIR/../../.."
2727

28+
# TODO(kustermann): For windows as well as for hosts running on arm, our
29+
# checked-in dart binaries must be adjusted.
2830
if [[ `uname` == 'Darwin' ]]; then
2931
DART="$SDK_DIR/tools/sdks/mac/dart-sdk/bin/dart"
3032
OUT_DIR="$SDK_DIR/xcodebuild"

tools/testing/dart/compiler_configuration.dart

Lines changed: 20 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -574,18 +574,14 @@ class PrecompilerCompilerConfiguration extends CompilerConfiguration {
574574
List<String> arguments, Map<String, String> environmentOverrides) {
575575
var commands = <Command>[];
576576

577-
if (_isStrong) {
578-
commands.add(computeCompileToKernelCommand(
579-
tempDir, arguments, environmentOverrides));
580-
}
577+
commands.add(computeCompileToKernelCommand(
578+
tempDir, arguments, environmentOverrides));
581579

582580
commands.add(
583-
computeCompilationCommand(tempDir, arguments, environmentOverrides));
581+
computeDartBootstrapCommand(tempDir, arguments, environmentOverrides));
584582

585-
if (_isStrong) {
586-
commands.add(computeRemoveKernelFileCommand(
587-
tempDir, arguments, environmentOverrides));
588-
}
583+
commands.add(computeRemoveKernelFileCommand(
584+
tempDir, arguments, environmentOverrides));
589585

590586
if (!_configuration.useBlobs) {
591587
commands.add(
@@ -604,14 +600,25 @@ class PrecompilerCompilerConfiguration extends CompilerConfiguration {
604600
Map<String, String> environmentOverrides) {
605601
final genKernel =
606602
Platform.script.resolve('../../../pkg/vm/tool/gen_kernel').toFilePath();
603+
604+
final kernelBinariesFolder = _useSdk
605+
? '${_configuration.buildDirectory}/dart-sdk/lib/_internal'
606+
: '${_configuration.buildDirectory}';
607+
608+
final vmPlatform = _isStrong
609+
? '$kernelBinariesFolder/vm_platform_strong.dill'
610+
: '$kernelBinariesFolder/vm_platform.dill';
611+
607612
final dillFile = tempKernelFile(tempDir);
608-
var args = [
613+
final args = [
609614
'--aot',
610-
'--platform=${_configuration.buildDirectory}/vm_platform_strong.dill',
615+
_isStrong ? '--strong-mode' : '--no-strong-mode',
616+
'--platform=$vmPlatform',
611617
'-o',
612618
dillFile,
613619
];
614620
args.add(arguments.where((name) => name.endsWith('.dart')).single);
621+
615622
return Command.vmKernelCompilation(dillFile, true, bootstrapDependencies(),
616623
genKernel, args, environmentOverrides);
617624
}
@@ -631,7 +638,7 @@ class PrecompilerCompilerConfiguration extends CompilerConfiguration {
631638
alwaysCompile: !_useSdk);
632639
}
633640

634-
Command computeCompilationCommand(String tempDir, List<String> arguments,
641+
Command computeDartBootstrapCommand(String tempDir, List<String> arguments,
635642
Map<String, String> environmentOverrides) {
636643
var buildDir = _configuration.buildDirectory;
637644
String exec;
@@ -645,17 +652,7 @@ class PrecompilerCompilerConfiguration extends CompilerConfiguration {
645652
exec = "$buildDir/dart_bootstrap";
646653
}
647654

648-
var args = <String>[];
649-
if (useDfe) {
650-
if (!_isStrong) {
651-
args.add('--dfe=pkg/vm/bin/kernel_service.dart');
652-
args.add('--kernel-binaries=' +
653-
(_useSdk
654-
? '${_configuration.buildDirectory}/dart-sdk/lib/_internal'
655-
: '${buildDir}'));
656-
}
657-
}
658-
655+
final args = <String>[];
659656
args.add("--snapshot-kind=app-aot");
660657
if (_configuration.useBlobs) {
661658
args.add("--snapshot=$tempDir/out.aotsnapshot");

0 commit comments

Comments
 (0)