[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 <kustermann@google.com>
Commit-Queue: Samir Jindel <sjindel@google.com>
This commit is contained in:
Samir Jindel 2020-03-05 16:51:44 +00:00 committed by commit-bot@chromium.org
parent c2fc5f9756
commit 9983424a3c
2 changed files with 2 additions and 2 deletions

View file

@ -43,7 +43,7 @@ class _AsyncAwaitCompleter<T> implements Completer<T> {
}
}
void start(f) {
void start(void Function() f) {
f();
isSync = true;
}

View file

@ -41,7 +41,7 @@ class _AsyncAwaitCompleter<T> implements Completer<T> {
}
}
void start(f) {
void start(void Function() f) {
f();
isSync = true;
}