Maybe it could be that's making a call to some alread compiled library?
Yeah - I think you need some background on what the JNI is. Let me try and provide that background quickly, as I think it will clear up your confusion, or at least set you on the right track.
Java runtimes can't run on Java - they are implemented as native executables.
The JNI (the Java Native Interface) is, essentially, a native interface for asking a Java runtime to do various things.
Amongst a ton of other things, you can use the JNI to invoke methods implemented in Java.
The JNI has a bunch of different helper methods for invoking different types of methods.
The method you are asking about, in particular, CallStaticVoidMethod
would be used to invoke a Java function such as the one in this example:
public static void DoSomething() { ... }
In order for the runtime to invoke that method, it needs to know a few things - such as: information about the current runtime/context/environment (this is the JNIEnv * env
parameter), the class the static method is declared in (this is the jclass cls
parameter), the method to invoke (this is the jmethodID methodID
parameter).
EDIT:
Followup to your reply:
I found it without much trouble in the OpenJDK code.
http://hg.openjdk.java.net/
cvmi/cvmi/jdk Common VM Interface
http://hg.openjdk.java.net/cvmi/cvmi/jdk/archive/tip.zip
Under:
./src/share/javavm/export/jni.h
void CallStaticVoidMethod(jclass cls, jmethodID methodID, ...) {
va_list args;
va_start(args,methodID);
functions->CallStaticVoidMethodV(this,cls,methodID,args);
va_end(args);
}
I don't know where this is assigned: functions->CallStaticVoidMethodV
but I'm sure if you go through the trouble of downloading all the source for the various components you'll find a struct with that member and/or an assignment to that function pointer - and you can go from there.
Because it's supposed to be a standard/common interface for multiple runtimes I wouldn't be surprised if there was some layer of indirection between the actual implementation and the way it's exposed through the JNI.