I disassembled a simple Helloworld java class. The magic instruction
between JVM and the real world is "invokevirtual". What happens inside
the instruction? What's status of JVM when this instruction is
processing? How do JVM deal with the exceptions happening in the
realworld methods?
Also, if I wanna add some special functions to JVM, is JNI the only way
to extend JVM? Is JNI effecient enough to process large blocks of data?
>I disassembled a simple Helloworld java class. The magic instruction
> between JVM and the real world is "invokevirtual".
This is not magic, and it can occur between normal Java objects. Look at
this: (one link)
http://java.sun.com/docs/books/vmspec/2nd-edition/html/Instructions2.doc6.html#i
nvokevirtual
> What happens inside the instruction?
If you meant to ask: "What happens when the instruction is executed?", then
the answer is given.
> What's status of JVM when this instruction is processing?
I'm not sure what you meant to ask here.
> How do JVM deal with the exceptions happening in the realworld methods?
They can still be thrown, but not caught. Check your jni.h for details.
> Also, if I wanna add some special functions to JVM, is JNI the only way
> to extend JVM?
Of course not. You can also modify the JVM itself, provided that the owner
has granted you permission for that.
> Is JNI effecient enough to process large blocks of data?
JNI is usually actually less efficient for simple tasks.