Commit bdaff9d
committed
Limit expansion in
The template type loader is a limited type loader that we use in native AOT to support scenarios such as `MakeGenericType`. We keep around extra MethodTables and metadata to be able to construct new type instantiations (e.g. `List<string>`) at runtime from template instantiations (e.g. `List<__Canon>`) we made at compile time.
The template instantiation is a `MethodTable` like any other that we make a copy of and patch up with the help of the metadata ("native layout metadata"). Patching up involves e.g. building interface list (`List<string>` should have `IList<string>` in the interface list). This patching up may involve loading more new types from templates (e.g. the mentioned `IList<string>` that needs to be loadable from a `IList<__Canon>` template MethodTable).
The job of the compiler is to figure out all the templates we might need (recursively) to build a type. This is done in places using a rather non-exact `TemplateConstructableTypes` call that just decomposes the type and makes templates for _everything_. Some of these might not be actually needed.
This is an attempt to somewhat limit it.TemplateConstructableTypes
1 parent 9fa2ecb commit bdaff9d
File tree
2 files changed
+12
-43
lines changed- src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/DependencyAnalysis
2 files changed
+12
-43
lines changedLines changed: 6 additions & 40 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
650 | 650 | | |
651 | 651 | | |
652 | 652 | | |
653 | | - | |
654 | | - | |
655 | | - | |
656 | | - | |
657 | | - | |
658 | | - | |
659 | | - | |
660 | | - | |
661 | | - | |
662 | | - | |
663 | | - | |
664 | | - | |
665 | | - | |
666 | | - | |
667 | | - | |
668 | | - | |
669 | | - | |
670 | | - | |
671 | | - | |
672 | | - | |
673 | | - | |
674 | 653 | | |
675 | 654 | | |
676 | 655 | | |
| |||
788 | 767 | | |
789 | 768 | | |
790 | 769 | | |
791 | | - | |
792 | | - | |
793 | | - | |
794 | | - | |
795 | | - | |
796 | | - | |
797 | | - | |
798 | | - | |
799 | | - | |
800 | | - | |
801 | | - | |
802 | | - | |
803 | | - | |
804 | 770 | | |
805 | 771 | | |
806 | 772 | | |
| |||
1103 | 1069 | | |
1104 | 1070 | | |
1105 | 1071 | | |
| 1072 | + | |
1106 | 1073 | | |
1107 | 1074 | | |
1108 | 1075 | | |
| |||
1239 | 1206 | | |
1240 | 1207 | | |
1241 | 1208 | | |
| 1209 | + | |
1242 | 1210 | | |
1243 | 1211 | | |
1244 | 1212 | | |
| |||
1250 | 1218 | | |
1251 | 1219 | | |
1252 | 1220 | | |
1253 | | - | |
1254 | | - | |
1255 | | - | |
| 1221 | + | |
1256 | 1222 | | |
1257 | | - | |
| 1223 | + | |
1258 | 1224 | | |
1259 | | - | |
| 1225 | + | |
1260 | 1226 | | |
1261 | 1227 | | |
1262 | | - | |
| 1228 | + | |
1263 | 1229 | | |
1264 | 1230 | | |
1265 | 1231 | | |
| |||
Lines changed: 6 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
150 | 150 | | |
151 | 151 | | |
152 | 152 | | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
153 | 159 | | |
154 | 160 | | |
155 | 161 | | |
| |||
160 | 166 | | |
161 | 167 | | |
162 | 168 | | |
163 | | - | |
164 | | - | |
165 | 169 | | |
166 | 170 | | |
167 | 171 | | |
| |||
184 | 188 | | |
185 | 189 | | |
186 | 190 | | |
187 | | - | |
188 | 191 | | |
189 | 192 | | |
190 | 193 | | |
| |||
0 commit comments