IP Library Granted Patent US 8,104,027
Granted Patent B2
US 8,104,027 · App. 12/128,368 · Granted Jan 24, 2012

Architecture for generating intermediate representations for program code conversion

View Patent ↗
Loading inventors, assignments & file history…
Monitor This Case
Get email alerts when status or documents change.
Order Certified Copies
Most orders are placed with the USPTO same day — all within 24 business hours.
Order via The Patent Place →
Pre-filled with this patent's details
Quick Facts
Patent No.
US 8,104,027
App. No.
12/128,368
Granted
Jan 24, 2012
Kind
B2
Abstract

An improved architecture for a program code conversion apparatus and method for generating intermediate representations for program code conversion. The program code conversion apparatus determines which types of IR nodes to generate in an intermediate representation (IR) of subject code ( 10 ) to be translated. Depending upon the particular subject and target computing environments involved in the conversion, the program code conversion apparatus utilizes either base nodes, complex nodes, polymorphic nodes, and architecture specific nodes, or some combination thereof, in generating the intermediate representation.

Claims (28)

1. A method of converting program code of a subject computing architecture into target code for execution on a target computing system, the method comprising the steps of:

providing a set of code generator functions each associated with a particular subject instruction type in the subject computing architecture;

decoding a plurality of instructions of the program code and identifying one or more instructions of the particular subject instruction types;

generating an intermediate representation of the decoded instructions including selectively generating a polymorphic node for the intermediate representation containing a function pointer to a respective code generator function in the set of code generator functions for each of the instructions of the particular subject instruction types;

generating the target code from the intermediate representation, including invoking the respective code generator function according to the function pointer in the polymorphic node and planting target code which is generated by the respective code generator function; and

executing the target code on the target computing system.

2. The method of claim 1 , further comprising providing a list of the particular subject instructions types, identifying instructions in the program code whose type is present on the list, and selectively generating polymorphic nodes for the identified instructions.

3. The method of claim 2 , wherein said step of generating the intermediate representation includes selectively generating either a polymorphic node or a set of base nodes for each of the identified instructions.

4. The method of claim 1 , wherein said polymorphic nodes further specify one or more registers of the target computing system, and the step of generating the target code includes allocating the specified registers in the generated target code.

5. The method of claim 1 , further comprising the step of performing generic optimizations to the intermediate representation by inferring information from the function pointer in the polymorphic nodes.

6. The method of claim 1 , wherein the program code is dynamically translated into the target code for execution on the target computing system.

7. The method of claim 1 , wherein the program code is binary executable code of the subject computer architecture and is dynamically translated into the target code as binary executable code for execution on the target computing system.

8. A computer readable storage medium having translator software resident thereon in the form of computer readable code executable by a target computer system to perform the steps of:

providing a set of code generator functions each associated with a particular subject instruction type in a subject computing architecture;

decoding a plurality of instructions of a program code of the subject computing architecture and identifying one or more instructions of the particular subject instruction types;

generating an intermediate representation of the decoded instructions including selectively generating a polymorphic node for the intermediate representation containing a function pointer to a respective code generator function in the set of code generator functions for each of the instructions of the particular subject instruction types;

generating the target code from the intermediate representation, including invoking the respective code generator function according to the function pointer in the polymorphic node and planting target code which is generated by the respective code generator function; and

executing the target code on the target computing system.

9. A computer apparatus having a processor and a memory coupled to the processor to provide a target computing environment, and a program code conversion unit for converting program code appropriate to a subject computing architecture to produce target code appropriate to the target computing environment, the apparatus comprising:

a set of code generator functions each associated with a particular subject instruction type in the subject computing architecture;

a decoding mechanism arranged to decode a plurality of instructions of the program code of the subject computing architecture and identifying one or more instructions of the particular subject instruction types;

an intermediate representation generating mechanism arranged to generate an intermediate representation of the decoded instructions including selectively generating a polymorphic node for the intermediate representation containing a function pointer to a respective code generator function in the set of code generator functions for each of the instructions of the particular subject instruction types;

a target code generating mechanism arranged to generate the target code from the intermediate representation, including invoking the respective code generator function according to the function pointer in the polymorphic node and planting target code which is generated by the respective code generator function; and

a target code execution mechanism arranged to execute the target code on the processor.

10. The computer readable storage medium of claim 8 , wherein the computer readable code is executable by the target computer system to:

selectively generate the polymorphic node to specify one or more registers of the target computing system; and

generate the target code to allocate the specified registers in the generated target code.

11. The computer apparatus of claim 9 , wherein the intermediate representation generating mechanism is arranged to generate the polymorphic node to specify one or more registers of the target computing system, and wherein the target code generating mechanism arranged to generate the target code to allocate the specified registers in the generated target code.

Assignments (3)
CORRECTIVE ASSIGNMENT TO CORRECT THE ASSIGNEE NAME PREVIOUSLY RECORDED ON REEL 022928 FRAME 0190. ASSIGNOR(S) HEREBY CONFIRMS THE RECEIVING PARTY. Recorded Aug 26, 2013
From: IBM UNITED KINGDOM LIMITED
To: INTERNATIONAL BUSINESS MACHINES CORPORATION
Reel/Frame 031085/0824 →
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Jul 7, 2009
From: IBM UNITED KINGDOM LIMITED
To: IBM CORPORATION
Reel/Frame 022928/0190 →
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Jun 16, 2009
From: TRANSITIVE LIMITED
To: IBM UNITED KINGDOM LIMITED
Reel/Frame 022824/0715 →