# Tuesday, 24 March 2015
« IKVM.NET 8.0 Release Candidate 1 | Main | New Development Snapshot »
New Development Snapshot

After debugging a stack overflow caused by a weird class loader, I decided to make the runtime more robust against this and as a side effect I added the ability to disable eager class loading. This in turn made it easier to test the late binding infrastructure (which is used when a class is not yet available while a method is compiled) and that testing revealed a large number of bugs that have now been fixed.

Changes:

  • Bug fix. When -Xsave is used the modopt types should be attached to unloadable types in inherited method signatures.
  • Bug fix. Don't try to get constructor on generic instantiation containing a TypeBuilder generic parameter.
  • Use the last write time of the input file for resources read from the file system.
  • Enable UniverseOptions.DeterministicOutput for ikvmc (unless -debug option is used).
  • Copy timestamps from source files for generated files that end up in resources.jar.
  • The zip file timestamp is in local time, but for deterministic builds we don't want to depend on system timezone, so we have to store the UTC time.
  • Bug fix. Removed legacy (incorrect) array assignability check that compensated for the lack of ghost array typing. This should have been removed when ghost array tagging was introduced.
  • Bug fix. Verifier should disallow using invokeinterface on private methods.
  • The message of a VM generated java.lang.NoClassDefFoundError exception should be the class name, not the message of the underlying exception.
  • Bug fix. Don't crash if java.lang.invoke.LambdaMetafactory class is not loadable.
  • Added Unsafe.reallocateMemory() and fixed allocateMemory() to do nothing if zero length is allocated.
  • Bug fix. Return background color (instead of foreground color). Fix by Daniel Zatonyi .
  • Bug fix. Dynamically created ghost arrays should get tagged.
  • Bug fix. When catching a dynamically loaded .NET exception type the exception should not be remapped.
  • Bug fix. Bootstrap classes that use .NET types in their signatures should be accessible via MethodHandles.
  • Bug fix. Allow MethodHandle for cli.System.Object methods to work on (Java compatble) arrays to handle a hole in the type system.
  • Bug fix. Handle unloadable types in interface stub signatures.
  • Bug fix. MethodHandle and JNI should be able to set static final fields.
  • Bug fix. If a miranda method signature differs from its base class miranda method (due to unloadable types), we need to emit an override stub.
  • Bug fix. Allow value type default constructor to be invoked using MethodHandle.
  • Bug fix. Allow invokedynamic with unloadable type in signature.
  • Bug fix. Handle late-bound MethodHandle.invokeExact() with unloadable type in signature.
  • Bug fix. Late bound instanceof and castclass should behave the same as regular versions (with respect to type system holes caused by .NET types).
  • Bug fix. MethodHandle interface method lookup should support methods inherited from base interfaces.
  • Bug fix. Late bound delegate signature conversion should use explicitCastArguments instead of asType to handle varargs correctly.
  • Implemented delegate constructor invocation on existing object (to enable MethodHandle to construct a delegate).
  • Bug fix. Handle unloadable return type in native method signature.
  • Bug fix. Handle unloadable types in native method signature in JniProxyBuilder (used when -Xsave is used).
  • Bug fix. Late bound invokespecial should also be handled in local variable analysis.
  • Bug fix. Handle unloadable type in BSM extra arguments.
  • Bug fix. Verifier would incorrectly report a loader constraints violated if a field type was not unloadable, but the field ref type was unloadable.
  • Bug fix. Make sure declaring class is loadable.
  • Bug fix. Try loading unloadable declared classes instead of simply throwing a NoClassDefFoundError.
  • Bug fix. Make sure inner classes are loadable.
  • Bug fix. Disallow invokevirtual MH constant to resolve to interface method and disallow invokeinterface MH constant to resolve to non-public method.
  • Bug fix. Handle unloadable type in MH.invoke() signature.
  • Bug fix. Handle invocation of method on unloadable value type.
  • Bug fix. Handle ghost and value types in override stub signatures.
  • Added a hack to the deprecated Reflection.getCallerClass(int) version to skip LamdbaForm methods to report the right caller when dynamic binding is used.
  • Bug fix. Dynamica caller id should return host class for anonymous classes injected into host class.
  • Avoid infinite recursion if (broken) class loader triggers a load of a class currently being finished.
  • Added environment switch IKVM_DISABLE_EAGER_CLASS_LOADING to enable testing late binding.
  • IKVM.Reflection: Added CoreCLR target.
  • IKVM.Reflection: Fixed ModuleBuilder.DefineManifestResource() to support very large resources.
  • IKVM.Reflection: Added new public API ModuleBuilder.__PEHeaderTimeDateStamp property.
  • IKVM.Reflection: Added UniverseOptions.DeterministicOutput to enable deterministic output (i.e. setting the PE file header time stamp to zero and computing the module version id based on the contents, instead of using a random guid).

Binaries available here: ikvmbin-8.1.5561.zip

Tuesday, 24 March 2015 14:43:45 (W. Europe Standard Time, UTC+01:00)  #    Comments [2]
Tuesday, 07 April 2015 14:14:05 (W. Europe Daylight Time, UTC+02:00)
hi,

many thanks for the great Job.


i'm using ikvm to include a small Java Project into a bigger Visualstudio 2013 solution. After a Java update to 1.8 and using your lates dev build i'm able to compile the jar file with ikvmc.

using "-sharedclassfolder"

Building jar: D:\Tools\Development\Java\CorvilApi\dist\CorvilApi.jar
To run this application from the command line without Ant, try:
java -jar "D:\Tools\Development\Java\CorvilApi\dist\CorvilApi.jar"
IKVM.NET Compiler version 8.1.5561.0
Copyright (C) 2002-2015 Jeroen Frijters
http://www.ikvm.net/

note IKVMC0002: Output file is "CorvilApi.dll"
jar:
BUILD SUCCESSFUL (total time: 7 seconds)

--------------------------------------------ERROR ----------------------------------------

the compile runs smooth but executing code within the dll results in the following error

java.lang.ClassCastException: Unable to cast object of type 'java.util.PropertyResourceBundle' to type 'sun.util.resources.OpenListResourceBundle'.

------------------------------------------End Error -----------------------------------------

any idea.

Juergen
Juergen
Tuesday, 07 April 2015 14:25:16 (W. Europe Daylight Time, UTC+02:00)
The comments are not for support questions, but your problem is caused by not copying all the required IKVM.OpenJDK.*.dll files.
Jeroen Frijters
Name
E-mail
Home page

I apologize for the lameness of this, but the comment spam was driving me nuts. In order to be able to post a comment, you need to answer a simple question. Hopefully this question is easy enough not to annoy serious commenters, but hard enough to keep the spammers away.

Anti-Spam Question: What method on java.lang.System returns an object's original hashcode (i.e. the one that would be returned by java.lang.Object.hashCode() if it wasn't overridden)? (case is significant)

Answer:  
Comment (HTML not allowed)  

Live Comment Preview