internal void BeginMethod(Type returnType, MethodBuilderInfo methodBuilderInfo, Type[] argTypes, string[] argNames, MethodAttributes methodAttributes) { #if DEBUG methodBuilderInfo.Validate(returnType, argTypes, methodAttributes); #endif this.methodBuilder = methodBuilderInfo.MethodBuilder; this.ilGen = methodBuilder.GetILGenerator(); InitILGeneration(argTypes, argNames, (methodBuilder.Attributes & MethodAttributes.Static) == MethodAttributes.Static); }
internal MethodBuilder EnsureMethodBuilder(TypeBuilder typeBuilder, string methodName, MethodAttributes attributes, Type returnType, Type[] parameterTypes) { MethodBuilderInfo methodBuilderInfo; if (!methodBuilders.TryGetValue(methodName, out methodBuilderInfo)) { MethodBuilder methodBuilder = typeBuilder.DefineMethod( methodName, attributes, returnType, parameterTypes); methodBuilderInfo = new MethodBuilderInfo(methodBuilder, parameterTypes); methodBuilders.Add(methodName, methodBuilderInfo); } #if DEBUG else { methodBuilderInfo.Validate(returnType, parameterTypes, attributes); } #endif return methodBuilderInfo.MethodBuilder; }