mirror of
https://github.com/dart-lang/sdk
synced 2024-11-02 09:43:08 +00:00
b85679eaf3
Right now all type literal usages will perform a runtime call which is rather slow. Flutter happens to use type literals such as `return T;` in hot code which causes this to show up in the profile. This CL adds fast paths for type parameter type literals if the type parameter value (i.e. entry of TAV corresponding to T): * is `null`: return `dynamic` * is a non-FutureOr [Type] with compatible nullability: return value * is [FunctionType] with compatible nullability: return value otherwise fall back to runtime call. It makes simple type literal uses 10x+ faster - the kinds that Flutter is using. Issue https://github.com/dart-lang/sdk/issues/48757 TEST=vm/dart{,_2}/instantiate_type_literal_test Change-Id: I1139d6689aedbc68321f47ee6c9946a3323fbf6e Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/241968 Reviewed-by: Alexander Markov <alexmarkov@google.com> Commit-Queue: Martin Kustermann <kustermann@google.com> |
||
---|---|---|
.. | ||
bin | ||
docs | ||
include | ||
lib | ||
observatory | ||
observatory_2 | ||
platform | ||
tests | ||
third_party | ||
tools | ||
vm | ||
.clang-tidy | ||
.gitignore | ||
BUILD.gn | ||
codereview.settings | ||
configs.gni | ||
CPPLINT.cfg | ||
OWNERS | ||
PRESUBMIT.py | ||
runtime_args.gni |