dart-sdk/pkg/vm
Martin Kustermann 8e0feb9fa9 [vm] Avoid type parameter check of _Future._asyncComplete() when caller knows its safe
Currently we have to do a runtime `as FutureOr<T>` check for the
parameter to `_Future<T>.asyncComplete(FutureOr<T> value)`. Although
needed for general cases, for the particular usage in the VM's
async/await transformer, we know that the test is going to suceed.

This CL adds two VM-specific methods on `_Future` that take `dynamic`
and downcast via `unsafeCast<>()` to avoid this rather large runtime
type checking overhead.

Issue https://github.com/dart-lang/sdk/issues/48226

TEST=ci

Change-Id: Ieeffae3ac8e2960f849512cf22c51d41cadb1ecf
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/230261
Reviewed-by: Slava Egorov <vegorov@google.com>
Reviewed-by: Lasse Nielsen <lrn@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
2022-02-04 16:42:59 +00:00
..
bin [vm, cfe] Add an option to include extra source files into kernel compilation 2022-02-04 15:23:39 +00:00
lib [vm, cfe] Add an option to include extra source files into kernel compilation 2022-02-04 15:23:39 +00:00
test [vm, cfe] Add an option to include extra source files into kernel compilation 2022-02-04 15:23:39 +00:00
testcases/transformations [vm] Avoid type parameter check of _Future._asyncComplete() when caller knows its safe 2022-02-04 16:42:59 +00:00
tool [vm/infra] Improve IL testing framework 2021-11-16 12:39:11 +00:00
analysis_options.yaml
LICENSE Update LICENSE 2021-04-07 10:28:38 +00:00
pubspec.yaml Remove explicit bool type hack. 2021-12-09 16:34:59 +00:00
README.md

This package hosts VM specific Dart code and helper scripts.