# US 2002/0166116 A1 · Method and apparatus for distinguishing reference values from non-reference values in a runtime environment

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

- Number: US 2002/0166116 A1
- Document ID: US20020166116A1
- Status: Published application
- Kind: A1
- Application number: 10/184,532
- Filed: 2002-06-27
- Published: 2002-11-07
- Earliest claimed: 1998-05-08
- Assignees: Apple Computer, Inc.
- Inventors: Erik L. Eidt
- Web page: https://patentgrep.com/patent/US20020166116A1

## CPC

- G06F 12/0253: {Garbage collection, i.e. reclamation of unreferenced memory}
- Y10S 707/99953: Recoverability
- Y10S 707/99957: Garbage collection
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)
- Y10S: TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS

## Abstract

A method and apparatus for distinguishing reference values from non-reference values in a runtime environment is described. A set of volatile registers and a set of non-volatile registers are statically determined. The set of volatile registers is partitioned into reference and non-reference register partitions statically. The set of non-volatile registers is partitioned into reference and non-reference partitions dynamically.

## Claims

### Claim 1

A method of distinguishing reference values from non-reference values in a runtime environment comprising the steps of:
statically determining a set of volatile registers and a set of non-volatile registers;
statically determining a partition of the set of volatile registers into reference and non-reference partitions; and
dynamically determining a partition of the set of non-volatile registers into reference and non-reference partitions.

### Claim 2 (depends on 1)

The method of claim 1, wherein the step of dynamically determining a partition is performed for each subroutine.

### Claim 3 (depends on 1)

The method of claim 1, wherein reference registers store a pointer either directly or indirectly to an object in memory.

### Claim 4

A machine-readable medium having stored thereon data representing a sequence of instructions, the sequence of instructions which, when executed by a processor, cause the processor to perform a method comprising the computer-implemented steps of:
statically determining a set of volatile registers and a set of non-volatile registers;
statically determining a partition of the set of volatile registers into reference and non-reference partitions; and
dynamically determining a partition of the set of non-volatile registers into reference and non-reference partitions.

### Claim 5 (depends on 4)

The machine-readable medium of claim 4, wherein the step of dynamically determining a partition is performed for each subroutine.

### Claim 6

A computer system comprising:
means for statically determining a set of volatile registers and a set of non-volatile registers;
means for statically determining a partition of the set of volatile registers into reference and non-reference partitions; and
means for dynamically determining a partition of the set of non-volatile registers into reference and non-reference partitions.

### Claim 7 (depends on 6)

The computer system of claim 6, wherein the means for dynamically determining a partition of volatile registers determines partitioning on a routine by routine basis.

### Claim 8 (depends on 6)

The computer system of claim 6, wherein the dynamic partition is indicated by a mask having a bit associated with each non-volatile register.

### Claim 9

A computer system comprising:
a bus;
a processor coupled to the bus, the processor having a set of registers, wherein the set of registers is partitioned into volatile and non-volatile registers, and further wherein the volatile registers are further partitioned into reference and non-reference registers; and
memory coupled to the bus, the memory storing a plurality of objects;
wherein the non-volatile registers are dynamically partitioned at compile time into reference and non-reference registers based on data flow analysis of the objects in memory.

### Claim 10 (depends on 9)

The computer system of claim 9, wherein the non-volatile registers are dynamically partitioned into reference and non-reference registers for each object in memory based on data flow analysis of the particular object in memory.

### Claim 11 (depends on 10)

The computer system of claim 10, wherein the objects are received as a series of byte codes.

### Claim 12

A method of collecting garbage in a computer system comprising the steps of:
reading a register mask for a particular subroutine to determine a set of reference values stored on a stack; and
determining whether the reference values stored on the stack correspond to a live object in memory.

### Claim 13 (depends on 12)

The method of claim 12, wherein the steps are repeated for each of a plurality of subroutines placing values on the stack.

### Claim 14 (depends on 12)

The method of claim 12, wherein the register mask is determined dynamically at compile time based on data flow analysis of a corresponding subroutine.

### Claim 15 (depends on 12)

The method of claim 12 further comprising the step of counting back links stored on the stack to determine whether one or more subroutine calls have been completed.

### Claim 16 (depends on 15)

The method of claim 15 further comprising the step of restarting initialization of reference values if the number of back links stored on the stack is an odd number.

### Claim 17 (depends on 12)

The method of claims 12, wherein a top value on the stack is used to determine whether a corresponding stack frame has been completed.

### Claim 18

A method of calling a subroutine in a computer system comprising the steps of:
storing a set of non-volatile registers on a stack;
storing a first back link indicating a stack location preceding the set of non-volatile registers; and
designating a set of stack locations for storing a first predetermined number of reference values and a second predetermine number of non-reference values.

### Claim 19 (depends on 18)

The method of claim 18 further comprising the step of storing a back link on the stack that points to the first back link.

### Claim 20 (depends on 18)

The method of claim 18, wherein the first back link includes a mask value that indicates a partitioning of the non-volatile registers indicating reference values and non reference values.

### Claim 21 (depends on 18)

The method of claim 18, wherein an interrupt occurring during the steps causes any steps performed to be reversed and performed after the interrupt has been serviced.

### Claim 22 (depends on 18)

The method of claim 18, wherein an interrupt occurring during the steps is serviced after the storing of the second back link.

### Claim 23

A computer-readable medium having stored thereon data representing a sequence of instructions, the sequence of instructions which, when executed by a processor, cause the processor to perform a method comprising the computer-implemented steps of:
storing a set of non-volatile registers on a stack;
storing a first back link indicating a stack location preceding the set of non-volatile registers; and
designating a set of stack locations for storing a first predetermined number of reference values and a second predetermine number of non-reference values.

### Claim 24 (depends on 23)

The computer-readable medium of claim 23, wherein the first back link includes a mask value that indicates a partitioning of the non-volatile registers indicating reference values and non reference values.

### Claim 25 (depends on 23)

The computer-readable medium of claim 23 further comprising the step of storing a back link on the stack that points to the first back link.

### Claim 26 (depends on 23)

The computer-readable medium of claim 23, wherein an interrupt occurring during the steps causes any steps performed to be reversed and performed after the interrupt has been serviced.

### Claim 27 (depends on 23)

The computer-readable medium of claim 23, wherein an interrupt occurring during the steps is serviced after the storing of the second back link.
