Data processing: software development – installation – and managem – Software program development tool – Translation of code
Reexamination Certificate
2001-05-29
2004-11-02
Ingberg, Todd (Department: 2124)
Data processing: software development, installation, and managem
Software program development tool
Translation of code
C717S148000, C717S118000
Reexamination Certificate
active
06813764
ABSTRACT:
FIELD OF THE INVENTION
The present invention is directed to an improvement in computing systems and in particular to an improvement in the generation of instruction sequences for unresolved storage references in executable code.
BACKGROUND OF THE INVENTION
Certain computer languages, such as Java, support compilers that generate code that includes unresolved references. These references cannot be determined at compile-time but are able to be resolved at runtime. The inclusion of unresolved references in compiled code introduces potential inefficiencies in the runtime execution of the compiled code. Typically such unresolved references are generated where portions of code are compiled in a language for which the code is otherwise interpreted. The details of how unresolved references may occur in a Java programming environment are set out below.
Java language program code is stored as Java byte-code. Java byte-code is interpreted by a Java virtual machine which implements the Java language on a particular computer. A common way to optimize the interpretation of Java byte-code by a virtual machine is for the virtual machine to incorporate a Java JIT (just in time) compiler. Such a compiler will compile portions of the Java byte-code, typically those that are frequently interpreted by the virtual machine, and generate executable code for the machine corresponding to those portions of the Java byte-code. Such compilation is referred to as dynamic compilation.
When dynamically generating compiled code using a Java JIT compiler, code will typically be compiled which includes unresolved references. For example, a static data reference may be compiled where the address of the static data item is unknown at compile time, but which will be resolved at runtime. With respect to instance data, the offset from the beginning of an object to which an instance has been mapped may be unknown at compile time, but will similarly be resolvable at runtime. Thus for dynamic compilation of Java (and other analogous languages) it is common to have executable code emitted by the compiler that contains references that are only able to be resolved at runtime. This differs from traditional compilers where all references are resolved when the executable code is emitted. The dynamically generated executable code requires executable code to resolve the references at execution time.
One prior art approach to code generation for unresolved runtime references is to insert a runtime test into the compiled code which will determine whether the data reference is resolved at execution of the instruction having the storage reference. Such an approach includes an overhead associated with the runtime check carried out whenever the storage reference is reached in the compiled code.
A second prior art approach is to introduce an indirection into the data reference. The first access of the data is defined by the compiler to result in a trap to a trap handler that will load the proper resolved data reference to the indirect data structure. Further accesses to the storage reference will result in the proper resolved data reference being accessed. This approach, however, includes a runtime cost associated with the indirect access to the data reference. It is therefore desirable to have a compiler for emitting code which may include unresolved references but which will generate code to provide for efficient run-time resolution and execution of the initially unresolved code.
SUMMARY OF THE INVENTION
According to an aspect of the present invention there is provided an improved computer system for the generation of instruction sequences for unresolved storage references in compiled code.
According to another aspect of the present invention there is provided a computer program product including a computer usable medium having computer readable program code means embodied in the medium, the program code means including a compiler and an associated runtime helper, the runtime helper being defined for resolving references at runtime, the compiler including means to emit compiled code including a set of target instructions, each target instruction having an associated target location in the compiled code, each target instruction including an unresolved reference at compile time, the emitted code for each target instruction including a trigger instruction initially located at the associated target location in the compiled code and a snippet including a copy of the target instruction including the unresolved reference and resolution data useable by the runtime helper to resolve references in the target instruction, the compiler further including means for defining the trigger instruction such that on execution the trigger instruction triggers the execution of defined instructions to pass data to the runtime helper for resolution of the unresolved reference in the copy of the target instruction and to replace the trigger instruction at the target location with the copy of the target instruction having the unresolved reference resolved.
According to another aspect of the present invention there is provided the above computer program product in which the compiler further includes means for first emitting, for each one of the set of target instructions, the associated unresolved target instruction at the corresponding target location, means for creating and maintaining a snippet list including entries, each entry in the snippet list corresponding to one of the set of target instructions, means for subsequently traversing the snippet list, and for each entry in the snippet list defining the snippet relating to the one of the set of target instructions corresponding to the snippet list entry, storing the associated unresolved target instruction in the defined snippet to permit the replacement of the associated unresolved target instruction at its target location with the corresponding trigger instruction.
According to another aspect of the present invention there is provided the above computer program product in which the trigger instruction for a one of the set of target instructions is a call to the corresponding snippet and in which the snippet includes instructions to pass the resolution data to the helper code.
According to another aspect of the present invention there is provided the above computer program product in which the trigger instruction for a one of the set of target instructions includes an illegal instruction for throwing an exception on execution, and in which the computer program product further includes computer usable medium having computer readable program code means embodied in the medium including a trap handler including instructions to branch to a snippet corresponding to the target instruction when the exception is thrown.
According to another aspect of the present invention there is provided the above computer program product in which trap handler further includes a data structure for identifying snippets and in which the instructions to branch to a snippet further include a look up in the data structure to define the branch to the snippet corresponding to the target instruction.
According to another aspect of the present invention there is provided the above computer program product in which the compiler is a Java just in time compiler.
According to another aspect of the present invention there is provided a computer program product including a computer usable medium having computer readable program code means embodied in the medium for defining a Java runtime environment, the computer program product including computer readable program code means including a Java just in time compiler and an associated runtime helper, the runtime helper being defined for resolving references at runtime, the compiler including means to emit compiled code including a set of target instructions, each target instruction having an associated target location in the compiled code, each target instruction including an unresolved reference at compile time, the means to emit compiled code including means for first emitting, for each one
Ingberg Todd
Rogitz John L.
LandOfFree
Compiler generation of instruction sequences for unresolved... does not yet have a rating. At this time, there are no reviews or comments for this patent.
If you have personal experience with Compiler generation of instruction sequences for unresolved..., we encourage you to share that experience with our LandOfFree.com community. Your opinion is very important and Compiler generation of instruction sequences for unresolved... will most certainly appreciate the feedback.
Profile ID: LFUS-PAI-O-3288087