Commit a93219a
committed
[dart2js] Generate empty method bodies for external effect members.
The new @pragma('external-effect') causes the removal of invocations, including arguments, of any annotated member. This means the codegen builder shouldn't see any calls to these methods.
In a normal dart2js compilation this would mean we don't try to build bodies for the members. However, when running codegen in sharded mode, we have to be more conservative and assume another shard may need the member. Therefore one shard will still try to generate these methods.
We can just emit an empty member as the linker will exclude the unused method from the final JS code.
Change-Id: I28a82267f692f6a4921fe3b5207a7284f3fc8e0a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/500001
Reviewed-by: Stephen Adams <sra@google.com>1 parent 470f6e9 commit a93219a
1 file changed
Lines changed: 13 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2051 | 2051 | | |
2052 | 2052 | | |
2053 | 2053 | | |
2054 | | - | |
2055 | | - | |
2056 | | - | |
2057 | | - | |
2058 | | - | |
| 2054 | + | |
| 2055 | + | |
| 2056 | + | |
| 2057 | + | |
| 2058 | + | |
| 2059 | + | |
| 2060 | + | |
| 2061 | + | |
| 2062 | + | |
| 2063 | + | |
| 2064 | + | |
| 2065 | + | |
| 2066 | + | |
2059 | 2067 | | |
2060 | 2068 | | |
2061 | 2069 | | |
| |||
0 commit comments