# US 2004/0205733 A1 · Program code conversion

> Agents: this data is available as JSON from the patentgrep API and MCP server — see https://patentgrep.com/llms.txt

- Number: US 2004/0205733 A1
- Document ID: US20040205733A1
- Status: Published application
- Kind: A1
- Application number: 09/827,971
- Filed: 2001-04-06
- Published: 2004-10-14
- Earliest claimed: 1998-10-10
- Assignees: The Victoria University of Manchester
- Inventors: Jason Souloglou; Alasdair Rawsthorne
- Web page: https://patentgrep.com/patent/US20040205733A1

## CPC

- G06F 8/52: Binary to binary
- G06F 8/44: {Encoding}
- G06F 8/441: {Register allocation; Assignment of physical memory space to logical memory space}
- G06F 8/47: {Retargetable compilers}
- G06F 9/45504: {Abstract machines for program code execution, e.g. Java virtual machine [JVM], interpreters or emulators}
- G06F 9/45516: {Runtime code conversion or optimisation}
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

A method for generating an intermediate representation of computer program code written for running on a programmable machine comprises: (i) generating a plurality of register objects for holding variable values to be generated by the program code; and (ii) generating a plurality of expression objects representing fixed values and/or relationships between said fixed values and said variable values according to said program code; said objects being organized into a branched tree-like network having all register objects at the lowest basic root or tree-trunk level of the network with no register object feeding into any other register object.

## Claims

### Claim 1

A method of generating an intermediate representation of program code, the method comprising the computer implemented steps of:
generating a plurality of register objects representing abstract registers, a single register object representing a respective abstract register; and
generating expression objects each representing a different element of said program code as that element arises in the program code, each expression object being referenced by a register object to which it relates either directly, or indirectly via references from other expression objects.

### Claim 2 (depends on 1)

A method according to claim 1, wherein said program code is expressed in terms of an instruction set of a subject processor.

### Claim 3 (depends on 2)

A method according to claim 2, wherein said register objects represent abstract registers corresponding to registers of said subject processor.

### Claim 4 (depends on 1)

A method according to claim 1, wherein each of said steps are performed sequentially for basic blocks of said program code having only one effective entry point instruction and one effective exit point instruction.

### Claim 5 (depends on 1)

A method according to claim 1, wherein at least some said expression objects feed into more than one said register object.

### Claim 6 (depends on 1)

A method according to claim 1, wherein said expression objects are not duplicated.

### Claim 7 (depends on 1)

A method according to claim 1, wherein a single said expression object is generated for a given element of said program code, and each said expression object is referenced by all said register objects to which it relates.

### Claim 8 (depends on 1)

A method according to claim 1, wherein if a said register object or a said expression object becomes redundant or unnecessary it is eliminated.

### Claim 9 (depends on 8)

A method according to claim 8, wherein a redundant or unnecessary said register object or said expression object is identified by maintaining an ongoing count of references being made to that object as a network of register and expression objects is constructed.

### Claim 10 (depends on 9)

The method according to claim 9, wherein for each expression object a count is maintained of the number of references to that expression object from other expression objects or from register objects, the count associated with a particular expression object being adjusted each time a reference to that expression object is made or removed.

### Claim 11 (depends on 10)

A method according to claim 10, wherein an expression object and all references from that expression object are eliminated when said count for that expression object is zero.

### Claim 12 (depends on 1)

The method of claim 1, comprising translating the program code written for execution by a processor of a first type so that the program code may be executed by a processor of a second type, using the generated intermediate representation.

### Claim 13 (depends on 12)

The method of claim 12, wherein said translating step is performed dynamically as the program code is run.

### Claim 14 (depends on 1)

The method of claim 1, comprising optimising the program code by optimising the generated intermediate representation.

### Claim 15 (depends on 14)

The method of claim 14, wherein said optimising step is used to optimise the program code written for execution by a processor of a first type so that the program code may be executed more efficiently by that processor.

### Claim 16

A method for generating an intermediate representation of program code written for running on a programmable machine, said method comprising:
(i) generating a plurality of register objects for holding variable values to be generated by the program code; and
(ii) generating a plurality of expression objects representing fixed values and/or relationships between said fixed values and said variable values according to said program code;
said objects being organised into a branched tree-like network having all register objects at the lowest basic root or tree-trunk level of the network with no register object feeding into any other register object.

### Claim 17

A system for generating an intermediate representation of program code, comprising:
means for generating a plurality of register objects representing abstract registers, a single register object representing a respective abstract register; and
means for generating expression objects each representing a different element of said program code as that element arises in the program code, each expression object being referenced by a register object to which it relates either directly, or indirectly via references from other expression objects.

### Claim 18

A system for generating an intermediate representation of program code written for running on a programmable machine, the system comprising:
means for generating a plurality of register objects for holding variable values to be generated by the program code; and
means for generating a plurality of expression objects representing fixed values and/or relationships between said fixed values and said variable values according to said program code;
wherein said objects are organised into a branched tree-like network having all register objects at the lowest basic root or tree-trunk level of the network with no register object feeding into any other register object.
