Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Conversation

@mkustermann
Copy link
Member

The @pragma('vm:entry-point') annotation serves as an annotation telling our AOT compiler that the member is needed and cannot be tree-shaken because it may be accessed from the outside (i.e. C++).

There are seemingly entry-point annotations on members that aren't actually used from C++.
=> We remove the annotation from those members in this CL.

…ccessed from C++

The `@pragma('vm:entry-point')` annotation serves as an annotation
telling our AOT compiler that the member is needed and cannot be
tree-shaken because it may be accessed from the outside (i.e. C++).

There are seemingly entry-point annotations on members that aren't actually
used from C++.
=> We remove the annotation from those members in this CL.
@chinmaygarde
Copy link
Member

Curious how you were able to determine this was safe? Can we perhaps add that as a lint?

@mkustermann
Copy link
Member Author

Curious how you were able to determine this was safe? Can we perhaps add that as a lint?

The Dart embedder API surface is mainly based on strings (one has to look libraries, classes, methods up by their name). By grepping in the engine C++ sources it seems like the members I removed the annotation from aren't referenced in C++.

As a side-effect of making things an entrypoint, it prevents obfuscation. So running obfuscation tests would result in more class / method names being obfuscated, making C++ unable to find them, therefore fail.

Lastly, the Dart VM has verification support that ensures anything accessed by-name from the embedder API has the @pragma('vm:entry-point') annotation. This verification is disabled by default (as it broke some 3rd party flutter apps that e.g. use PluginUtilities.getCallbackHandle without making the functions as entrypoints). Though flutter debug mode is passing this flag, see here. That means if any of those classes/functions this PR removes the annotation from is actually used from C++ (in any tests running in debug mode on CI) it should trigger an entrypoint verification error.

@chinmaygarde
Copy link
Member

@mkustermann Is this waiting on roll to land? Looks good to go.

@mkustermann mkustermann merged commit 3b944b6 into flutter:main Sep 14, 2023
@mkustermann
Copy link
Member Author

@mkustermann Is this waiting on roll to land? Looks good to go.

Apologies, I was preoccupied with other things today. Landed now. In unlikely case something breaks, please revert and I'll take a look (after coming back from vacation)

engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Sep 14, 2023
zanderso pushed a commit to flutter/flutter that referenced this pull request Sep 16, 2023
…134791)

flutter/engine@45bc430...67dd12f

2023-09-14 [email protected] Roll Dart SDK from
d25e8d682c8f to 7e4d9f4d8e52 (3 revisions) (flutter/engine#45854)
2023-09-14 [email protected] Remove @pragma('vm:entry-point')
annotations on members that aren't accessed from C++
(flutter/engine#45697)
2023-09-14 [email protected] Roll Skia from 6bc9f5886ddf to
9b7c116ed6c2 (1 revision) (flutter/engine#45853)
2023-09-14 [email protected] Switch
linux_android_debug_engine from goma to reclient (flutter/engine#45345)
2023-09-14 [email protected] Switch goma to
reclient fro standalone targets (flutter/engine#45804)
2023-09-14 [email protected] Handle
external window's `WM_CLOSE` in lifecycle manager (flutter/engine#45840)

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/flutter-engine-flutter-autoroll
Please CC [email protected],[email protected],[email protected] on the
revert to ensure that a human
is aware of the problem.

To file a bug in Flutter:
https://github.com/flutter/flutter/issues/new/choose

To report a problem with the AutoRoller itself, please file a bug:
https://bugs.chromium.org/p/skia/issues/entry?template=Autoroller+Bug

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
Mairramer pushed a commit to Mairramer/flutter that referenced this pull request Oct 10, 2023
…lutter#134791)

flutter/engine@45bc430...67dd12f

2023-09-14 [email protected] Roll Dart SDK from
d25e8d682c8f to 7e4d9f4d8e52 (3 revisions) (flutter/engine#45854)
2023-09-14 [email protected] Remove @pragma('vm:entry-point')
annotations on members that aren't accessed from C++
(flutter/engine#45697)
2023-09-14 [email protected] Roll Skia from 6bc9f5886ddf to
9b7c116ed6c2 (1 revision) (flutter/engine#45853)
2023-09-14 [email protected] Switch
linux_android_debug_engine from goma to reclient (flutter/engine#45345)
2023-09-14 [email protected] Switch goma to
reclient fro standalone targets (flutter/engine#45804)
2023-09-14 [email protected] Handle
external window's `WM_CLOSE` in lifecycle manager (flutter/engine#45840)

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/flutter-engine-flutter-autoroll
Please CC [email protected],[email protected],[email protected] on the
revert to ensure that a human
is aware of the problem.

To file a bug in Flutter:
https://github.com/flutter/flutter/issues/new/choose

To report a problem with the AutoRoller itself, please file a bug:
https://bugs.chromium.org/p/skia/issues/entry?template=Autoroller+Bug

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
harryterkelsen pushed a commit that referenced this pull request Oct 23, 2023
…ccessed from C++ (#45697)

The `@pragma('vm:entry-point')` annotation serves as an annotation
telling our AOT compiler that the member is needed and cannot be
tree-shaken because it may be accessed from the outside (i.e. C++).

There are seemingly entry-point annotations on members that aren't
actually used from C++.
=> We remove the annotation from those members in this CL.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants