mirror of
https://github.com/dart-lang/sdk
synced 2024-09-19 14:51:30 +00:00
a261196ea7
Previously, when taking a tear-off, a separate Context object was allocated in order to capture receiver. Now, receiver is stored directly in the Closure object in the 'context' field. This saves 1 object allocation per tear-off and makes tear-offs cheaper compared to explicit closures which can share context with other closures. Benchmarks in AOT mode: x64: TearOff.NotInlined +40% TearOff.NotInlined.InTry +43% TearOff.Inlined.InTry +47% arm64: TearOff.NotInlined +27-43% TearOff.NotInlined.InTry +29-43% TearOff.Inlined.InTry +58-94% arm64c: TearOff.NotInlined +71% TearOff.NotInlined.InTry +72% TearOff.Inlined.InTry +96% TEST=ci Issue: https://github.com/dart-lang/sdk/issues/54808 Change-Id: I3ad95e8a8a4fc23f856bbc0fe238da58a9d25b8d Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/350945 Reviewed-by: Martin Kustermann <kustermann@google.com> Commit-Queue: Alexander Markov <alexmarkov@google.com> |
||
---|---|---|
.. | ||
bin | ||
lib | ||
tests | ||
tool | ||
web | ||
.gitignore | ||
analysis_options.yaml | ||
BUILD.gn | ||
HACKING.md | ||
observatory_sources.gni | ||
pubspec.yaml | ||
update_sources.py |