Removed circular dependency hack for delegate types that isn't required anymore with the new CreateStep2 compilation pass.

This commit is contained in:
jfrijters 2011-12-14 12:10:00 +00:00
Родитель 531f688a16
Коммит 848311cad9
2 изменённых файлов: 2 добавлений и 36 удалений

Просмотреть файл

@ -69,9 +69,6 @@ namespace IKVM.Internal
{
private static readonly object wrapperLock = new object();
private static readonly Dictionary<Type, TypeWrapper> globalTypeToTypeWrapper = new Dictionary<Type, TypeWrapper>();
#if STATIC_COMPILER
private TypeWrapper circularDependencyHack;
#endif
#if STATIC_COMPILER || STUB_GENERATOR
private static ClassLoaderWrapper bootstrapClassLoader;
#else
@ -293,32 +290,6 @@ namespace IKVM.Internal
}
}
#if STATIC_COMPILER
internal TypeWrapper LoadCircularDependencyHack(TypeWrapper tw, string name)
{
if (circularDependencyHack == null)
{
circularDependencyHack = tw;
try
{
return LoadClassByDottedNameFast(name);
}
finally
{
circularDependencyHack = null;
}
}
else if (circularDependencyHack.Name == name)
{
return circularDependencyHack;
}
else
{
return LoadClassByDottedNameFast(name);
}
}
#endif
protected virtual void CheckDefineClassAllowed(string className)
{
// this hook exists so that AssemblyClassLoader can prevent DefineClass when the name is already present in the assembly

Просмотреть файл

@ -288,12 +288,7 @@ namespace IKVM.Internal
{
throw new VerifyError("Delegate may not declare any fields");
}
TypeWrapper iface;
#if STATIC_COMPILER
iface = classLoader.LoadCircularDependencyHack(this, f.Name + DotNetTypeWrapper.DelegateInterfaceSuffix);
#else
iface = classLoader.LoadClassByDottedNameFast(f.Name + DotNetTypeWrapper.DelegateInterfaceSuffix);
#endif
TypeWrapper iface = classLoader.LoadClassByDottedNameFast(f.Name + DotNetTypeWrapper.DelegateInterfaceSuffix);
DelegateInnerClassCheck(iface != null);
DelegateInnerClassCheck(iface.IsInterface);
DelegateInnerClassCheck(iface.IsPublic);
@ -625,7 +620,7 @@ namespace IKVM.Internal
{
try
{
outerClassWrapper = wrapper.GetClassLoader().LoadCircularDependencyHack(wrapper, outerClassName) as DynamicTypeWrapper;
outerClassWrapper = wrapper.classLoader.LoadClassByDottedNameFast(outerClassName) as DynamicTypeWrapper;
}
catch (RetargetableJavaException x)
{