private void getReadyToRunDelegateCtorHelper(ref CORINFO_RESOLVED_TOKEN pTargetMethod, CORINFO_CLASS_STRUCT_ *delegateType, ref CORINFO_LOOKUP pLookup) { #if DEBUG // In debug, write some bogus data to the struct to ensure we have filled everything // properly. fixed(CORINFO_LOOKUP *tmp = &pLookup) MemoryHelper.FillMemory((byte *)tmp, 0xcc, sizeof(CORINFO_LOOKUP)); #endif MethodDesc targetMethod = HandleToObject(pTargetMethod.hMethod); TypeDesc delegateTypeDesc = HandleToObject(delegateType); if (targetMethod.IsSharedByGenericInstantiations) { // If the method is not exact, fetch it as a runtime determined method. targetMethod = (MethodDesc)GetRuntimeDeterminedObjectForToken(ref pTargetMethod); } /* TODO * bool isLdvirtftn = pTargetMethod.tokenType == CorInfoTokenKind.CORINFO_TOKENKIND_Ldvirtftn; * DelegateCreationInfo delegateInfo = _compilation.GetDelegateCtor(delegateTypeDesc, targetMethod, isLdvirtftn); * * if (delegateInfo.NeedsRuntimeLookup) * { * pLookup.lookupKind.needsRuntimeLookup = true; * * MethodDesc contextMethod = methodFromContext(pTargetMethod.tokenContext); * * // We should not be inlining these. RyuJIT should have aborted inlining already. * Debug.Assert(contextMethod == MethodBeingCompiled); * * pLookup.lookupKind.runtimeLookupKind = GetGenericRuntimeLookupKind(contextMethod); * pLookup.lookupKind.runtimeLookupFlags = (ushort)ReadyToRunHelperId.DelegateCtor; * pLookup.lookupKind.runtimeLookupArgs = (void*)ObjectToHandle(delegateInfo); * } * else */ { pLookup.lookupKind.needsRuntimeLookup = false; pLookup.constLookup = CreateConstLookupToSymbol(_compilation.SymbolNodeFactory.DelegateCtor( delegateTypeDesc, targetMethod, new ModuleToken(_tokenContext, (mdToken)pTargetMethod.token), _signatureContext)); } }
private void getReadyToRunDelegateCtorHelper(ref CORINFO_RESOLVED_TOKEN pTargetMethod, CORINFO_CLASS_STRUCT_ *delegateType, ref CORINFO_LOOKUP pLookup) { #if DEBUG // In debug, write some bogus data to the struct to ensure we have filled everything // properly. fixed(CORINFO_LOOKUP *tmp = &pLookup) MemoryHelper.FillMemory((byte *)tmp, 0xcc, sizeof(CORINFO_LOOKUP)); #endif MethodDesc targetMethod = HandleToObject(pTargetMethod.hMethod); TypeDesc delegateTypeDesc = HandleToObject(delegateType); pLookup.lookupKind.needsRuntimeLookup = false; pLookup.constLookup = CreateConstLookupToSymbol(_compilation.SymbolNodeFactory.DelegateCtor( delegateTypeDesc, targetMethod, new ModuleToken(_tokenContext, (mdToken)pTargetMethod.token), _signatureContext)); }