VM Interface

Just a quick post to mention some changes I’ve been working on for IcedTea (the JDK 7 tree) and finally committed last night:

  • The build is now based around OpenJDK b33 (just as b34 is posted…). Such an update has been delayed, due firstly to CORBA build issues with b32 and then issues with javah and the new Java-based NIO generator in b33.
  • You can now build against something other than the JDK tree by using --enable-hg and --with-project. Current values for –with-project are caciocavallo, closures, cvmi and bsd.

Happy hacking :)

While working out where the class library makes calls to the VM can be tricky at times, such points are usually well-delimited (e.g. all in jvm.h in OpenJDK as we saw last time) and there are a variety of clues to help find them. Firstly, if a non-Java VM is in use, then the possible VM-utilising methods is already limited to those that are declared native. Secondly, failures in this area usually produce clear runtime errors such as linking errors (e.g. libjava.so can’t resolve the symbol JVM_IHashCode on loading). Thus, the main issues to deal with are usually ‘what should this method do?’ and ‘what state(s) can I expect this method to be executed from?’.

Library calls made from the VM are much more subtle. First of all, they of course vary from VM to VM. Some VMs may choose to call up to the library much more often than others. Certainly, this will be the case with a Java-based VM where the boundaries between the two are less clear, being delimited by packages rather than language/linking boundaries (though this also applies a little in the opposite direction too). Over the past few weeks, I’ve been attempting to get JamVM to run with the OpenJDK class library, simply by swapping glibj.zip from GNU Classpath for the rt.jar from OpenJDK*. This has revealed a number of cases where both JamVM and HotSpot call methods in their corresponding class libraries and thus depend on their presence.

As mentioned briefly last time, one of the first things I noticed was that it was assumed that the VM boot process would link libjava.so. As CACAO has also done, I had to add this to JamVM’s boot process in initialiseNatives.
Another area where a unspoken relationship between the VM and the class library exists is in the 1.4 JNI NIO support. The VM needs to be able to create a java.nio.DirectByteBuffer which maps onto a native buffer underneath. Both OpenJDK/HotSpot and GNU Classpath/JamVM do this in a similar way, but there are two notable differences between them:

  1. JamVM relies on GNU Classpath’s java.nio.DirectByteBufferImpl$ReadWrite class, which doesn’t exist on OpenJDK. Sun’s implementation is simply java.nio.DirectByteBuffer.
  2. The pointer to the buffer is passed from HotSpot to the OpenJDK class library as a jlong (a Java long, not to be confused with a C long, which may vary in size; Java longs are always 64-bit). GNU Classpath encapsulates pointers in a wrapper class called either Pointer32 or Pointer64, both of which have the common superclass of gnu.classpath.Pointer. This has the advantage of making it clearer that the number being stored is a pointer, with the disadvantage of having to create an object instance.

For now, I’ve altered JamVM to use the OpenJDK/HotSpot way of doing things, but it may be worth providing a Pointer class in OpenJDK, as it does have safety advantages. The only other minor difference is that the GNU Classpath constructor seems to take a few more arguments, but the same values were being provided by both JamVM and the superconstructor call in the OpenJDK class library.

Both issues highlighted so far have fairly trivial solutions and involve minimal interaction between the VM and class library. However, the biggest interaction point between the two is at boot-time. It is the VM that is started by the user (or in the case of OpenJDK, the launcher which then starts the VM via JNI). However, the actual code needs to be executing with direct reference to the class library, not the VM. This, again, differs between native and non-native VMs, where the former have to also make the switch from native code to Java code before the user code can be executed.

The runtime overview of HotSpot, provided by the HotSpot team, provides a good overview of the boot process from HotSpot’s perspective, although it doesn’t go into full detail on the interaction with the class library. Here, we concern ourselves mainly with the call to JNI_CreateJavaVM by the launcher, which takes us into src/share/vm/prims/jni.cpp in the HotSpot VM, and the class and thread initialisation that follows.

Most of the work (2-12) actually goes on in src/share/vm/runtime/thread.cpp and the create_vm method. The main part of this which is of interest for VM–>library interaction is the process by which the native OS thread is linked to a java.lang.Thread object. HotSpot makes three calls to the class library:

  1. (create_initial_thread_group) It creates an instance of java.lang.ThreadGroup using its no-arg constructor. This constructor is private and so can only be accessed by HotSpot for this purpose. This default constructor creates the root thread group, “system”.
  2. (create_initial_thread_group) It creates another java.lang.ThreadGroup instance using the public constructor which takes a parent group and a name. It uses this to create a child of “system” called “main”.
  3. (create_initial_thread) Calls the public constructor of java.lang.Thread to create a thread in the “main” group with the name “main”.

Apart from this, it initialises several core classes including java.lang.String, java.lang.reflect.Method, java.lang.ref.Finalizer and java.lang.Class, along with a number of exception and error classes such as java.lang.OutOfMemoryError. Additional classes are initialised if some options are enabled, such as java.util.HashMap if aggressive optimisations are turned on.

Although parts of this are specific to HotSpot, there is an implicit assumption in the class library that, for example, certain classes will have been initialised before the VM is fully operational. Thus another implementing VM has to do the same, calling the same internal methods such as the private thread group constructor described above. GNU Classpath has similar requirements, and in both cases, it is important we make such requirements explicit.

Note that GNU Classpath’s handling of threads differs considerably and I think there is some room for improvement here. JamVM does not pass or create any thread groups. An internal constructor expects a java.lang.VMThread which is then stored in java.lang.Thread and used for later calls such as start. Notably, the VM has to remember to set the group after the constructor concludes, and the hierarchy is different; GNU Classpath provides a root group called “main” which is created on java.lang.Thread class initialisation and JamVM places the main thread in that. There is no “system” group.

Both solutions leave the management of the thread itself to the VM, and it’s hard to see what the advantage is of GNU Classpath storing the VMThread. Calling general VMThread methods with the Thread instance may be a better solution. Where possible, general work should be taken off the VM and into the class library, and so it would be better if the group addition was handled by the constructor of Thread rather than relying on the VM to remember to do it.

I’d welcome comments on how different VMs handle this bootup process and what is the best solution for ensuring that the method contract between VM and class library is well documented and adhered to.

* Note that this means we still JamVM as the launcher for now. CACAO’s OpenJDK implementation takes a different approach with CACAO merely providing a replacement libjvm.so into a JDK tree and thus using the same launcher as HotSpot.

The biggest difference between the GNU Classpath and Sun OpenJDK VM interfaces is the point at which control shifts from the library to the virtual machine. Both solutions do provide separation between the library and the VM. Contrary to what may be initially assumed, this is true of OpenJDK even though both HotSpot and the JDK are maintained in the same location. This is what allows different versions of HotSpot to be swapped in, as mentioned in the OpenJDK trademark license. That said, there are likely to be closer ties between the JDK within OpenJDK and HotSpot than there are between GNU Classpath and any of its VMs, simply because of the number of and variance between the latter.

OpenJDK’s VM interface is entirely C-based. The class library calls into the VM using a number of functions with the prefix ‘JVM_’ that are listed in src/share/javavm/export/jvm.h. Implementations of these functions can be found both in HotSpot’s src/share/vm/prims/jvm.cpp and CACAO’s src/native/vm/openjdk/jvm.c. These are dynamically linked in at runtime for a variety of dynamic libraries held in jre/lib/${arch} where ${arch} is the architecture in use such as amd64. The output below shows their use in the recent b31 drop:

Checking build/linux-amd64/j2sdk-image/jre/lib/amd64/libjava.so...
                 U JVM_ActiveProcessorCount@@SUNWprivate_1.1
                 U JVM_ArrayCopy@@SUNWprivate_1.1
                 U JVM_AssertionStatusDirectives@@SUNWprivate_1.1
                 U JVM_Available@@SUNWprivate_1.1
                 U JVM_ClassDepth@@SUNWprivate_1.1
                 U JVM_ClassLoaderDepth@@SUNWprivate_1.1
                 U JVM_Clone@@SUNWprivate_1.1
                 U JVM_Close@@SUNWprivate_1.1
                 U JVM_CompileClass@@SUNWprivate_1.1
                 U JVM_CompileClasses@@SUNWprivate_1.1
                 U JVM_CompilerCommand@@SUNWprivate_1.1
                 U JVM_ConstantPoolGetClassAt@@SUNWprivate_1.1
                 U JVM_ConstantPoolGetClassAtIfLoaded@@SUNWprivate_1.1
                 U JVM_ConstantPoolGetDoubleAt@@SUNWprivate_1.1
                 U JVM_ConstantPoolGetFieldAt@@SUNWprivate_1.1
                 U JVM_ConstantPoolGetFieldAtIfLoaded@@SUNWprivate_1.1
                 U JVM_ConstantPoolGetFloatAt@@SUNWprivate_1.1
                 U JVM_ConstantPoolGetIntAt@@SUNWprivate_1.1
                 U JVM_ConstantPoolGetLongAt@@SUNWprivate_1.1
                 U JVM_ConstantPoolGetMemberRefInfoAt@@SUNWprivate_1.1
                 U JVM_ConstantPoolGetMethodAt@@SUNWprivate_1.1
                 U JVM_ConstantPoolGetMethodAtIfLoaded@@SUNWprivate_1.1
                 U JVM_ConstantPoolGetSize@@SUNWprivate_1.1
                 U JVM_ConstantPoolGetStringAt@@SUNWprivate_1.1
                 U JVM_ConstantPoolGetUTF8At@@SUNWprivate_1.1
                 U JVM_CountStackFrames@@SUNWprivate_1.1
                 U JVM_CurrentClassLoader@@SUNWprivate_1.1
                 U JVM_CurrentLoadedClass@@SUNWprivate_1.1
                 U JVM_CurrentThread@@SUNWprivate_1.1
                 U JVM_CurrentTimeMillis@@SUNWprivate_1.1
                 U JVM_DefineClassWithSource@@SUNWprivate_1.1
                 U JVM_DesiredAssertionStatus@@SUNWprivate_1.1
                 U JVM_DisableCompiler@@SUNWprivate_1.1
                 U JVM_DoPrivileged@@SUNWprivate_1.1
                 U JVM_DumpThreads@@SUNWprivate_1.1
                 U JVM_EnableCompiler@@SUNWprivate_1.1
                 U JVM_FillInStackTrace@@SUNWprivate_1.1
                 U JVM_FindClassFromClassLoader@@SUNWprivate_1.1
                 U JVM_FindLibraryEntry@@SUNWprivate_1.1
                 U JVM_FindLoadedClass@@SUNWprivate_1.1
                 U JVM_FindPrimitiveClass@@SUNWprivate_1.1
                 U JVM_FindSignal@@SUNWprivate_1.1
                 U JVM_FreeMemory@@SUNWprivate_1.1
                 U JVM_GC@@SUNWprivate_1.1
                 U JVM_GetAllThreads@@SUNWprivate_1.1
                 U JVM_GetArrayElement@@SUNWprivate_1.1
                 U JVM_GetArrayLength@@SUNWprivate_1.1
                 U JVM_GetCallerClass@@SUNWprivate_1.1
                 U JVM_GetClassAccessFlags@@SUNWprivate_1.1
                 U JVM_GetClassAnnotations@@SUNWprivate_1.1
                 U JVM_GetClassConstantPool@@SUNWprivate_1.1
                 U JVM_GetClassContext@@SUNWprivate_1.1
                 U JVM_GetClassDeclaredConstructors@@SUNWprivate_1.1
                 U JVM_GetClassDeclaredFields@@SUNWprivate_1.1
                 U JVM_GetClassDeclaredMethods@@SUNWprivate_1.1
                 U JVM_GetClassInterfaces@@SUNWprivate_1.1
                 U JVM_GetClassLoader@@SUNWprivate_1.1
                 U JVM_GetClassModifiers@@SUNWprivate_1.1
                 U JVM_GetClassName@@SUNWprivate_1.1
                 U JVM_GetClassSignature@@SUNWprivate_1.1
                 U JVM_GetClassSigners@@SUNWprivate_1.1
                 U JVM_GetComponentType@@SUNWprivate_1.1
                 U JVM_GetDeclaredClasses@@SUNWprivate_1.1
                 U JVM_GetDeclaringClass@@SUNWprivate_1.1
                 U JVM_GetEnclosingMethodInfo@@SUNWprivate_1.1
                 U JVM_GetInheritedAccessControlContext@@SUNWprivate_1.1
                 U JVM_GetInterfaceVersion@@SUNWprivate_1.1
                 U JVM_GetLastErrorString@@SUNWprivate_1.1
                 U JVM_GetPrimitiveArrayElement@@SUNWprivate_1.1
                 U JVM_GetProtectionDomain@@SUNWprivate_1.1
                 U JVM_GetStackAccessControlContext@@SUNWprivate_1.1
                 U JVM_GetStackTraceDepth@@SUNWprivate_1.1
                 U JVM_GetStackTraceElement@@SUNWprivate_1.1
                 U JVM_GetSystemPackage@@SUNWprivate_1.1
                 U JVM_GetSystemPackages@@SUNWprivate_1.1
                 U JVM_Halt@@SUNWprivate_1.1
                 U JVM_HoldsLock@@SUNWprivate_1.1
                 U JVM_IHashCode@@SUNWprivate_1.1
                 U JVM_InitProperties@@SUNWprivate_1.1
                 U JVM_InternString@@SUNWprivate_1.1
                 U JVM_Interrupt@@SUNWprivate_1.1
                 U JVM_InvokeMethod@@SUNWprivate_1.1
                 U JVM_IsArrayClass@@SUNWprivate_1.1
                 U JVM_IsInterface@@SUNWprivate_1.1
                 U JVM_IsInterrupted@@SUNWprivate_1.1
                 U JVM_IsNaN@@SUNWprivate_1.1
                 U JVM_IsPrimitiveClass@@SUNWprivate_1.1
                 U JVM_IsSupportedJNIVersion@@SUNWprivate_1.1
                 U JVM_IsThreadAlive@@SUNWprivate_1.1
                 U JVM_LatestUserDefinedLoader@@SUNWprivate_1.1
                 U JVM_LoadLibrary@@SUNWprivate_1.1
                 U JVM_Lseek@@SUNWprivate_1.1
                 U JVM_MaxMemory@@SUNWprivate_1.1
                 U JVM_MaxObjectInspectionAge@@SUNWprivate_1.1
                 U JVM_MonitorNotify@@SUNWprivate_1.1
                 U JVM_MonitorNotifyAll@@SUNWprivate_1.1
                 U JVM_MonitorWait@@SUNWprivate_1.1
                 U JVM_NanoTime@@SUNWprivate_1.1
                 U JVM_NativePath@@SUNWprivate_1.1
                 U JVM_NewArray@@SUNWprivate_1.1
                 U JVM_NewInstanceFromConstructor@@SUNWprivate_1.1
                 U JVM_NewMultiArray@@SUNWprivate_1.1
                 U JVM_Open@@SUNWprivate_1.1
                 U JVM_RaiseSignal@@SUNWprivate_1.1
                 U JVM_Read@@SUNWprivate_1.1
                 U JVM_RegisterSignal@@SUNWprivate_1.1
                 U JVM_ResolveClass@@SUNWprivate_1.1
                 U JVM_ResumeThread@@SUNWprivate_1.1
                 U JVM_SetArrayElement@@SUNWprivate_1.1
                 U JVM_SetClassSigners@@SUNWprivate_1.1
                 U JVM_SetLength@@SUNWprivate_1.1
                 U JVM_SetPrimitiveArrayElement@@SUNWprivate_1.1
                 U JVM_SetProtectionDomain@@SUNWprivate_1.1
                 U JVM_SetThreadPriority@@SUNWprivate_1.1
                 U JVM_Sleep@@SUNWprivate_1.1
                 U JVM_StartThread@@SUNWprivate_1.1
                 U JVM_StopThread@@SUNWprivate_1.1
                 U JVM_SupportsCX8@@SUNWprivate_1.1
                 U JVM_SuspendThread@@SUNWprivate_1.1
                 U JVM_Sync@@SUNWprivate_1.1
                 U JVM_TotalMemory@@SUNWprivate_1.1
                 U JVM_TraceInstructions@@SUNWprivate_1.1
                 U JVM_TraceMethodCalls@@SUNWprivate_1.1
                 U JVM_UnloadLibrary@@SUNWprivate_1.1
                 U JVM_Write@@SUNWprivate_1.1
                 U JVM_Yield@@SUNWprivate_1.1
Checking build/linux-amd64/j2sdk-image/jre/lib/amd64/libmanagement.so...
                 U JVM_ActiveProcessorCount@@SUNWprivate_1.1
                 U JVM_GetAllThreads@@SUNWprivate_1.1
                 U JVM_GetManagement@@SUNWprivate_1.1
Checking build/linux-amd64/j2sdk-image/jre/lib/amd64/libnet.so...
                 U JVM_Connect@@SUNWprivate_1.1
                 U JVM_CurrentTimeMillis@@SUNWprivate_1.1
                 U JVM_FindLibraryEntry@@SUNWprivate_1.1
                 U JVM_GetHostName@@SUNWprivate_1.1
                 U JVM_GetSockName@@SUNWprivate_1.1
                 U JVM_GetSockOpt@@SUNWprivate_1.1
                 U JVM_InitializeSocketLibrary@@SUNWprivate_1.1
                 U JVM_Listen@@SUNWprivate_1.1
                 U JVM_Send@@SUNWprivate_1.1
                 U JVM_SetSockOpt@@SUNWprivate_1.1
                 U JVM_Socket@@SUNWprivate_1.1
                 U JVM_SocketAvailable@@SUNWprivate_1.1
                 U JVM_SocketClose@@SUNWprivate_1.1
                 U JVM_SocketShutdown@@SUNWprivate_1.1
Checking build/linux-amd64/j2sdk-image/jre/lib/amd64/librmi.so...
                 U JVM_LatestUserDefinedLoader@@SUNWprivate_1.1
Checking build/linux-amd64/j2sdk-image/jre/lib/amd64/libverify.so...
                 U JVM_FindClassFromClass@@SUNWprivate_1.1
                 U JVM_GetCPClassNameUTF@@SUNWprivate_1.1
                 U JVM_GetCPFieldClassNameUTF@@SUNWprivate_1.1
                 U JVM_GetCPFieldModifiers@@SUNWprivate_1.1
                 U JVM_GetCPFieldSignatureUTF@@SUNWprivate_1.1
                 U JVM_GetCPMethodClassNameUTF@@SUNWprivate_1.1
                 U JVM_GetCPMethodModifiers@@SUNWprivate_1.1
                 U JVM_GetCPMethodNameUTF@@SUNWprivate_1.1
                 U JVM_GetCPMethodSignatureUTF@@SUNWprivate_1.1
                 U JVM_GetClassCPEntriesCount@@SUNWprivate_1.1
                 U JVM_GetClassCPTypes@@SUNWprivate_1.1
                 U JVM_GetClassFieldsCount@@SUNWprivate_1.1
                 U JVM_GetClassMethodsCount@@SUNWprivate_1.1
                 U JVM_GetClassNameUTF@@SUNWprivate_1.1
                 U JVM_GetFieldIxModifiers@@SUNWprivate_1.1
                 U JVM_GetMethodIxArgsSize@@SUNWprivate_1.1
                 U JVM_GetMethodIxByteCode@@SUNWprivate_1.1
                 U JVM_GetMethodIxByteCodeLength@@SUNWprivate_1.1
                 U JVM_GetMethodIxExceptionIndexes@@SUNWprivate_1.1
                 U JVM_GetMethodIxExceptionTableEntry@@SUNWprivate_1.1
                 U JVM_GetMethodIxExceptionTableLength@@SUNWprivate_1.1
                 U JVM_GetMethodIxExceptionsCount@@SUNWprivate_1.1
                 U JVM_GetMethodIxLocalsCount@@SUNWprivate_1.1
                 U JVM_GetMethodIxMaxStack@@SUNWprivate_1.1
                 U JVM_GetMethodIxModifiers@@SUNWprivate_1.1
                 U JVM_GetMethodIxNameUTF@@SUNWprivate_1.1
                 U JVM_GetMethodIxSignatureUTF@@SUNWprivate_1.1
                 U JVM_IsConstructorIx@@SUNWprivate_1.1
                 U JVM_IsInterface@@SUNWprivate_1.1
                 U JVM_IsSameClassPackage@@SUNWprivate_1.1
                 U JVM_ReleaseUTF@@SUNWprivate_1.1
Checking build/linux-amd64/j2sdk-image/jre/lib/amd64/libzip.so...
                 U JVM_Close@@SUNWprivate_1.1
                 U JVM_GetLastErrorString@@SUNWprivate_1.1
                 U JVM_Lseek@@SUNWprivate_1.1
                 U JVM_NativePath@@SUNWprivate_1.1
                 U JVM_Open@@SUNWprivate_1.1
                 U JVM_RawMonitorCreate@@SUNWprivate_1.1
                 U JVM_RawMonitorDestroy@@SUNWprivate_1.1
                 U JVM_RawMonitorEnter@@SUNWprivate_1.1
                 U JVM_RawMonitorExit@@SUNWprivate_1.1

Clearly most of these are found in libjava.so, which is the library that contains the native code for the core classes like those in java.lang. What’s interesting about libjava is that, unlike for example libnet, it isn’t loaded via a call to LoadLibrary in the class library code. Rather, it is expected that the VM will know about and load this. In CACAO, a special OpenJDK case is provided in src/native/vm/nativevm.c to handle this. This needs to happen early in the VM initialisation process before any of the native calls in the core classes are used.

In contrast, GNU Classpath interacts with the VM while still at the Java level. Each call which may need to go to the VM is first handed off to a package-private VM class, for example vm/reference/java/lang/VMObject.java provides methods like wait() and notify(). The reference version of these classes tend to do what the OpenJDK classes do in the original classes like java.lang.Object; define the methods as native. However, a VM can replace these VM* classes as needed. Some are mandatory, as it isn’t possible to provide a generic reference implementation in the class library. In both cases, missing implementations are visible through linking errors at runtime.

To further clarify the difference, let’s trace the path of one such function, java.lang.Object#wait(). In GNU Classpath, java.lang.Object defines it as:

  public final void wait()
    throws IllegalMonitorStateException, InterruptedException
    VMObject.wait(this, 0, 0);

in java/lang/Object.java. In the reference version of VMObject.java, we find:

  static native void wait(Object o, long ms, int ns)
    throws IllegalMonitorStateException, InterruptedException;

In some cases, there is also a reference native implementation under native/jni/${package name}/${package_name}_${class_name}.c (native/jni/java-lang/java_lang_VMObject.c in this case), but this isn’t the case here. Instead, we look to CACAO and find this in src/native/vm/gnuclasspath/java_lang_VMObject.cpp:

JNIEXPORT void JNICALL Java_java_lang_VMObject_wait(JNIEnv *env, jclass clazz, java_lang_Object *o, int64_t ms, int32_t ns)

How about for OpenJDK? Again, we start in java.lang.Object and find this in src/share/classes/java/lang/Object.java:

public final native void wait(long timeout) throws InterruptedException;

Unlike with GNU Classpath, the java.lang.Object code goes straight to the native implementation found in src/share/native/java/lang/Object.c. However, we don’t find an implementation there. Instead, we need to look at another function in Object.c called registerNatives:

static JNINativeMethod methods[] = {
    {"hashCode",    "()I",                    (void *)&JVM_IHashCode},
    {"wait",        "(J)V",                   (void *)&JVM_MonitorWait},
    {"notify",      "()V",                    (void *)&JVM_MonitorNotify},
    {"notifyAll",   "()V",                    (void *)&JVM_MonitorNotifyAll},
    {"clone",       "()Ljava/lang/Object;",   (void *)&JVM_Clone},

Java_java_lang_Object_registerNatives(JNIEnv *env, jclass cls)
    (*env)->RegisterNatives(env, cls,
                            methods, sizeof(methods)/sizeof(methods[0]));

The array, methods, tells us that wait maps to JVM_MonitorWait. Looking at the list above, we see that JVM_MonitorWait is one of the VM symbols in the java library. And sure enough, we find it in src/share/javavm/export/jvm.h:

JVM_MonitorWait(JNIEnv *env, jobject obj, jlong ms);

and a corresponding implementation in HotSpot’s src/share/vm/prims/jvm.cpp

JVM_ENTRY(void, JVM_MonitorWait(JNIEnv* env, jobject handle, jlong ms))

and CACAO’s jvm.c:

void JVM_MonitorWait(JNIEnv* env, jobject handle, jlong ms)

Clearly, there isn’t that much difference between the two. The main issue is finding the right functions and where and how they are called. One other major difference is that Classpath VMs provide their own launchers (you run ‘cacao’, ‘jamvm’, ‘gij’, ‘kaffe’ etc. binaries) while the ‘java’ in OpenJDK is a standard launcher (also used for other tools) which invokes the VM via JNI and libjvm.so. There’s also a mechanism for selecting VM in this manner through src/(solaris|windows)/bin/${arch}/jvm.cfg, which we’ll look at later.

With the CVMI project, we aim to document these issues and also experiment with providing an OpenJDK interface more at the Java level. Comments and suggestions welcome.

I read Mario and Roman’s posts this morning and they inspired me to post too, after realising that there was a lot of stuff that’s been going on that I also hadn’t blogged about. Firstly, Google Summer of Code closed its doors to student applications on Monday (well Tuesday really, here in Europe) and we were rather disappointed to find only two applications for GNU Classpath, both for java.util.Scanner. This is a real pity, as I think we had some really good ideas on the list (and even more interesting ones were left to one side after AICAS didn’t get in as a mentoring organisation).

I think students picked Scanner because it’s used on many undergraduate courses these days (something of which I was blissfully unaware, as it’s years since I did any introductory Java course or read an introductory book). Unfortunately, the future of such an idea is really dubious, as I explained to our first applicant online, as there is already an implementation (no idea how good or complete) by a student of Christian Thalinger (twisti) which we hope to get into the codebase, once the legalities are sorted out. Equally, we are looking at using BrandWeg to get the OpenJDK version; this has only really ground to a halt because I found we’d need to either update our regex implementation or also bring in the OpenJDK one and I simply haven’t had time. Again, BrandWeg was on the ideas list, but no takers :(

Personally, I’ve mainly been looking at IcedTea recently, in preparation for the OpenJDK challenge work. I haven’t really blogged on the details of this yet, but my first port of call will be to take an OpenJDK/IcedTea build and attempt to get the class library from that to work with one of our Free GNU Classpath VMs. Rather than trying to build the Sun interface into that VM, I want to use that process to figure out the best way to create a more well-documented VM interface including support for VMs that don’t want to go the native route for the VM interface. I intend this to be an interactive process so I’ll be posting results and hoping for feedback as we go along. As the OpenJDK challenge infrastructure gets sorted, I expect this will take place under the auspices of an OpenJDK project. I’ll be tagging appropriate blogs with the ‘VM interface’ category so feel free to track them.

One question that does spring to mind is whether the challenge projects are intended to work with OpenJDK or OpenJDK6. IcedTea work has pretty much shifted to OpenJDK6 (in the form of IcedTea6) with good reason; distros want to ship a stable Free equivalent to JDK6, not an early alpha of JDK7 (which doesn’t yet even have a JSR attached to it). Ideally, I think we should maintain both, as the IcedTea porting process seemed to suggest the differences weren’t too major. But feedback here would be welcomed. I’d also like to make the new VM work easy for others to test, so hopefully some integration with IcedTea will be possible there too. I’m very impressed with IcedTea so far, especially Gary’s zero port (as my previous blogs hopefully illustrate). There are some niggles, but lots of eyes and people testing it in different environments will fix these. It’s great to have OpenJDK on PPC64 for one thing!

To close, I notice that people are moving around in the Free Java world (as my reference to Mario’s title in mine hopefully indicates). First, Tom Marble left Sun earlier this year, and now we find that Dalibor has successfully stepped into his (hopefully clean) shoes. To me, there doesn’t seem to be a more appropriate replacement, though it does make his governance board position interesting… Mario has also now moved to AICAS, so it seems like most people are getting new jobs and different roles in the new Free Java world brought about by OpenJDK. Things will change for me as well soon, as I’m due to finish my PhD here in October (well the funding runs out at least, which means I need some alternate source of cash at any rate). So it will be interesting to see where I am in a year from now too…