System.Text.RegularExpressions.RegexLWCGCompiler.DefineDynamicMethod C# (CSharp) Method

DefineDynamicMethod() private method

private DefineDynamicMethod ( String methname, Type returntype, Type hostType ) : DynamicMethod
methname String
returntype System.Type
hostType System.Type
return System.Reflection.Emit.DynamicMethod
        internal DynamicMethod DefineDynamicMethod(String methname, Type returntype, Type hostType) {
            // We're claiming that these are static methods, but really they are instance methods.
            // By giving them a parameter which represents "this", we're tricking them into 
            // being instance methods.  

            MethodAttributes attribs =  MethodAttributes.Public | MethodAttributes.Static;
            CallingConventions conventions = CallingConventions.Standard;
                            
            DynamicMethod dm = new DynamicMethod(methname, attribs, conventions, returntype, _paramTypes, hostType, false /*skipVisibility*/);
            _ilg = dm.GetILGenerator();
            return dm;
        }