コード例 #1
0
ファイル: TableHeap.cs プロジェクト: djlw78/Mosa
        /// <summary>
        /// Reads the specified token.
        /// </summary>
        /// <param name="token">The token.</param>
        /// <param name="result">The result.</param>
        public void Read(TokenTypes token, out MethodSpecRow result)
        {
            if ((token & TokenTypes.TableMask) != TokenTypes.MethodSpec)
            {
                throw new ArgumentException("Invalid token type for MethodSpecRow.", "token");
            }

            using (BinaryReader reader = CreateReaderForToken(token))
            {
                result = new MethodSpecRow(ReadIndexValue(reader, IndexType.MethodDefOrRef), ReadIndexValue(reader, IndexType.BlobHeap));
            }
        }
コード例 #2
0
        public GenericInstanceMethod GetMethodSpecAt(uint rid, GenericContext context)
        {
            int index = (int)rid - 1;
            GenericInstanceMethod gim = m_methodSpecs [index];

            if (gim != null)
            {
                return(gim);
            }

            MethodSpecTable msTable = m_tableReader.GetMethodSpecTable();
            MethodSpecRow   msRow   = msTable [index];

            MethodSpec sig = m_sigReader.GetMethodSpec(msRow.Instantiation);

            MethodReference meth;

            if (msRow.Method.TokenType == TokenType.Method)
            {
                meth = GetMethodDefAt(msRow.Method.RID);
            }
            else if (msRow.Method.TokenType == TokenType.MemberRef)
            {
                meth = (MethodReference)GetMemberRefAt(msRow.Method.RID, context);
            }
            else
            {
                throw new ReflectionException("Unknown method type for method spec");
            }

            gim = new GenericInstanceMethod(meth);
            foreach (SigType st in sig.Signature.Types)
            {
                gim.GenericArguments.Add(GetTypeRefFromSig(st, context));
            }

            m_methodSpecs [index] = gim;

            return(gim);
        }
コード例 #3
0
 public virtual void VisitMethodSpecRow(MethodSpecRow row)
 {
 }
コード例 #4
0
ファイル: MetadataRoot.cs プロジェクト: djlw78/Mosa
        void IMetadataProvider.Read(TokenTypes token, out MethodSpecRow result)
        {
            TableHeap theap = (TableHeap)_streams[(int)HeapType.Tables];

            theap.Read(token, out result);
        }
コード例 #5
0
 public virtual void VisitMethodSpecRow(MethodSpecRow row)
 {
 }