Java Virtual Machine (7)

Source: Internet
Author: User

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.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.