Just in time compiler technique

Data processing: software development – installation – and managem – Software program development tool – Translation of code

Reexamination Certificate

Rate now

  [ 0.00 ] – not rated yet Voters 0   Comments 0

Details

Reexamination Certificate

active

06324686

ABSTRACT:

BACKGROUND OF THE INVENTION
1. Field of the Invention
The present invention relates to a compiler, and more particularly, to a Just In Time (JIT) compiler for Java (Java is a trademark of Sun Microsystems).
2. Description of the Related Art
The Java programming language has become ubiquitous over the last few years, due to the propagation of the Internet and its applicability to Internet programming. This is due to the characteristics of Java, especially the characteristics of Java byte code. As illustrated in
FIG. 1
, a server computer
1
compiles Java source code
10
into Java byte code
14
. Java byte code, which can also be thought of as the executable code which comprises a Java program or application or applet, is not dependent on or tied to any specific operating system (OS) (such as Windows, OS/2 or Solaris) or computer platform (such as Intel, PowerPC, or RISC), thus the byte code
14
is not dependant on an OS
53
or hardware/CPU
55
in a client computer
5
. (Windows is a trademark of Microsoft Corporation, OS/2 and Power PC are trademarks of IBM, and Solaris is a trademark of Sun Microsystems.) Thus, the byte code
14
can be executed by a variety of client computers connected to a network
3
. The client computers can have a variety of hardware and OS configurations.
On the other hand, the Java byte code
14
must be interpreted at execution by the executing client computer. Interpreting code is a relatively slow process compared to executing compiled code (such as that found in C or C++ applications), and has proven to be a stumbling block in the acceptance of Java. The client computers may be workstations, personal computers, or network computers or similar devices, such as home-use information processors, that have small memory capacities or are not equipped with auxiliary storage devices, such as hard disks.
In the Java environment, Java byte code is executed by a client computer by a Java virtual machine which is present on the client computer. As illustrated in
FIG. 1
, the byte code
14
is provided to a Java virtual machine (Java VM)
52
, which is provided for a WWW (World Wide Web) browser in the client computer
5
. A Java interpreter
54
and a Java JIT compiler
56
are employed when the CPU (hardware
55
) actually executes the byte code
14
.
When executing the byte code
14
, the interpreter
54
translates the byte code
14
and calls and executes an execution routine that is prepared for each instruction. Using an interpreter provides some advantages. First, execution of the byte code
14
can be initiated immediately, as soon as it is read. Second, as the amount of byte code involved is generally small, only a small memory capacity is required for the execution. A major disadvantage with the use of an interpreter is low execution speed. Low execution speed is the result of the following problems, which, arise because the byte code is decoded just before it is executed. First, since Java byte code is provided in a format having variable lengths, optimization by multiple prefetches is difficult for the CPU to perform. Second, rule-based optimization is difficult to provide for frequently detected byte code. When a complicated rule is employed or when many rules are employed, a relatively large amount of time is required to detect a byte code sequence for which the rule can be applied. Thus, rule-based optimization is not practical. Third, the reading of parameters can take place only at the head of the execution routine, and thus the processing can not be initiated immediately. Fourth, since a decoding loop exists, the processing time for the decoding loop is added to the processing time for the entire byte code
14
. Therefore, the processing speed can not be enhanced so that it exceeds the decoding loop processing speed.
To obviate these shortcomings, a number of solutions have been attempted. One involves the use of a “just-in-time” compiler. As illustrated in
FIG. 1
, the JIT compiler
56
translates the byte code
14
into machine code in advance of or immediately before its execution, and executes it. The advantage of this method is that since the compiler technique is employed to optimize the machine code, the execution speed for the translated code is high. However, a conventional optimizing compiler requires more memory and greater CPU power than does an interpreter.
Another performance enhancement technique involves using threaded code. Using this technique, the byte code
14
is converted into a subroutine call, which is then executed. The threaded code is a pair of (1) a subroutine, which is prepared for each byte code to process the corresponding byte code, and (2) machine code, which sets a parameter and issues a subroutine call according to the byte code. The threaded code is obtained by compiling the byte code into machine code components, each of which has a minimum size. Executing the threaded code is faster than interpreting byte code and requires fewer resources than a conventional optimizing compiler. However, there are a number of drawbacks involved with using threaded code. First, to execute Java byte codes with, for example, a 32-bit RISC CPU, the average amount of memory occupied by converted parameter sets and call instructions is four times as large as that occupied by the original byte code. Second, before rule-based optimization can be applied for a frequently detected byte code sequence, the program structure must be analyzed to confirm that the byte code sequence does not extend over a plurality of basic blocks, because then the byte code sequence overhead may offset the effect of the optimization. Third, since intermediate code is also machine code, an execution routine that was previously executed may be expelled from an instruction cache.
However, no Java byte code compiler has been developed that can be incorporated in network computers and home-use information processors, and that can perform high-speed processing while requiring only a few resources.
SUMMARY OF THE INVENTION
One object of the present invention is to provide a compiler that can compile Java byte code at high speed while employing only limited resources.
Another object of the present invention is to provide a compiler that can perform rule-based optimization without having to analyze program structure.
An additional object of the present invention is to permit a rule to be applied, regardless of basic block boundaries of a program, in order to optimize the execution of the program.
A further object of the present invention is to provide an instruction configuration for an execution routine that corresponds to a byte code, that fully utilizes the capabilities of a CPU.
The first feature of the present invention is a method for converting a byte code into an intermediate code that employs, as opcode, an address of an execution routine that corresponds to a byte code, and for executing the execution routines in a sequential order corresponding to that of the intermediate code. The length of the intermediate code is made constant and the bit position of the opcode is also made constant. The execution routines are stored in sequential areas in a memory, and offsets of the execution routines from the head address are employed as opcodes. Therefore, the address generation of the execution routine corresponding to the intermediate code, and the operand generation can be performed at high speed. Furthermore, by employing empty pipelines in the CPU, one part (operand generation and a jump) of an instruction group for jumping to the next intermediate code execution routine, and one part (prefetching of the intermediate code and address calculation of an execution routine) of an instruction group for jumping to the next plus one intermediate code execution routine can be executed in parallel to the original intermediate code process. As a result, a saving can be realized in the time required for the decoding and jumping processes, and the execution speed can be increased. In addition, since the intermediate code is not an instruction but is

LandOfFree

Say what you really think

Search LandOfFree.com for the USA inventors and patents. Rate them and share your experience with other people.

Rating

Just in time compiler technique does not yet have a rating. At this time, there are no reviews or comments for this patent.

If you have personal experience with Just in time compiler technique, we encourage you to share that experience with our LandOfFree.com community. Your opinion is very important and Just in time compiler technique will most certainly appreciate the feedback.

Rate now

     

Profile ID: LFUS-PAI-O-2570184

  Search
All data on this website is collected from public sources. Our data reflects the most accurate information available at the time of publication.