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