accordance with embodiments of the present invention the virtual machine has enabled automatic generation of this stub the stub translates the java calling convention with the object pointer in rsi and the integer argument in eax to the native calling convention with a jnienv pointer in rsi the object pointer in rdi and the integer argument in rdx the calling convention adaptor creates the mir code for this stub not using platform specific knowledge the compiler then compiles the mir code using the paraminfo which contained the platform specific knowledge since embodiments of the present invention extend the compiler to generate stubs with the calling convention adaptor and the paraminfo structure there is no separate manual work required to maintain the stub generation code if the compiler can compile for the platform it can generate native call stubs for the platform furthermore since the compiler has access to a higher level description of the native call stub it can apply advanced compiler optimization techniques on the stub to increase the code efficiency it is even possible to include the mir of the native call into the mir of the caller to achive even higher performance improvements there is no limitation on what kind of native calls can be generated jni compatible calls.