Method and device for running Java programs
A technology of java method and java virtual machine, which is applied in the direction of program control device, program loading/starting, etc., can solve the problems of limiting the calling level of Java methods and the depth of recursive calling, not providing enough space to execute Java methods, and less space , to achieve the effect of improving flexibility, expanding size, and avoiding abnormal situations
- Summary
- Abstract
- Description
- Claims
- Application Information
AI Technical Summary
Problems solved by technology
Method used
Image
Examples
Embodiment 1
[0030] Embodiment 1 of the present invention provides a method for running a Java program, such as figure 1 shown, including the following steps:
[0031] Step 101, when the Java virtual machine invokes a Java method, calculate the space required for executing the Java method.
[0032] Specifically, the Java virtual machine can calculate the size of the frame corresponding to the Java method. The frame includes a local variable area, an operand stack, and a frame data area. The size of the local variable area and the operand stack are generated by the compiler and the converter. Known when calling a Java method; the size of the frame data area is implementation-dependent and usually fixed. The Java virtual machine can sum the sizes of the local variable area, the operand stack, and the frame data area to obtain the size of the frame. Since the Java virtual machine executes the Java method in the frame corresponding to the Java method, the size of the frame corresponding to t...
Embodiment 2
[0047] In the first embodiment above, since the frame in the Java stack in RAM is transferred to the non-volatile memory, when the calling level of the Java program is reduced, if there is no called Java method in the Java stack in RAM, Corresponding to the frame, the Java virtual machine can restore part or all of the frame in the non-volatile memory to the Java stack in the RAM.
[0048] Embodiment 2 of the present invention provides a method for running a Java program, such as figure 2 shown, including the following steps:
[0049] Step 201, when the execution of the Java method ends, the Java virtual machine pops the frame corresponding to the Java method from the Java stack and discards it.
[0050] In step 202, the Java virtual machine judges whether there is a frame in the Java stack in RAM, and if yes, executes step 204; otherwise, executes step 203.
[0051] Step 203, the Java virtual machine copies the frame in the non-volatile memory to the Java stack in the RAM,...
Embodiment 3
[0057] In the first embodiment above, since the frames in the Java stack in the RAM are transferred to the non-volatile memory, when the calling level of the Java program decreases, if the number of frames in the Java stack in the RAM is less than the fourth When the preset value (the fourth preset value can be an integer greater than 1), the Java virtual machine can restore some or all frames in the non-volatile memory to the Java stack in the RAM.
[0058] Embodiment 3 of the present invention provides a method for running a Java program, such as image 3 shown, including the following steps:
[0059] Step 301, when the execution of the Java method ends, the Java virtual machine pops the frame corresponding to the Java method from the Java stack and discards it.
[0060] In step 302, the Java virtual machine judges whether there is a frame in the Java stack in RAM, and if yes, executes step 304; otherwise, executes step 303.
[0061] Step 303, the Java virtual machine copi...
PUM
Abstract
Description
Claims
Application Information
- R&D Engineer
- R&D Manager
- IP Professional
- Industry Leading Data Capabilities
- Powerful AI technology
- Patent DNA Extraction
Browse by: Latest US Patents, China's latest patents, Technical Efficacy Thesaurus, Application Domain, Technology Topic, Popular Technical Reports.
© 2024 PatSnap. All rights reserved.Legal|Privacy policy|Modern Slavery Act Transparency Statement|Sitemap|About US| Contact US: help@patsnap.com