# Monday, 27 December 2010
New Development Snapshot

Several IKVM bug fixes as well as more IKVM.Reflection bug fixes and a couple of new APIs for issues found by Marek during his Mono C# compiler work.

I've also modified the build process to generate a stub jar for the IKVM.NET specific Java APIs, to remove the need to run ikvmstub on IKVM.OpenJDK.Core.dll. The stubs are now available in the binaries zip file (ikvm/lib/ikvm-api.jar).

  • Fixed ikvmstub to not mark abstract methods as native.
  • Changed registry access (for java.util.prefs) on Windows to be more compatible with JDK and UAC aware.
  • Added support for encoding incorrect annotation values and reporting the exception back when the annotation is queried.
  • Fixed ikvmstub encoding of boolean annotation method defaults.
  • System.mapLibraryName() should throw NPE for null arg.
  • Ported parts of fdlibm to C# to use for StrictMath methods tan, cbrt, floor, pow, hypot, expm1 and log1p.
  • Several awt fixes.
  • Added ikvmstub -out: option and improved usage message.
  • Added ikvmstub -namespace: option to only process types in the specified namespace(s).
  • Generate lib/ikvm-api.jar to expose the ikvm API more easily to java code (by shipping this jar as part of ikvmbin.zip).
  • Fix for NullReferenceException in ClassLoaderWrapper.LoadGenericClass() if type parameter type cannot be loaded.
  • IKVM.Reflection: Delay creation of tokens for base type and interfaces until CreateType, to avoid problems when a non yet completely defined type is used as a base type or interface.
  • IKVM.Reflection: Don't clear properties and events fields during CreateType.
  • IKVM.Reflection: Call CreateType on TypeBuilder created by DefineInitializedData.
  • IKVM.Reflection: Emit Param table records is correct order.
  • IKVM.Reflection: HashAlgId in assembly manifest record turns out to be useless (SHA1 is always used).
  • IKVM.Reflection: Custom attributes applied to GenericTypeParameterBuilder were attached to the type token, instead of the type parameter token.
  • IKVM.Reflection: Added support for reading decimal parameter default values with ParamterInfo.RawDefaultValue.
  • IKVM.Reflection: Added support for emitting assemblies with non-existing cultures.
  • IKVM.Reflection: Fixed several ILGenerator bugs when __CleverExceptionBlockAssistance is used.
  • IKVM.Reflection: Removed NotImplementedException for unsorted GenericParam table, because we don't really care.
  • IKVM.Reflection: Exception block end label should be marked regardless of exception assistance mode.
  • IKVM.Reflection: The end label of an exception block should always be marked, because you can also backward branch to it.
  • IKVM.Reflection: Don't emit unnecessary leave instructions in "clever" mode.
  • IKVM.Reflection: Added ModuleBuilder.__AddAssemblyReference() API to explicitly add assembly references. This can be used in conjunction with AssemblyBuilder.__AddModule() to add the assemblies referenced by the module to the assembly manifest module. It's not clear to me whether this is required, but Microsoft does it and Assembly.GetReferencedAssemblies() only returns the assemblies referenced from the manifest module.
  • IKVM.Reflection: Added Module.__GetReferencedAssemblies() API.
  • IKVM.Reflection: Sort PropertyMap table. Not required by the spec, but .NET does it and Mono requires it.
  • IKVM.Reflection: Made CustomAttributeData more lazy (when all custom attributes are queried, regardless of type).
  • IKVM.Reflection: Added CustomAttributeData.__ReadTypeName() to get the type name without resolving it.
  • IKVM.Reflection: Fixed copy/paste bug in AssemblyBuilder.GetTypeImpl(). The modules list was iterated twice instead of looking through both modules and addedModules.
  • IKVM.Reflection: AssemblyResolve event should fire before resolving to AssemblyBuilder.
  • IKVM.Reflection: Don't create duplicate ClassLayout table records when using the DefineType overload that specifies the size and also applying a StructLayoutAttribute.

Binaries available here: ikvmbin-0.45.4013.zip

Monday, 27 December 2010 06:53:23 (W. Europe Standard Time, UTC+01:00)  #    Comments [0]
# Wednesday, 01 December 2010
New Development Snapshot

Several bug fixes. I also figured out a way to workaround an annoying .NET 4 x64 JIT bug without any significant performance impact. Marek Safar has started on porting gmcs to IKVM.Reflection and that triggered some IKVM.Reflection bug fixes and improvements.

  • Fixed regression in Throwable.printStackTrace(). Exception cause in stack trace should use Throwable.toString() not System.Exception.ToString().
  • Add support for serializing .NET exceptions in Java. We don't serialize the actual object, but a placeholder instead, to avoid having to implement full .NET serialization interop.
  • File.lastModified() should return 0 for non-existing files. Fix for #3111432. Thanks to Stephen White for the patch.
  • Added workaround for .NET 4 x64 JIT bug.
  • Optimized thread creation.
  • Optimized ProtectionDomains created for .NET assemblies to be more lazy.
  • Made assembly Java class loader construction lazy.
  • Removed trace messages that don't add much value but do cause the tracer to needlessly read configuration data early in initialization.
  • Fixed AccessController.doPrivileged() bug that caused context to be ignored.
  • Removed implementation specific methods from top of stack trace for threads started from Java.
  • UnauthorizedAccessException caused by already existing file or directory should cause createFileExclusively() to return false instead of throwing an exception.
  • File.canWrite() should always return true for directories (on Windows).
  • Fixed regression. Don't call GetIPv6Properties() if IPv6 isn't available.
  • AWT fixes.
  • IKVM.Reflection: Added IKVM.Reflection.Missing type. Thanks to Marek Safar for pointing this out.
  • IKVM.Reflection: Fixed ParameterInfo.RawDefaultValue to return Missing.Value if the parameter is optional, but doesn't have a default and to return null, if the parameter isn't optional (and doesn't have a default).
  • IKVM.Reflection: Added AssemblyBuilder.__DefineIconResource() API.
  • Added -win32icon:<file> option to ikvmc.
  • IKVM.Reflection: Added ModuleBuilder.__Save() to support -target:module option better.
  • Changed ikvmc to use new ModuleBuilder.__Save() instead of workaround of deleting the manifest module after saving the assembly.
  • Added support for assembly custom attributes in combination with -target:module.
  • IKVM.Reflection: Added AssemblyBuilder.__AddModule() to allow pre-existing modules to be linked in.
  • IKVM.Reflection: Fixed RawModule.GetReferencedAssemblies() to work for non-manifest modules as well.
  • IKVM.Reflection: Added API to query placeholder assembly custom attributes in a module.
  • Fixed Thread.stop() race condition.
  • Implemented java.awt.Font.createFont().
  • Fixed .NET 4 security attribute regressions.

Binaries available here: ikvmbin-0.45.3987.zip

Wednesday, 01 December 2010 09:46:41 (W. Europe Standard Time, UTC+01:00)  #    Comments [0]