IP Library Granted Patent US 7,716,658
Granted Patent B2
US 7,716,658 · App. 11/298,776 · Granted May 11, 2010

Method and apparatus for optimizing patching of objects containing references

Assignee: Oracle America, Inc.
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 7,716,658
App. No.
11/298,776
Granted
May 11, 2010
Kind
B2
Abstract

One embodiment of the present invention provides a method and a system for patching a set of objects containing references. The system uses a location structure to keep track of the locations of references within the set of objects. During the patching process, the system converts the references within the set objects from an absolute form into an offset-based form, where offsets are computed with respect to base addresses of objects. The system then applies an offset-based patch to the set of objects and to the location structure using a binary-patching technique. After applying the patch, the system converts the references in the set of objects back into absolute form. By using an offset-based patch, the system reduces the number of reference changes that need to be specified in the patch, thereby reducing the size of the patch.

Claims (69)

1. A method for patching a set of objects containing references, comprising:

using a location structure to keep track of the locations of references within the set of objects, wherein the location structure includes a table that contains addresses for objects in the set of objects, and wherein each object in the set of objects includes zero or more references;

converting the references within the set of objects from absolute references into offset-based references, wherein offsets are computed with respect to base addresses of objects, wherein said offsets are stored in place of said absolute references, wherein converting the absolute references into the offset-based references involves, for each absolute reference in said each object in the set of objects:

obtaining a base address from the table for the object of the absolute reference;

computing an offset for an offset-based reference by subtracting the base address of the object from the absolute reference;

applying an offset-based patch to the set of objects and to the location structure using a binary-patching technique; and

converting the references in the set of objects from offset-based references back into absolute references, wherein said absolute references are stored in place of said offsets;

wherein using the offset-based patch reduces the number of reference changes that need to be specified in the patch, and hence reduces the size of the patch.

2. The method of claim 1 , wherein converting an absolute reference into an offset-based reference comprises dividing the absolute reference into:

an address for the target object of the absolute reference; and

an offset for a target location of the absolute reference within the target object.

3. The method of claim 1 ,

wherein an entry for a given object in the table in the location structure points to a sub-table containing offsets for each reference contained in the given object; and

wherein the location structure allows the system to determine the locations of all references in the set of objects.

4. The method of claim 1 ,

wherein the method is used to patch the set of objects on a mobile device with a limited-bandwidth network connection; and

wherein using the offset-based references results in a smaller patch, which reduces the amount of data that needs to be transferred across the limited-bandwidth network connection during the patching process.

5. The method of claim 4 , wherein the method further comprises generating the offset-based patch by:

obtaining a previous version of the set of objects and a new version of the set of objects;

wherein the previous version of the set of objects and the new version of the set of objects each include a corresponding location structure;

decomposing the references in the previous version of the set of objects and the new version of the set of objects into offset-based references;

calculating a set of differences between the offset-based references of the previous version of the set of objects and the new version of the set of objects;

compressing the set of differences to form the offset-based patch; and

sending the offset-based patch to the mobile device to patch the previous version of the set of objects located on the mobile device.

6. The method of claim 1 , further comprising aggregating adjacent objects in the set of objects to reduce the size of the location structure.

7. The method of claim 1 ,

wherein the set of objects comprises a program binary; and

wherein the program binary includes a large machine-generated binary table in the J2ME™ environment.

8. The method of claim 7 , wherein the program binary includes a JAVA™ system ROM image.

9. A computer-readable storage medium storing instructions that when executed by a computer cause the computer to perform a method for patching a set of objects containing references, comprising:

using a location structure to keep track of the locations of references within the set of objects, wherein the location structure includes a table that contains addresses for objects in the set of objects, and wherein each object in the set of objects includes zero or more references;

converting the references within the set of objects from absolute references into offset-based references, wherein offsets are computed with respect to base addresses of objects, wherein said offsets are stored in place of said absolute references, wherein converting the absolute references into the offset-based references involves, for each absolute reference in said each object in the set of objects:

obtaining a base address from the table for the object of the absolute reference;

computing an offset for an offset-based reference by subtracting the base address of the object from the absolute reference;

applying an offset-based patch to the set of objects and to the location structure using a binary-patching technique; and

converting the references in the set of objects from offset-based references back into absolute references, wherein said absolute references are stored in place of said offsets;

wherein using the offset-based patch reduces the number of reference changes that need to be specified in the patch, and hence reduces the size of the patch.

10. The computer-readable storage medium of claim 9 , wherein converting an absolute reference into an offset-based reference comprises dividing the absolute reference into:

an address for the target object of the absolute reference; and

an offset for a target location of the absolute reference within the target object.

11. The computer-readable storage medium of claim 9 ,

wherein an entry for a given object in the table in the location structure points to a sub-table containing offsets for each reference contained in the given object; and

wherein the location structure allows the system to determine the locations of all references in the set of objects.

12. The computer-readable storage medium of claim 9 ,

wherein the method is used to patch the set of objects on a mobile device with a limited-bandwidth network connection; and

wherein using offset-based references results in a smaller patch, which reduces the amount of data that needs to be transferred across the limited-bandwidth network connection during the patching process.

13. The computer-readable storage medium of claim 12 , wherein the method further comprises generating the offset-based patch by:

obtaining a previous version of the set of objects and a new version of the set of objects;

wherein the previous version of the set of objects and the new version of the set of objects each include a corresponding location structure;

decomposing the references in the previous version of the set of objects and the new version of the set of objects into offset-based references;

calculating a set of differences between the previous version of the set of objects and the new version of the set of objects;

compressing the set of differences to form the offset-based patch; and

sending the offset-based patch to the mobile device to patch the previous version of the set of objects located on the mobile device.

14. The computer-readable storage medium of claim 9 , further comprising aggregating adjacent objects in the set of objects to reduce the size of the location structure.

15. The computer-readable storage medium of claim 9 , wherein the set of objects comprises a program binary; and wherein the program binary includes a large machine-generated binary table in the J2ME™ environment.

16. The computer-readable storage medium of claim 15 , wherein the program binary includes a JAVA™ system ROM image.

17. A computer system for patching a set of objects containing references, comprising:

a processor;

a memory coupled to the processor, wherein said memory comprises:

instructions for a locating mechanism configured to keep track of the locations of references within the set of objects, wherein the location mechanism maintains a table that contains addresses for objects in the set of objects, and wherein each object in the set of objects includes zero or more references;

instructions for a conversion mechanism configured to convert the references within the set of objects from absolute references into offset-based references, wherein offsets are computed with respect to base addresses of objects, wherein said offsets are stored in place of said absolute references, wherein converting the absolute references into the offset-based references involves, for each absolute reference in said each object in the set of objects:

obtaining a base address from the table for the object of the absolute reference;

computing an offset for an offset-based reference by subtracting the base address of the object from the absolute reference;

instructions for an application mechanism configured to apply an offset-based patch to the set of objects and to the location structure using a binary-patching technique; and

wherein the conversion mechanism is additionally configured to convert the references in the set of objects from offset-based references back into absolute references, wherein said absolute references are stored in place of said offsets;

wherein using the offset-based patch reduces the number of reference changes that need to be specified in the patch, and hence reduces the size of the patch.

18. The computer system of claim 17 ,

wherein the computer system is used to patch the set of objects on a mobile device with a limited-bandwidth network connection; and

wherein using the offset-based references results in a smaller patch, which reduces the amount of data that needs to be transferred across the limited-bandwidth network connection during the patching process.

Assignments (2)
MERGER AND CHANGE OF NAME Recorded Dec 16, 2015
From: ORACLE USA, INC.; SUN MICROSYSTEMS, INC.; ORACLE AMERICA, INC.
To: ORACLE AMERICA, INC.
Reel/Frame 037306/0292 →
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Dec 9, 2005
From: LAM, IOI K.; PLISS, OLEG A.
To: SUN MICROSYSTEMS, INC.
Reel/Frame 017355/0498 →
Continuity (1)
Related Publication 20070169082A1 · Jul 19, 2007