зеркало из https://github.com/mono/ikvm-fork.git
Removed circular dependency hack for delegate types that isn't required anymore with the new CreateStep2 compilation pass.
This commit is contained in:
Родитель
531f688a16
Коммит
848311cad9
|
@ -69,9 +69,6 @@ namespace IKVM.Internal
|
||||||
{
|
{
|
||||||
private static readonly object wrapperLock = new object();
|
private static readonly object wrapperLock = new object();
|
||||||
private static readonly Dictionary<Type, TypeWrapper> globalTypeToTypeWrapper = new Dictionary<Type, TypeWrapper>();
|
private static readonly Dictionary<Type, TypeWrapper> globalTypeToTypeWrapper = new Dictionary<Type, TypeWrapper>();
|
||||||
#if STATIC_COMPILER
|
|
||||||
private TypeWrapper circularDependencyHack;
|
|
||||||
#endif
|
|
||||||
#if STATIC_COMPILER || STUB_GENERATOR
|
#if STATIC_COMPILER || STUB_GENERATOR
|
||||||
private static ClassLoaderWrapper bootstrapClassLoader;
|
private static ClassLoaderWrapper bootstrapClassLoader;
|
||||||
#else
|
#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)
|
protected virtual void CheckDefineClassAllowed(string className)
|
||||||
{
|
{
|
||||||
// this hook exists so that AssemblyClassLoader can prevent DefineClass when the name is already present in the assembly
|
// 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");
|
throw new VerifyError("Delegate may not declare any fields");
|
||||||
}
|
}
|
||||||
TypeWrapper iface;
|
TypeWrapper iface = classLoader.LoadClassByDottedNameFast(f.Name + DotNetTypeWrapper.DelegateInterfaceSuffix);
|
||||||
#if STATIC_COMPILER
|
|
||||||
iface = classLoader.LoadCircularDependencyHack(this, f.Name + DotNetTypeWrapper.DelegateInterfaceSuffix);
|
|
||||||
#else
|
|
||||||
iface = classLoader.LoadClassByDottedNameFast(f.Name + DotNetTypeWrapper.DelegateInterfaceSuffix);
|
|
||||||
#endif
|
|
||||||
DelegateInnerClassCheck(iface != null);
|
DelegateInnerClassCheck(iface != null);
|
||||||
DelegateInnerClassCheck(iface.IsInterface);
|
DelegateInnerClassCheck(iface.IsInterface);
|
||||||
DelegateInnerClassCheck(iface.IsPublic);
|
DelegateInnerClassCheck(iface.IsPublic);
|
||||||
|
@ -625,7 +620,7 @@ namespace IKVM.Internal
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
outerClassWrapper = wrapper.GetClassLoader().LoadCircularDependencyHack(wrapper, outerClassName) as DynamicTypeWrapper;
|
outerClassWrapper = wrapper.classLoader.LoadClassByDottedNameFast(outerClassName) as DynamicTypeWrapper;
|
||||||
}
|
}
|
||||||
catch (RetargetableJavaException x)
|
catch (RetargetableJavaException x)
|
||||||
{
|
{
|
||||||
|
|
Загрузка…
Ссылка в новой задаче