Open
Description
https://dart-review.googlesource.com/c/sdk/+/418880 changed the lowering for dart2js to use a synthesized getter that is replaces the external
getter, and is (usually) later inlined. The synthesized getter has the annotations of the external getter, allowing dart2js optimization annotations to be used.
Consider doing this for the lowering for DDC, for consistency.
Concerns that prevented us from using the same pattern for DDC:
- The cost of the additional call. If problematic, this could be solved by doing more inlining in DDC.
- The synthesized getter shows up in the library or class scope in debugging. This breaks some non-sdk tests. This could be solved by fixing the tests to expect some
external
members to be in scope.