Skip to content

Commit

Permalink
[frontend_server] Include bytecode generation in the training run. (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
rmacnak-google committed Oct 15, 2019
1 parent 81110bb commit 4c3e87c
Showing 1 changed file with 24 additions and 19 deletions.
43 changes: 24 additions & 19 deletions flutter_frontend_server/lib/server.dart
Original file line number Diff line number Diff line change
Expand Up @@ -111,25 +111,30 @@ Future<int> starter(
final Directory temp =
Directory.systemTemp.createTempSync('train_frontend_server');
try {
final String outputTrainingDill = path.join(temp.path, 'app.dill');
options = frontend.argParser.parse(<String>[
'--incremental',
'--sdk-root=$sdkRoot',
'--output-dill=$outputTrainingDill',
'--target=flutter',
'--track-widget-creation',
]);
compiler ??= _FlutterFrontendCompiler(output);

await compiler.compile(input, options);
compiler.acceptLastDelta();
await compiler.recompileDelta();
compiler.acceptLastDelta();
compiler.resetIncrementalCompiler();
await compiler.recompileDelta();
compiler.acceptLastDelta();
await compiler.recompileDelta();
compiler.acceptLastDelta();
for (int i = 0; i < 3; i++) {
final String outputTrainingDill = path.join(temp.path, 'app.dill');
options = frontend.argParser.parse(<String>[
'--incremental',
'--sdk-root=$sdkRoot',
'--output-dill=$outputTrainingDill',
'--target=flutter',
'--track-widget-creation',
'--enable-asserts',
'--gen-bytecode',
'--bytecode-options=source-positions,local-var-info,debugger-stops,instance-field-initializers,keep-unreachable-code,avoid-closure-call-instructions',
]);
compiler ??= _FlutterFrontendCompiler(output);

await compiler.compile(input, options);
compiler.acceptLastDelta();
await compiler.recompileDelta();
compiler.acceptLastDelta();
compiler.resetIncrementalCompiler();
await compiler.recompileDelta();
compiler.acceptLastDelta();
await compiler.recompileDelta();
compiler.acceptLastDelta();
}
return 0;
} finally {
temp.deleteSync(recursive: true);
Expand Down

0 comments on commit 4c3e87c

Please sign in to comment.