remove no-gen-bytecode flag (#43908)

This commit is contained in:
Jonah Williams
2019-11-15 13:15:05 -08:00
committed by GitHub
parent ae62a3cf1b
commit 2a576b774c
3 changed files with 41 additions and 4 deletions

View File

@@ -325,8 +325,6 @@ class KernelCompiler {
if (aot) ...<String>[
'--aot',
'--tfa',
// TODO(jonahwilliams): remove when https://github.com/flutter/flutter/issues/43751 is resolved.
'--no-gen-bytecode',
],
if (packagesPath != null) ...<String>[
'--packages',

View File

@@ -232,6 +232,7 @@ flutter_tools:lib/''');
await const KernelSnapshot().build(androidEnvironment
..defines[kTargetPlatform] = 'darwin-x64'
..defines[kBuildMode] = 'debug'
..defines[kTrackWidgetCreation] = 'false'
);
}, overrides: <Type, Generator>{
KernelCompilerFactory: () => MockKernelCompilerFactory(),

View File

@@ -72,7 +72,39 @@ void main() {
Platform: kNoColorTerminalPlatform,
});
testUsingContext('passes no-gen-bytecode to kernel compiler in aot/release mode', () async {
testUsingContext('passes correct AOT config to kernel compiler in aot/profile mode', () async {
when(mockFrontendServer.stdout)
.thenAnswer((Invocation invocation) => Stream<List<int>>.fromFuture(
Future<List<int>>.value(utf8.encode(
'result abc\nline1\nline2\nabc\nabc /path/to/main.dart.dill 0'
))
));
final KernelCompiler kernelCompiler = await kernelCompilerFactory.create(null);
await kernelCompiler.compile(sdkRoot: '/path/to/sdkroot',
mainPath: '/path/to/main.dart',
buildMode: BuildMode.profile,
trackWidgetCreation: false,
aot: true,
dartDefines: const <String>[],
);
expect(mockFrontendServerStdIn.getAndClear(), isEmpty);
final VerificationResult argVerification = verify(mockProcessManager.start(captureAny));
expect(argVerification.captured.single, containsAll(<String>[
'--aot',
'--tfa',
'-Ddart.vm.profile=true',
'-Ddart.vm.product=false',
'--bytecode-options=source-positions',
]));
}, overrides: <Type, Generator>{
ProcessManager: () => mockProcessManager,
OutputPreferences: () => OutputPreferences(showColor: false),
Platform: kNoColorTerminalPlatform,
});
testUsingContext('passes correct AOT config to kernel compiler in aot/release mode', () async {
when(mockFrontendServer.stdout)
.thenAnswer((Invocation invocation) => Stream<List<int>>.fromFuture(
Future<List<int>>.value(utf8.encode(
@@ -90,7 +122,13 @@ void main() {
expect(mockFrontendServerStdIn.getAndClear(), isEmpty);
final VerificationResult argVerification = verify(mockProcessManager.start(captureAny));
expect(argVerification.captured.single, contains('--no-gen-bytecode'));
expect(argVerification.captured.single, containsAll(<String>[
'--aot',
'--tfa',
'-Ddart.vm.profile=false',
'-Ddart.vm.product=true',
'--bytecode-options=source-positions',
]));
}, overrides: <Type, Generator>{
ProcessManager: () => mockProcessManager,
OutputPreferences: () => OutputPreferences(showColor: false),