# Wednesday, 11 October 2006
New Snapshot

New snapshot where I've reintroduced netmodule support. I think that was the final issue resulting from the assembly class loader architecture change, but, as always, I welcome feedback.

Changes:

  • Added modreq(IsVolatile) support for WHIDBEY target.
  • Fixed a bug in ikvmc's detection of incompatible assemblies (compiled with another version of ikvm).
  • Added support for specifying partial names in ikvmc -reference option (this is most useful for .NET Framework assemblies, e.g. you can now say -r:mscorlib).
  • Fixed NullReferenceException in AssemblyClassLoader when one of the referenced assemblies is not available.
  • Changed class.map and pkg.lst from resources to custom attributes, to better support modules that are merged together (WARNING: merging ikvmc generated modules with modules generated by other compiler is *not* supported)
  • Added support for multi-module assemblies (each module in a multi-module assembly can be written in a different language [but J# is still not suppored]).
  • Added optimization to ikvmc to seal private types that do not have subclasses.
  • Removed global DefineClass lock.
  • Constant fields no longer have a CLR backing field in dynamic mode.

Source is in cvs. Binaries: ikvmbin-0.31.2475.zip

Wednesday, 11 October 2006 07:35:48 (W. Europe Daylight Time, UTC+02:00)  #    Comments [0]
# Wednesday, 04 October 2006
New Snapshot

Yet another new snapshot.

Changes:

  • Fixed java.lang.Byte implementation of IFormattable to treat byte as a signed number.
  • Changed ikvm.lang.CIL boxing methods for built-in primitives to no longer do the actual boxing, but instead simply return the passed in value as another type, the call site will then do the boxing (if required).
  • Fixed field reflection to support overloaded field names.
  • Fixed a bunch of metadata regressions introduced in 0.31 with the changes made to final field handling.
  • Deprecated final fields that are compiled as properties now have the properties marked with ObsoleteAttribute.
  • Added support for encoding method/field signatures with types that look different in the Java world, but are actually the same in the CLR signatures (e.g. you can now have a method that takes or returns cli.System.Object or cli.System.Int32).

Source is in cvs. Binaries: ikvmbin-0.31.2468.zip

Wednesday, 04 October 2006 11:33:49 (W. Europe Daylight Time, UTC+02:00)  #    Comments [0]
# Monday, 02 October 2006
New Snapshot

Again, a new snapshot. This time with some new magic to make Java boxed primitives integrate a little better with .NET string formatting. The following code now produces the expected result:

class test
{
  public static void main(String[] args)
  {
    cli.System.Console.WriteLine("Java Magic = {0:X}", 0xCAFEBABE);
    cli.System.Console.WriteLine("Pi is approx. = {0:N2}", Math.PI);
  }
}

To enable this, the Java box classes have to implement IFormattable. I added support to the remapping infrastructure for this:

<class name="java.lang.Double">
  <implements class="cli.System.IFormattable">
    <method
     
name="ToString"
      sig="(Ljava.lang.String;Lcli.System.IFormatProvider;)Ljava.lang.String;">
      <redirect
        class="ikvm.internal.Formatter"
        type="static"
        name="ToString"
        sig="(Ljava.lang.Double;Ljava.lang.String;Lcli.System.IFormatProvider;)Ljava.lang.String;"
      />
    </method>
  </implements>
</
class>

The ToString helper method is trivial:

public static String ToString(Double d, String format, IFormatProvider provider)
{
  return ((IFormattable)CIL.box_double(d.doubleValue())).ToString(format, provider);
}

Note that from the Java side this is mostly invisible (the exception being that you can now cast a java.lang.Double to cli.System.IFormattable, even though the interface is not visible thru reflection).

Changes:

  • Added workaround for mono bug.
  • Added support for specifying java class names in map.xml attribute parameters of type System.Type.
  • Added support to remapping infrastructure for adding interfaces to classes (invisible to Java code).
  • Made java.lang.Byte, Short, Integer, Long, Float and Double implement IFormattable (privately, so this is invisible to Java code).

Source is in cvs. Binaries: ikvmbin-0.31.2466.zip

Monday, 02 October 2006 09:27:16 (W. Europe Daylight Time, UTC+02:00)  #    Comments [0]