using System;
+using System.Collections;
namespace Mono.ILASM {
private PEAPI.Type type;
private bool is_resolved;
+ private static Hashtable method_table = new Hashtable ();
public PrimitiveTypeRef (PEAPI.PrimitiveType type, string full_name)
{
is_resolved = false;
}
+ public string Name {
+ get { return full_name; }
+ }
+
public string FullName {
get { return full_name + sig_mod; }
}
}
public IMethodRef GetMethodRef (ITypeRef ret_type, PEAPI.CallConv call_conv,
- string name, ITypeRef[] param)
+ string name, ITypeRef[] param, int gen_param_count)
{
- return new TypeSpecMethodRef (this, ret_type, call_conv, name, param);
+ string key = full_name + MethodDef.CreateSignature (ret_type, name, param, gen_param_count) + sig_mod;
+ TypeSpecMethodRef mr = method_table [key] as TypeSpecMethodRef;
+ if (mr != null)
+ return mr;
+
+ //FIXME: generic methodref for primitive type?
+ mr = new TypeSpecMethodRef (this, ret_type, call_conv, name, param, gen_param_count);
+ method_table [key] = mr;
+ return mr;
}
public IFieldRef GetFieldRef (ITypeRef ret_type, string name)