ikvm-commit Mailing List for IKVM.NET (Page 229)
Brought to you by:
jfrijters
You can subscribe to this list here.
2007 |
Jan
(25) |
Feb
(22) |
Mar
(32) |
Apr
(77) |
May
(111) |
Jun
(129) |
Jul
(223) |
Aug
(109) |
Sep
(60) |
Oct
(60) |
Nov
(36) |
Dec
(55) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2008 |
Jan
(23) |
Feb
(76) |
Mar
(42) |
Apr
(49) |
May
(33) |
Jun
(64) |
Jul
(19) |
Aug
(124) |
Sep
(16) |
Oct
|
Nov
(87) |
Dec
(54) |
2009 |
Jan
(53) |
Feb
(116) |
Mar
(86) |
Apr
(64) |
May
(101) |
Jun
(99) |
Jul
(105) |
Aug
(63) |
Sep
(20) |
Oct
(110) |
Nov
(102) |
Dec
(36) |
2010 |
Jan
(87) |
Feb
(67) |
Mar
(5) |
Apr
(100) |
May
(178) |
Jun
(95) |
Jul
(22) |
Aug
(85) |
Sep
(82) |
Oct
(99) |
Nov
(119) |
Dec
(132) |
2011 |
Jan
(130) |
Feb
(18) |
Mar
(114) |
Apr
(8) |
May
(21) |
Jun
(53) |
Jul
(127) |
Aug
(111) |
Sep
(29) |
Oct
(28) |
Nov
(64) |
Dec
(94) |
2012 |
Jan
(56) |
Feb
(8) |
Mar
(65) |
Apr
(48) |
May
(22) |
Jun
(52) |
Jul
(73) |
Aug
(38) |
Sep
(18) |
Oct
(59) |
Nov
(16) |
Dec
(21) |
2013 |
Jan
(83) |
Feb
(151) |
Mar
(102) |
Apr
(13) |
May
(37) |
Jun
(1) |
Jul
(7) |
Aug
(42) |
Sep
(28) |
Oct
(13) |
Nov
(5) |
Dec
(3) |
2014 |
Jan
(3) |
Feb
(39) |
Mar
(11) |
Apr
(40) |
May
(62) |
Jun
(54) |
Jul
(21) |
Aug
(3) |
Sep
|
Oct
(15) |
Nov
(26) |
Dec
(7) |
2015 |
Jan
(6) |
Feb
(12) |
Mar
(51) |
Apr
(15) |
May
(7) |
Jun
(41) |
Jul
(2) |
Aug
(8) |
Sep
(5) |
Oct
(6) |
Nov
(11) |
Dec
(1) |
2016 |
Jan
|
Feb
(1) |
Mar
|
Apr
(1) |
May
|
Jun
(2) |
Jul
(19) |
Aug
(2) |
Sep
(2) |
Oct
|
Nov
|
Dec
|
2017 |
Jan
|
Feb
(2) |
Mar
|
Apr
(1) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Jeroen F. <jfr...@us...> - 2007-04-08 10:50:32
|
Update of /cvsroot/ikvm/ikvm/classpath/ikvm/lang In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv24454/ikvm/lang Modified Files: IterableEnumerator.java Log Message: Added ikvm.runtime.Util.throwException() method to throw CLI exceptions without declaring them. Index: IterableEnumerator.java =================================================================== RCS file: /cvsroot/ikvm/ikvm/classpath/ikvm/lang/IterableEnumerator.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** IterableEnumerator.java 11 Mar 2007 14:14:55 -0000 1.1 --- IterableEnumerator.java 8 Apr 2007 10:50:19 -0000 1.2 *************** *** 26,29 **** --- 26,30 ---- import cli.System.Collections.IEnumerator; import cli.System.InvalidOperationException; + import ikvm.runtime.Util; import java.util.Iterator; *************** *** 56,61 **** if (current == UNDEFINED) { ! // HACK we abuse Thread.stop() to throw a checked exception ! Thread.currentThread().stop(new InvalidOperationException()); } return current; --- 57,61 ---- if (current == UNDEFINED) { ! Util.throwException(new InvalidOperationException()); } return current; |
From: Jeroen F. <jfr...@us...> - 2007-04-08 10:50:32
|
Update of /cvsroot/ikvm/ikvm/classpath/java/lang In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv24454/java/lang Modified Files: VMClass.java Log Message: Added ikvm.runtime.Util.throwException() method to throw CLI exceptions without declaring them. Index: VMClass.java =================================================================== RCS file: /cvsroot/ikvm/ikvm/classpath/java/lang/VMClass.java,v retrieving revision 1.26 retrieving revision 1.27 diff -C2 -d -r1.26 -r1.27 *** VMClass.java 28 Dec 2006 07:46:27 -0000 1.26 --- VMClass.java 8 Apr 2007 10:50:29 -0000 1.27 *************** *** 244,248 **** private static native Class getClassFromType(cli.System.Type type); ! static native void throwException(Throwable t); static boolean isArray(Class clazz) --- 244,248 ---- private static native Class getClassFromType(cli.System.Type type); ! public static native void throwException(Throwable t); static boolean isArray(Class clazz) |
From: Jeroen F. <jfr...@us...> - 2007-04-05 12:51:01
|
Update of /cvsroot/ikvm/ikvm/runtime In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv26539 Modified Files: TypeWrapper.cs Log Message: Added workaround for .NET bug. Index: TypeWrapper.cs =================================================================== RCS file: /cvsroot/ikvm/ikvm/runtime/TypeWrapper.cs,v retrieving revision 1.165 retrieving revision 1.166 diff -C2 -d -r1.165 -r1.166 *** TypeWrapper.cs 29 Mar 2007 09:17:20 -0000 1.165 --- TypeWrapper.cs 5 Apr 2007 12:50:59 -0000 1.166 *************** *** 1554,1558 **** internal static void SetConstantValue(FieldBuilder field, object constantValue) { ! CustomAttributeBuilder constantValueAttrib = new CustomAttributeBuilder(typeofConstantValueAttribute.GetConstructor(new Type[] { constantValue.GetType() }), new object[] { constantValue }); field.SetCustomAttribute(constantValueAttrib); } --- 1554,1575 ---- internal static void SetConstantValue(FieldBuilder field, object constantValue) { ! CustomAttributeBuilder constantValueAttrib; ! try ! { ! constantValueAttrib = new CustomAttributeBuilder(typeofConstantValueAttribute.GetConstructor(new Type[] { constantValue.GetType() }), new object[] { constantValue }); ! } ! catch (OverflowException) ! { ! // FXBUG for char values > 32K .NET (1.1 and 2.0) throws an exception (because it tries to convert to Int16) ! if (constantValue is char) ! { ! // we use the int constant value instead, the stub generator can handle that ! constantValueAttrib = new CustomAttributeBuilder(typeofConstantValueAttribute.GetConstructor(new Type[] { typeof(int) }), new object[] { (int)(char)constantValue }); ! } ! else ! { ! throw; ! } ! } field.SetCustomAttribute(constantValueAttrib); } |
From: Jeroen F. <jfr...@us...> - 2007-04-02 08:25:32
|
Update of /cvsroot/ikvm/ikvm/runtime In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv28929 Modified Files: JniInterface.cs Log Message: Updated init args and thread attach string conversions to explicitly use UTF-8 or OEM encoding as specified in the JDK 6 JNI spec. Index: JniInterface.cs =================================================================== RCS file: /cvsroot/ikvm/ikvm/runtime/JniInterface.cs,v retrieving revision 1.45 retrieving revision 1.46 diff -C2 -d -r1.45 -r1.46 *** JniInterface.cs 16 Jan 2007 12:10:53 -0000 1.45 --- JniInterface.cs 2 Apr 2007 08:25:30 -0000 1.46 *************** *** 1,4 **** /* ! Copyright (C) 2002, 2003, 2004, 2005, 2006 Jeroen Frijters This software is provided 'as-is', without any express or implied --- 1,4 ---- /* ! Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007 Jeroen Frijters This software is provided 'as-is', without any express or implied *************** *** 65,69 **** unsafe struct JavaVMOption { ! internal sbyte* optionString; internal void* extraInfo; } --- 65,69 ---- unsafe struct JavaVMOption { ! internal byte* optionString; internal void* extraInfo; } *************** *** 104,108 **** for(int i = 0; i < pInitArgs->nOptions; i++) { ! string option = new String(pInitArgs->options[i].optionString); if(option.StartsWith("-D")) { --- 104,108 ---- for(int i = 0; i < pInitArgs->nOptions; i++) { ! string option = JNIEnv.StringFromOEM(pInitArgs->options[i].optionString); if(option.StartsWith("-D")) { *************** *** 871,875 **** { internal jint version; ! internal sbyte* name; internal jobject group; } --- 871,875 ---- { internal jint version; ! internal byte* name; internal jobject group; } *************** *** 950,954 **** try { ! System.Threading.Thread.CurrentThread.Name = new String(pAttachArgs->name); } catch(InvalidOperationException) --- 950,954 ---- try { ! System.Threading.Thread.CurrentThread.Name = JNIEnv.StringFromUTF8(pAttachArgs->name); } catch(InvalidOperationException) *************** *** 1110,1114 **** } ! private static string StringFromOEM(byte* psz) { for(int i = 0;; i++) --- 1110,1114 ---- } ! internal static string StringFromOEM(byte* psz) { for(int i = 0;; i++) |
From: Jeroen F. <jfr...@us...> - 2007-04-02 08:21:21
|
Update of /cvsroot/ikvm/ikvm/runtime In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv27395 Modified Files: ByteCodeHelper.cs Log Message: Changed left-shift to multiply operator, as it turns out that shift operators aren't affected by "checked". Index: ByteCodeHelper.cs =================================================================== RCS file: /cvsroot/ikvm/ikvm/runtime/ByteCodeHelper.cs,v retrieving revision 1.27 retrieving revision 1.28 diff -C2 -d -r1.27 -r1.28 *** ByteCodeHelper.cs 5 Jan 2007 08:14:18 -0000 1.27 --- ByteCodeHelper.cs 2 Apr 2007 08:21:14 -0000 1.28 *************** *** 478,482 **** checked { ! Buffer.BlockCopy(src, srcStart << 3, dest, destStart << 3, len << 3); return; } --- 478,482 ---- checked { ! Buffer.BlockCopy(src, srcStart * 8, dest, destStart * 8, len * 8); return; } *************** *** 503,507 **** checked { ! Buffer.BlockCopy(src, srcStart << 2, dest, destStart << 2, len << 2); return; } --- 503,507 ---- checked { ! Buffer.BlockCopy(src, srcStart * 4, dest, destStart * 4, len * 4); return; } *************** *** 528,532 **** checked { ! Buffer.BlockCopy(src, srcStart << 1, dest, destStart << 1, len << 1); return; } --- 528,532 ---- checked { ! Buffer.BlockCopy(src, srcStart * 2, dest, destStart * 2, len * 2); return; } |
From: Jeroen F. <jfr...@us...> - 2007-03-30 05:47:47
|
Update of /cvsroot/ikvm/ikvm/ikvmstub In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv16362 Modified Files: ikvmstub.8.csproj ikvmstub.build ikvmstub.cs Log Message: Changed ikvmstub to use java.util.zip instead of SharpZipLib. Index: ikvmstub.build =================================================================== RCS file: /cvsroot/ikvm/ikvm/ikvmstub/ikvmstub.build,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** ikvmstub.build 7 Dec 2005 09:06:32 -0000 1.4 --- ikvmstub.build 30 Mar 2007 05:47:46 -0000 1.5 *************** *** 2,13 **** <project name="ikvmstub" default="ikvmstub"> <target name="ikvmstub"> - <property overwrite="false" name="generics" value="false" /> <property name="defs" value="TRACE" /> <if test="${property::exists('signed')}"> <property name="defs" value="${defs};${signed}" /> </if> - <if test="${generics}"> - <property name="defs" value="${defs};GENERICS" /> - </if> <if test="${framework::get-target-framework()=='net-2.0'}"> <property name="defs" value="${defs};WHIDBEY" /> --- 2,9 ---- *************** *** 20,24 **** <include name="../bin/IKVM.GNU.Classpath.dll" asis="true" /> <include name="../bin/IKVM.Runtime.dll" asis="true" /> - <include name="../bin/ICSharpCode.SharpZipLib.dll" asis="true" /> </references> </csc> --- 16,19 ---- Index: ikvmstub.cs =================================================================== RCS file: /cvsroot/ikvm/ikvm/ikvmstub/ikvmstub.cs,v retrieving revision 1.34 retrieving revision 1.35 diff -C2 -d -r1.34 -r1.35 *** ikvmstub.cs 29 Mar 2007 09:17:20 -0000 1.34 --- ikvmstub.cs 30 Mar 2007 05:47:46 -0000 1.35 *************** *** 1,4 **** /* ! Copyright (C) 2002, 2004, 2005, 2006 Jeroen Frijters This software is provided 'as-is', without any express or implied --- 1,4 ---- /* ! Copyright (C) 2002, 2004, 2005, 2006, 2007 Jeroen Frijters This software is provided 'as-is', without any express or implied *************** *** 27,32 **** using System.Text; using System.Collections; - using ICSharpCode.SharpZipLib.Zip; using IKVM.Attributes; public class NetExp --- 27,32 ---- using System.Text; using System.Collections; using IKVM.Attributes; + using java.util.zip; public class NetExp *************** *** 94,117 **** else { ! zipFile = new ZipOutputStream(new FileStream(assembly.GetName().Name + ".jar", FileMode.Create)); ! try ! { ! ProcessAssembly(assembly); ! } ! catch(ReflectionTypeLoadException x) { ! Console.WriteLine(x); ! Console.WriteLine("LoaderExceptions:"); ! foreach(Exception n in x.LoaderExceptions) { ! Console.WriteLine(n); } } - catch(System.Exception x) - { - java.lang.Throwable.instancehelper_printStackTrace(ikvm.runtime.Util.mapException(x)); - rc = 1; - } - zipFile.Close(); } // FXBUG if we run a static initializer that starts a thread, we would never end, --- 94,119 ---- else { ! using(zipFile = new ZipOutputStream(new java.io.FileOutputStream(assembly.GetName().Name + ".jar"))) { ! zipFile.setComment(ikvm.runtime.Startup.getVersionAndCopyrightInfo()); ! try { ! ProcessAssembly(assembly); ! } ! catch(ReflectionTypeLoadException x) ! { ! Console.WriteLine(x); ! Console.WriteLine("LoaderExceptions:"); ! foreach (Exception n in x.LoaderExceptions) ! { ! Console.WriteLine(n); ! } ! } ! catch(System.Exception x) ! { ! java.lang.Throwable.instancehelper_printStackTrace(ikvm.runtime.Util.mapException(x)); ! rc = 1; } } } // FXBUG if we run a static initializer that starts a thread, we would never end, *************** *** 150,155 **** private static void WriteClass(string name, byte[] buf) { ! zipFile.PutNextEntry(new ZipEntry(name)); ! zipFile.Write(buf, 0, buf.Length); } --- 152,157 ---- private static void WriteClass(string name, byte[] buf) { ! zipFile.putNextEntry(new ZipEntry(name)); ! zipFile.write(buf, 0, buf.Length); } Index: ikvmstub.8.csproj =================================================================== RCS file: /cvsroot/ikvm/ikvm/ikvmstub/ikvmstub.8.csproj,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** ikvmstub.8.csproj 29 Mar 2007 09:21:09 -0000 1.1 --- ikvmstub.8.csproj 30 Mar 2007 05:47:46 -0000 1.2 *************** *** 53,60 **** </PropertyGroup> <ItemGroup> - <Reference Include="ICSharpCode.SharpZipLib"> - <Name>ICSharpCode.SharpZipLib</Name> - <HintPath>..\bin\ICSharpCode.SharpZipLib.dll</HintPath> - </Reference> <Reference Include="IKVM.GNU.Classpath"> <Name>IKVM.GNU.Classpath</Name> --- 53,56 ---- |
From: Jeroen F. <jfr...@us...> - 2007-03-29 09:21:12
|
Update of /cvsroot/ikvm/ikvm/runtime In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv25605/runtime Added Files: IKVM.Runtime.8.csproj Log Message: New Visual Studio 2005 solution and project files. --- NEW FILE: IKVM.Runtime.8.csproj --- (This appears to be a binary file; contents omitted.) |
From: Jeroen F. <jfr...@us...> - 2007-03-29 09:21:12
|
Update of /cvsroot/ikvm/ikvm In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv25605 Added Files: ikvm8.sln ikvmc.8.csproj Log Message: New Visual Studio 2005 solution and project files. --- NEW FILE: ikvmc.8.csproj --- (This appears to be a binary file; contents omitted.) --- NEW FILE: ikvm8.sln --- Microsoft Visual Studio Solution File, Format Version 9.00 # Visual Studio 2005 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "IKVM.Runtime.8", "runtime\IKVM.Runtime.8.csproj", "{F5C7B588-0403-4AF2-A4DE-5697DE21BC2C}" EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ikvm.8", "ikvm\ikvm.8.csproj", "{4FBAFF23-1E48-4977-8C50-30F87E70A8B5}" EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ikvmstub.8", "ikvmstub\ikvmstub.8.csproj", "{D2A9434D-59E4-43E9-8D9C-332AA138CEAD}" EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ikvmc.8", "ikvmc.8.csproj", "{4CA3F3DF-D2B7-4FA2-874C-BFC4B04286A2}" EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "IKVM.AWT.WinForms.8", "awt\IKVM.AWT.WinForms.8.csproj", "{E00A0FA2-1FD7-4DD9-8C06-7202CE366102}" EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ikvm-native", "native\native.8.vcproj", "{14EC8F2A-90C6-4CFC-AD26-04C9A3392B8E}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU Debug|Mixed Platforms = Debug|Mixed Platforms Debug|Win32 = Debug|Win32 EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution {F5C7B588-0403-4AF2-A4DE-5697DE21BC2C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {F5C7B588-0403-4AF2-A4DE-5697DE21BC2C}.Debug|Any CPU.Build.0 = Debug|Any CPU {F5C7B588-0403-4AF2-A4DE-5697DE21BC2C}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU {F5C7B588-0403-4AF2-A4DE-5697DE21BC2C}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU {F5C7B588-0403-4AF2-A4DE-5697DE21BC2C}.Debug|Win32.ActiveCfg = Debug|Any CPU {4FBAFF23-1E48-4977-8C50-30F87E70A8B5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {4FBAFF23-1E48-4977-8C50-30F87E70A8B5}.Debug|Any CPU.Build.0 = Debug|Any CPU {4FBAFF23-1E48-4977-8C50-30F87E70A8B5}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU {4FBAFF23-1E48-4977-8C50-30F87E70A8B5}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU {4FBAFF23-1E48-4977-8C50-30F87E70A8B5}.Debug|Win32.ActiveCfg = Debug|Any CPU {D2A9434D-59E4-43E9-8D9C-332AA138CEAD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {D2A9434D-59E4-43E9-8D9C-332AA138CEAD}.Debug|Any CPU.Build.0 = Debug|Any CPU {D2A9434D-59E4-43E9-8D9C-332AA138CEAD}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU {D2A9434D-59E4-43E9-8D9C-332AA138CEAD}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU {D2A9434D-59E4-43E9-8D9C-332AA138CEAD}.Debug|Win32.ActiveCfg = Debug|Any CPU {4CA3F3DF-D2B7-4FA2-874C-BFC4B04286A2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {4CA3F3DF-D2B7-4FA2-874C-BFC4B04286A2}.Debug|Any CPU.Build.0 = Debug|Any CPU {4CA3F3DF-D2B7-4FA2-874C-BFC4B04286A2}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU {4CA3F3DF-D2B7-4FA2-874C-BFC4B04286A2}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU {4CA3F3DF-D2B7-4FA2-874C-BFC4B04286A2}.Debug|Win32.ActiveCfg = Debug|Any CPU {E00A0FA2-1FD7-4DD9-8C06-7202CE366102}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {E00A0FA2-1FD7-4DD9-8C06-7202CE366102}.Debug|Any CPU.Build.0 = Debug|Any CPU {E00A0FA2-1FD7-4DD9-8C06-7202CE366102}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU {E00A0FA2-1FD7-4DD9-8C06-7202CE366102}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU {E00A0FA2-1FD7-4DD9-8C06-7202CE366102}.Debug|Win32.ActiveCfg = Debug|Any CPU {14EC8F2A-90C6-4CFC-AD26-04C9A3392B8E}.Debug|Any CPU.ActiveCfg = Debug|Win32 {14EC8F2A-90C6-4CFC-AD26-04C9A3392B8E}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 {14EC8F2A-90C6-4CFC-AD26-04C9A3392B8E}.Debug|Mixed Platforms.Build.0 = Debug|Win32 {14EC8F2A-90C6-4CFC-AD26-04C9A3392B8E}.Debug|Win32.ActiveCfg = Debug|Win32 {14EC8F2A-90C6-4CFC-AD26-04C9A3392B8E}.Debug|Win32.Build.0 = Debug|Win32 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection EndGlobal |
From: Jeroen F. <jfr...@us...> - 2007-03-29 09:21:12
|
Update of /cvsroot/ikvm/ikvm/awt In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv25605/awt Added Files: IKVM.AWT.WinForms.8.csproj Log Message: New Visual Studio 2005 solution and project files. --- NEW FILE: IKVM.AWT.WinForms.8.csproj --- (This appears to be a binary file; contents omitted.) |
From: Jeroen F. <jfr...@us...> - 2007-03-29 09:21:12
|
Update of /cvsroot/ikvm/ikvm/native In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv25605/native Added Files: native.8.vcproj Log Message: New Visual Studio 2005 solution and project files. --- NEW FILE: native.8.vcproj --- <?xml version="1.0" encoding="Windows-1252"?> <VisualStudioProject ProjectType="Visual C++" Version="8.00" Name="ikvm-native" ProjectGUID="{14EC8F2A-90C6-4CFC-AD26-04C9A3392B8E}" Keyword="Win32Proj" > <Platforms> <Platform Name="Win32" /> </Platforms> <ToolFiles> </ToolFiles> <Configurations> <Configuration Name="Debug|Win32" OutputDirectory="Debug" IntermediateDirectory="Debug" ConfigurationType="2" InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops" CharacterSet="2" > <Tool Name="VCPreBuildEventTool" /> <Tool Name="VCCustomBuildTool" /> <Tool Name="VCXMLDataGeneratorTool" /> <Tool Name="VCWebServiceProxyGeneratorTool" /> <Tool Name="VCMIDLTool" /> <Tool Name="VCCLCompilerTool" Optimization="0" PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;NATIVE_EXPORTS" MinimalRebuild="true" BasicRuntimeChecks="3" RuntimeLibrary="1" UsePrecompiledHeader="0" WarningLevel="3" Detect64BitPortabilityProblems="true" DebugInformationFormat="4" /> <Tool Name="VCManagedResourceCompilerTool" /> <Tool Name="VCResourceCompilerTool" /> <Tool Name="VCPreLinkEventTool" /> <Tool Name="VCLinkerTool" OutputFile="$(OutDir)/ikvm-native.dll" LinkIncremental="2" GenerateDebugInformation="true" ProgramDatabaseFile="$(OutDir)/native.pdb" SubSystem="2" ImportLibrary="$(OutDir)/native.lib" TargetMachine="1" /> <Tool Name="VCALinkTool" /> <Tool Name="VCManifestTool" /> <Tool Name="VCXDCMakeTool" /> <Tool Name="VCBscMakeTool" /> <Tool Name="VCFxCopTool" /> <Tool Name="VCAppVerifierTool" /> <Tool Name="VCWebDeploymentTool" /> <Tool Name="VCPostBuildEventTool" /> </Configuration> </Configurations> <References> </References> <Files> <Filter Name="Source Files" Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx" UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}" > <File RelativePath=".\jni.c" > </File> <File RelativePath=".\os.c" > </File> </Filter> <Filter Name="Header Files" Filter="h;hpp;hxx;hm;inl;inc;xsd" UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}" > <File RelativePath=".\jni.h" > </File> </Filter> <Filter Name="Resource Files" Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx" UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}" > </Filter> </Files> <Globals> </Globals> </VisualStudioProject> |
From: Jeroen F. <jfr...@us...> - 2007-03-29 09:21:12
|
Update of /cvsroot/ikvm/ikvm/ikvm In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv25605/ikvm Added Files: ikvm.8.csproj Log Message: New Visual Studio 2005 solution and project files. --- NEW FILE: ikvm.8.csproj --- (This appears to be a binary file; contents omitted.) |
From: Jeroen F. <jfr...@us...> - 2007-03-29 09:21:12
|
Update of /cvsroot/ikvm/ikvm/ikvmstub In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv25605/ikvmstub Added Files: ikvmstub.8.csproj Log Message: New Visual Studio 2005 solution and project files. --- NEW FILE: ikvmstub.8.csproj --- (This appears to be a binary file; contents omitted.) |
From: Jeroen F. <jfr...@us...> - 2007-03-29 09:17:42
|
Update of /cvsroot/ikvm/ikvm In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv24180 Modified Files: HOWTO Log Message: Updated. Index: HOWTO =================================================================== RCS file: /cvsroot/ikvm/ikvm/HOWTO,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** HOWTO 11 Nov 2006 10:09:57 -0000 1.1 --- HOWTO 29 Mar 2007 09:17:41 -0000 1.2 *************** *** 1,24 **** If you want to build from source, follow these steps: 1. Download the GNU Classpath corresponding to the ikvm version you have. If you use ikvm from cvs, also use GNU Classpath from cvs or use the latest snapshot. ! The latest (nightly build) version is avaialable at http://builder.classpath.org/dist/ . There is standard version (compatible with JDK 1.4) and a generic version (comptible with JDK 1.5 but has more bugs) 2. Download NAnt Version 0.85 and install it ! 3. Download the Eclipse compiler 3.2 ! The compiler is a single file ecj.jar. It is named "JDT Core Batch Compiler". You find it in the download center from eclipse at http://download.eclipse.org/eclipse/downloads/ . 4. Extract the GNU Classpath ! to a directory parallel to the top IKVM project directory. Use the sirectory name "classpath" for the standard edition or "classpath-generics". ! 5. Compile the ecj ! with the command line: ikvmc ecj.jar ! This create a file ecj.exe ! 6. Set the Path to ecj ! The IKVM.GNU.Classpath.dll and IKVM.Runtime.dll must be in the same directory as ecj.exe (or in the GAC). ! 7. generics or not ! In the file classpath.build set the property "generics" to true or false ! 8. Run build script ! Change in the directory with the file classpath.build and call NAnt ! 9. Compiler Errors ! It can occur that the list of files has changes then you must modify the file "allsources.lst" or "allsources-generics.lst". After it repeat with the previous step. (Thanks to Volker Berlin for this step by step list.) --- 1,21 ---- + Note that IKVM.NET comes with a build script for the GNU Classpath sources as well, you don't need to run the GNU Classpath make files. + If you want to build from source, follow these steps: 1. Download the GNU Classpath corresponding to the ikvm version you have. If you use ikvm from cvs, also use GNU Classpath from cvs or use the latest snapshot. ! The latest (nightly build) version is available at http://builder.classpath.org/dist/. 2. Download NAnt Version 0.85 and install it ! 3. Download the Eclipse Java Compiler 3.2 ! The compiler is a single file ecj.jar. It is named "JDT Core Batch Compiler". You find it in the download center from eclipse at http://download.eclipse.org/eclipse/downloads/. 4. Extract the GNU Classpath ! archive to a directory parallel to the top IKVM project directory. Use the directory name "classpath". ! 5. Compile the ecj with the command line: ikvmc ecj.jar ! This creates a file ecj.exe . ! 6. Set the PATH to ecj.exe and make sure that IKVM.GNU.Classpath.dll and IKVM.Runtime.dll are in the same directory as ecj.exe (or in the GAC). ! 7. Run build script in the ikvm directory: nant -t:net-1.1 ! 8. Compiler Errors ! It can occur that the list of files has changes then you must modify the file "allsources.lst". After it repeat with the previous step. (Thanks to Volker Berlin for this step by step list.) |
From: Jeroen F. <jfr...@us...> - 2007-03-29 09:17:28
|
Update of /cvsroot/ikvm/ikvm/ikvmstub In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv23789/ikvmstub Modified Files: ikvmstub.cs Log Message: - .NET "generic class loaders" now return something sensible when toString() is called on them. - Ikvmc no longer warns about generic stubs. - Ikvmstub now has WHIDBEY conditional code to properly determine if a class is a generic type instance (instead of the name based hack). - Fixed .NET generic type name mangling bug (nested generic types were double encoded). - Added support for loading .NET generic type stubs. - Fixed several .NET generic type loading bugs. - Fixed ikvm.runtime.Util.getInstanceTypeFromClass() to return null instead of throw an exception when it is called on a "dynamic only" class. Index: ikvmstub.cs =================================================================== RCS file: /cvsroot/ikvm/ikvm/ikvmstub/ikvmstub.cs,v retrieving revision 1.33 retrieving revision 1.34 diff -C2 -d -r1.33 -r1.34 *** ikvmstub.cs 12 Sep 2006 12:36:19 -0000 1.33 --- ikvmstub.cs 29 Mar 2007 09:17:20 -0000 1.34 *************** *** 222,227 **** private static bool IsGenericType(java.lang.Class c) { ! // HACK huge hack, we look for the backtick return c.getName().IndexOf("$$0060") > 0; } --- 222,237 ---- private static bool IsGenericType(java.lang.Class c) { ! #if WHIDBEY ! Type t = ikvm.runtime.Util.getInstanceTypeFromClass(c); ! while(t == null && c.getDeclaringClass() != null) ! { ! // dynamic only inner class, so we look at the declaring class ! c = c.getDeclaringClass(); ! t = ikvm.runtime.Util.getInstanceTypeFromClass(c); ! } ! return t.IsGenericType; ! #else return c.getName().IndexOf("$$0060") > 0; + #endif } |
From: Jeroen F. <jfr...@us...> - 2007-03-29 09:17:28
|
Update of /cvsroot/ikvm/ikvm/ikvmc In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv23789/ikvmc Modified Files: CompilerClassLoader.cs Log Message: - .NET "generic class loaders" now return something sensible when toString() is called on them. - Ikvmc no longer warns about generic stubs. - Ikvmstub now has WHIDBEY conditional code to properly determine if a class is a generic type instance (instead of the name based hack). - Fixed .NET generic type name mangling bug (nested generic types were double encoded). - Added support for loading .NET generic type stubs. - Fixed several .NET generic type loading bugs. - Fixed ikvm.runtime.Util.getInstanceTypeFromClass() to return null instead of throw an exception when it is called on a "dynamic only" class. Index: CompilerClassLoader.cs =================================================================== RCS file: /cvsroot/ikvm/ikvm/ikvmc/CompilerClassLoader.cs,v retrieving revision 1.38 retrieving revision 1.39 diff -C2 -d -r1.38 -r1.39 *** CompilerClassLoader.cs 15 Mar 2007 08:04:35 -0000 1.38 --- CompilerClassLoader.cs 29 Mar 2007 09:17:20 -0000 1.39 *************** *** 2372,2376 **** if(wrapper.GetClassLoader() != loader) { ! StaticCompiler.IssueMessage(Message.SkippingReferencedClass, s, ((AssemblyClassLoader)wrapper.GetClassLoader()).Assembly.FullName); continue; } --- 2372,2379 ---- if(wrapper.GetClassLoader() != loader) { ! if(!(wrapper.GetClassLoader() is GenericClassLoader)) ! { ! StaticCompiler.IssueMessage(Message.SkippingReferencedClass, s, ((AssemblyClassLoader)wrapper.GetClassLoader()).Assembly.FullName); ! } continue; } |
From: Jeroen F. <jfr...@us...> - 2007-03-29 09:17:28
|
Update of /cvsroot/ikvm/ikvm/runtime In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv23789/runtime Modified Files: ClassLoaderWrapper.cs TypeWrapper.cs classpath.cs Log Message: - .NET "generic class loaders" now return something sensible when toString() is called on them. - Ikvmc no longer warns about generic stubs. - Ikvmstub now has WHIDBEY conditional code to properly determine if a class is a generic type instance (instead of the name based hack). - Fixed .NET generic type name mangling bug (nested generic types were double encoded). - Added support for loading .NET generic type stubs. - Fixed several .NET generic type loading bugs. - Fixed ikvm.runtime.Util.getInstanceTypeFromClass() to return null instead of throw an exception when it is called on a "dynamic only" class. Index: TypeWrapper.cs =================================================================== RCS file: /cvsroot/ikvm/ikvm/runtime/TypeWrapper.cs,v retrieving revision 1.164 retrieving revision 1.165 diff -C2 -d -r1.164 -r1.165 *** TypeWrapper.cs 13 Mar 2007 07:44:23 -0000 1.164 --- TypeWrapper.cs 29 Mar 2007 09:17:20 -0000 1.165 *************** *** 8707,8712 **** { string s = tw.Name; ! s = s.Replace("__", "$$005F$$005F"); ! s = s.Replace(".", "__"); sb.Append('L').Append(s); } --- 8707,8717 ---- { string s = tw.Name; ! // only do the mangling for non-generic types (because we don't want to convert ! // the double underscores in two adjacent _$$$_ or _$$$$_ markers) ! if (s.IndexOf("_$$$_") == -1) ! { ! s = s.Replace("__", "$$005F$$005F"); ! s = s.Replace(".", "__"); ! } sb.Append('L').Append(s); } Index: ClassLoaderWrapper.cs =================================================================== RCS file: /cvsroot/ikvm/ikvm/runtime/ClassLoaderWrapper.cs,v retrieving revision 1.88 retrieving revision 1.89 diff -C2 -d -r1.88 -r1.89 *** ClassLoaderWrapper.cs 16 Feb 2007 07:42:33 -0000 1.88 --- ClassLoaderWrapper.cs 29 Mar 2007 09:17:20 -0000 1.89 *************** *** 224,246 **** if(dotnetAssembly != null) { ! // The sole purpose of the stub class is to let us load the assembly that the class lives in, ! // once we've done that, all types in it become visible. ! Assembly asm; try { ! #if WHIDBEY && STATIC_COMPILER ! asm = Assembly.ReflectionOnlyLoad(dotnetAssembly); ! #else ! asm = Assembly.Load(dotnetAssembly); ! #endif } catch(Exception x) { throw new NoClassDefFoundError(f.Name + " (" + x.Message + ")"); } ! TypeWrapper tw = ClassLoaderWrapper.GetAssemblyClassLoader(asm).LoadClassByDottedNameFast(f.Name); if(tw == null) { ! throw new NoClassDefFoundError(f.Name + " (type not found in " + asm.FullName + ")"); } return RegisterInitiatingLoader(tw); --- 224,243 ---- if(dotnetAssembly != null) { ! // It's a stub class generated by ikvmstub (or generated by the runtime when getResource was ! // called on a statically compiled class). ! ClassLoaderWrapper loader; try { ! loader = ClassLoaderWrapper.GetAssemblyClassLoaderByName(dotnetAssembly); } catch(Exception x) { + // TODO don't catch all exceptions here throw new NoClassDefFoundError(f.Name + " (" + x.Message + ")"); } ! TypeWrapper tw = loader.LoadClassByDottedNameFast(f.Name); if(tw == null) { ! throw new NoClassDefFoundError(f.Name + " (type not found in " + dotnetAssembly + ")"); } return RegisterInitiatingLoader(tw); *************** *** 466,470 **** return null; } ! Type type = GetBootstrapClassLoader().GetType(DotNetTypeWrapper.DemangleTypeName(name.Substring(0, pos))); if(type == null || !Whidbey.IsGenericTypeDefinition(type)) { --- 463,467 ---- return null; } ! Type type = GetType(DotNetTypeWrapper.DemangleTypeName(name.Substring(0, pos))); if(type == null || !Whidbey.IsGenericTypeDefinition(type)) { *************** *** 519,524 **** { string s = (string)typeParamNames[i]; ! s = s.Replace("__", "."); ! s = s.Replace("$$005F$$005F", "__"); int dims = 0; while(s.Length > dims && s[dims] == 'A') --- 516,526 ---- { string s = (string)typeParamNames[i]; ! // only do the unmangling for non-generic types (because we don't want to convert ! // the double underscores in two adjacent _$$$_ or _$$$$_ markers) ! if(s.IndexOf("_$$$_") == -1) ! { ! s = s.Replace("__", "."); ! s = s.Replace("$$005F$$005F", "__"); ! } int dims = 0; while(s.Length > dims && s[dims] == 'A') *************** *** 875,879 **** } ClassLoaderWrapper[] key = (ClassLoaderWrapper[])list.ToArray(typeof(ClassLoaderWrapper)); ! ClassLoaderWrapper matchingLoader = null; lock(wrapperLock) { --- 877,887 ---- } ClassLoaderWrapper[] key = (ClassLoaderWrapper[])list.ToArray(typeof(ClassLoaderWrapper)); ! ClassLoaderWrapper matchingLoader = GetGenericClassLoaderByKey(key); ! matchingLoader.RegisterInitiatingLoader(wrapper); ! return matchingLoader; ! } ! ! private static ClassLoaderWrapper GetGenericClassLoaderByKey(ClassLoaderWrapper[] key) ! { lock(wrapperLock) { *************** *** 886,908 **** if(loader.Matches(key)) { ! matchingLoader = loader; ! break; } } ! if(matchingLoader == null) ! { ! object javaClassLoader = null; #if !STATIC_COMPILER ! javaClassLoader = JVM.Library.newAssemblyClassLoader(null); #endif ! matchingLoader = new GenericClassLoader(key, javaClassLoader); #if !STATIC_COMPILER ! JVM.Library.setWrapperForClassLoader(javaClassLoader, matchingLoader); #endif ! genericClassLoaders.Add(matchingLoader); } } ! matchingLoader.RegisterInitiatingLoader(wrapper); ! return matchingLoader; } --- 894,967 ---- if(loader.Matches(key)) { ! return loader; } } ! object javaClassLoader = null; #if !STATIC_COMPILER ! javaClassLoader = JVM.Library.newAssemblyClassLoader(null); #endif ! GenericClassLoader newLoader = new GenericClassLoader(key, javaClassLoader); #if !STATIC_COMPILER ! JVM.Library.setWrapperForClassLoader(javaClassLoader, newLoader); #endif ! genericClassLoaders.Add(newLoader); ! return newLoader; ! } ! } ! ! internal static ClassLoaderWrapper GetGenericClassLoaderByName(string name) ! { ! Debug.Assert(name.StartsWith("[[") && name.EndsWith("]]")); ! Stack stack = new Stack(); ! ArrayList list = null; ! for(int i = 0; i < name.Length; i++) ! { ! if(name[i] == '[') ! { ! if(name[i + 1] == '[') ! { ! stack.Push(list); ! list = new ArrayList(); ! if(name[i + 2] == '[') ! { ! i++; ! } ! } ! else ! { ! int start = i + 1; ! i = name.IndexOf(']', i); ! list.Add(ClassLoaderWrapper.GetAssemblyClassLoaderByName(name.Substring(start, i - start))); ! } ! } ! else if(name[i] == ']') ! { ! ClassLoaderWrapper loader = GetGenericClassLoaderByKey((ClassLoaderWrapper[])list.ToArray(typeof(ClassLoaderWrapper))); ! list = (ArrayList)stack.Pop(); ! if(list == null) ! { ! return loader; ! } ! list.Add(loader); ! } ! else ! { ! throw new InvalidOperationException(); } } ! throw new InvalidOperationException(); ! } ! ! internal static ClassLoaderWrapper GetAssemblyClassLoaderByName(string name) ! { ! if(name.StartsWith("[[")) ! { ! return GetGenericClassLoaderByName(name); ! } ! #if WHIDBEY && STATIC_COMPILER ! return ClassLoaderWrapper.GetAssemblyClassLoader(Assembly.ReflectionOnlyLoad(name)); ! #else ! return ClassLoaderWrapper.GetAssemblyClassLoader(Assembly.Load(name)); ! #endif } *************** *** 1068,1071 **** --- 1127,1152 ---- return null; } + + internal string GetName() + { + System.Text.StringBuilder sb = new System.Text.StringBuilder(); + sb.Append('['); + foreach(ClassLoaderWrapper loader in delegates) + { + sb.Append('['); + GenericClassLoader gcl = loader as GenericClassLoader; + if(gcl != null) + { + sb.Append(gcl.GetName()); + } + else + { + sb.Append(((AssemblyClassLoader)loader).Assembly.FullName); + } + sb.Append(']'); + } + sb.Append(']'); + return sb.ToString(); + } } Index: classpath.cs =================================================================== RCS file: /cvsroot/ikvm/ikvm/runtime/classpath.cs,v retrieving revision 1.94 retrieving revision 1.95 diff -C2 -d -r1.94 -r1.95 *** classpath.cs 16 Feb 2007 07:42:33 -0000 1.94 --- classpath.cs 29 Mar 2007 09:17:20 -0000 1.95 *************** *** 1584,1587 **** --- 1584,1592 ---- return ((IKVM.Internal.AssemblyClassLoader)ClassLoaderWrapper.GetBootstrapClassLoader()).Assembly; } + + public static string GetGenericClassLoaderName(object classLoader) + { + return ((GenericClassLoader)JVM.Library.getWrapperFromClassLoader(classLoader)).GetName(); + } } *************** *** 1600,1605 **** else { ! // TODO ! return "TODO: implement support for generic types referencing multiple assemblies in their IKVM.NET.Assembly attribute"; } } --- 1605,1609 ---- else { ! return ((IKVM.Internal.GenericClassLoader)loader).GetName(); } } *************** *** 1718,1721 **** --- 1722,1729 ---- { TypeWrapper wrapper = (TypeWrapper)wrapperObject; + if(wrapper.IsDynamicOnly) + { + return null; + } if(wrapper.IsRemapped && wrapper.IsFinal) { |
From: Jeroen F. <jfr...@us...> - 2007-03-29 09:17:28
|
Update of /cvsroot/ikvm/ikvm/classpath/ikvm/internal In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv23789/classpath/ikvm/internal Modified Files: AssemblyClassLoader.java Log Message: - .NET "generic class loaders" now return something sensible when toString() is called on them. - Ikvmc no longer warns about generic stubs. - Ikvmstub now has WHIDBEY conditional code to properly determine if a class is a generic type instance (instead of the name based hack). - Fixed .NET generic type name mangling bug (nested generic types were double encoded). - Added support for loading .NET generic type stubs. - Fixed several .NET generic type loading bugs. - Fixed ikvm.runtime.Util.getInstanceTypeFromClass() to return null instead of throw an exception when it is called on a "dynamic only" class. Index: AssemblyClassLoader.java =================================================================== RCS file: /cvsroot/ikvm/ikvm/classpath/ikvm/internal/AssemblyClassLoader.java,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** AssemblyClassLoader.java 5 Dec 2006 07:52:27 -0000 1.8 --- AssemblyClassLoader.java 29 Mar 2007 09:17:19 -0000 1.9 *************** *** 160,163 **** --- 160,164 ---- private static native int GetGenericClassLoaderId(AssemblyClassLoader classLoader); private static native Assembly GetBootClassLoaderAssembly(); + private static native String GetGenericClassLoaderName(Object classLoader); // also used by VMClassLoader public static native String[] GetPackages(Object classLoader); *************** *** 269,274 **** return assembly.get_FullName(); } ! // TODO make this string more meaningful ! return "GenericClassLoader"; } --- 270,274 ---- return assembly.get_FullName(); } ! return GetGenericClassLoaderName(this); } |
From: Jeroen F. <jfr...@us...> - 2007-03-15 08:04:36
|
Update of /cvsroot/ikvm/ikvm/ikvmc In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv25094 Modified Files: CompilerClassLoader.cs Log Message: As pointed out by FxCop: - Comparable.__Helper should not have a public constructor and should be sealed. - Shadow methods in remapped types (that exist to hide the Java methods from Intellisense) should copy LinkDemands from the methods that they hide. Index: CompilerClassLoader.cs =================================================================== RCS file: /cvsroot/ikvm/ikvm/ikvmc/CompilerClassLoader.cs,v retrieving revision 1.37 retrieving revision 1.38 diff -C2 -d -r1.37 -r1.38 *** CompilerClassLoader.cs 16 Feb 2007 07:42:33 -0000 1.37 --- CompilerClassLoader.cs 15 Mar 2007 08:04:35 -0000 1.38 *************** *** 39,42 **** --- 39,44 ---- using ILGenerator = IKVM.Internal.CountingILGenerator; using Label = IKVM.Internal.CountingLabel; + using System.Security.Permissions; + using System.Security; namespace IKVM.Internal *************** *** 835,838 **** --- 837,841 ---- if(specialCases != null) { + ILGenerator ilgen; Type[] temp = typeWrapper.GetClassLoader().ArgTypeListFromSig(m.Sig); Type[] argTypes = new Type[temp.Length + 1]; *************** *** 842,846 **** { // FXBUG we use a nested helper class, because Reflection.Emit won't allow us to add a static method to the interface ! typeWrapper.helperTypeBuilder = typeWrapper.typeBuilder.DefineNestedType("__Helper", TypeAttributes.NestedPublic | TypeAttributes.Class); AttributeHelper.HideFromJava(typeWrapper.helperTypeBuilder); } --- 845,852 ---- { // FXBUG we use a nested helper class, because Reflection.Emit won't allow us to add a static method to the interface ! typeWrapper.helperTypeBuilder = typeWrapper.typeBuilder.DefineNestedType("__Helper", TypeAttributes.NestedPublic | TypeAttributes.Class | TypeAttributes.Sealed); ! ilgen = typeWrapper.helperTypeBuilder.DefineConstructor(MethodAttributes.Private, CallingConventions.Standard, Type.EmptyTypes).GetILGenerator(); ! ilgen.Emit(OpCodes.Ldnull); ! ilgen.Emit(OpCodes.Throw); AttributeHelper.HideFromJava(typeWrapper.helperTypeBuilder); } *************** *** 854,858 **** } SetParameters(helper, m.Params); ! ILGenerator ilgen = helper.GetILGenerator(); foreach(IKVM.Internal.MapXml.Class c in specialCases) { --- 860,864 ---- } SetParameters(helper, m.Params); ! ilgen = helper.GetILGenerator(); foreach(IKVM.Internal.MapXml.Class c in specialCases) { *************** *** 1459,1463 **** // annotate it with EditorBrowsableAttribute(EditorBrowsableState.Never) to make // sure the inherited methods don't show up in Intellisense. - // TODO if the original method has a LinkDemand, we should copy that Hashtable methods = new Hashtable(); foreach(MethodInfo mi in typeBuilder.BaseType.GetMethods(BindingFlags.Public | BindingFlags.Instance | BindingFlags.Static | BindingFlags.FlattenHierarchy)) --- 1465,1468 ---- *************** *** 1475,1478 **** --- 1480,1484 ---- AttributeHelper.HideFromJava(mb); AttributeHelper.SetEditorBrowsableNever(mb); + CopyLinkDemands(mb, mi); ILGenerator ilgen = mb.GetILGenerator(); for(int i = 0; i < paramTypes.Length; i++) *************** *** 1521,1524 **** --- 1527,1547 ---- } + private static void CopyLinkDemands(MethodBuilder mb, MethodInfo mi) + { + foreach (object attr in mi.GetCustomAttributes(false)) + { + CodeAccessSecurityAttribute cas = attr as CodeAccessSecurityAttribute; + if (cas != null) + { + if (cas.Action == SecurityAction.LinkDemand) + { + PermissionSet pset = new PermissionSet(PermissionState.None); + pset.AddPermission(cas.CreatePermission()); + mb.AddDeclarativeSecurity(SecurityAction.LinkDemand, pset); + } + } + } + } + private static string MakeMethodKey(MethodInfo method) { |
From: Jeroen F. <jfr...@us...> - 2007-03-15 08:02:52
|
Update of /cvsroot/ikvm/ikvm/ikvmc In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv24352 Modified Files: AotTypeWrapper.cs Log Message: As pointed out by FxCop: Ghost types should have Equals, GetHashCode, == and != methods. Index: AotTypeWrapper.cs =================================================================== RCS file: /cvsroot/ikvm/ikvm/ikvmc/AotTypeWrapper.cs,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** AotTypeWrapper.cs 4 Jan 2007 07:46:40 -0000 1.13 --- AotTypeWrapper.cs 15 Mar 2007 08:02:51 -0000 1.14 *************** *** 1,4 **** /* ! Copyright (C) 2002, 2003, 2004, 2005, 2006 Jeroen Frijters This software is provided 'as-is', without any express or implied --- 1,4 ---- /* ! Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007 Jeroen Frijters This software is provided 'as-is', without any express or implied *************** *** 835,838 **** --- 835,881 ---- ilgen.MarkLabel(end); ilgen.Emit(OpCodes.Ret); + + // Implement the "Equals" method + mb = typeBuilder.DefineMethod("Equals", MethodAttributes.HideBySig | MethodAttributes.Public | MethodAttributes.Virtual, typeof(bool), new Type[] { typeof(object) }); + AttributeHelper.HideFromJava(mb); + ilgen = mb.GetILGenerator(); + ilgen.Emit(OpCodes.Ldarg_0); + ilgen.Emit(OpCodes.Ldfld, ghostRefField); + ilgen.Emit(OpCodes.Ldarg_1); + ilgen.Emit(OpCodes.Ceq); + ilgen.Emit(OpCodes.Ret); + + // Implement the "GetHashCode" method + mb = typeBuilder.DefineMethod("GetHashCode", MethodAttributes.HideBySig | MethodAttributes.Public | MethodAttributes.Virtual, typeof(int), Type.EmptyTypes); + AttributeHelper.HideFromJava(mb); + ilgen = mb.GetILGenerator(); + ilgen.Emit(OpCodes.Ldarg_0); + ilgen.Emit(OpCodes.Ldfld, ghostRefField); + ilgen.Emit(OpCodes.Callvirt, typeof(object).GetMethod("GetHashCode")); + ilgen.Emit(OpCodes.Ret); + + // Implement the "op_Equality" method + mb = typeBuilder.DefineMethod("op_Equality", MethodAttributes.HideBySig | MethodAttributes.Public | MethodAttributes.Static | MethodAttributes.SpecialName, typeof(bool), new Type[] { typeBuilder, typeBuilder }); + AttributeHelper.HideFromJava(mb); + ilgen = mb.GetILGenerator(); + ilgen.Emit(OpCodes.Ldarga_S, (byte)0); + ilgen.Emit(OpCodes.Ldfld, ghostRefField); + ilgen.Emit(OpCodes.Ldarga_S, (byte)1); + ilgen.Emit(OpCodes.Ldfld, ghostRefField); + ilgen.Emit(OpCodes.Ceq); + ilgen.Emit(OpCodes.Ret); + + // Implement the "op_Inequality" method + mb = typeBuilder.DefineMethod("op_Inequality", MethodAttributes.HideBySig | MethodAttributes.Public | MethodAttributes.Static | MethodAttributes.SpecialName, typeof(bool), new Type[] { typeBuilder, typeBuilder }); + AttributeHelper.HideFromJava(mb); + ilgen = mb.GetILGenerator(); + ilgen.Emit(OpCodes.Ldarga_S, (byte)0); + ilgen.Emit(OpCodes.Ldfld, ghostRefField); + ilgen.Emit(OpCodes.Ldarga_S, (byte)1); + ilgen.Emit(OpCodes.Ldfld, ghostRefField); + ilgen.Emit(OpCodes.Ceq); + ilgen.Emit(OpCodes.Ldc_I4_0); + ilgen.Emit(OpCodes.Ceq); + ilgen.Emit(OpCodes.Ret); } } |
From: Jeroen F. <jfr...@us...> - 2007-03-15 08:01:53
|
Update of /cvsroot/ikvm/ikvm/classpath In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv23971 Modified Files: map.xml Log Message: As pointed out by FxCopy: Runtime.addShutdownHook() indirectly exposes the AppDomain.ProcessExit event, which has a LinkDemand, so we're adding the LinkDemand to addShutdownHook. Index: map.xml =================================================================== RCS file: /cvsroot/ikvm/ikvm/classpath/map.xml,v retrieving revision 1.57 retrieving revision 1.58 diff -C2 -d -r1.57 -r1.58 *** map.xml 5 Jan 2007 08:14:18 -0000 1.57 --- map.xml 15 Mar 2007 08:01:50 -0000 1.58 *************** *** 1507,1510 **** --- 1507,1518 ---- </implements> </class> + <class name="java.lang.Runtime"> + <method name="addShutdownHook" sig="(Ljava.lang.Thread;)V"> + <attribute type="System.Security.Permissions.SecurityPermissionAttribute" sig="(Lcli.System.Security.Permissions.SecurityAction;)V"> + <parameter>LinkDemand</parameter> + <property name="ControlAppDomain" sig="Z">true</property> + </attribute> + </method> + </class> </assembly> <exceptionMappings> |
From: Jeroen F. <jfr...@us...> - 2007-03-15 08:00:31
|
Update of /cvsroot/ikvm/ikvm/classpath/gnu/java/nio In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv23590 Modified Files: FileChannelImpl.java Log Message: As pointed out by FxCopy: GetLastWin32Error should be called immediately after the P/Invoke call. Index: FileChannelImpl.java =================================================================== RCS file: /cvsroot/ikvm/ikvm/classpath/gnu/java/nio/FileChannelImpl.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** FileChannelImpl.java 19 Oct 2006 06:12:48 -0000 1.2 --- FileChannelImpl.java 15 Mar 2007 08:00:30 -0000 1.3 *************** *** 125,131 **** copy_on_write ? PAGE_WRITECOPY : (writeable ? PAGE_READWRITE : PAGE_READONLY), 0, size, null); if(hFileMapping.Equals(IntPtr.Zero)) { - int err = cli.System.Runtime.InteropServices.Marshal.GetLastWin32Error(); throw new IOException("Win32 error " + err); } --- 125,131 ---- copy_on_write ? PAGE_WRITECOPY : (writeable ? PAGE_READWRITE : PAGE_READONLY), 0, size, null); + int err = cli.System.Runtime.InteropServices.Marshal.GetLastWin32Error(); if(hFileMapping.Equals(IntPtr.Zero)) { throw new IOException("Win32 error " + err); } *************** *** 136,143 **** copy_on_write ? FILE_MAP_COPY : (writeable ? FILE_MAP_WRITE : FILE_MAP_READ), (int)(position >> 32), (int)position, new IntPtr(size)); CloseHandle(hFileMapping); if(p.Equals(IntPtr.Zero)) { - int err = cli.System.Runtime.InteropServices.Marshal.GetLastWin32Error(); throw new IOException("Win32 error " + err); } --- 136,143 ---- copy_on_write ? FILE_MAP_COPY : (writeable ? FILE_MAP_WRITE : FILE_MAP_READ), (int)(position >> 32), (int)position, new IntPtr(size)); + err = cli.System.Runtime.InteropServices.Marshal.GetLastWin32Error(); CloseHandle(hFileMapping); if(p.Equals(IntPtr.Zero)) { throw new IOException("Win32 error " + err); } |
From: Jeroen F. <jfr...@us...> - 2007-03-15 07:59:36
|
Update of /cvsroot/ikvm/ikvm/awt In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv23171 Modified Files: toolkit.cs Log Message: Removed .NET 2.0 specific code introduced in previous patch. Index: toolkit.cs =================================================================== RCS file: /cvsroot/ikvm/ikvm/awt/toolkit.cs,v retrieving revision 1.52 retrieving revision 1.53 diff -C2 -d -r1.52 -r1.53 *** toolkit.cs 13 Mar 2007 08:10:13 -0000 1.52 --- toolkit.cs 15 Mar 2007 07:59:33 -0000 1.53 *************** *** 2086,2090 **** public void mail(URI uri) { ! if (!uri.getScheme().Equals("mailto", StringComparison.OrdinalIgnoreCase)) { throw new java.lang.IllegalArgumentException("URI scheme is not \"mailto\""); --- 2086,2090 ---- public void mail(URI uri) { ! if (uri.getScheme().ToLower(System.Globalization.CultureInfo.InvariantCulture) != "mailto") { throw new java.lang.IllegalArgumentException("URI scheme is not \"mailto\""); |
From: Jeroen F. <jfr...@us...> - 2007-03-13 08:10:20
|
Update of /cvsroot/ikvm/ikvm/awt In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv27735 Modified Files: toolkit.cs Log Message: Implemented java.awt.Desktop peer. Index: toolkit.cs =================================================================== RCS file: /cvsroot/ikvm/ikvm/awt/toolkit.cs,v retrieving revision 1.51 retrieving revision 1.52 diff -C2 -d -r1.51 -r1.52 *** toolkit.cs 9 Mar 2007 07:11:52 -0000 1.51 --- toolkit.cs 13 Mar 2007 08:10:13 -0000 1.52 *************** *** 525,528 **** --- 525,533 ---- throw new NotImplementedException(); } + + protected override DesktopPeer createDesktopPeer(java.awt.Desktop target) + { + return new NetDesktopPeer(); + } } *************** *** 2039,2041 **** --- 2044,2110 ---- } + class NetDesktopPeer : DesktopPeer + { + private static void ShellExecute(string file, string verb) + { + try + { + ProcessStartInfo psi = new ProcessStartInfo(file); + psi.UseShellExecute = true; + psi.Verb = verb; + Process p = Process.Start(psi); + if (p != null) + { + p.Dispose(); + } + } + catch (System.ComponentModel.Win32Exception x) + { + throw new java.io.IOException(x.Message); + } + } + + public void browse(URI uri) + { + ShellExecute(uri.toString(), "open"); + } + + public void edit(java.io.File f) + { + ShellExecute(f.toString(), "edit"); + } + + public bool isSupported(java.awt.Desktop.Action da) + { + return da == java.awt.Desktop.Action.BROWSE + || da == java.awt.Desktop.Action.EDIT + || da == java.awt.Desktop.Action.MAIL + || da == java.awt.Desktop.Action.OPEN + || da == java.awt.Desktop.Action.PRINT; + } + + public void mail(URI uri) + { + if (!uri.getScheme().Equals("mailto", StringComparison.OrdinalIgnoreCase)) + { + throw new java.lang.IllegalArgumentException("URI scheme is not \"mailto\""); + } + ShellExecute(uri.toString(), "open"); + } + + public void mail() + { + ShellExecute("mailto:", "open"); + } + + public void open(java.io.File f) + { + ShellExecute(f.toString(), "open"); + } + + public void print(java.io.File f) + { + ShellExecute(f.toString(), "print"); + } + } } |
From: Jeroen F. <jfr...@us...> - 2007-03-13 07:45:08
|
Update of /cvsroot/ikvm/ikvm/runtime In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv17889 Modified Files: MemberWrapper.cs TypeWrapper.cs Log Message: Fixed several .NET 2.0 "ReflectionOnly" bugs. Index: TypeWrapper.cs =================================================================== RCS file: /cvsroot/ikvm/ikvm/runtime/TypeWrapper.cs,v retrieving revision 1.163 retrieving revision 1.164 diff -C2 -d -r1.163 -r1.164 *** TypeWrapper.cs 11 Mar 2007 14:14:54 -0000 1.163 --- TypeWrapper.cs 13 Mar 2007 07:44:23 -0000 1.164 *************** *** 170,173 **** --- 170,174 ---- private static Type typeofNoPackagePrefixAttribute = JVM.LoadType(typeof(NoPackagePrefixAttribute)); private static Type typeofConstantValueAttribute = JVM.LoadType(typeof(ConstantValueAttribute)); + private static Type typeofAnnotationAttributeAttribute = JVM.LoadType(typeof(AnnotationAttributeAttribute)); #if STATIC_COMPILER && !COMPACT_FRAMEWORK *************** *** 736,739 **** --- 737,765 ---- #endif + internal static object GetConstantValue(FieldInfo field) + { + #if WHIDBEY && !COMPACT_FRAMEWORK + if(JVM.IsStaticCompiler || field.DeclaringType.Assembly.ReflectionOnly) + { + foreach(CustomAttributeData cad in CustomAttributeData.GetCustomAttributes(field)) + { + if(MatchTypes(cad.Constructor.DeclaringType, typeofConstantValueAttribute)) + { + return cad.ConstructorArguments[0].Value; + } + } + return null; + } + #endif + // In Java, instance fields can also have a ConstantValue attribute so we emulate that + // with ConstantValueAttribute (for consumption by ikvmstub only) + object[] attrib = field.GetCustomAttributes(typeof(ConstantValueAttribute), false); + if(attrib.Length == 1) + { + return ((ConstantValueAttribute)attrib[0]).GetConstantValue(); + } + return null; + } + internal static ModifiersAttribute GetModifiersAttribute(Type type) { *************** *** 1349,1352 **** --- 1375,1391 ---- internal static string GetAnnotationAttributeType(Type type) { + #if WHIDBEY && !COMPACT_FRAMEWORK + if(JVM.IsStaticCompiler || type.Assembly.ReflectionOnly) + { + foreach(CustomAttributeData cad in CustomAttributeData.GetCustomAttributes(type)) + { + if(MatchTypes(cad.Constructor.DeclaringType, typeofAnnotationAttributeAttribute)) + { + return (string)cad.ConstructorArguments[0].Value; + } + } + return null; + } + #endif object[] attr = type.GetCustomAttributes(typeof(AnnotationAttributeAttribute), false); if(attr.Length == 1) *************** *** 2839,2842 **** --- 2878,2888 ---- if(mb != null) { + #if WHIDBEY + if(mb.DeclaringType.Assembly.ReflectionOnly) + { + // TODO + return null; + } + #endif // WHIDBEY object[] attr = mb.GetCustomAttributes(typeof(AnnotationDefaultAttribute), false); if(attr.Length == 1) *************** *** 2847,2851 **** return null; } ! #endif #if !COMPACT_FRAMEWORK --- 2893,2897 ---- return null; } ! #endif // !STATIC_COMPILER #if !COMPACT_FRAMEWORK *************** *** 8302,8305 **** --- 8348,8358 ---- internal override object[] GetDeclaredAnnotations() { + #if WHIDBEY + if(type.Assembly.ReflectionOnly) + { + // TODO + return null; + } + #endif // WHIDBEY return type.GetCustomAttributes(false); } *************** *** 8307,8316 **** internal override object[] GetMethodAnnotations(MethodWrapper mw) { ! return mw.GetMethod().GetCustomAttributes(false); } internal override object[][] GetParameterAnnotations(MethodWrapper mw) { ! ParameterInfo[] parameters = mw.GetMethod().GetParameters(); object[][] attribs = new object[parameters.Length][]; for(int i = 0; i < parameters.Length; i++) --- 8360,8385 ---- internal override object[] GetMethodAnnotations(MethodWrapper mw) { ! MethodBase mb = mw.GetMethod(); ! #if WHIDBEY ! if(mb.DeclaringType.Assembly.ReflectionOnly) ! { ! // TODO ! return null; ! } ! #endif // WHIDBEY ! return mb.GetCustomAttributes(false); } internal override object[][] GetParameterAnnotations(MethodWrapper mw) { ! MethodBase mb = mw.GetMethod(); ! #if WHIDBEY ! if(mb.DeclaringType.Assembly.ReflectionOnly) ! { ! // TODO ! return null; ! } ! #endif // WHIDBEY ! ParameterInfo[] parameters = mb.GetParameters(); object[][] attribs = new object[parameters.Length][]; for(int i = 0; i < parameters.Length; i++) *************** *** 8326,8329 **** --- 8395,8405 ---- if(field != null) { + #if WHIDBEY + if (field.DeclaringType.Assembly.ReflectionOnly) + { + // TODO + return null; + } + #endif // WHIDBEY return field.GetCustomAttributes(false); } *************** *** 8331,8334 **** --- 8407,8417 ---- if(getter != null) { + #if WHIDBEY + if (getter.GetGetter().DeclaringType.Assembly.ReflectionOnly) + { + // TODO + return null; + } + #endif // WHIDBEY return getter.GetGetter().GetCustomAttributes(false); } *************** *** 9215,9250 **** internal override object[] GetDeclaredAnnotations() { ! object target = null; object[] attr = attributeType.GetCustomAttributes(typeof(AttributeUsageAttribute), false); if(attr.Length == 1) { - ArrayList targets = new ArrayList(); - targets.Add(AnnotationDefaultAttribute.TAG_ARRAY); AttributeUsageAttribute aua = (AttributeUsageAttribute)attr[0]; ! if((aua.ValidOn & (AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Enum | AttributeTargets.Delegate | AttributeTargets.Assembly)) != 0) ! { ! targets.Add(new object[] { AnnotationDefaultAttribute.TAG_ENUM, "Ljava/lang/annotation/ElementType;", "TYPE" }); ! } ! if((aua.ValidOn & AttributeTargets.Constructor) != 0) ! { ! targets.Add(new object[] { AnnotationDefaultAttribute.TAG_ENUM, "Ljava/lang/annotation/ElementType;", "CONSTRUCTOR" }); ! } ! if((aua.ValidOn & AttributeTargets.Field) != 0) ! { ! targets.Add(new object[] { AnnotationDefaultAttribute.TAG_ENUM, "Ljava/lang/annotation/ElementType;", "FIELD" }); ! } ! if((aua.ValidOn & AttributeTargets.Method) != 0) ! { ! targets.Add(new object[] { AnnotationDefaultAttribute.TAG_ENUM, "Ljava/lang/annotation/ElementType;", "METHOD" }); ! } ! if((aua.ValidOn & AttributeTargets.Parameter) != 0) ! { ! targets.Add(new object[] { AnnotationDefaultAttribute.TAG_ENUM, "Ljava/lang/annotation/ElementType;", "PARAMETER" }); ! } ! target = JVM.Library.newAnnotation(GetClassLoader().GetJavaClassLoader(), new object[] { AnnotationDefaultAttribute.TAG_ANNOTATION, "java.lang.annotation.Target", "value", (object[])targets.ToArray() }); // TODO figure out if AttributeUsageAttribute.Inherited maps to java.lang.annotation.Inherited } return new object[] { ! target, JVM.Library.newAnnotation(GetClassLoader().GetJavaClassLoader(), new object[] { AnnotationDefaultAttribute.TAG_ANNOTATION, "java.lang.annotation.Retention", "value", new object[] { AnnotationDefaultAttribute.TAG_ENUM, "Ljava/lang/annotation/RetentionPolicy;", "RUNTIME" } }) }; --- 9298,9347 ---- internal override object[] GetDeclaredAnnotations() { ! AttributeTargets validOn = AttributeTargets.All; ! #if WHIDBEY ! foreach(CustomAttributeData cad in CustomAttributeData.GetCustomAttributes(attributeType)) ! { ! if(cad.Constructor.DeclaringType == typeof(AttributeUsageAttribute)) ! { ! if(cad.ConstructorArguments.Count == 1 && cad.ConstructorArguments[0].ArgumentType == typeof(AttributeTargets)) ! { ! validOn = (AttributeTargets)cad.ConstructorArguments[0].Value; ! break; ! } ! } ! } ! #else // WHIDBEY object[] attr = attributeType.GetCustomAttributes(typeof(AttributeUsageAttribute), false); if(attr.Length == 1) { AttributeUsageAttribute aua = (AttributeUsageAttribute)attr[0]; ! validOn = aua.ValidOn; // TODO figure out if AttributeUsageAttribute.Inherited maps to java.lang.annotation.Inherited } + #endif // WHIDBEY + ArrayList targets = new ArrayList(); + targets.Add(AnnotationDefaultAttribute.TAG_ARRAY); + if((validOn & (AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Enum | AttributeTargets.Delegate | AttributeTargets.Assembly)) != 0) + { + targets.Add(new object[] { AnnotationDefaultAttribute.TAG_ENUM, "Ljava/lang/annotation/ElementType;", "TYPE" }); + } + if((validOn & AttributeTargets.Constructor) != 0) + { + targets.Add(new object[] { AnnotationDefaultAttribute.TAG_ENUM, "Ljava/lang/annotation/ElementType;", "CONSTRUCTOR" }); + } + if((validOn & AttributeTargets.Field) != 0) + { + targets.Add(new object[] { AnnotationDefaultAttribute.TAG_ENUM, "Ljava/lang/annotation/ElementType;", "FIELD" }); + } + if((validOn & AttributeTargets.Method) != 0) + { + targets.Add(new object[] { AnnotationDefaultAttribute.TAG_ENUM, "Ljava/lang/annotation/ElementType;", "METHOD" }); + } + if((validOn & AttributeTargets.Parameter) != 0) + { + targets.Add(new object[] { AnnotationDefaultAttribute.TAG_ENUM, "Ljava/lang/annotation/ElementType;", "PARAMETER" }); + } return new object[] { ! JVM.Library.newAnnotation(GetClassLoader().GetJavaClassLoader(), new object[] { AnnotationDefaultAttribute.TAG_ANNOTATION, "java.lang.annotation.Target", "value", (object[])targets.ToArray() }), JVM.Library.newAnnotation(GetClassLoader().GetJavaClassLoader(), new object[] { AnnotationDefaultAttribute.TAG_ANNOTATION, "java.lang.annotation.Retention", "value", new object[] { AnnotationDefaultAttribute.TAG_ENUM, "Ljava/lang/annotation/RetentionPolicy;", "RUNTIME" } }) }; *************** *** 9590,9594 **** internal static object GetEnumPrimitiveValue(object obj) { ! Type underlyingType = Enum.GetUnderlyingType(obj.GetType()); if(underlyingType == typeof(sbyte) || underlyingType == typeof(byte)) { --- 9687,9696 ---- internal static object GetEnumPrimitiveValue(object obj) { ! return GetEnumPrimitiveValue(Enum.GetUnderlyingType(obj.GetType()), obj); ! } ! ! // this method can be used to convert an enum value or its underlying value to a Java primitive ! internal static object GetEnumPrimitiveValue(Type underlyingType, object obj) ! { if(underlyingType == typeof(sbyte) || underlyingType == typeof(byte)) { *************** *** 9757,9761 **** } #if WHIDBEY ! object val = fields[i].GetRawConstantValue(); #else object val = EnumValueFieldWrapper.GetEnumPrimitiveValue(fields[i].GetValue(null)); --- 9859,9863 ---- } #if WHIDBEY ! object val = EnumValueFieldWrapper.GetEnumPrimitiveValue(underlyingType, fields[i].GetRawConstantValue()); #else object val = EnumValueFieldWrapper.GetEnumPrimitiveValue(fields[i].GetValue(null)); *************** *** 10396,10401 **** --- 10498,10528 ---- internal override object[] GetDeclaredAnnotations() { + #if WHIDBEY + if(type.Assembly.ReflectionOnly) + { + // TODO + return null; + } + #endif return type.GetCustomAttributes(false); } + + internal override object[] GetFieldAnnotations(FieldWrapper fw) + { + // TODO + return null; + } + + internal override object[] GetMethodAnnotations(MethodWrapper mw) + { + // TODO + return null; + } + + internal override object[][] GetParameterAnnotations(MethodWrapper mw) + { + // TODO + return null; + } } Index: MemberWrapper.cs =================================================================== RCS file: /cvsroot/ikvm/ikvm/runtime/MemberWrapper.cs,v retrieving revision 1.66 retrieving revision 1.67 diff -C2 -d -r1.66 -r1.67 *** MemberWrapper.cs 3 Feb 2007 14:16:58 -0000 1.66 --- MemberWrapper.cs 13 Mar 2007 07:44:23 -0000 1.67 *************** *** 1,4 **** /* ! Copyright (C) 2002, 2003, 2004, 2005, 2006 Jeroen Frijters This software is provided 'as-is', without any express or implied --- 1,4 ---- /* ! Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007 Jeroen Frijters This software is provided 'as-is', without any express or implied *************** *** 1169,1191 **** throw x.InnerException; } ! if(val is Enum) { ! val = DotNetTypeWrapper.EnumValueFieldWrapper.GetEnumPrimitiveValue(val); } - #endif } else { ! #if WHIDBEY ! // TODO ! #else ! // In Java, instance fields can also have a ConstantValue attribute so we emulate that ! // with ConstantValueAttribute (for consumption by ikvmstub only) ! object[] attrib = field.GetCustomAttributes(typeof(ConstantValueAttribute), false); ! if(attrib.Length == 1) ! { ! val = ((ConstantValueAttribute)attrib[0]).GetConstantValue(); ! } ! #endif } if(val != null && !(val is string)) --- 1169,1185 ---- throw x.InnerException; } ! #endif ! if(field.FieldType.IsEnum) { ! val = DotNetTypeWrapper.EnumValueFieldWrapper.GetEnumPrimitiveValue(Enum.GetUnderlyingType(field.FieldType), val); } } else { ! // NOTE instance fields can also be "constant" and we round trip this information to make the Japi results look ! // nice (but otherwise this has no practical value), but note that this only works when the code is compiled ! // with -strictfieldfieldsemantics (because the ConstantValueAttribute is on the field and when we're a GetterFieldWrapper ! // we don't have access to the corresponding field). ! val = AttributeHelper.GetConstantValue(field); } if(val != null && !(val is string)) *************** *** 1675,1679 **** --- 1669,1691 ---- if(constant == null) { + #if WHIDBEY + FieldInfo field = GetField(); + #if !STATIC_COMPILER + if(field.FieldType.IsEnum && !field.DeclaringType.IsEnum) + { + if(field.DeclaringType.Assembly.ReflectionOnly) + { + return null; + } + constant = field.GetValue(null); + } + else + #endif // !STATIC_COMPILER + { + constant = field.GetRawConstantValue(); + } + #else // WHIDBEY constant = GetField().GetValue(null); + #endif // WHIDBEY } return constant; |
From: Jeroen F. <jfr...@us...> - 2007-03-12 14:18:57
|
Update of /cvsroot/ikvm/ikvm/jvm In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv3806 Modified Files: jvm.build Log Message: Added HACK to detect x64 and build accordingly. Index: jvm.build =================================================================== RCS file: /cvsroot/ikvm/ikvm/jvm/jvm.build,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** jvm.build 2 Feb 2005 15:12:03 -0000 1.5 --- jvm.build 12 Mar 2007 14:18:46 -0000 1.6 *************** *** 4,11 **** <property overwrite="false" name="ilasm_signoption" value="" /> <exec program="../tools/asmref.exe" useruntimeengine="true" commandline="mscorlib ../bin/IKVM.Runtime.dll ../bin/IKVM.GNU.Classpath.dll" output="jvm_h.il" /> ! <exec program="ilasm" commandline="/dll ${ilasm_signoption} /out:../bin/JVM.DLL jvm_h.il jvm32.il JVM.il" /> ! <!-- ! <exec program="ilasm" commandline="/x64 /dll ${ilasm_signoption} /out:../bin/JVM.DLL jvm_h.il jvm64.il JVM.il" /> ! --> </target> </project> --- 4,13 ---- <property overwrite="false" name="ilasm_signoption" value="" /> <exec program="../tools/asmref.exe" useruntimeengine="true" commandline="mscorlib ../bin/IKVM.Runtime.dll ../bin/IKVM.GNU.Classpath.dll" output="jvm_h.il" /> ! <if test="${not string::contains(environment::get-variable('FrameworkDir'), 'Framework64')}"> ! <exec program="ilasm" commandline="/dll ${ilasm_signoption} /out:../bin/JVM.DLL jvm_h.il jvm32.il JVM.il" /> ! </if> ! <if test="${string::contains(environment::get-variable('FrameworkDir'), 'Framework64')}"> ! <exec program="ilasm" commandline="/pe64 /x64 /dll ${ilasm_signoption} /out:../bin/JVM.DLL jvm_h.il jvm64.il JVM.il" /> ! </if> </target> </project> |