You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Nov 1, 2020. It is now read-only.
Repro program (needs to be compiled with --usesharedgenerics):
usingSystem;internalclassProgram{privatestaticintMain(){TestDelegateFatFunctionPointers.Run();return100;}/// <summary>/// Tests that we can use a delegate that points to a generic method./// </summary>classTestDelegateFatFunctionPointers{TGeneric<T>(objecto)whereT:class{Func<object,T>f=OtherGeneric<T>;returnf(o);}TOtherGeneric<T>(objecto)whereT:class{returnoasT;}publicstaticvoidRun(){stringhw="Hello World";stringroundtrip=newTestDelegateFatFunctionPointers().Generic<string>(hw);if(roundtrip!=hw)thrownewException();}}}
fgOptimizeDelegateConstructor will abort the optimization because if (oper == GT_FTN_ADDR) is not met.
This will result in generating a normal call to the delegate's .ctor method. CoreRT doesn't have enough smarts in it to be able to tell from the function pointer how the delegate object should be laid out. The construction needs to always go through the helper. I think we're aborting because the actual address is coming from a dictionary lookup.
We're expecting the token passed to getReadyToRunDelegateCtorHelper will be the token that was ldftn'd.
Repro program (needs to be compiled with
--usesharedgenerics):fgOptimizeDelegateConstructorwill abort the optimization becauseif (oper == GT_FTN_ADDR)is not met.This will result in generating a normal call to the delegate's
.ctormethod. CoreRT doesn't have enough smarts in it to be able to tell from the function pointer how the delegate object should be laid out. The construction needs to always go through the helper. I think we're aborting because the actual address is coming from a dictionary lookup.We're expecting the token passed to
getReadyToRunDelegateCtorHelperwill be the token that was ldftn'd.