mirror of
https://github.com/dart-lang/sdk
synced 2024-09-05 00:13:50 +00:00
![]() So far tree shaking was removing fields which are not used at all. This change improves tree shaking of fields so fields which are only written or used as interface targets can be removed. The following limitations apply: * Field is not removed if there is a constant object with that field, as it may impact identity of constant objects which is an observable behavior. * Field is not removed if it has a non-trivial initializer as it may have side-effects. * Late final fields are not removed, as writing such fields may have side-effect. * When field is removed, we may need to introduce an abstract getter or abstract setter if field is used as a target of an interface call. If a field was written, then setter would be non-abstract (but empty). Fixes https://github.com/dart-lang/sdk/issues/35310 Change-Id: I79c00158b8eb658081a647c5dbdecde481fddb41 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134204 Commit-Queue: Alexander Markov <alexmarkov@google.com> Reviewed-by: Ryan Macnak <rmacnak@google.com> Reviewed-by: Martin Kustermann <kustermann@google.com> |
||
---|---|---|
.. | ||
bin | ||
lib | ||
tests | ||
tool | ||
web | ||
.gitignore | ||
.packages | ||
analysis_options.yaml | ||
BUILD.gn | ||
HACKING.md | ||
observatory_sources.gni | ||
pubspec.yaml | ||
update_sources.py |