Implement DacDbi cDAC APIs and simplify generic type context APIs#128263
Conversation
…actGenericArgsToken, GetGenericArgTokenIndex Co-authored-by: rcj1 <77995559+rcj1@users.noreply.github.com>
|
Tagging subscribers to this area: @steveisok, @tommcdon, @dotnet/dotnet-diag |
|
I just noticed there is a small pre-existing divergence in RequiresInstArg that we should probably fix. Native MethodDesc::AcquiresInstMethodTableFromThis excludes only non-abstract interface methods (i.e., DIMs): return
IsSharedByGenericInstantiations() &&
!HasMethodInstantiation() &&
!IsStatic() &&
!GetMethodTable()->IsValueType() &&
!(GetMethodTable()->IsInterface() && !IsAbstract());The cDAC's RequiresInstArg drops the !IsAbstract qualifier and returns true for any interface method. |
I saw that too, PR will be up shortly Edit: Your suggestion on the generics API sounds good, I think I will just take that and incorporate the changes into this PR |
|
/ba-g timeout |
Implements four DacDbi APIs in the managed cDAC.
cDAC DacDbi implementations
GetSimpleType— resolves CorElementType to its metadata token + module via_target.Contracts.RuntimeTypeSystem.ResolveAssembly— looks up an assembly ref token through the loader contract.ResolveExactGenericArgsToken— walks the generic dictionary to recover the exact instantiation token.GetGenericArgTokenIndex— mirrors the native three-state result (S_FALSE/*pIndex = 0/*pIndex = TYPECTXT_ILNUM).Each implementation is gated by the existing
#if DEBUGlegacy cross-check pattern.