Esempio n. 1
0
        public MethodFixupSignature(
            ReadyToRunFixupKind fixupKind,
            MethodWithToken method,
            bool isInstantiatingStub)
        {
            _fixupKind           = fixupKind;
            _method              = method;
            _isInstantiatingStub = isInstantiatingStub;

            // Ensure types in signature are loadable and resolvable, otherwise we'll fail later while emitting the signature
            CompilerTypeSystemContext compilerContext = (CompilerTypeSystemContext)method.Method.Context;

            compilerContext.EnsureLoadableMethod(method.Method);
            compilerContext.EnsureLoadableType(_method.OwningType);

            if (method.ConstrainedType != null)
            {
                compilerContext.EnsureLoadableType(method.ConstrainedType);
            }
        }
Esempio n. 2
0
        public DelegateCtorSignature(
            TypeDesc delegateType,
            IMethodNode targetMethod,
            ModuleToken methodToken)
        {
            _delegateType = delegateType;
            _targetMethod = targetMethod;
            _methodToken  = methodToken;

            // Ensure types in signature are loadable and resolvable, otherwise we'll fail later while emitting the signature
            CompilerTypeSystemContext compilerContext = (CompilerTypeSystemContext)delegateType.Context;

            compilerContext.EnsureLoadableType(delegateType);
            compilerContext.EnsureLoadableMethod(targetMethod.Method);
        }
        public VirtualResolutionFixupSignature(ReadyToRunFixupKind fixupKind, MethodWithToken declMethod, TypeDesc implType, MethodWithToken implMethod)
        {
            _fixupKind  = fixupKind;
            _declMethod = declMethod;
            _implType   = implType;
            _implMethod = implMethod;

            // Ensure types in signature are loadable and resolvable, otherwise we'll fail later while emitting the signature
            CompilerTypeSystemContext compilerContext = (CompilerTypeSystemContext)declMethod.Method.Context;

            compilerContext.EnsureLoadableMethod(declMethod.Method);
            compilerContext.EnsureLoadableType(implType);
            if (implMethod != null)
            {
                compilerContext.EnsureLoadableMethod(implMethod.Method);
            }
        }