mirror of
https://github.com/dart-lang/sdk
synced 2024-10-03 10:18:31 +00:00
6672353e0f
Previously, the default type arguments for closure functions were instantiated in the same way as other types of functions, where the instantiator and function type arguments of the call were used. However, the defaults for closure functions should be instantiated with the instantiator and parent function type arguments stored within the closure itself. Since the instantiation of the default type arguments only depends on the instantiator and parent function type arguments, which are shared between partial instantiations of the same generic closure, the VM performs this instantiation once at closure creation and caches it in the closure object, so it can be retrieved when the default type arguments are needed and copied to new partial instantiations of the same closure without need for recalculation. As a side effect, this should speed up dynamic invocation of generic closures, since the invoke field dispatcher that implements them previously performed this instantiation when needed on every invocation, but now it just retrieves the cached version instead. TEST=language/closure/type_arguments vm/dart/regress_54426 Fixes: https://github.com/dart-lang/sdk/issues/54426 Change-Id: I9baad807befa0323f3c5b66196b9664e4d78af0a Cq-Include-Trybots: luci.dart.try:vm-aot-linux-release-x64-try,vm-reload-linux-release-x64-try,vm-reload-rollback-linux-release-x64-try,vm-tsan-linux-release-x64-try,vm-aot-tsan-linux-release-x64-try,vm-aot-msan-linux-release-x64-try,vm-msan-linux-release-x64-try,vm-aot-linux-release-arm64-try,vm-aot-dwarf-linux-product-x64-try,vm-aot-mac-product-arm64-try,vm-aot-obfuscate-linux-release-x64-try Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/344700 Reviewed-by: Daco Harkes <dacoharkes@google.com> |
||
---|---|---|
.. | ||
bin | ||
docs | ||
include | ||
lib | ||
observatory | ||
platform | ||
tests | ||
tools | ||
vm | ||
.clang-tidy | ||
.gitignore | ||
BUILD.gn | ||
codereview.settings | ||
configs.gni | ||
CPPLINT.cfg | ||
OWNERS | ||
PRESUBMIT.py | ||
runtime_args.gni | ||
vm-jit.shard.cml | ||
vm.shard.cml |