Commit 1841a8d
[dart2js] Add support for tree shaking protobuf messages with mixins.
Typically these mixins introduce additional reflective features on the messages extending them. This made it unfavorable to tree shake fields on these messages.
However, some customers have tooling that makes it so the set of messages/fields accessed reflectively through mixins is statically known. Therefore, they can inject special code to retain those messages/fields and still benefit from treeshaking on the rest of the fields in those messages.
This is a separate flag because it introduces new opportunities for breakages that users may want to roll out separately.
Testing on an internal build showed an additional ~2.8% code size reduction from this additional tree shaking.
Change-Id: I6bbe6209acc26f8e8904c81f6960b71e4b516f25
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/414820
Reviewed-by: Mayank Patke <[email protected]>
Commit-Queue: Nate Biggs <[email protected]>1 parent 97ba123 commit 1841a8d
File tree
4 files changed
+48
-6
lines changed- pkg/compiler/lib/src
- ir
4 files changed
+48
-6
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
77 | 77 | | |
78 | 78 | | |
79 | 79 | | |
| 80 | + | |
80 | 81 | | |
81 | 82 | | |
82 | 83 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
514 | 514 | | |
515 | 515 | | |
516 | 516 | | |
| 517 | + | |
517 | 518 | | |
518 | 519 | | |
519 | 520 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
73 | 73 | | |
74 | 74 | | |
75 | 75 | | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
76 | 89 | | |
77 | 90 | | |
78 | 91 | | |
79 | 92 | | |
80 | 93 | | |
81 | 94 | | |
| 95 | + | |
| 96 | + | |
82 | 97 | | |
83 | 98 | | |
84 | 99 | | |
85 | 100 | | |
86 | 101 | | |
87 | 102 | | |
88 | | - | |
89 | | - | |
90 | | - | |
91 | | - | |
92 | | - | |
93 | | - | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
94 | 125 | | |
95 | 126 | | |
96 | 127 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
705 | 705 | | |
706 | 706 | | |
707 | 707 | | |
| 708 | + | |
708 | 709 | | |
709 | 710 | | |
710 | 711 | | |
| |||
959 | 960 | | |
960 | 961 | | |
961 | 962 | | |
| 963 | + | |
| 964 | + | |
| 965 | + | |
| 966 | + | |
962 | 967 | | |
963 | 968 | | |
964 | 969 | | |
| |||
1172 | 1177 | | |
1173 | 1178 | | |
1174 | 1179 | | |
| 1180 | + | |
| 1181 | + | |
| 1182 | + | |
| 1183 | + | |
1175 | 1184 | | |
1176 | 1185 | | |
1177 | 1186 | | |
| |||
0 commit comments