Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move toString removal transformation before tree shaking #46022

Closed
alexmarkov opened this issue May 14, 2021 · 0 comments
Closed

Move toString removal transformation before tree shaking #46022

alexmarkov opened this issue May 14, 2021 · 0 comments
Assignees
Labels
area-vm Use area-vm for VM related issues, including code coverage, FFI, and the AOT and JIT backends.

Comments

@alexmarkov
Copy link
Contributor

Since https://dart-review.googlesource.com/c/sdk/+/199200/ tree shaker removes annotations in AOT mode. Flutter toString() removal transformation currently runs after tree shaking but relies on @keepToString annotations which are already removed by that moment.

We should consider running toString removal before tree shaking to make sure it still sees annotations.

Internal bug: b/187962467

@alexmarkov alexmarkov added the area-vm Use area-vm for VM related issues, including code coverage, FFI, and the AOT and JIT backends. label May 14, 2021
@alexmarkov alexmarkov self-assigned this May 14, 2021
alexmarkov added a commit to flutter/engine that referenced this issue May 17, 2021
)

This change prepares Flutter front-end server to the migration of --delete-tostring-package-uri option to Dart SDK. This is needed to call toString transformation before tree shaking.

dart-lang/sdk#46022
dart-bot pushed a commit that referenced this issue May 20, 2021
This change adds toString transformation to gen_kernel and
frontend_server tools in Dart SDK.

The implementation and tests are derived from
pkg/frontend_server/lib/src/to_string_transformer.dart and
https://github.com/flutter/engine/tree/master/flutter_frontend_server/test.

In addition to _KeepToString in dart:ui, toString transformation
now supports @pragma('flutter:keep-to-string') to exclude
certain toString methods from the transformation without depending
on dart:ui.

pkg/frontend_server/lib/src/to_string_transformer.dart is not
cleaned up in this change yet as it is still used by Flutter
engine. Cleanup will be done after Flutter engine is cleaned up,
after it is switched to the implementation of toString transformer
added in this change.

This is also a step towards a unified kernel compiler
(#39126).

TEST=pkg/vm/test/transformations/to_string_transformer_test.dart

Issue: #46022
Issue: #39126

Change-Id: Icbfd3fa193d54f1fc6b2d7fa0bace82b3704f91f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/200525
Reviewed-by: Dan Field <dnfield@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
alexmarkov added a commit to flutter/engine that referenced this issue May 20, 2021
This change removes uses of toString transformer from Flutter engine. The transformer is already wired up in Dart SDK: front-end server from Dart SDK supports --delete-tostring-package-uri option. After this change only the integration test is left in the Flutter engine to make sure dart:ui is properly transformed.

dart-lang/sdk#46022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-vm Use area-vm for VM related issues, including code coverage, FFI, and the AOT and JIT backends.
Projects
None yet
Development

No branches or pull requests

1 participant