IP Library Granted Patent US 7,543,282
Granted Patent B2
US 7,543,282 · App. 11/389,579 · Granted Jun 2, 2009

Method and apparatus for selectively executing different executable code versions which are optimized in different ways

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,543,282
App. No.
11/389,579
Granted
Jun 2, 2009
Kind
B2
Abstract

One embodiment of the present invention provides a system that selectively executes different versions of executable code for the same source code. During operation, the system first receives an executable code module which includes two or more versions of executable code for the same source code, wherein the two or more versions of the executable code are optimized in different ways. Next, the system executes the executable code module by first evaluating a test condition, and subsequently executing a specific version of the executable code based on the outcome of the evaluation, so that the execution is optimized for the test condition.

Claims (42)

1. A method for selectively executing different versions of executable code for the same source code, the method comprising:

receiving an executable code module which includes two or more versions of executable code for the same source code, wherein the two or more versions are optimized in different ways; and

executing the executable code module, wherein executing the executable code module involves:

evaluating a test condition, wherein evaluating the test condition involves determining a temperature of a processor/core; and

executing a specific version of the executable code based on the outcome of the evaluation, wherein the specific version of the executable code is optimized for the test condition.

2. The method of claim 1 , wherein evaluating the test condition involves executing a branch instruction in the executable code module, wherein the branch instruction directs the execution to the specific version of the executable code based on the outcome of the evaluation.

3. The method of claim 1 , wherein prior to receiving the executable code module, the method further comprises creating the executable code module by combining the two or more differently optimized versions of the executable code into the executable code module.

4. The method of claim 1 , wherein evaluating the test condition involves evaluating a condition associated with a runtime state of a system.

5. The method of claim 4 , wherein evaluating the test condition further involves determining one or more of:

a core utilization;

a memory bandwidth utilization; or

other system performance criteria.

6. The method of claim 1 , wherein evaluating the test condition further involves obtaining a processor type.

7. The method of claim 1 , further comprising producing the two or more versions of the executable code by compiling the source code with different optimization parameters.

8. A computer-readable storage medium storing instructions that when executed by a computer cause the computer to perform a method for selectively executing different versions of executable code for the same source code, the method comprising:

receiving an executable code module which includes two or more versions of executable code for the same source code, wherein the two or more versions are optimized in different ways; and

executing the executable code module, wherein executing the executable code module involves:

evaluating a test condition, wherein evaluating the test condition involves determining a temperature of a processor/core; and

executing a specific version of the executable code based on the outcome of the evaluation, wherein the specific version of the executable code is optimized for the test condition.

9. The computer-readable storage medium of claim 8 , wherein evaluating the test condition involves executing a branch instruction in the executable code module, wherein the branch instruction directs the execution to the specific version of the executable code based on the outcome of the evaluation.

10. The computer-readable storage medium of claim 8 , wherein prior to receiving the executable code module, the method further comprises creating the executable code module by combining the two or more differently optimized versions of the executable code into the executable code module.

11. The computer-readable storage medium of claim 8 , wherein evaluating the test condition involves evaluating a condition associated with a runtime state of a system.

12. The computer-readable storage medium of claim 11 , wherein evaluating the test condition further involves determining one or more of:

a core utilization;

a memory bandwidth utilization; or

other system performance criteria.

13. The computer-readable storage medium of claim 8 , wherein evaluating the test condition further involves obtaining a processor type.

14. The computer-readable storage medium of claim 8 , further comprising producing the two or more versions of the executable code by compiling the source code with different optimization parameters.

15. An apparatus for selectively executing different versions of executable code for the same source code, comprising:

a receiving mechanism configured to receive an executable code module which includes two or more versions of executable code for the same source code, wherein the two or more versions are optimized in different ways; and

an execution mechanism configured to execute the executable code module, wherein while executing the executable code module, the execution mechanism is configured to:

evaluate a test condition, wherein evaluating the test condition involves determining a temperature of a processor/core; and to

execute a specific version of the executable code based on the outcome of the evaluation, wherein the specific version of the executable code is optimized for the test condition.

16. The apparatus of claim 15 , wherein the execution mechanism is configured to execute a branch instruction in the executable code module, wherein the branch instruction directs the execution to the specific version of the executable code based on the outcome of the evaluation.

17. The apparatus of claim 15 , further comprising a creation mechanism configured to create the executable code module by combining the two or more differently optimized versions of the executable code into the executable code module.

18. The apparatus of claim 15 , wherein while evaluating the test condition, the execution mechanism is configured to evaluate a condition associated with a runtime state of a system.

19. The apparatus of claim 18 , wherein evaluating the test condition further involves determining one or more of:

a core utilization;

a memory bandwidth utilization; or

other system performance criteria.

20. The apparatus of claim 15 , wherein while evaluating the test condition, the execution mechanism is configured to obtain a processor type.

21. The apparatus of claim 15 , further comprising a compilation mechanism configured to produce the two or more versions of the executable code by compiling the source code with different optimization parameters.

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 037304/0183 →
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Mar 24, 2006
From: CHOU, YUAN C.
To: SUN MICROSYSTEMS, INC.
Reel/Frame 017728/0228 →