Skip to content

Commit 9983424

Browse files
sjindel-googlecommit-bot@chromium.org
authored andcommitted
[vm] Add type to _AsyncAwaitCompleter.start.
Without the type, the call to the the parameter f() was being handled as a dynamic InstanceCall (smiable), so we had a megamorphic call to one of the Closure_XXXX_call methods (there are many copies of this method for different signatures) which in turn calls the closure. Now that the type is present, we do a direct ClosureCall to the target. This gives a measurable improvement to an important internal benchmark. Change-Id: Ia9429879f69257465a2537616d8f8595fb1eefa8 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/138520 Reviewed-by: Martin Kustermann <[email protected]> Commit-Queue: Samir Jindel <[email protected]>
1 parent c2fc5f9 commit 9983424

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

sdk/lib/_internal/vm/lib/async_patch.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ class _AsyncAwaitCompleter<T> implements Completer<T> {
4343
}
4444
}
4545

46-
void start(f) {
46+
void start(void Function() f) {
4747
f();
4848
isSync = true;
4949
}

sdk_nnbd/lib/_internal/vm/lib/async_patch.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ class _AsyncAwaitCompleter<T> implements Completer<T> {
4141
}
4242
}
4343

44-
void start(f) {
44+
void start(void Function() f) {
4545
f();
4646
isSync = true;
4747
}

0 commit comments

Comments
 (0)