# Thursday, 16 July 2009
« IKVM.Reflection.Emit Update | Main | Responsible Disclosure, Irresponsible Pa... »
New Development Snapshot

It's been a while since the previous snapshot, but I haven't been sitting around idle. Besides the fixes to IKVM.Reflection.Emit, which were part of secret prototype project I've been working on (and may or may not announce at some point in the future :-)), I've also been working on IKVM.NET itself.

I did a bunch of work to improve startup (at least for "core" classes). In particular, many scenarios should now be possible without initializing the reflection machinery.

Here are some examples:

 

IKVM 0.40

IKVM 0.41.3484

 

    x86 JIT

    x86 NGEN

            x86 JIT

    x86 NGEN

    2nd invocation

obj = Float.TYPE 12.4 1.56 0.280 0.0152 0.0041
System.out.println("Hello World") 275 12.8 114 8.90 0.0569
new StringBuffer() 129 10.8 6.34 0.0866 0.0041
Charset.forName("windows-1252") 267 13.7 77.4 7.87 0.0028


Times are in milliseconds and (except for the last column) show the time it takes to execute the code snippet on the left as the very first Java code in the process. I added the "2nd invocation" column to emphasize that these large times are due to JIT and/or initialization costs. Things have clearly improved, but it should also be clear that when you care about startup time, you really need to look into using NGEN.

I should point out that currently only the "windows-1252" (and UTF-8) charsets are eagerly constructed to avoid reflection, if you care about another charset, let me know and I will add it (unless your charset isn't in IKVM.OpenJDK.Core.dll, then you're out of luck.)

Changes:

  • More AWT/Swing work..
  • Removed more GNU Classpath remnants.
  • Added rmi stub generation to build process, instead of relying on .class files in stripped zip.
  • Added "RuntimeCompatibilityAttribute(WrapNonExceptionThrows = true)" to generated assemblies.
  • Added ikvmc warnings for VerificationError and ClassFormatError.
  • Added -baseaddress:<address> option to ikvmc.
  • Fixed ikvmc to skip empty lines in response file, instead of throwing an exception.
  • Split XML assembly into eight parts. Thanks to Michael Kay for helping out with this.
  • Changed build to put x86 specific binaries in bin-x86 directory and x64 specific binaries in bin-x64. jvm.dll is now always built in both flavors. Unfortunately, ikvm-native still needs to be built separately.
  • Split core library into several more assemblies.
  • Added step to build process to automatically compute a base address for core library assemblies. This should make ngen-ed images more efficient (if the images can be loaded at their preferred base addresses).
  • Added a mechanism to the build to prevent accidentally introducing new dependencies between the OpenJDK assemblies.
  • Fixed bug that caused startup properties set with ikvm.runtime.Startup.setProperties() to be forgotten when doing a System.setProperties(null).
  • Forked java.io.ObjectStreamField to make signature computation lazy.
  • Made ikvm.runtime.Util.getInstanceTypeFromClass() into an instrinsic, when used with a class literal.
  • Optimized class literals that reference statically compiled classes (at a slight cost to dynamically compiled classes).
  • Optimized primitive class literals.
  • Added codegen optimization for reading unsigned bytes from a byte array (buf[i] & 0xFF or buf[i] 0x0FFL).
  • Made callerID initialization lazy.
  • Forked sun/nio/cs/StandardCharsets.java to eagerly create MS1252 and UTF-8 charsets, to avoid reflection (at least in Western Europe, if you want another charset added, just let me know.)
  • Several other minor optimizations.

Binary available here: ikvmbin-0.41.3484.zip

Thursday, 16 July 2009 10:00:05 (W. Europe Daylight Time, UTC+02:00)  #    Comments [4]
Thursday, 16 July 2009 15:54:15 (W. Europe Daylight Time, UTC+02:00)
Looks like there is a nice JavaVM vs .NET book:
http://www.sourcestream.com/JavaDotNet/Chapter1.htm
http://www.sourcestream.com/JavaDotNet/Chapter2.htm
http://www.sourcestream.com/JavaDotNet/Chapter3.htm
....

:-)

only to mention.
Ken
Thursday, 16 July 2009 18:00:48 (W. Europe Daylight Time, UTC+02:00)
I think you're blog is read not only by Java people but Mono too, so you should redo your captcha to cover the latter too (I'm a part of them and had to surf on the Java docs to find it out...).
antimonio
Friday, 17 July 2009 10:16:34 (W. Europe Daylight Time, UTC+02:00)
It appears that JVM.dll and ikvm-native.dll only exist in the bin-x64 folder. Does it mean that they are no longer needed for 32-bit environments or are they just missing mistakenly?
Pat
Friday, 17 July 2009 10:28:04 (W. Europe Daylight Time, UTC+02:00)
I forgot to add the bin-x86 directory to my snapshot script. Thanks. I've updated the zip file.
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