Patent ID: 7328432

Claim:
A method for performing proximity-based addressing in a platform-independent virtual machine, comprising: prior to execution of a program, converting an instruction in the program to support proximity-based addressing; receiving the instruction during execution of the program on the platform-independent virtual machine; receiving a parameter associated with the instruction that can be used to generate a reference to a program element associated with the instruction; examining information encoded within the parameter to determine a proximity of the reference; and using the parameter to generate the reference to the program element, wherein the proximity of the reference determines how the reference is generated from the parameter; wherein converting the instruction to support proximity-based addressing enables executing the program in-place, thereby reducing memory usage and program overhead wherein the proximity of the reference can indicate that: the program element is located in the same class as the instruction; the program element is associated with another class in the same bundle as the instruction; or the program element is associated with another class in another bundle than the bundle that includes the instruction; and wherein if the program element is a field or a method, and if the proximity of the reference indicates that the program element is located in another class in another bundle, generating the reference involves: using the parameter to lookup an entry in a reference lookup structure, wherein the entry identifies a class name, a program element name and a program element type; using the class name to lookup a global offset for the class; and using the program element name and the program element type to look up an offset for the program element within the class.