Skip to content

Commit 0b8d270

Browse files
mkustermanncommit-bot@chromium.org
authored andcommitted
Do not use pkg/vm wrapper script when running fully-linked kernel files
Issue #31585 Change-Id: I5211c7d8fb16ea60509916bf525cc36ac05dd3a9 Reviewed-on: https://dart-review.googlesource.com/29591 Reviewed-by: Vyacheslav Egorov <[email protected]> Commit-Queue: Martin Kustermann <[email protected]>
1 parent 38df6ea commit 0b8d270

File tree

3 files changed

+21
-7
lines changed

3 files changed

+21
-7
lines changed

tools/testing/dart/compiler_configuration.dart

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -228,8 +228,8 @@ class VMKernelCompilerConfiguration extends CompilerConfiguration
228228
final commands = <Command>[
229229
computeCompileToKernelCommand(tempDir, arguments, environmentOverrides),
230230
];
231-
return new CommandArtifact(
232-
commands, tempKernelFile(tempDir), 'application/kernel-ir');
231+
return new CommandArtifact(commands, tempKernelFile(tempDir),
232+
'application/kernel-ir-fully-linked');
233233
}
234234

235235
List<String> computeRuntimeArguments(
@@ -242,6 +242,8 @@ class VMKernelCompilerConfiguration extends CompilerConfiguration
242242
var args = <String>[];
243243
if (_isStrong) {
244244
args.add('--strong');
245+
args.add('--reify-generic-functions');
246+
args.add('--limit-ints-to-64-bits');
245247
}
246248
if (_isChecked) {
247249
args.add('--enable_asserts');

tools/testing/dart/runtime_configuration.dart

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -226,10 +226,19 @@ class StandaloneDartRuntimeConfiguration extends DartVmRuntimeConfiguration {
226226
if (script != null &&
227227
type != 'application/dart' &&
228228
type != 'application/dart-snapshot' &&
229-
type != 'application/kernel-ir') {
229+
type != 'application/kernel-ir' &&
230+
type != 'application/kernel-ir-fully-linked') {
230231
throw "Dart VM cannot run files of type '$type'.";
231232
}
233+
232234
String executable = suite.dartVmBinaryFileName;
235+
if (type == 'application/kernel-ir-fully-linked') {
236+
// We don't use the pkg/vm/tool/dart2 wrapper script for fully linked
237+
// kernel files, since we don't want to pass the --dfe/--kernel-binaries
238+
// flags to the VM (the vm cannot distinguish fully-linked vs
239+
// not-fully-linked, see http://dartbug.com/31545)
240+
executable = suite.dartVmExecutableFileName;
241+
}
233242
return [Command.vm(executable, arguments, environmentOverrides)];
234243
}
235244
}

tools/testing/dart/test_suite.dart

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -177,16 +177,19 @@ abstract class TestSuite {
177177
}
178178

179179
if (dartExecutable == null) {
180-
var suffix = executableBinarySuffix;
181-
dartExecutable = useSdk
182-
? '$buildDir/dart-sdk/bin/dart$suffix'
183-
: '$buildDir/dart$suffix';
180+
dartExecutable = dartVmExecutableFileName;
184181
}
185182

186183
TestUtils.ensureExists(dartExecutable, configuration);
187184
return dartExecutable;
188185
}
189186

187+
String get dartVmExecutableFileName {
188+
return useSdk
189+
? '$buildDir/dart-sdk/bin/dart$executableBinarySuffix'
190+
: '$buildDir/dart$executableBinarySuffix';
191+
}
192+
190193
/// Returns the name of the flutter engine executable.
191194
String get flutterEngineBinaryFileName {
192195
// Controlled by user with the option "--flutter".

0 commit comments

Comments
 (0)