mirror of
https://github.com/dart-lang/sdk
synced 2024-10-14 17:18:04 +00:00
e7239ff03c
Currently if we have a `<obj> is/as Iterable<T>` check we will * allocate a `WasmArray<_Type>` array and put value for `T` in it * allocate a `_InterfaceType` object with the array as type arguments * call to RTT which is looping over the type arguments array With this CL we recognize in the compiler if we generate tests against interface types and specialize the most common cases (0, 1 or 2 type arguments). This in return will make us * call to 0/1/2 specialized RTT isInterfaceSubtype implementation which will use unrolled loops to do the checking. => We avoid allocation of `_InterfaceType` always => We avoid allocation of `WasmArray<_Type>` for length=0/1/2 => We have faster checking due to unrolled loops. (It is very unlikely binaryen can achieve the same, as it would need to do very aggressive inlining & loop unrolling to get to the same result. If we'd force it to inline then every is/as check would be very large). Issue https://github.com/dart-lang/sdk/issues/55516 Change-Id: Ia99548d514683f678178ea30d07aeb742ae914ca Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/370260 Reviewed-by: Ömer Ağacan <omersa@google.com> Commit-Queue: Martin Kustermann <kustermann@google.com> |
||
---|---|---|
.. | ||
bin | ||
lib | ||
.gitignore | ||
api_readme.md | ||
BUILD.gn | ||
OWNERS |