How to locate the local method source code corresponding to a Java local method in the jvm source code?

for example, how does java.lang.Object-sharpwait (), locate it in the jvm source code?

Jul.09,2021

from the jdk/src/share/native/java/lang/Object.c file, you can find

static JNINativeMethod methods[] = {
    {"hashCode",    "()I",                    (void *)&JVM_IHashCode},
    {"wait",        "(J)V",                   (void *)&JVM_MonitorWait},
    {"notify",      "()V",                    (void *)&JVM_MonitorNotify},
    {"notifyAll",   "()V",                    (void *)&JVM_MonitorNotifyAll},
    {"clone",       "()Ljava/lang/Object;",   (void *)&JVM_Clone},
};

so you need to look at JVM_MonitorWait

in the native code.

you can use grep to search, and a better tool is source insight

.
Menu