We know the following calling conversation the this thread, What's the calling convention for the Java code in Linux platform? And also it explained that
"You may notice that Java calling convention looks similar to C calling convention but shifted by one argument right. This is done intentionally to avoid extra register shuffling when calling JNI methods (you know, JNI methods have extra JNIEnv* argument prepended to method parameters)."
So does it mean when we called the JNI function such as jclass FindClass(JNIEnv *env, const char *name); then JNIEnv value env would be passed to the rdi, and name passed to rsi, however when we called the general non-JNI Java method such as void printClassName(int Integer1 ,Object obj), then Integer1 is passed to rsi, and obj was passed to the stack as it is not a Integer,it is right?
please correct me if I'm wrong.
|-------------------------------------------------------|
| c_rarg0 c_rarg1 c_rarg2 c_rarg3 c_rarg4 c_rarg5 |
|-------------------------------------------------------|
| rcx rdx r8 r9 rdi* rsi* | windows (* not a c_rarg)
| rdi rsi rdx rcx r8 r9 | solaris/linux
|-------------------------------------------------------|
| j_rarg5 j_rarg0 j_rarg1 j_rarg2 j_rarg3 j_rarg4 |
|-------------------------------------------------------|