Rough idea:
1) Produce fat function pointers in interface resolve.
2) Teach interface call lowering fat function pointer dispatch.
3) Limit the impact of this on code quality by:
Recording all the IDIC-implementing interfaces during scanning.
Only using the fat function pointer aware lowering for calls to interfaces that the IDIC implementations implement. So if for example we have [IDICImpl] IImplOne : ISomething, [IDICImpl] IImplTwo : ISomething during scanning, the final set of affected methods would be those on ISomethingandIImplOne with IImplTwo, since the latter "implement themselves".
See https://github.com/dotnet/runtime/pull/108235, which uses the thunk pool and will not work for us.
Rough idea: 1) Produce fat function pointers in interface resolve. 2) Teach interface call lowering fat function pointer dispatch. 3) Limit the impact of this on code quality by:
[IDICImpl] IImplOne : ISomething, [IDICImpl] IImplTwo : ISomething
during scanning, the final set of affected methods would be those onISomething
andIImplOne
withIImplTwo
, since the latter "implement themselves".