Open mikedn opened 6 years ago
Code folding affects delegate equality (a delegate to Array<int>.get_Count()
cannot be equal to a delegate to Array<byte>.get_Count()
even though the code is the same, or bad things will happen).
On Project N, we do code folding, but we create a jump stub whenever a unique code address is needed (e.g. when expanding the LDFTN
instruction). Having confusing stack traces is less of an issue (but people do notice it in their UWP apps and it does raise support questions from time to time).
For the open source CoreRT compiler, this is something that is on our radar but we don't do it yet.
I see in the linker response file that is generated when publishing that
/OPT:ICF
(and/OPT:REF
) are specified. However, the final exe appears to contain identical method bodies that are not folded (e.g.Array<int>.get_Count()
andArray<byte>.get_Count()
.Is it even possible to use
/OPT:ICF
with managed code? Won't it affect callstacks somehow?