void ReadMethodSpecs()
        {
            if (!m_tHeap.HasTable(MethodSpecTable.RId))
            {
                return;
            }

            MethodSpecTable msTable = m_tableReader.GetMethodSpecTable();

            m_methodSpecs = new GenericInstanceMethod [msTable.Rows.Count];
        }
        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);
        }