I am currently looking under the hood of the JVM, of the OpenJDK JVM to be speciffic. And I was wondering how the JVM calls native functions. I know that it loads them dynamically and saves them as void*
but I can't seem to find the actual calling part.
For example:
jint Java_Test_add(jobject*, jint);
can be a native c function but so can:
jvoid Java_Test_main(jobject*);
So now I was wondering how the JVM can call these functions when only having the method signature as a string at runtime. As far as I know C does not support such dynamic calls. I hope someone can tell me how this works or how to approach such an problem.
Thanks in advance!