摘要 |
<p>A system includes a CPU and a code translator. The CPU may execute instructions from a first instruction set, and the code translator may translate Java code sequences from Java bytecodes to code sequences having instructions defined in the first instruction set. The translated code sequences may be executed by the CPU. The Java instruction set is a stack-based instruction set, and the first instruction set may be a register-based instruction set. Accordingly, the code translator may translate stack operand references to register operand references. The code translator may predecode the Java bytecodes with stack change information to aid in the translation of stack operand references to register operand references. For example, the stack change information may include a number of pushes, a number of pops, and a stack pointer modification for each bytecode. By predecoding the stack change information, the translation process may be performed more rapidly. Furthermore, several instructions may be translated in parallel using the stack change information predecoded for each instruction. While Java is used as an example of instructions which the code translator translates, the code translator may translate instructions from any instruction set to instructions executable by the CPU. Furthermore, the predecoding of stack change information may be performed for any stack based instruction set.</p> |