Patch, patch or patch

Rémi Forax forax at univ-mlv.fr
Sat Oct 31 13:00:47 PDT 2009


Ignoring the patch that test indy,
I've managed to have a build that compile.

But it doesn't work,
jdk/ MethodHandleNatives.java is not in sync with
hotspot/ methodHandles.cpp

So at runtime, the VM warning me :)
OpenJDK Server VM warning: JSR 292 method handle code is mismatched to 
this JVM.  Disabling support.
OpenJDK Server VM warning: JSR 292 method handle code is mismatched to 
this JVM.  Disabling support.

As far as I can see linkCallSite in hotspot takes a CallSite and a 
MethodHandle
(there is also a weird space between them).

#define CST   JDYN"CallSite;"
#define MH    JDYN"MethodHandle;"
// More entry points specifically for EnableInvokeDynamic.
static JNINativeMethod methods2[] = {
   {CC"linkCallSite",            CC"("CST MH")V",                
FN_PTR(MH_linkCallSite)}
};

And on Java side, the native method is declared as this:

/** Tell the JVM that we need to change the target of an invokedynamic. */
     static native void linkCallSite(CallSiteImpl site, MethodHandle 
target);

So the VM try to find a linkcallSite(CallSite, MethodHandle) and
the java code declare a linkCallSite(CallSiteImpl, MethodHandle)

Oups, mismatch,
I hope I've not forgotten to apply a patch.

Rémi




More information about the mlvm-dev mailing list