Does JNI really need interface pointer to provide multiple versions of JNI function tables

Viewed 165

On JNI spec, it says:

The JNI interface is organized like a C++ virtual function table or a COM interface. The advantage to using an interface table, rather than hard-wired function entries, is that the JNI namespace becomes separate from the native code. A VM can easily provide multiple versions of JNI function tables. For example, the VM may support two JNI function tables:

one performs thorough illegal argument checks, and is suitable for debugging; the other performs the minimal amount of checking required by the JNI specification and is therefore more efficient.

But is it really needed? After all, the interface pointer is pointer to pointer. It costs more performance recession.

1 Answers
Related