Local method stack when a thread calls the native method, it enters a world not restricted by Java virtual machine. It can use registers of the local processor to allocate memory on any number of local stacks or use any type of stacks.
The local method interface uses a certain type of local method stack. When the thread calls the java method, the virtual machine creates a frame and pushes it to the java stack. When the thread calls the natvie method, the thread does not push a new frame to the java stack of the thread. the java VM dynamically connects to the native method and calls it directly.
A local method may call a java method. In this case, the thread will leave the local method stack and enter another java stack. Describes how a thread calls a native method and calls back another java method in the native method.
The thread calls two java methods, and the second java method calls a native method. This action causes the virtual machine to use a local method stack. In this figure, the local method stack is displayed with a limited amount of continuous memory space. Assume that it is a c stack. Each c-linked function is rendered in gray and separated by dotted lines. The first c-linked function is called as a native method, and it calls another c-linked function. The second c-linked function calls the java method through the native method interface. Then this java method calls another java method, that is, the current method shown in the figure.