Closed
Description
Right now the interop space calculates if a call needs a return buffer for managed->native calls instead of the JIT. In dotnet/coreclr#23145, we taught the interop space how to correctly insert return buffers for member functions on Windows. Most of the logic (except possibly the stdcall
member function case used by COM), should be possible to move into the JIT instead of the interop ILStub generation.
See ILMarshaler::EmitMarshalReturnValue for most of the logic. https://github.com/dotnet/coreclr/blob/6b889aba05b8e1ccc9cef793a2d1293e30598453/src/vm/ilmarshalers.h#L567-L801
cc: @jkotas