dart-sdk/runtime/observatory
Alexander Markov a261196ea7 [vm] Remove context allocations for tear-offs
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>
2024-02-13 15:33:38 +00:00
..
bin Replace Uri.scheme == with Uri.isScheme 2022-02-08 21:38:57 +00:00
lib Trivial cleanup to make VSCode workspace for the SDK 2023-11-07 17:49:53 +00:00
tests [vm] Remove context allocations for tear-offs 2024-02-13 15:33:38 +00:00
tool Change references to "dartfmt" in runtime and tools to "dart format". 2021-10-01 18:16:27 +00:00
web Spelling runtime observatory 2023-01-20 14:29:08 +00:00
.gitignore [observatory] remove unused_imports and some unused variables 2023-02-15 16:49:58 +00:00
analysis_options.yaml Revert "observatory: Ignore new static Warning" 2023-09-19 07:51:37 +00:00
BUILD.gn [build] Use relative paths. 2023-03-08 22:10:42 +00:00
HACKING.md [ VM / Service / Observatory ] The VM service now requires an authentication code by default. 2019-04-09 22:57:29 +00:00
observatory_sources.gni [ Observatory ] Remove footer with dead / irrelevant links 2021-10-11 23:30:24 +00:00
pubspec.yaml [observatory] remove unused_imports and some unused variables 2023-02-15 16:49:58 +00:00
update_sources.py [infra] Migrate scripts to python3 2021-04-15 10:10:20 +00:00