ikvm-commit Mailing List for IKVM.NET
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...> - 2017-04-18 13:27:55
|
Update of /cvsroot/ikvm/ikvm/openjdk/java/lang In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv27929 Modified Files: Shutdown.java Log Message: Use AppDomain.DomainUnload event for shutdown hooks when running in secondary AppDomain. Index: Shutdown.java =================================================================== RCS file: /cvsroot/ikvm/ikvm/openjdk/java/lang/Shutdown.java,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** Shutdown.java 18 Dec 2012 06:08:29 -0000 1.11 --- Shutdown.java 18 Apr 2017 13:27:53 -0000 1.12 *************** *** 95,103 **** private static void registerShutdownHook() { ! AppDomain.get_CurrentDomain().add_ProcessExit(new EventHandler(new EventHandler.Method() { public void Invoke(Object sender, EventArgs e) { shutdown(); } ! })); } --- 95,109 ---- private static void registerShutdownHook() { ! EventHandler eh = new EventHandler(new EventHandler.Method() { public void Invoke(Object sender, EventArgs e) { shutdown(); } ! }); ! AppDomain ad = AppDomain.get_CurrentDomain(); ! if (ad.IsDefaultAppDomain()) { ! ad.add_ProcessExit(eh); ! } else { ! ad.add_DomainUnload(eh); ! } } |
From: Jeroen F. <jfr...@us...> - 2017-02-21 16:03:26
|
Update of /cvsroot/ikvm/ikvm/ikvmc In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv25393 Modified Files: Compiler.cs CompilerClassLoader.cs Log Message: Fix for #320. When -target:module is used, disable deterministic output. Index: CompilerClassLoader.cs =================================================================== RCS file: /cvsroot/ikvm/ikvm/ikvmc/CompilerClassLoader.cs,v retrieving revision 1.279 retrieving revision 1.280 diff -C2 -d -r1.279 -r1.280 *** CompilerClassLoader.cs 7 Sep 2016 07:57:52 -0000 1.279 --- CompilerClassLoader.cs 21 Feb 2017 16:03:24 -0000 1.280 *************** *** 3753,3760 **** } ! internal static void Init(bool emitSymbols) { UniverseOptions options = UniverseOptions.ResolveMissingMembers | UniverseOptions.EnableFunctionPointers; ! if (!emitSymbols) { options |= UniverseOptions.DeterministicOutput; --- 3753,3760 ---- } ! internal static void Init(bool nonDeterministicOutput) { UniverseOptions options = UniverseOptions.ResolveMissingMembers | UniverseOptions.EnableFunctionPointers; ! if (!nonDeterministicOutput) { options |= UniverseOptions.DeterministicOutput; Index: Compiler.cs =================================================================== RCS file: /cvsroot/ikvm/ikvm/ikvmc/Compiler.cs,v retrieving revision 1.169 retrieving revision 1.170 diff -C2 -d -r1.169 -r1.170 *** Compiler.cs 26 Jun 2015 11:22:19 -0000 1.169 --- Compiler.cs 21 Feb 2017 16:03:23 -0000 1.170 *************** *** 178,182 **** private static string runtimeAssembly; private static bool nostdlib; ! private static bool emitSymbols; private static readonly List<string> libpaths = new List<string>(); internal static readonly AssemblyResolver resolver = new AssemblyResolver(); --- 178,182 ---- private static string runtimeAssembly; private static bool nostdlib; ! private static bool nonDeterministicOutput; private static readonly List<string> libpaths = new List<string>(); internal static readonly AssemblyResolver resolver = new AssemblyResolver(); *************** *** 303,307 **** StaticCompiler.toplevel = toplevel; comp.ParseCommandLine(argList.GetEnumerator(), targets, toplevel); ! StaticCompiler.Init(emitSymbols); resolver.Warning += loader_Warning; resolver.Init(StaticCompiler.Universe, nostdlib, toplevel.unresolvedReferences, libpaths); --- 303,307 ---- StaticCompiler.toplevel = toplevel; comp.ParseCommandLine(argList.GetEnumerator(), targets, toplevel); ! StaticCompiler.Init(nonDeterministicOutput); resolver.Warning += loader_Warning; resolver.Init(StaticCompiler.Universe, nostdlib, toplevel.unresolvedReferences, libpaths); *************** *** 598,601 **** --- 598,602 ---- options.target = PEFileKinds.Dll; options.guessFileKind = false; + nonDeterministicOutput = true; break; case "-target:library": *************** *** 822,826 **** else if(s == "-debug") { ! emitSymbols = true; options.codegenoptions |= CodeGenOptions.Debug; } --- 823,827 ---- else if(s == "-debug") { ! nonDeterministicOutput = true; options.codegenoptions |= CodeGenOptions.Debug; } |
From: Jeroen F. <jfr...@us...> - 2017-02-07 14:50:36
|
Update of /cvsroot/ikvm/ikvm/awt In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv8638 Modified Files: toolkit-0.95.cs Log Message: Fix by Dmitry Firsakov <Dmi...@ex...>. Index: toolkit-0.95.cs =================================================================== RCS file: /cvsroot/ikvm/ikvm/awt/toolkit-0.95.cs,v retrieving revision 1.114 retrieving revision 1.115 diff -C2 -d -r1.114 -r1.115 *** toolkit-0.95.cs 9 Jun 2015 09:28:37 -0000 1.114 --- toolkit-0.95.cs 7 Feb 2017 14:50:34 -0000 1.115 *************** *** 1889,1893 **** this.target = target; this.paintArea = new RepaintArea(); ! java.awt.Container parent = SunToolkit.getNativeContainer(target); NetComponentPeer parentPeer = (NetComponentPeer)NetToolkit.targetToPeer(parent); control = Create(parentPeer); --- 1889,1897 ---- this.target = target; this.paintArea = new RepaintArea(); ! // A window has an owner, but it does NOT have a container. ! // Component getNativeContainer() was changed in 8.2 so it returns null for Window ! // We have to use getParent() instead ! //java.awt.Container parent = SunToolkit.getNativeContainer(target); ! java.awt.Component parent = SunToolkit.getHeavyweightComponent(target.getParent()); NetComponentPeer parentPeer = (NetComponentPeer)NetToolkit.targetToPeer(parent); control = Create(parentPeer); |
From: Small S. <sma...@us...> - 2016-09-07 09:26:42
|
Update of /cvsroot/ikvm/ikvm/openjdk/sun/awt/image In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv32252/openjdk/sun/awt/image Modified Files: ImageRepresentation.java Log Message: Fix InvalidArgumentEx on invalid images which result in an endless blocking of MediaTracker. Index: ImageRepresentation.java =================================================================== RCS file: /cvsroot/ikvm/ikvm/openjdk/sun/awt/image/ImageRepresentation.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** ImageRepresentation.java 10 Mar 2012 11:52:49 -0000 1.6 --- ImageRepresentation.java 7 Sep 2016 09:26:40 -0000 1.7 *************** *** 327,331 **** consuming = false; } ! if (bimage == null ) { bimage = new BufferedImage(getBitmapRef()); } --- 327,331 ---- consuming = false; } ! if (bimage == null && width > 0 && height > 0 ) { bimage = new BufferedImage(getBitmapRef()); } |
From: Jeroen F. <jfr...@us...> - 2016-09-07 07:57:54
|
Update of /cvsroot/ikvm/ikvm/openjdk/java/lang In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv28656/openjdk/java/lang Modified Files: StringHelper.java Log Message: Bug fix. Added missing methods to String (chars() and codePoints()). Index: StringHelper.java =================================================================== RCS file: /cvsroot/ikvm/ikvm/openjdk/java/lang/StringHelper.java,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** StringHelper.java 9 Jun 2015 09:28:43 -0000 1.10 --- StringHelper.java 7 Sep 2016 07:57:52 -0000 1.11 *************** *** 39,42 **** --- 39,49 ---- import java.util.regex.Pattern; import java.util.regex.PatternSyntaxException; + import java.util.NoSuchElementException; + import java.util.PrimitiveIterator; + import java.util.Spliterator; + import java.util.Spliterators; + import java.util.function.IntConsumer; + import java.util.stream.IntStream; + import java.util.stream.StreamSupport; /** *************** *** 2725,2727 **** --- 2732,2825 ---- return Double.toString(d); } + + public static IntStream chars(String _this) { + class CharIterator implements PrimitiveIterator.OfInt { + int cur = 0; + + public boolean hasNext() { + return cur < _this.length(); + } + + public int nextInt() { + if (hasNext()) { + return _this.charAt(cur++); + } else { + throw new NoSuchElementException(); + } + } + + @Override + public void forEachRemaining(IntConsumer block) { + for (; cur < _this.length(); cur++) { + block.accept(_this.charAt(cur)); + } + } + } + + return StreamSupport.intStream(() -> + Spliterators.spliterator( + new CharIterator(), + _this.length(), + Spliterator.ORDERED), + Spliterator.SUBSIZED | Spliterator.SIZED | Spliterator.ORDERED, + false); + } + + public static IntStream codePoints(String _this) { + class CodePointIterator implements PrimitiveIterator.OfInt { + int cur = 0; + + @Override + public void forEachRemaining(IntConsumer block) { + final int length = _this.length(); + int i = cur; + try { + while (i < length) { + char c1 = _this.charAt(i++); + if (!Character.isHighSurrogate(c1) || i >= length) { + block.accept(c1); + } else { + char c2 = _this.charAt(i); + if (Character.isLowSurrogate(c2)) { + i++; + block.accept(Character.toCodePoint(c1, c2)); + } else { + block.accept(c1); + } + } + } + } finally { + cur = i; + } + } + + public boolean hasNext() { + return cur < _this.length(); + } + + public int nextInt() { + final int length = _this.length(); + + if (cur >= length) { + throw new NoSuchElementException(); + } + char c1 = _this.charAt(cur++); + if (Character.isHighSurrogate(c1) && cur < length) { + char c2 = _this.charAt(cur); + if (Character.isLowSurrogate(c2)) { + cur++; + return Character.toCodePoint(c1, c2); + } + } + return c1; + } + } + + return StreamSupport.intStream(() -> + Spliterators.spliteratorUnknownSize( + new CodePointIterator(), + Spliterator.ORDERED), + Spliterator.ORDERED, + false); + } } |
From: Jeroen F. <jfr...@us...> - 2016-08-03 13:56:06
|
Update of /cvsroot/ikvm/ikvm/reflect In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv28727 Modified Files: Universe.cs Log Message: Patch by Marek Safar <mar...@gm...> Add mcs required DisableDefaultAssembliesLookup option. Index: Universe.cs =================================================================== RCS file: /cvsroot/ikvm/ikvm/reflect/Universe.cs,v retrieving revision 1.88 retrieving revision 1.89 diff -C2 -d -r1.88 -r1.89 *** Universe.cs 4 Jul 2016 05:15:00 -0000 1.88 --- Universe.cs 3 Aug 2016 13:56:03 -0000 1.89 *************** *** 137,140 **** --- 137,141 ---- DecodeVersionInfoAttributeBlobs = 128, DeterministicOutput = 256, + DisableDefaultAssembliesLookup = 512, } *************** *** 718,722 **** { Assembly asm; ! if (!assembliesByName.TryGetValue(refname, out asm)) { string simpleName = GetSimpleAssemblyName(refname); --- 719,723 ---- { Assembly asm; ! if (!assembliesByName.TryGetValue(refname, out asm) && (options & UniverseOptions.DisableDefaultAssembliesLookup) == 0) { string simpleName = GetSimpleAssemblyName(refname); |
From: Jeroen F. <jfr...@us...> - 2016-08-03 13:55:24
|
Update of /cvsroot/ikvm/ikvm/reflect In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv28687 Modified Files: Fusion.cs Log Message: Patch by Marek Safar <mar...@gm...> [PATCH] Fixes FX assemblies unification with different build and revision versions. This happens for PCL assemblies like System.Runtime which already exists in versions 4.0.0.0, 4.0.10.0, 4.0.20.0 Index: Fusion.cs =================================================================== RCS file: /cvsroot/ikvm/ikvm/reflect/Fusion.cs,v retrieving revision 1.32 retrieving revision 1.33 diff -C2 -d -r1.32 -r1.33 *** Fusion.cs 1 Jul 2016 05:44:41 -0000 1.32 --- Fusion.cs 3 Aug 2016 13:55:22 -0000 1.33 *************** *** 220,232 **** bool fxUnified = false; ! bool versionMatch = version1 == version2; if (IsFrameworkAssembly(name1)) { ! fxUnified |= !versionMatch; version1 = FrameworkVersion; } if (IsFrameworkAssembly(name2) && version2 < FrameworkVersionNext) { ! fxUnified |= !versionMatch; version2 = FrameworkVersion; } --- 220,234 ---- bool fxUnified = false; ! ! // build and revision numbers are ignored ! bool fxVersionMatch = version1.Major == version2.Major && version1.Minor == version2.Minor; if (IsFrameworkAssembly(name1)) { ! fxUnified |= !fxVersionMatch; version1 = FrameworkVersion; } if (IsFrameworkAssembly(name2) && version2 < FrameworkVersionNext) { ! fxUnified |= !fxVersionMatch; version2 = FrameworkVersion; } *************** *** 275,279 **** } } ! else if (!versionMatch || fxUnified) { result = partial ? AssemblyComparisonResult.EquivalentPartialFXUnified : AssemblyComparisonResult.EquivalentFXUnified; --- 277,281 ---- } } ! else if (fxUnified || version1 != version2) { result = partial ? AssemblyComparisonResult.EquivalentPartialFXUnified : AssemblyComparisonResult.EquivalentFXUnified; |
From: Jeroen F. <jfr...@us...> - 2016-07-20 05:43:17
|
Update of /cvsroot/ikvm/ikvm/reflect/Metadata In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv29558 Modified Files: Tables.cs Log Message: We don't support custom attributes on DeclSecurity or GenericParamConstraint, so there is no need to implement it. Index: Tables.cs =================================================================== RCS file: /cvsroot/ikvm/ikvm/reflect/Metadata/Tables.cs,v retrieving revision 1.32 retrieving revision 1.33 diff -C2 -d -r1.32 -r1.33 *** Tables.cs 20 Jul 2016 05:16:33 -0000 1.32 --- Tables.cs 20 Jul 2016 05:43:14 -0000 1.33 *************** *** 1198,1201 **** --- 1198,1203 ---- records[i].Parent = (GenericParamTable.Index << 24) + genericParamFixup[(records[i].Parent & 0xFFFFFF) - 1] + 1; } + // TODO if we ever add support for custom attributes on DeclSecurity or GenericParamConstraint + // we need to fix them up here (because they are sorted tables, like GenericParam) } Sort(); *************** *** 1224,1228 **** // LAMESPEC spec calls this Permission table case DeclSecurityTable.Index: ! return (token & 0xFFFFFF) << 5 | 8; case PropertyTable.Index: return (token & 0xFFFFFF) << 5 | 9; --- 1226,1231 ---- // LAMESPEC spec calls this Permission table case DeclSecurityTable.Index: ! //return (token & 0xFFFFFF) << 5 | 8; ! throw new NotImplementedException(); case PropertyTable.Index: return (token & 0xFFFFFF) << 5 | 9; *************** *** 1248,1252 **** return (token & 0xFFFFFF) << 5 | 19; case GenericParamConstraintTable.Index: ! return (token & 0xFFFFFF) << 5 | 20; case MethodSpecTable.Index: return (token & 0xFFFFFF) << 5 | 21; --- 1251,1256 ---- return (token & 0xFFFFFF) << 5 | 19; case GenericParamConstraintTable.Index: ! //return (token & 0xFFFFFF) << 5 | 20; ! throw new NotImplementedException(); case MethodSpecTable.Index: return (token & 0xFFFFFF) << 5 | 21; |
From: Jeroen F. <jfr...@us...> - 2016-07-20 05:16:36
|
Update of /cvsroot/ikvm/ikvm/reflect/Reader In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv28295/Reader Modified Files: MetadataReader.cs Log Message: Bug fix. Handle custom attributes on DeclSecurity, GenericParam, GenericParamConstraint and MethodSpec tables. Index: MetadataReader.cs =================================================================== RCS file: /cvsroot/ikvm/ikvm/reflect/Reader/MetadataReader.cs,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** MetadataReader.cs 14 Feb 2011 05:54:46 -0000 1.4 --- MetadataReader.cs 20 Jul 2016 05:16:33 -0000 1.5 *************** *** 204,208 **** return (ModuleTable.Index << 24) + (codedIndex >> 5); case 8: ! throw new BadImageFormatException(); case 9: return (PropertyTable.Index << 24) + (codedIndex >> 5); --- 204,208 ---- return (ModuleTable.Index << 24) + (codedIndex >> 5); case 8: ! return (DeclSecurityTable.Index << 24) + (codedIndex >> 5); case 9: return (PropertyTable.Index << 24) + (codedIndex >> 5); *************** *** 227,230 **** --- 227,234 ---- case 19: return (GenericParamTable.Index << 24) + (codedIndex >> 5); + case 20: + return (GenericParamConstraintTable.Index << 24) + (codedIndex >> 5); + case 21: + return (MethodSpecTable.Index << 24) + (codedIndex >> 5); default: throw new BadImageFormatException(); |
From: Jeroen F. <jfr...@us...> - 2016-07-20 04:52:40
|
Update of /cvsroot/ikvm/ikvm/reflect/Emit In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv27113 Modified Files: ILGenerator.cs Log Message: ILGenerator.UsingNamespace() should apply to current scope. Index: ILGenerator.cs =================================================================== RCS file: /cvsroot/ikvm/ikvm/reflect/Emit/ILGenerator.cs,v retrieving revision 1.41 retrieving revision 1.42 diff -C2 -d -r1.41 -r1.42 *** ILGenerator.cs 1 Jul 2016 08:41:04 -0000 1.41 --- ILGenerator.cs 20 Jul 2016 04:52:37 -0000 1.42 *************** *** 201,204 **** --- 201,205 ---- internal readonly List<Scope> children = new List<Scope>(); internal readonly List<LocalBuilder> locals = new List<LocalBuilder>(); + internal readonly List<string> namespaces = new List<string>(); internal int startOffset; internal int endOffset; *************** *** 408,414 **** { #if !NO_SYMBOL_WRITER ! if (moduleBuilder.symbolWriter != null) { ! moduleBuilder.symbolWriter.UsingNamespace(usingNamespace); } #endif --- 409,415 ---- { #if !NO_SYMBOL_WRITER ! if (scope != null) { ! scope.namespaces.Add(usingNamespace); } #endif *************** *** 1140,1143 **** --- 1141,1148 ---- } } + foreach (string ns in scope.namespaces) + { + moduleBuilder.symbolWriter.UsingNamespace(ns); + } foreach (Scope child in scope.children) { |
From: Jeroen F. <jfr...@us...> - 2016-07-04 06:25:46
|
Update of /cvsroot/ikvm/ikvm/reflect In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv11623 Modified Files: Module.cs Log Message: Module constructor should be internal, not protected. Index: Module.cs =================================================================== RCS file: /cvsroot/ikvm/ikvm/reflect/Module.cs,v retrieving revision 1.62 retrieving revision 1.63 diff -C2 -d -r1.62 -r1.63 *** Module.cs 4 Jul 2016 05:15:00 -0000 1.62 --- Module.cs 4 Jul 2016 06:25:44 -0000 1.63 *************** *** 158,162 **** internal readonly GenericParamConstraintTable GenericParamConstraint = new GenericParamConstraintTable(); ! protected Module(Universe universe) { this.universe = universe; --- 158,162 ---- internal readonly GenericParamConstraintTable GenericParamConstraint = new GenericParamConstraintTable(); ! internal Module(Universe universe) { this.universe = universe; |
From: Jeroen F. <jfr...@us...> - 2016-07-04 06:16:16
|
Update of /cvsroot/ikvm/ikvm/reflect/Reader In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv11216 Modified Files: Authenticode.cs Log Message: Use SkipStream to simplify hashing. Index: Authenticode.cs =================================================================== RCS file: /cvsroot/ikvm/ikvm/reflect/Reader/Authenticode.cs,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** Authenticode.cs 3 Nov 2015 09:15:04 -0000 1.4 --- Authenticode.cs 4 Jul 2016 06:16:14 -0000 1.5 *************** *** 113,142 **** private static byte[] ComputeHashWithSkip(Stream stream, string hashAlgorithm, int[] skipOffsets, int[] skipLengths) { ! using (HashAlgorithm hash = HashAlgorithm.Create(hashAlgorithm)) { ! using (CryptoStream cs = new CryptoStream(Stream.Null, hash, CryptoStreamMode.Write)) ! { ! stream.Seek(0, SeekOrigin.Begin); ! byte[] buf = new byte[8192]; ! HashChunk(stream, cs, buf, skipOffsets[0]); ! stream.Seek(skipLengths[0], SeekOrigin.Current); ! for (int i = 1; i < skipOffsets.Length; i++) ! { ! HashChunk(stream, cs, buf, skipOffsets[i] - (skipOffsets[i - 1] + skipLengths[i - 1])); ! stream.Seek(skipLengths[i], SeekOrigin.Current); ! } ! HashChunk(stream, cs, buf, (int)stream.Length - (skipOffsets[skipOffsets.Length - 1] + skipLengths[skipLengths.Length - 1])); ! } ! return hash.Hash; } ! } ! ! private static void HashChunk(Stream stream, CryptoStream cs, byte[] buf, int length) ! { ! while (length > 0) { ! int read = stream.Read(buf, 0, Math.Min(buf.Length, length)); ! cs.Write(buf, 0, read); ! length -= read; } } --- 113,124 ---- private static byte[] ComputeHashWithSkip(Stream stream, string hashAlgorithm, int[] skipOffsets, int[] skipLengths) { ! stream.Position = 0; ! for (int i = skipOffsets.Length - 1; i >= 0; i--) { ! stream = new IKVM.Reflection.Writer.SkipStream(stream, skipOffsets[i], skipLengths[i]); } ! using (HashAlgorithm hash = HashAlgorithm.Create(hashAlgorithm)) { ! return hash.ComputeHash(stream); } } |
From: Jeroen F. <jfr...@us...> - 2016-07-04 05:29:24
|
Update of /cvsroot/ikvm/ikvm/reflect In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv9274 Modified Files: IKVM.Reflection.csproj Log Message: Forgot to remove coreclr.cls from Visual Studio project. Index: IKVM.Reflection.csproj =================================================================== RCS file: /cvsroot/ikvm/ikvm/reflect/IKVM.Reflection.csproj,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** IKVM.Reflection.csproj 16 Feb 2015 12:24:28 -0000 1.10 --- IKVM.Reflection.csproj 4 Jul 2016 05:29:22 -0000 1.11 *************** *** 48,52 **** <Compile Include="Binder.cs" /> <Compile Include="ConstructorInfo.cs" /> - <Compile Include="coreclr.cs" /> <Compile Include="CustomAttributeData.cs" /> <Compile Include="CustomAttributeNamedArgument.cs" /> --- 48,51 ---- |
From: Jeroen F. <jfr...@us...> - 2016-07-04 05:15:02
|
Update of /cvsroot/ikvm/ikvm/reflect/Emit In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv8727/Emit Modified Files: AssemblyBuilder.cs ConstructorBuilder.cs ModuleBuilder.cs Log Message: Removed [Obsolete] methods from NETSTANDARD build. Index: ConstructorBuilder.cs =================================================================== RCS file: /cvsroot/ikvm/ikvm/reflect/Emit/ConstructorBuilder.cs,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** ConstructorBuilder.cs 1 Jul 2016 05:44:41 -0000 1.10 --- ConstructorBuilder.cs 4 Jul 2016 05:15:00 -0000 1.11 *************** *** 52,55 **** --- 52,56 ---- } + #if !NETSTANDARD [Obsolete("Please use __SetSignature(Type, CustomModifiers, Type[], CustomModifiers[]) instead.")] public void __SetSignature(Type returnType, Type[] returnTypeRequiredCustomModifiers, Type[] returnTypeOptionalCustomModifiers, Type[] parameterTypes, Type[][] parameterTypeRequiredCustomModifiers, Type[][] parameterTypeOptionalCustomModifiers) *************** *** 57,60 **** --- 58,62 ---- methodBuilder.SetSignature(returnType, returnTypeRequiredCustomModifiers, returnTypeOptionalCustomModifiers, parameterTypes, parameterTypeRequiredCustomModifiers, parameterTypeOptionalCustomModifiers); } + #endif public ParameterBuilder DefineParameter(int position, ParameterAttributes attributes, string strParamName) Index: ModuleBuilder.cs =================================================================== RCS file: /cvsroot/ikvm/ikvm/reflect/Emit/ModuleBuilder.cs,v retrieving revision 1.108 retrieving revision 1.109 diff -C2 -d -r1.108 -r1.109 *** ModuleBuilder.cs 1 Jul 2016 05:44:41 -0000 1.108 --- ModuleBuilder.cs 4 Jul 2016 05:15:00 -0000 1.109 *************** *** 396,399 **** --- 396,400 ---- } + #if !NETSTANDARD [Obsolete("Please use __DefineField(string, Type, CustomModifiers, FieldAttributes) instead.")] public FieldBuilder __DefineField(string name, Type type, Type[] requiredCustomModifiers, Type[] optionalCustomModifiers, FieldAttributes attributes) *************** *** 401,404 **** --- 402,406 ---- return moduleType.DefineField(name, type, requiredCustomModifiers, optionalCustomModifiers, attributes); } + #endif public ConstructorBuilder __DefineModuleInitializer(MethodAttributes visibility) *************** *** 1567,1570 **** --- 1569,1573 ---- } + #if !NETSTANDARD [Obsolete("Use __StackReserve property.")] public void __SetStackReserve(long stackReserve) *************** *** 1572,1575 **** --- 1575,1579 ---- __StackReserve = stackReserve; } + #endif internal ulong GetStackReserve(ulong defaultValue) Index: AssemblyBuilder.cs =================================================================== RCS file: /cvsroot/ikvm/ikvm/reflect/Emit/AssemblyBuilder.cs,v retrieving revision 1.65 retrieving revision 1.66 diff -C2 -d -r1.65 -r1.66 *** AssemblyBuilder.cs 1 Jul 2016 05:44:41 -0000 1.65 --- AssemblyBuilder.cs 4 Jul 2016 05:15:00 -0000 1.66 *************** *** 204,207 **** --- 204,208 ---- } + #if !NETSTANDARD [Obsolete("Use __AssemblyFlags property instead.")] public void __SetAssemblyFlags(AssemblyNameFlags flags) *************** *** 209,212 **** --- 210,214 ---- this.__AssemblyFlags = flags; } + #endif protected override AssemblyNameFlags GetAssemblyFlags() |
From: Jeroen F. <jfr...@us...> - 2016-07-01 08:41:06
|
Update of /cvsroot/ikvm/ikvm/reflect/Emit In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv6941/Emit Modified Files: ILGenerator.cs Log Message: Avoid importing System.Console and System.IO.TextWriter. Index: ILGenerator.cs =================================================================== RCS file: /cvsroot/ikvm/ikvm/reflect/Emit/ILGenerator.cs,v retrieving revision 1.40 retrieving revision 1.41 diff -C2 -d -r1.40 -r1.41 *** ILGenerator.cs 16 Feb 2015 12:24:28 -0000 1.40 --- ILGenerator.cs 1 Jul 2016 08:41:04 -0000 1.41 *************** *** 830,834 **** Universe u = moduleBuilder.universe; Emit(OpCodes.Ldstr, text); ! Emit(OpCodes.Call, u.Import(typeof(Console)).GetMethod("WriteLine", new Type[] { u.System_String })); } --- 830,834 ---- Universe u = moduleBuilder.universe; Emit(OpCodes.Ldstr, text); ! Emit(OpCodes.Call, u.System_Console.GetMethod("WriteLine", new Type[] { u.System_String })); } *************** *** 836,840 **** { Universe u = moduleBuilder.universe; ! Emit(OpCodes.Call, u.Import(typeof(Console)).GetMethod("get_Out")); if (field.IsStatic) { --- 836,840 ---- { Universe u = moduleBuilder.universe; ! Emit(OpCodes.Call, u.System_Console.GetMethod("get_Out")); if (field.IsStatic) { *************** *** 846,850 **** Emit(OpCodes.Ldfld, field); } ! Emit(OpCodes.Callvirt, u.Import(typeof(System.IO.TextWriter)).GetMethod("WriteLine", new Type[] { field.FieldType })); } --- 846,850 ---- Emit(OpCodes.Ldfld, field); } ! Emit(OpCodes.Callvirt, u.System_IO_TextWriter.GetMethod("WriteLine", new Type[] { field.FieldType })); } *************** *** 852,858 **** { Universe u = moduleBuilder.universe; ! Emit(OpCodes.Call, u.Import(typeof(Console)).GetMethod("get_Out")); Emit(OpCodes.Ldloc, local); ! Emit(OpCodes.Callvirt, u.Import(typeof(System.IO.TextWriter)).GetMethod("WriteLine", new Type[] { local.LocalType })); } --- 852,858 ---- { Universe u = moduleBuilder.universe; ! Emit(OpCodes.Call, u.System_Console.GetMethod("get_Out")); Emit(OpCodes.Ldloc, local); ! Emit(OpCodes.Callvirt, u.System_IO_TextWriter.GetMethod("WriteLine", new Type[] { local.LocalType })); } |
From: Jeroen F. <jfr...@us...> - 2016-07-01 07:20:46
|
Update of /cvsroot/ikvm/ikvm/reflect In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv3820 Modified Files: Universe.cs Log Message: In NETSTANDARD, make import able to load the original assembly when there are no custom resolvers. Index: Universe.cs =================================================================== RCS file: /cvsroot/ikvm/ikvm/reflect/Universe.cs,v retrieving revision 1.85 retrieving revision 1.86 diff -C2 -d -r1.85 -r1.86 *** Universe.cs 1 Jul 2016 07:18:40 -0000 1.85 --- Universe.cs 1 Jul 2016 07:20:44 -0000 1.86 *************** *** 603,606 **** --- 603,617 ---- private Assembly Import(System.Reflection.Assembly asm) { + #if NETSTANDARD + if (resolvers.Count == 0) + { + Assembly result = GetLoadedAssembly(asm.FullName); + if (result != null) + { + return result; + } + return LoadFile(asm.ManifestModule.FullyQualifiedName); + } + #endif return Load(asm.FullName); } |
From: Jeroen F. <jfr...@us...> - 2016-07-01 07:18:42
|
Update of /cvsroot/ikvm/ikvm/reflect In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv3722 Modified Files: Universe.cs Log Message: Fixed NETSTANDARD default resolver to actually register the loaded assembly. Index: Universe.cs =================================================================== RCS file: /cvsroot/ikvm/ikvm/reflect/Universe.cs,v retrieving revision 1.84 retrieving revision 1.85 diff -C2 -d -r1.84 -r1.85 *** Universe.cs 1 Jul 2016 06:14:48 -0000 1.84 --- Universe.cs 1 Jul 2016 07:18:40 -0000 1.85 *************** *** 793,797 **** if (module.IsManifestModule && CompareAssemblyIdentity(refname, false, module.GetAssemblyName().FullName, false, out result)) { ! return module.ToAssembly(); } } --- 793,797 ---- if (module.IsManifestModule && CompareAssemblyIdentity(refname, false, module.GetAssemblyName().FullName, false, out result)) { ! return LoadAssembly(module); } } |
From: Jeroen F. <jfr...@us...> - 2016-07-01 06:20:40
|
Update of /cvsroot/ikvm/ikvm/reflect In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv1034 Modified Files: Type.cs Log Message: Implemented Type.GetEnumName() in a way that is compatible with NETSTANDARD. Index: Type.cs =================================================================== RCS file: /cvsroot/ikvm/ikvm/reflect/Type.cs,v retrieving revision 1.114 retrieving revision 1.115 diff -C2 -d -r1.114 -r1.115 *** Type.cs 1 Jul 2016 05:57:10 -0000 1.114 --- Type.cs 1 Jul 2016 06:20:37 -0000 1.115 *************** *** 543,547 **** } - #if !CORECLR public string GetEnumName(object value) { --- 543,546 ---- *************** *** 556,560 **** try { ! value = Convert.ChangeType(value, GetTypeCode(GetEnumUnderlyingType())); } catch (FormatException) --- 555,559 ---- try { ! value = Convert.ChangeType(value, __GetSystemType(GetTypeCode(GetEnumUnderlyingType()))); } catch (FormatException) *************** *** 579,583 **** return null; } - #endif public bool IsEnumDefined(object value) --- 578,581 ---- |
From: Jeroen F. <jfr...@us...> - 2016-07-01 06:14:50
|
Update of /cvsroot/ikvm/ikvm/reflect In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv696 Modified Files: Universe.cs Log Message: Implemented a simple default assembly resolver for NETSTANDARD target that works at least for mscorlib. Index: Universe.cs =================================================================== RCS file: /cvsroot/ikvm/ikvm/reflect/Universe.cs,v retrieving revision 1.83 retrieving revision 1.84 diff -C2 -d -r1.83 -r1.84 *** Universe.cs 1 Jul 2016 05:57:10 -0000 1.83 --- Universe.cs 1 Jul 2016 06:14:48 -0000 1.84 *************** *** 783,787 **** return asm; } ! #if CORECLR return null; #else --- 783,800 ---- return asm; } ! #if NETSTANDARD ! string dir = Path.GetDirectoryName(TypeUtil.GetAssembly(typeof(object)).ManifestModule.FullyQualifiedName); ! string filepath = Path.Combine(dir, GetSimpleAssemblyName(refname) + ".dll"); ! if (File.Exists(filepath)) ! { ! using (RawModule module = OpenRawModule(filepath)) ! { ! AssemblyComparisonResult result; ! if (module.IsManifestModule && CompareAssemblyIdentity(refname, false, module.GetAssemblyName().FullName, false, out result)) ! { ! return module.ToAssembly(); ! } ! } ! } return null; #else |
From: Jeroen F. <jfr...@us...> - 2016-07-01 05:57:13
|
Update of /cvsroot/ikvm/ikvm/reflect In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv32381 Modified Files: Type.cs Universe.cs Log Message: Implemented Type.IsContextful and Type.IsMarshalByRef without relying on Import. Index: Universe.cs =================================================================== RCS file: /cvsroot/ikvm/ikvm/reflect/Universe.cs,v retrieving revision 1.82 retrieving revision 1.83 diff -C2 -d -r1.82 -r1.83 *** Universe.cs 1 Jul 2016 05:44:41 -0000 1.82 --- Universe.cs 1 Jul 2016 05:57:10 -0000 1.83 *************** *** 182,185 **** --- 182,187 ---- private Type typeof_System_Decimal; private Type typeof_System_AttributeUsageAttribute; + private Type typeof_System_ContextBoundObject; + private Type typeof_System_MarshalByRefObject; private Type typeof_System_Runtime_InteropServices_DllImportAttribute; private Type typeof_System_Runtime_InteropServices_FieldOffsetAttribute; *************** *** 399,402 **** --- 401,414 ---- } + internal Type System_ContextBoundObject + { + get { return typeof_System_ContextBoundObject ?? (typeof_System_ContextBoundObject = ImportMscorlibType("System", "ContextBoundObject")); } + } + + internal Type System_MarshalByRefObject + { + get { return typeof_System_MarshalByRefObject ?? (typeof_System_MarshalByRefObject = ImportMscorlibType("System", "MarshalByRefObject")); } + } + internal Type System_Runtime_InteropServices_DllImportAttribute { Index: Type.cs =================================================================== RCS file: /cvsroot/ikvm/ikvm/reflect/Type.cs,v retrieving revision 1.113 retrieving revision 1.114 diff -C2 -d -r1.113 -r1.114 *** Type.cs 1 Jul 2016 05:15:22 -0000 1.113 --- Type.cs 1 Jul 2016 05:57:10 -0000 1.114 *************** *** 1422,1436 **** } - #if !CORECLR public bool IsContextful { ! get { return IsSubclassOf(this.Module.universe.Import(typeof(ContextBoundObject))); } } public bool IsMarshalByRef { ! get { return IsSubclassOf(this.Module.universe.Import(typeof(MarshalByRefObject))); } } - #endif public virtual bool IsVisible --- 1422,1434 ---- } public bool IsContextful { ! get { return IsSubclassOf(this.Module.universe.System_ContextBoundObject); } } public bool IsMarshalByRef { ! get { return IsSubclassOf(this.Module.universe.System_MarshalByRefObject); } } public virtual bool IsVisible |
From: Jeroen F. <jfr...@us...> - 2016-07-01 05:44:43
|
Update of /cvsroot/ikvm/ikvm/reflect/Writer In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv31864/Writer Modified Files: VersionInfo.cs Log Message: Replaced CORECLR symbol with NETSTANDARD. Index: VersionInfo.cs =================================================================== RCS file: /cvsroot/ikvm/ikvm/reflect/Writer/VersionInfo.cs,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** VersionInfo.cs 1 Jul 2016 05:15:22 -0000 1.9 --- VersionInfo.cs 1 Jul 2016 05:44:41 -0000 1.10 *************** *** 104,108 **** int codepage = 1200; // Unicode codepage ! #if CORECLR // we set the langId to MAKELANGID(LANG_NEUTRAL, SUBLANG_NEUTRAL) // (this matches Roslyn) --- 104,108 ---- int codepage = 1200; // Unicode codepage ! #if NETSTANDARD // we set the langId to MAKELANGID(LANG_NEUTRAL, SUBLANG_NEUTRAL) // (this matches Roslyn) |
From: Jeroen F. <jfr...@us...> - 2016-07-01 05:24:45
|
Update of /cvsroot/ikvm/ikvm/reflect In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv31102 Modified Files: reflect.build Removed Files: coreclr.cs Log Message: Removed CoreCLR build target. --- coreclr.cs DELETED --- Index: reflect.build =================================================================== RCS file: /cvsroot/ikvm/ikvm/reflect/reflect.build,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** reflect.build 16 Feb 2015 12:24:28 -0000 1.15 --- reflect.build 1 Jul 2016 05:24:43 -0000 1.16 *************** *** 44,55 **** </target> - <target name="CoreCLR" depends="properties"> - <property name="CoreCLR" value="true" /> - <property name="defs" value="${defs};CORECLR;NO_SYMBOL_WRITER;NO_AUTHENTICODE" /> - <call target="compile" /> - </target> - <target name="IKVM.Reflection" depends="properties"> - <property name="CoreCLR" value="false" /> <call target="compile" /> </target> --- 44,48 ---- *************** *** 65,69 **** <include name="Binder.cs" /> <include name="ConstructorInfo.cs" /> - <include name="coreclr.cs" /> <include name="CustomAttributeData.cs" /> <include name="CustomAttributeNamedArgument.cs" /> --- 58,61 ---- *************** *** 123,127 **** <include name="Impl\ITypeOwner.cs" /> <include name="Impl\MdbWriter.cs" /> ! <include name="Impl\PdbWriter.cs" unless="${CoreCLR}" /> <include name="Impl\SymbolSupport.cs" /> <include name="Metadata\CliHeader.cs" /> --- 115,119 ---- <include name="Impl\ITypeOwner.cs" /> <include name="Impl\MdbWriter.cs" /> ! <include name="Impl\PdbWriter.cs" /> <include name="Impl\SymbolSupport.cs" /> <include name="Metadata\CliHeader.cs" /> *************** *** 154,159 **** <include if="${framework::exists('mono-2.0')}" name="${MonoSymbolWriter}" /> <include name="${ReferencePath}/mscorlib.dll" /> ! <include name="${ReferencePath}/System.dll" unless="${CoreCLR}" /> ! <include name="${ReferencePath}/System.Security.dll" unless="${CoreCLR}" /> </references> </csc> --- 146,151 ---- <include if="${framework::exists('mono-2.0')}" name="${MonoSymbolWriter}" /> <include name="${ReferencePath}/mscorlib.dll" /> ! <include name="${ReferencePath}/System.dll" /> ! <include name="${ReferencePath}/System.Security.dll" /> </references> </csc> |
Update of /cvsroot/ikvm/ikvm/reflect/Emit In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv30723/Emit Modified Files: AssemblyBuilder.cs CustomAttributeBuilder.cs MethodBuilder.cs ModuleBuilder.cs SignatureHelper.cs TypeBuilder.cs Log Message: Added support for building against .NET Standard 1.3. Index: ModuleBuilder.cs =================================================================== RCS file: /cvsroot/ikvm/ikvm/reflect/Emit/ModuleBuilder.cs,v retrieving revision 1.106 retrieving revision 1.107 diff -C2 -d -r1.106 -r1.107 *** ModuleBuilder.cs 3 Nov 2015 08:19:22 -0000 1.106 --- ModuleBuilder.cs 1 Jul 2016 05:15:22 -0000 1.107 *************** *** 534,538 **** --- 534,542 ---- if (cab.ConstructorArgumentCount == 0) { + #if NETSTANDARD + action = 6; + #else action = (int)System.Security.Permissions.SecurityAction.LinkDemand; + #endif } else Index: TypeBuilder.cs =================================================================== RCS file: /cvsroot/ikvm/ikvm/reflect/Emit/TypeBuilder.cs,v retrieving revision 1.61 retrieving revision 1.62 diff -C2 -d -r1.61 -r1.62 *** TypeBuilder.cs 3 Nov 2015 09:10:24 -0000 1.61 --- TypeBuilder.cs 1 Jul 2016 05:15:22 -0000 1.62 *************** *** 585,589 **** --- 585,593 ---- pack = (short)((int?)customBuilder.GetFieldValue("Pack") ?? 0); size = (int?)customBuilder.GetFieldValue("Size") ?? 0; + #if NETSTANDARD + CharSet charSet = customBuilder.GetFieldValue<CharSet>("CharSet") ?? (CharSet)1; + #else CharSet charSet = customBuilder.GetFieldValue<CharSet>("CharSet") ?? CharSet.None; + #endif attribs &= ~TypeAttributes.LayoutMask; switch (layout) *************** *** 602,610 **** --- 606,622 ---- switch (charSet) { + #if NETSTANDARD + case (CharSet)1: + #else case CharSet.None: + #endif case CharSet.Ansi: attribs |= TypeAttributes.AnsiClass; break; + #if NETSTANDARD + case (CharSet)4: + #else case CharSet.Auto: + #endif attribs |= TypeAttributes.AutoClass; break; Index: CustomAttributeBuilder.cs =================================================================== RCS file: /cvsroot/ikvm/ikvm/reflect/Emit/CustomAttributeBuilder.cs,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -d -r1.24 -r1.25 *** CustomAttributeBuilder.cs 3 Nov 2015 10:36:58 -0000 1.24 --- CustomAttributeBuilder.cs 1 Jul 2016 05:15:22 -0000 1.25 *************** *** 502,506 **** else if (val != null) { ! if (typeof(T).IsEnum) { Debug.Assert(Enum.GetUnderlyingType(typeof(T)) == val.GetType()); --- 502,506 ---- else if (val != null) { ! if (TypeUtil.IsEnum(typeof(T))) { Debug.Assert(Enum.GetUnderlyingType(typeof(T)) == val.GetType()); Index: MethodBuilder.cs =================================================================== RCS file: /cvsroot/ikvm/ikvm/reflect/Emit/MethodBuilder.cs,v retrieving revision 1.40 retrieving revision 1.41 diff -C2 -d -r1.40 -r1.41 *** MethodBuilder.cs 21 Apr 2015 10:15:39 -0000 1.40 --- MethodBuilder.cs 1 Jul 2016 05:15:22 -0000 1.41 *************** *** 167,171 **** --- 167,175 ---- flags |= CallConvCdecl; break; + #if NETSTANDARD + case (System.Runtime.InteropServices.CallingConvention)5: + #else case System.Runtime.InteropServices.CallingConvention.FastCall: + #endif flags |= CallConvFastcall; break; *************** *** 187,194 **** --- 191,206 ---- { case CharSet.Ansi: + #if NETSTANDARD + case (CharSet)1: + #else case CharSet.None: + #endif flags |= CharSetAnsi; break; + #if NETSTANDARD + case (CharSet)4: + #else case CharSet.Auto: + #endif flags |= CharSetAuto; break; *************** *** 246,255 **** throw new NotSupportedException(); } - MethodCodeType? type = customBuilder.GetFieldValue<MethodCodeType>("MethodCodeType"); implFlags = (MethodImplAttributes)opt; if (type.HasValue) { implFlags |= (MethodImplAttributes)type; } } --- 258,275 ---- throw new NotSupportedException(); } implFlags = (MethodImplAttributes)opt; + #if NETSTANDARD + object type = customBuilder.GetFieldValue("MethodCodeType"); + if (type != null) + { + implFlags |= (MethodImplAttributes)(int)type; + } + #else + MethodCodeType? type = customBuilder.GetFieldValue<MethodCodeType>("MethodCodeType"); if (type.HasValue) { implFlags |= (MethodImplAttributes)type; } + #endif } Index: SignatureHelper.cs =================================================================== RCS file: /cvsroot/ikvm/ikvm/reflect/Emit/SignatureHelper.cs,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** SignatureHelper.cs 13 Oct 2012 20:12:32 -0000 1.12 --- SignatureHelper.cs 1 Jul 2016 05:15:22 -0000 1.13 *************** *** 239,243 **** --- 239,247 ---- type = 0x03; // THISCALL break; + #if NETSTANDARD + case (CallingConvention)5: + #else case CallingConvention.FastCall: + #endif type = 0x04; // FASTCALL break; Index: AssemblyBuilder.cs =================================================================== RCS file: /cvsroot/ikvm/ikvm/reflect/Emit/AssemblyBuilder.cs,v retrieving revision 1.63 retrieving revision 1.64 diff -C2 -d -r1.63 -r1.64 *** AssemblyBuilder.cs 30 Jun 2016 06:01:01 -0000 1.63 --- AssemblyBuilder.cs 1 Jul 2016 05:15:22 -0000 1.64 *************** *** 24,28 **** --- 24,30 ---- using System; using System.Collections.Generic; + #if !NETSTANDARD using System.Configuration.Assemblies; + #endif using System.IO; using System.Diagnostics; *************** *** 127,131 **** else { ! this.imageRuntimeVersion = typeof(object).Assembly.ImageRuntimeVersion; } universe.RegisterDynamicAssembly(this); --- 129,141 ---- else { ! #if NETSTANDARD1_3 || NETSTANDARD1_4 ! using (Universe temp = new Universe(UniverseOptions.MetadataOnly)) ! using (RawModule mscorlib = temp.OpenRawModule(TypeUtil.GetAssembly(typeof(object)).ManifestModule.FullyQualifiedName)) ! { ! this.imageRuntimeVersion = mscorlib.ImageRuntimeVersion; ! } ! #else ! this.imageRuntimeVersion = TypeUtil.GetAssembly(typeof(object)).ImageRuntimeVersion; ! #endif } universe.RegisterDynamicAssembly(this); |
From: Jeroen F. <jfr...@us...> - 2016-07-01 05:15:24
|
Update of /cvsroot/ikvm/ikvm/reflect In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv30723 Modified Files: AssemblyName.cs CustomAttributeData.cs Enums.cs MarshalSpec.cs MethodSignature.cs Signature.cs StrongNameKeyPair.cs Type.cs Universe.cs Util.cs coreclr.cs Log Message: Added support for building against .NET Standard 1.3. Index: coreclr.cs =================================================================== RCS file: /cvsroot/ikvm/ikvm/reflect/coreclr.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** coreclr.cs 16 Feb 2015 12:24:28 -0000 1.1 --- coreclr.cs 1 Jul 2016 05:15:22 -0000 1.2 *************** *** 24,28 **** using System; ! #if CORECLR namespace System.Diagnostics { --- 24,28 ---- using System; ! #if CORECLR && !NETSTANDARD namespace System.Diagnostics { Index: Signature.cs =================================================================== RCS file: /cvsroot/ikvm/ikvm/reflect/Signature.cs,v retrieving revision 1.27 retrieving revision 1.28 diff -C2 -d -r1.27 -r1.28 *** Signature.cs 7 Jul 2015 07:42:00 -0000 1.27 --- Signature.cs 1 Jul 2016 05:15:22 -0000 1.28 *************** *** 466,470 **** --- 466,474 ---- bb.Write((byte)0x03); // THISCALL break; + #if NETSTANDARD + case (CallingConvention)5: + #else case CallingConvention.FastCall: + #endif bb.Write((byte)0x04); // FASTCALL break; Index: Util.cs =================================================================== RCS file: /cvsroot/ikvm/ikvm/reflect/Util.cs,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** Util.cs 16 Feb 2015 12:24:28 -0000 1.15 --- Util.cs 1 Jul 2016 05:15:22 -0000 1.16 *************** *** 264,266 **** --- 264,323 ---- } } + + static class TypeUtil + { + internal static bool IsEnum(System.Type type) + { + #if NETSTANDARD + return System.Reflection.IntrospectionExtensions.GetTypeInfo(type).IsEnum; + #else + return type.IsEnum; + #endif + } + + internal static System.Reflection.Assembly GetAssembly(System.Type type) + { + #if NETSTANDARD + return System.Reflection.IntrospectionExtensions.GetTypeInfo(type).Assembly; + #else + return type.Assembly; + #endif + } + + internal static System.Reflection.MethodBase GetDeclaringMethod(System.Type type) + { + #if NETSTANDARD + return System.Reflection.IntrospectionExtensions.GetTypeInfo(type).DeclaringMethod; + #else + return type.DeclaringMethod; + #endif + } + + internal static bool IsGenericType(System.Type type) + { + #if NETSTANDARD + return System.Reflection.IntrospectionExtensions.GetTypeInfo(type).IsGenericType; + #else + return type.IsGenericType; + #endif + } + + internal static bool IsGenericTypeDefinition(System.Type type) + { + #if NETSTANDARD + return System.Reflection.IntrospectionExtensions.GetTypeInfo(type).IsGenericTypeDefinition; + #else + return type.IsGenericTypeDefinition; + #endif + } + + internal static System.Type[] GetGenericArguments(System.Type type) + { + #if NETSTANDARD + return System.Reflection.IntrospectionExtensions.GetTypeInfo(type).GenericTypeArguments; + #else + return type.GetGenericArguments(); + #endif + } + } } Index: Enums.cs =================================================================== RCS file: /cvsroot/ikvm/ikvm/reflect/Enums.cs,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** Enums.cs 24 Oct 2012 17:08:07 -0000 1.12 --- Enums.cs 1 Jul 2016 05:15:22 -0000 1.13 *************** *** 42,45 **** --- 42,61 ---- } + #if NETSTANDARD + public enum AssemblyHashAlgorithm + { + None = 0, + MD5 = 0x8003, + SHA1 = 0x8004, + } + + public enum AssemblyVersionCompatibility + { + SameMachine = 1, + SameProcess = 2, + SameDomain = 3, + } + #endif + [Flags] public enum BindingFlags Index: Type.cs =================================================================== RCS file: /cvsroot/ikvm/ikvm/reflect/Type.cs,v retrieving revision 1.112 retrieving revision 1.113 diff -C2 -d -r1.112 -r1.113 *** Type.cs 1 Jul 2016 04:52:50 -0000 1.112 --- Type.cs 1 Jul 2016 05:15:22 -0000 1.113 *************** *** 407,414 **** --- 407,422 ---- break; case TypeAttributes.AutoClass: + #if NETSTANDARD + layout.CharSet = (CharSet)4; + #else layout.CharSet = CharSet.Auto; + #endif break; default: + #if NETSTANDARD + layout.CharSet = (CharSet)1; + #else layout.CharSet = CharSet.None; + #endif break; } *************** *** 587,591 **** throw new ArgumentNullException(); } ! if (System.Type.GetTypeCode(value.GetType()) != GetTypeCode(GetEnumUnderlyingType())) { throw new ArgumentException(); --- 595,599 ---- throw new ArgumentNullException(); } ! if (value.GetType() != __GetSystemType(GetTypeCode(GetEnumUnderlyingType()))) { throw new ArgumentException(); *************** *** 1647,1652 **** --- 1655,1665 ---- case TypeCode.Char: return typeof(System.Char); + #if NETSTANDARD + case (TypeCode)2: + return System.Type.GetType("System.DBNull", true); + #else case TypeCode.DBNull: return typeof(System.DBNull); + #endif case TypeCode.DateTime: return typeof(System.DateTime); *************** *** 1747,1751 **** --- 1760,1768 ---- else if (type == u.System_DBNull) { + #if NETSTANDARD + return (TypeCode)2; + #else return TypeCode.DBNull; + #endif } else if (type == u.System_Decimal) Index: StrongNameKeyPair.cs =================================================================== RCS file: /cvsroot/ikvm/ikvm/reflect/StrongNameKeyPair.cs,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** StrongNameKeyPair.cs 16 Feb 2015 12:24:28 -0000 1.8 --- StrongNameKeyPair.cs 1 Jul 2016 05:15:22 -0000 1.9 *************** *** 39,46 **** --- 39,48 ---- throw new ArgumentNullException("keyPairContainer"); } + #if !NETSTANDARD if (Universe.MonoRuntime && Environment.OSVersion.Platform == PlatformID.Win32NT) { throw new NotSupportedException("IKVM.Reflection does not support key containers when running on Mono"); } + #endif this.keyPairContainer = keyPairContainer; } Index: AssemblyName.cs =================================================================== RCS file: /cvsroot/ikvm/ikvm/reflect/AssemblyName.cs,v retrieving revision 1.35 retrieving revision 1.36 diff -C2 -d -r1.35 -r1.36 *** AssemblyName.cs 1 Jul 2016 04:51:51 -0000 1.35 --- AssemblyName.cs 1 Jul 2016 05:15:22 -0000 1.36 *************** *** 24,28 **** --- 24,30 ---- using System; using System.Globalization; + #if !NETSTANDARD using System.Configuration.Assemblies; + #endif using System.IO; using System.Security.Cryptography; Index: MarshalSpec.cs =================================================================== RCS file: /cvsroot/ikvm/ikvm/reflect/MarshalSpec.cs,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** MarshalSpec.cs 7 Jan 2013 11:57:04 -0000 1.17 --- MarshalSpec.cs 1 Jul 2016 05:15:22 -0000 1.18 *************** *** 31,38 **** --- 31,44 ---- using IKVM.Reflection.Metadata; + #if NETSTANDARD + // VarEnum, UnmanagedType.IDispatch and UnmanagedType.SafeArray are obsolete + #pragma warning disable 618 + #endif + namespace IKVM.Reflection { public struct FieldMarshal { + private const UnmanagedType UnmanagedType_CustomMarshaler = (UnmanagedType)0x2c; private const UnmanagedType NATIVE_TYPE_MAX = (UnmanagedType)0x50; public UnmanagedType UnmanagedType; *************** *** 106,110 **** } } ! else if (fm.UnmanagedType == UnmanagedType.CustomMarshaler) { blob.ReadCompressedUInt(); --- 112,116 ---- } } ! else if (fm.UnmanagedType == UnmanagedType_CustomMarshaler) { blob.ReadCompressedUInt(); *************** *** 211,215 **** } } ! else if (unmanagedType == UnmanagedType.CustomMarshaler) { bb.WriteCompressedUInt(0); --- 217,221 ---- } } ! else if (unmanagedType == UnmanagedType_CustomMarshaler) { bb.WriteCompressedUInt(0); Index: MethodSignature.cs =================================================================== RCS file: /cvsroot/ikvm/ikvm/reflect/MethodSignature.cs,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** MethodSignature.cs 1 May 2013 12:59:22 -0000 1.14 --- MethodSignature.cs 1 Jul 2016 05:15:22 -0000 1.15 *************** *** 166,170 **** --- 166,174 ---- break; case 0x04: // FASTCALL + #if NETSTANDARD + unmanagedCallingConvention = (System.Runtime.InteropServices.CallingConvention)5; + #else unmanagedCallingConvention = System.Runtime.InteropServices.CallingConvention.FastCall; + #endif unmanaged = true; break; Index: Universe.cs =================================================================== RCS file: /cvsroot/ikvm/ikvm/reflect/Universe.cs,v retrieving revision 1.80 retrieving revision 1.81 diff -C2 -d -r1.80 -r1.81 *** Universe.cs 21 Apr 2015 06:48:03 -0000 1.80 --- Universe.cs 1 Jul 2016 05:15:22 -0000 1.81 *************** *** 150,154 **** --- 150,156 ---- private bool resolveMissingMembers; private readonly bool enableFunctionPointers; + #if !CORECLR private readonly bool useNativeFusion; + #endif private readonly bool returnPseudoCustomAttributes; private readonly bool automaticallyProvideDefaultConstructor; *************** *** 212,216 **** --- 214,220 ---- this.options = options; enableFunctionPointers = (options & UniverseOptions.EnableFunctionPointers) != 0; + #if !CORECLR useNativeFusion = (options & UniverseOptions.DisableFusion) == 0 && GetUseNativeFusion(); + #endif returnPseudoCustomAttributes = (options & UniverseOptions.DisablePseudoCustomAttributeRetrieval) == 0; automaticallyProvideDefaultConstructor = (options & UniverseOptions.DontProvideAutomaticDefaultConstructor) == 0; *************** *** 218,221 **** --- 222,226 ---- } + #if !CORECLR private static bool GetUseNativeFusion() { *************** *** 231,234 **** --- 236,240 ---- } } + #endif internal Assembly Mscorlib *************** *** 520,524 **** private Type ImportImpl(System.Type type) { ! if (type.Assembly == typeof(IKVM.Reflection.Type).Assembly) { throw new ArgumentException("Did you really want to import " + type.FullName + "?"); --- 526,530 ---- private Type ImportImpl(System.Type type) { ! if (TypeUtil.GetAssembly(type) == TypeUtil.GetAssembly(typeof(IKVM.Reflection.Type))) { throw new ArgumentException("Did you really want to import " + type.FullName + "?"); *************** *** 552,556 **** else if (type.IsGenericParameter) { ! if (type.DeclaringMethod != null) { throw new NotImplementedException(); --- 558,562 ---- else if (type.IsGenericParameter) { ! if (TypeUtil.GetDeclaringMethod(type) != null) { throw new NotImplementedException(); *************** *** 561,567 **** } } ! else if (type.IsGenericType && !type.IsGenericTypeDefinition) { ! System.Type[] args = type.GetGenericArguments(); Type[] importedArgs = new Type[args.Length]; for (int i = 0; i < args.Length; i++) --- 567,573 ---- } } ! else if (TypeUtil.IsGenericType(type) && !TypeUtil.IsGenericTypeDefinition(type)) { ! System.Type[] args = TypeUtil.GetGenericArguments(type); Type[] importedArgs = new Type[args.Length]; for (int i = 0; i < args.Length; i++) *************** *** 571,575 **** return Import(type.GetGenericTypeDefinition()).MakeGenericType(importedArgs); } ! else if (type.Assembly == typeof(object).Assembly) { // make sure mscorlib types always end up in our mscorlib --- 577,581 ---- return Import(type.GetGenericTypeDefinition()).MakeGenericType(importedArgs); } ! else if (TypeUtil.GetAssembly(type) == TypeUtil.GetAssembly(typeof(object))) { // make sure mscorlib types always end up in our mscorlib *************** *** 579,583 **** { // FXBUG we parse the FullName here, because type.Namespace and type.Name are both broken on the CLR ! return ResolveType(Import(type.Assembly), type.FullName); } } --- 585,589 ---- { // FXBUG we parse the FullName here, because type.Namespace and type.Name are both broken on the CLR ! return ResolveType(Import(TypeUtil.GetAssembly(type)), type.FullName); } } *************** *** 606,610 **** if (fs != null) { ! fs.Close(); } } --- 612,616 ---- if (fs != null) { ! fs.Dispose(); } } Index: CustomAttributeData.cs =================================================================== RCS file: /cvsroot/ikvm/ikvm/reflect/CustomAttributeData.cs,v retrieving revision 1.61 retrieving revision 1.62 diff -C2 -d -r1.61 -r1.62 *** CustomAttributeData.cs 6 Apr 2015 07:06:31 -0000 1.61 --- CustomAttributeData.cs 1 Jul 2016 05:15:22 -0000 1.62 *************** *** 914,922 **** --- 914,930 ---- break; case ImplMapFlags.CharSetAuto: + #if NETSTANDARD + charSet = (System.Runtime.InteropServices.CharSet)4; + #else charSet = System.Runtime.InteropServices.CharSet.Auto; + #endif break; case ImplMapFlags.CharSetNotSpec: default: + #if NETSTANDARD + charSet = (System.Runtime.InteropServices.CharSet)1; + #else charSet = System.Runtime.InteropServices.CharSet.None; + #endif break; } *************** *** 928,932 **** --- 936,944 ---- break; case ImplMapFlags.CallConvFastcall: + #if NETSTANDARD + callingConvention = (System.Runtime.InteropServices.CallingConvention)5; + #else callingConvention = System.Runtime.InteropServices.CallingConvention.FastCall; + #endif break; case ImplMapFlags.CallConvStdcall: |
From: Jeroen F. <jfr...@us...> - 2016-07-01 04:52:52
|
Update of /cvsroot/ikvm/ikvm/reflect In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv29732 Modified Files: Missing.cs Type.cs Log Message: Added supported for cyclic TypeSpec. Index: Missing.cs =================================================================== RCS file: /cvsroot/ikvm/ikvm/reflect/Missing.cs,v retrieving revision 1.55 retrieving revision 1.56 diff -C2 -d -r1.55 -r1.56 *** Missing.cs 3 Nov 2015 09:10:24 -0000 1.55 --- Missing.cs 1 Jul 2016 04:52:50 -0000 1.56 *************** *** 400,403 **** --- 400,404 ---- private int flags; private bool cyclicTypeForwarder; + private bool cyclicTypeSpec; internal MissingType(Module module, Type declaringType, string ns, string name) *************** *** 622,625 **** --- 623,632 ---- } + internal override Type SetCyclicTypeSpec() + { + this.cyclicTypeSpec = true; + return this; + } + internal override bool IsBaked { *************** *** 637,640 **** --- 644,652 ---- get { return cyclicTypeForwarder; } } + + public override bool __IsCyclicTypeSpec + { + get { return cyclicTypeSpec; } + } } Index: Type.cs =================================================================== RCS file: /cvsroot/ikvm/ikvm/reflect/Type.cs,v retrieving revision 1.111 retrieving revision 1.112 diff -C2 -d -r1.111 -r1.112 *** Type.cs 3 Nov 2015 09:28:18 -0000 1.111 --- Type.cs 1 Jul 2016 04:52:50 -0000 1.112 *************** *** 2168,2171 **** --- 2168,2176 ---- } + internal virtual Type SetCyclicTypeSpec() + { + return this; + } + protected void MarkKnownType(string typeNamespace, string typeName) { *************** *** 2276,2279 **** --- 2281,2289 ---- get { return false; } } + + public virtual bool __IsCyclicTypeSpec + { + get { return false; } + } } *************** *** 3242,3246 **** internal static readonly Type Sentinel = new MarkerType(Signature.SENTINEL); internal static readonly Type Pinned = new MarkerType(Signature.ELEMENT_TYPE_PINNED); ! // used by ModuleReader.LazyForwardedType internal static readonly Type LazyResolveInProgress = new MarkerType(0xFF); --- 3252,3256 ---- internal static readonly Type Sentinel = new MarkerType(Signature.SENTINEL); internal static readonly Type Pinned = new MarkerType(Signature.ELEMENT_TYPE_PINNED); ! // used by ModuleReader.LazyForwardedType and TypeSpec resolution internal static readonly Type LazyResolveInProgress = new MarkerType(0xFF); |