This commit is contained in:
jfrijters 2006-04-11 14:59:43 +00:00
Родитель b21622b91c
Коммит 2e55ff13c6
5 изменённых файлов: 37 добавлений и 16 удалений

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

@ -4507,7 +4507,9 @@ gnu/java/nio/SocketChannelSelectionKey.java
gnu/java/nio/VMPipe.java
generics/ikvm/internal/AnnotationAttributeBase.java
ikvm/internal/LibraryVMInterface.java
ikvm/internal/WeakIdentityMap.java
ikvm/lang/CIL.java
ikvm/lang/Internal.java
ikvm/io/InputStreamWrapper.java
java/io/VMFile.java
java/io/VMObjectInputStream.java
@ -4540,4 +4542,4 @@ java/nio/VMDirectByteBuffer.java
java/security/VMAccessController.java
java/util/VMTimeZone.java
sun/misc/Ref.java
generics/sun/reflect/annotation/AnnotationInvocationHandler.java
sun/reflect/annotation/AnnotationInvocationHandler.java

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

@ -104,6 +104,7 @@
/>
<File
RelPath = "ikvmc\CompilerClassLoader.cs"
SubType = "Code"
BuildAction = "Compile"
/>
<File

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

@ -1871,7 +1871,7 @@ namespace IKVM.Internal
{
#if WHIDBEY
Assembly reference = Assembly.ReflectionOnlyLoadFrom(r);
if(AttributeHelper.IsDefined(reference, JVM.LoadType(typeof(RemappedClassAttribute))))
if(AttributeHelper.IsDefined(reference, StaticCompiler.GetType("IKVM.Attributes.RemappedClassAttribute")))
{
JVM.CoreAssembly = reference;
}
@ -2102,13 +2102,15 @@ namespace IKVM.Internal
return 1;
}
if(StaticCompiler.runtimeAssembly.GetType("gnu.classpath.Pointer") != null)
Type pointer = StaticCompiler.runtimeAssembly.GetType("gnu.classpath.Pointer");
if(pointer != null)
{
ClassLoaderWrapper.PublishLibraryImplementationHelperType(JVM.LoadType(typeof(gnu.classpath.Pointer)));
ClassLoaderWrapper.PublishLibraryImplementationHelperType(pointer);
}
if(StaticCompiler.runtimeAssembly.GetType("ikvm.internal.LibraryVMInterface") != null)
Type libvminterface = StaticCompiler.runtimeAssembly.GetType("ikvm.internal.LibraryVMInterface");
if(libvminterface != null)
{
ClassLoaderWrapper.PublishLibraryImplementationHelperType(JVM.LoadType(typeof(ikvm.@internal.LibraryVMInterface)));
ClassLoaderWrapper.PublishLibraryImplementationHelperType(libvminterface);
}
Tracer.Info(Tracer.Compiler, "Compiling class files (1)");

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

@ -137,7 +137,9 @@ namespace IKVM.Internal
private static CustomAttributeBuilder ghostInterfaceAttribute;
private static CustomAttributeBuilder hideFromJavaAttribute;
private static CustomAttributeBuilder deprecatedAttribute;
#if STATIC_COMPILER
private static CustomAttributeBuilder editorBrowsableNever;
#endif
private static ConstructorInfo implementsAttribute;
private static ConstructorInfo throwsAttribute;
private static ConstructorInfo sourceFileAttribute;
@ -1221,6 +1223,16 @@ namespace IKVM.Internal
return attr1;
}
internal static string GetAnnotationAttributeType(Type type)
{
object[] attr = type.GetCustomAttributes(typeof(AnnotationAttributeAttribute), false);
if(attr.Length == 1)
{
return ((AnnotationAttributeAttribute)attr[0]).AttributeType;
}
return null;
}
internal static bool IsDefined(Module mod, Type attribute)
{
#if WHIDBEY && !COMPACT_FRAMEWORK
@ -4747,7 +4759,11 @@ namespace IKVM.Internal
private class JniBuilder
{
private static readonly Type localRefStructType = JVM.LoadType(typeof(IKVM.Runtime.JNI.Frame));
#if STATIC_COMPILER
private static readonly Type localRefStructType = StaticCompiler.GetType("IKVM.Runtime.JNI.Frame");
#else
private static readonly Type localRefStructType = typeof(IKVM.Runtime.JNI.Frame);
#endif
private static readonly MethodInfo jniFuncPtrMethod = localRefStructType.GetMethod("GetFuncPtr");
private static readonly MethodInfo enterLocalRefStruct = localRefStructType.GetMethod("Enter");
private static readonly MethodInfo leaveLocalRefStruct = localRefStructType.GetMethod("Leave");
@ -5439,7 +5455,7 @@ namespace IKVM.Internal
#if STATIC_COMPILER
if(classFile.Methods[index].AnnotationDefault != null)
{
CustomAttributeBuilder cab = new CustomAttributeBuilder(JVM.LoadType(typeof(AnnotationDefaultAttribute)).GetConstructor(new Type[] { typeof(object) }), new object[] { classFile.Methods[index].AnnotationDefault });
CustomAttributeBuilder cab = new CustomAttributeBuilder(StaticCompiler.GetType("IKVM.Attributes.AnnotationDefaultAttribute").GetConstructor(new Type[] { typeof(object) }), new object[] { classFile.Methods[index].AnnotationDefault });
mb.SetCustomAttribute(cab);
}
#endif
@ -7089,14 +7105,10 @@ namespace IKVM.Internal
{
get
{
object[] attr = type.GetCustomAttributes(typeof(AnnotationAttributeAttribute), false);
if(attr.Length == 1)
string annotationAttribute = AttributeHelper.GetAnnotationAttributeType(type);
if(annotationAttribute != null)
{
Type annotationAttribute = type.Assembly.GetType(((AnnotationAttributeAttribute)attr[0]).AttributeType);
if(annotationAttribute != null)
{
return new CompiledAnnotation(annotationAttribute);
}
return new CompiledAnnotation(type.Assembly.GetType(annotationAttribute, true));
}
return null;
}

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

@ -75,7 +75,11 @@ class ByteCodeHelperMethods
static ByteCodeHelperMethods()
{
Type typeofByteCodeHelper = JVM.LoadType(typeof(ByteCodeHelper));
#if STATIC_COMPILER
Type typeofByteCodeHelper = StaticCompiler.GetType("IKVM.Runtime.ByteCodeHelper");
#else
Type typeofByteCodeHelper = typeof(ByteCodeHelper);
#endif
GetClassFromTypeHandle = typeofByteCodeHelper.GetMethod("GetClassFromTypeHandle");
multianewarray = typeofByteCodeHelper.GetMethod("multianewarray");
f2i = typeofByteCodeHelper.GetMethod("f2i");