IP Library Granted Patent US 7,730,469
Granted Patent B1
US 7,730,469 · App. 10/840,069 · Granted Jun 1, 2010

Method and system for code optimization

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,730,469
App. No.
10/840,069
Granted
Jun 1, 2010
Kind
B1
Abstract

Methods, systems, and articles of manufacture consistent with the present invention optimize a program by analyzing a statistical profile of a program execution, and automatically optimizing the program based on at least one of the analysis, information about at least one prior compilation of the program, and information about at least one prior optimization of the program. The optimization of the program can therefore take into consideration changes made during prior compilations and optimization and the results of the changes.

Claims (59)

1. A method in a data processing system for optimizing a program, the method comprising the steps of:

automatically analyzing a statistical profile of a program execution; and

automatically optimizing object code of the program based on at least one of the analysis, information about at least one prior compilation of the program, and information about at least one prior optimization of the program,

wherein,

said automatically optimizing includes

determining that information additional to the statistical profile is required to optimize the object code of the program,

performing a first compiling of a portion of the program,

executing the first compiled portion of the program,

gathering the information additional to the statistical profile,

generating and executing diagnostic code based on the information additional to the statistical profile to determine what optimization is required,

performing a second compiling of the portion of the program using the results generated from executing the diagnostic code, and

selecting, from among a plurality of optimization techniques based on logical relations between said plurality of optimization techniques, a not previously tried one of the plurality of optimization techniques if a previously tried optimization technique was unsuccessful.

2. The method of claim 1 , wherein the program is automatically optimized during a compilation.

3. The method of claim 2 , wherein the program is automatically optimized during a run-time compilation.

4. The method of claim 1 , further comprising the steps of:

interrupting the program;

recording an execution state of the program; and

storing the recorded execution state to create the statistical profile.

5. The method of claim 1 , wherein the information about at least one prior compilation of the program includes a profile of the program implemented during the at least one prior compilation.

6. The method of claim 1 , wherein the information about at least one prior optimization of the program includes a profile of at least one change made to the program during the at least one prior compilation.

7. A computer-readable storage medium containing instructions that cause a data processing system to perform a method for optimizing a program, the method comprising the steps of:

automatically analyzing a statistical profile of a program execution; and

automatically optimizing object code of the program based on at least one of the analysis, information about at least one prior compilation of the program, and information about at least one prior optimization of the program,

wherein, said automatically optimizing includes

determining that information additional to the statistical profile is required to optimize the object code of the program, performing a first compiling of a portion of the program,

executing the first compiled portion of the program,

gathering the information additional to the statistical profile,

generating and executing diagnostic code based on the information additional to the statistical profile to determine what optimization is required,

performing a second compiling of the portion of the program using the results generated from executing the diagnostic code, and

selecting, from among a plurality of optimization techniques based on logical relations between said plurality of optimization techniques, a not previously tried one of the plurality of optimization techniques if a previously tried optimization technique was unsuccessful.

8. The computer-readable storage medium of claim 7 , wherein the program is automatically optimized during a compilation.

9. The computer-readable storage medium of claim 8 , wherein the program is automatically optimized during a run-time compilation.

10. The computer-readable storage medium of claim 7 , further comprising the steps of:

interrupting the program;

recording an execution state of the program; and

storing the recorded execution state to create the statistical profile.

11. The computer-readable storage medium of claim 7 , wherein the information about at least one prior compilation of the program includes a profile of the program implemented during the at least one prior compilation.

12. The computer-readable storage medium of claim 7 , wherein the information about at least one prior optimization of the program includes a profile of at least one change made to the program during the at least one prior compilation.

13. A data processing system for optimizing a program, the data processing system comprising:

a memory having an optimization program that automatically analyzes a statistical profile of a program execution, and automatically optimizes object code of the program based on at least one of the analysis, information about at least one prior compilation of the program, and information about at least one prior optimization of the program,

wherein said automatically optimizing includes

determining that information additional to the statistical profile is required to optimize the object code of the program, performing a first compiling of a portion of the program, executing the first compiled portion of the program,

gathering the information additional to the statistical profile,

generating and executing diagnostic code based on the information additional to the statistical profile to determine what optimization is required,

performing a second compiling of the portion of the program using the results generated from executing the diagnostic code, and

selecting, from among a plurality of optimization techniques based on logical relations between said plurality of optimization techniques, a not previously tried one of optimization techniques if a previously tried optimization technique was unsuccessful; and

a processing unit that runs the program.

14. The data processing system according to claim 13 , wherein the program is automatically optimized during a compilation.

15. The data processing system according to claim 14 , wherein the program is automatically optimized during run-time compilation.

16. A data processing system having a processing unit and a memory for optimizing a program, the data processing system comprising:

an analysis unit for automatically analyzing a statistical profile of a program execution; and

an optimizing unit for automatically optimizing object code of the program based on at least one of the analysis, information about at least one prior compilation of the program, and information about at least one prior optimization of the program,

wherein

said automatically optimizing includes determining that information additional to the statistical profile is required to optimize the object code of the program,

performing a first compiling of a portion of the program,

executing the first compiled portion of the program,

gathering the information additional to the statistical profile,

performing a second compiling of the portion of the program using the gathered information additional to the statistical profile, and

selecting, from among a plurality of optimization techniques based on logical relations between said plurality of optimization techniques, a not previously tried one of optimization techniques if a previously tried optimization technique was unsuccessful.

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 May 4, 2004
From: BOUCHER, MICHAEL
To: SUN MICROSYSTEMS, INC.
Reel/Frame 015307/0595 →