Exemplo n.º 1
0
        public override Vertex WriteVertex(NodeFactory factory)
        {
            MethodCallingConvention methodCallingConvention = default(MethodCallingConvention);

            if (_method.Signature.GenericParameterCount > 0)
            {
                methodCallingConvention |= MethodCallingConvention.Generic;
            }
            if (_method.Signature.IsStatic)
            {
                methodCallingConvention |= MethodCallingConvention.Static;
            }

            Debug.Assert(_method.Signature.Length == _parametersSig.Length);

            Vertex returnType = _returnTypeSig.WriteVertex(factory);

            Vertex[] parameters = new Vertex[_parametersSig.Length];
            for (int i = 0; i < _parametersSig.Length; i++)
            {
                parameters[i] = _parametersSig[i].WriteVertex(factory);
            }

            Vertex signature = GetNativeWriter(factory).GetMethodSigSignature((uint)methodCallingConvention, (uint)_method.Signature.GenericParameterCount, returnType, parameters);

            return(factory.MetadataManager.NativeLayoutInfo.SignaturesSection.Place(signature));
        }
Exemplo n.º 2
0
        public override Vertex WriteVertex(NodeFactory factory)
        {
            Vertex containingType   = _containingTypeSig.WriteVertex(factory);
            Vertex methodSig        = _methodSig.WriteVertex(factory);
            Vertex methodNameAndSig = GetNativeWriter(factory).GetMethodNameAndSigSignature(_method.Name, methodSig);

            Debug.Assert(_instantiationArgsSig == null || (_method.HasInstantiation && _method.Instantiation.Length == _instantiationArgsSig.Length));

            Vertex[]    args  = null;
            MethodFlags flags = 0;

            if (_method.HasInstantiation)
            {
                flags |= MethodFlags.HasInstantiation;
                args   = new Vertex[_method.Instantiation.Length];
                for (int i = 0; i < args.Length; i++)
                {
                    args[i] = _instantiationArgsSig[i].WriteVertex(factory);
                }
            }

            Vertex signature = GetNativeWriter(factory).GetMethodSignature((uint)flags, 0, containingType, methodNameAndSig, args);

            return(SetSavedVertex(factory.MetadataManager.NativeLayoutInfo.LdTokenInfoSection.Place(signature)));
        }
Exemplo n.º 3
0
        public override Vertex WriteVertex(NodeFactory factory)
        {
            Vertex containingType = _containingTypeSig.WriteVertex(factory);

            Vertex unplacedVertex = GetNativeWriter(factory).GetFieldSignature(containingType, _field.Name);

            return(SetSavedVertex(factory.MetadataManager.NativeLayoutInfo.LdTokenInfoSection.Place(unplacedVertex)));
        }
Exemplo n.º 4
0
            public override Vertex WriteVertex(NodeFactory factory)
            {
                Vertex genericDefVertex = _genericTypeDefSig.WriteVertex(factory);

                Vertex[] args = new Vertex[_instantiationArgs.Length];
                for (int i = 0; i < args.Length; i++)
                {
                    args[i] = _instantiationArgs[i].WriteVertex(factory);
                }

                return(GetNativeWriter(factory).GetInstantiationTypeSignature(genericDefVertex, args));
            }
Exemplo n.º 5
0
 private Vertex GetContainingTypeVertex(NodeFactory factory)
 {
     if ((_flags & MethodEntryFlags.CreateInstantiatedSignature) != 0)
     {
         IEETypeNode eetypeNode = factory.NecessaryTypeSymbol(_method.OwningType);
         uint        typeIndex  = factory.MetadataManager.NativeLayoutInfo.ExternalReferences.GetIndex(eetypeNode);
         return(GetNativeWriter(factory).GetExternalTypeSignature(typeIndex));
     }
     else
     {
         return(_containingTypeSig.WriteVertex(factory));
     }
 }