private void InitILGeneration(Type[] argTypes, string[] argNames, bool isStatic)
{
_methodEndLabel = _ilGen.DefineLabel();
this.retLabel = _ilGen.DefineLabel();
_blockStack = new Stack();
_whileStack = new Stack();
_currentScope = new LocalScope();
_freeLocals = new Dictionary<Tuple<Type, string>, Queue<LocalBuilder>>();
_argList = new Dictionary<string, ArgBuilder>();
// this ptr is arg 0 for non static, assuming ref type (not value type)
if (!isStatic)
_argList.Add("this", new ArgBuilder("this", 0, _typeBuilder.BaseType));
for (int i = 0; i < argTypes.Length; i++)
{
ArgBuilder arg = new ArgBuilder(argNames[i], _argList.Count, argTypes[i]);
_argList.Add(arg.Name, arg);
_methodBuilder.DefineParameter(arg.Index, ParameterAttributes.None, arg.Name);
}
}