Systems and methods for implementing efficient execution transfers between successive translations of stack-based program code in a virtual machine environment
Systems and methods for implementing efficient execution transfers between successive translations of stack-based code in a virtual machine environment are provided. Briefly described, one such method comprises the steps of: defining a global translation convention for translating one or more stack-based code instructions on a register-based environment, the global translation convention specifying a predetermined portion of a stack-based context corresponding to a stack that is to be mapped to one or more registers corresponding to the register-based environment and enforcing the global translation convention for each translation of the one or more stack-based code instructions in the register-based environment.
Drawings
Claims31
A method for implementing efficient execution transfers between successive translations of stack-based program code in a virtual machine environment, the method comprising the steps of:
defining a global translation convention for translating one or more stack-based code instructions to execute in a register-based environment, the global translation convention specifying a predetermined portion of a stack-based context corresponding to a stack that is to be mapped to one or more registers corresponding to the register-based environment;
and
enforcing the global translation convention for each translation of the one or more stack-based code instructions in the register-based environment.
A system for translating and executing stack-based instructions in a register-based environment, the system comprising:
a predefined global translation rule, which is stored in memory and adapted to control the translation of one or more stack-based code instructions to be executed in a register-based environment, the predefined global translation rule specifying a predetermined portion of a stack-based context corresponding to an operand stack that is to be mapped to one or more registers corresponding to the register-based environment;
logic configured to receive the one or more stack-based code instructions;
and
logic configured to perform a translation of the one or more stack-based instructions according to the predefined global translation rule.
1 more element
A computing system for implementing a virtual machine environment that functions as an interface between stack-based code and a register-based hardware platform, the computing system comprising:
a register-based hardware platform;
an emulation system comprising logic configured to receive stack-based instructions, decode the stack-based instructions, and emulate the stack-based instructions on the register-based hardware platform;
and
a translation system comprising:
a predefined global translation rule, which is stored in an associated memory and adapted to control the translation of the stack-based instructions to be translated, the predefined global translation rule specifying a predetermined portion of a stack-based context corresponding to an operand stack that is to be mapped to one or more registers associated with the register-based hardware platform;
logic configured to receive the one or more stack-based instructions to be translated;
and
logic configured to perform a translation of the one or more stack-based instructions that are received according to the predefined global translation rule.
Assigned to Hewlett-Packard Companyassignment of assignor's interest
Assigned to Hewlett-Packard Development Company, L.P.assignment of assignor's interest
Published
Description6,662 words
Summary2,087 words
#This disclosure generally relates to systems for translating stack-based program code in a virtual machine environment to be executed on a register-based hardware platform. More particularly, the disclosure relates to systems and methods for implementing efficient execution transfers between successive translations of stack-based code to register-based code in a virtual machine environment.
#Currently, a variety of types of “virtual machines” are implemented in computing systems. In general, “virtual machine” is a term used to describe system software that functions as an interface between program code (e.g., Java® bytecode, etc.) and the hardware platform (e.g., microprocessor) that actually performs the instructions associated with the binary code.
#A virtual machine converts each program instruction into a set of specific machine instructions that the hardware platform will understand. Most computer languages used to develop software applications require a separate compiler for each computer platform (i.e., for each computer operating system and the hardware set of instructions). Using a virtual machine, program code in a particular computer language may run on any platform provided the platform provides a virtual machine for the computer language.
Brief description of the drawings10 figures
#The invention can be better understood with reference to the following drawings. The components in the drawings are not necessarily to scale, emphasis instead being placed upon clearly illustrating the principles of the present invention. Moreover, in the drawings, like reference numerals designate corresponding parts throughout the several views.
#FIG. 1 illustrates the contents of an exemplary operand stack during operation of a sample stack-based program.
#FIG. 2 illustrates an example of an existing computing system for implementing a virtual machine environment that functions as an interface between stack-based code and a register-based hardware platform.
Detailed description4,265 words
#FIG. 5 illustrates one of many possible embodiments of a computing system 500 according to the present invention for implementing efficient execution transfers between successive translations of stack-based code in a virtual machine environment. As illustrated in FIG. 5, computing system 500 generally comprises a virtual machine environment 204 for providing an interface between stack-based code 202 and a register-based hardware platform 210. One of ordinary skill in the art will appreciate that stack-based code 202 may comprise any of a variety of types of compiled computer object code that is configured to be run in a virtual machine environment. In this regard, stack-based code 202 comprises one or more generalized stack-based machine instructions. Stack-based machine instructions are generally configured to be processed in a stack-based environment, such as the one described above with respect to FIGS. 1, 3, and 4. For instance, in a stack-based environment, a data area or buffer (referred to as a stack, or operand stack) is used for storing requests that need to be processed. A stack is sometimes referred to as a push-down list because as new requests are received, they push down old ones. In other words, a program always takes the next item to process from the top of the stack. The generalized stack-based machine instructions comprising stack-based code 202 are generally configured to perform functions, operations, etc. in the stack-based environment.
#Accordingly, in one of many possible embodiments, stack-based code 202 comprises Java® bytecode and virtual machine environment 204 comprises a Java® virtual machine. Materials describing the operation, functionality, and/or architecture of the various Java® platforms (e.g., Java 2 Platform and predecessor Java® Development Kits (JDKs), etc.) may be found on the Sun Microsystems, Inc. web site at http://www.sun.com and on The Source for Java® Technology web site at http://java.sun.com/. All of these materials are hereby incorporated by reference in their entirety. Furthermore, one of ordinary skill in the art will appreciate that stack-based code 202 may comprise compiled stack-based instructions based on any of a variety of source code languages (e.g., C, C++, etc.).
#Referring again to FIG. 5, register-based hardware platform 210 may comprise any type of processing device that employs registers to perform processing functions. As stated above, registers are the data elements that provide a place for holding data operands and intermediate results between successively executed instructions. By way of example, in a register-based environment, instructions may be performed by loading values into registers and manipulating the contents of the registers. For instance, referring to the example of FIG. 4, register-based hardware platform 210 may perform a simple add instruction by loading the values of the two operands into two machine registers (r1, r2), adding the contents of r1 and r2, and loading the result back into r1.