Skip to content

Commit

Permalink
[vm] Enable new implementation of async/async* in JIT mode
Browse files Browse the repository at this point in the history
TEST=ci

Issue: #48378
Change-Id: I0fc069508cb1ce5648deb6604171dfdcd5bcb5c8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/246082
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Reviewed-by: Slava Egorov <vegorov@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
  • Loading branch information
alexmarkov authored and Commit Bot committed Jun 2, 2022
1 parent af4da78 commit b3544c4
Show file tree
Hide file tree
Showing 48 changed files with 336 additions and 925 deletions.
4 changes: 2 additions & 2 deletions pkg/frontend_server/lib/frontend_server.dart
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ ArgParser argParser = ArgParser(allowTrailingOptions: true)
'supported when --aot and --minimal-kernel are not used.',
defaultsTo: null)
..addFlag('compact-async',
help: 'Enable new compact async/await implementation.', defaultsTo: null)
help: 'Enable new compact async/await implementation.', defaultsTo: true)
..addFlag('tfa',
help:
'Enable global type flow analysis and related transformations in AOT mode.',
Expand Down Expand Up @@ -541,7 +541,7 @@ class FrontendCompiler implements CompilerInterface {
nullSafety: compilerOptions.nnbdMode == NnbdMode.Strong,
supportMirrors: options['support-mirrors'] ??
!(options['aot'] || options['minimal-kernel']),
compactAsync: options['compact-async'] ?? options['aot'],
compactAsync: options['compact-async'],
);
if (compilerOptions.target == null) {
print('Failed to create front-end target ${options['target']}.');
Expand Down
6 changes: 4 additions & 2 deletions pkg/kernel/lib/target/targets.dart
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class TargetFlags {
{this.trackWidgetCreation = false,
this.enableNullSafety = false,
this.supportMirrors = true,
this.compactAsync = false});
this.compactAsync = true});

@override
bool operator ==(other) {
Expand Down Expand Up @@ -786,7 +786,9 @@ class TestTargetFlags extends TargetFlags {
this.unsupportedDartLibraries: const {}})
: super(
trackWidgetCreation: trackWidgetCreation,
enableNullSafety: enableNullSafety);
enableNullSafety: enableNullSafety,
// TODO(dartbug.com/48378): Enable compact async in CFE tests
compactAsync: false);
}

mixin TestTargetMixin on Target {
Expand Down
6 changes: 3 additions & 3 deletions pkg/vm/lib/kernel_front_end.dart
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ void declareCompilerOptions(ArgParser args) {
'supported when --aot and --minimal-kernel are not used.',
defaultsTo: null);
args.addFlag('compact-async',
help: 'Enable new compact async/await implementation.', defaultsTo: null);
help: 'Enable new compact async/await implementation.', defaultsTo: true);
args.addOption('depfile', help: 'Path to output Ninja depfile');
args.addOption('from-dill',
help: 'Read existing dill file instead of compiling from sources',
Expand Down Expand Up @@ -202,7 +202,7 @@ Future<int> runCompiler(ArgResults options, String usage) async {
final String? manifestFilename = options['manifest'];
final String? dataDir = options['component-name'] ?? options['data-dir'];
final bool? supportMirrors = options['support-mirrors'];
final bool compactAsync = options['compact-async'] ?? aot;
final bool compactAsync = options['compact-async'];

final bool minimalKernel = options['minimal-kernel'];
final bool treeShakeWriteOnlyFields = options['tree-shake-write-only-fields'];
Expand Down Expand Up @@ -617,7 +617,7 @@ Target? createFrontEndTarget(String targetName,
{bool trackWidgetCreation = false,
bool nullSafety = false,
bool supportMirrors = true,
bool compactAsync = false}) {
bool compactAsync = true}) {
// Make sure VM-specific targets are available.
installAdditionalTargets();

Expand Down
Loading

0 comments on commit b3544c4

Please sign in to comment.