System, method and program product to optimize code during run time
First Claim
1. A process for optimizing a computer program during run time, said computer program including a call to a first method, said first method including a call to a second method, said process comprising the steps of:
- during run time, a processor of a computer determining if said second method includes a conditional evaluation of a variable which is fixed such that the execution of said second method does not result in anything productive being accomplished except to return to said first method, andif so, deleting in said first method said call to said second method, andif not, not deleting said call in said first method to said second method.
1 Assignment
0 Petitions
Accused Products
Abstract
System, process and program product for optimizing a computer program during run time. During run time, a determination is made whether the computer program calls a method which includes a conditional evaluation of a variable which is fixed and the evaluation of the fixed variable does not result in anything productive being accomplished except to return to execution of the computer program. If so, the call to the method which includes the conditional evaluation is deleted from the computer program for subsequent iterations of the computer program. Consequently, the subsequent execution of the computer program will yield a same result as if the conditional evaluation was executed. If the evaluation of the fixed variable results in something productive being accomplished, the call to the method which includes the conditional evaluation is not deleted from the subsequent execution of the computer program.
46 Citations
20 Claims
-
1. A process for optimizing a computer program during run time, said computer program including a call to a first method, said first method including a call to a second method, said process comprising the steps of:
-
during run time, a processor of a computer determining if said second method includes a conditional evaluation of a variable which is fixed such that the execution of said second method does not result in anything productive being accomplished except to return to said first method, and if so, deleting in said first method said call to said second method, and if not, not deleting said call in said first method to said second method. - View Dependent Claims (2)
-
-
3. A process for optimizing a computer program during run time of the computer program, said process comprising executing a program tool on a processor of a computer during said run time of the computer program, said program tool stored in a memory of the computer, said computer program being object code configured to be executed on the processor, said object code having been previously compiled by a compiler from source code, said computer program comprising a sequence of program statements declared explicitly in the source code to be a method, said executing the program tool during said run time comprising:
-
fetching an instruction of the computer program; said processor determining that the fetched instruction consists of a call to the method, said fetched instruction being comprised by program code of the computer program; responsive to said determining that the fetched instruction consists of said call to the method, said processor determining that a program statement of the declared sequence of program statements of the method includes a conditional evaluation of a fixed variable, wherein a declaration statement appearing in the source code explicitly declares the fixed variable as having a fixed value, and wherein an assignment statement appearing in the source code assigns the fixed value to the fixed variable, and wherein the declaration statement and the assignment statement are different statements in the source code; responsive to said determining that said program statement includes said conditional evaluation, said processor determining that an immediate return condition exits in the method such that an evaluation of the fixed variable results in an immediate return from the method to the program code without performance of any other program statement of the method; and responsive to said determining that the immediate return condition exits, deleting from the computer program the fetched instruction that consists of the call to the method. - View Dependent Claims (4, 5, 6, 7, 8)
-
-
9. A computer program product for optimizing a computer program during run time of the computer program, said computer program product comprising computer readable storage media and multiple program instructions to execute a program tool on a processor of a computer during said run time of the computer program, said program tool stored in a memory of the computer, said computer program being object code configured to be executed on the processor, said object code having been previously compiled by a compiler from source code, said computer program comprising a sequence of program statements declared explicitly in the source code to be a method, said multiple program instructions stored on the computer readable storage media, said multiple program instructions comprising:
-
first program instructions to fetch an instruction of the computer program; second program instructions to determine that the fetched instruction consists of a call to the method, said fetched instruction being comprised by program code of the computer program; third program instructions to determine, in response to prior execution of the second program instructions, that a program statement of the declared sequence of program statements of the method includes a conditional evaluation of a fixed variable, wherein a declaration statement appearing in the source code explicitly declares the fixed variable as having a fixed value, and wherein an assignment statement appearing in the source code assigns the fixed value to the fixed variable, and wherein the declaration statement and the assignment statement are different statements in the source code; fourth program instructions to determine, in response to prior execution of the third program instructions, that an immediate return condition exits in the method such that an evaluation of the fixed variable results in an immediate return from the method to the program code without performance of any other program statement of the method; and fifth program instructions to delete from the computer program, in response to prior execution of the fourth program instructions, the fetched instruction that consists of the call to the method. - View Dependent Claims (10, 11, 12, 13, 14)
-
-
15. A system for optimizing a computer program during run time of the computer program, said system comprising a processor of a computer, a computer readable memory, computer readable storage media, and multiple program instructions to execute a program tool on the processor during said run time of the computer program, said program tool stored in the computer readable memory, said computer program being object code configured to be executed on the processor, said object code having been previously compiled by a compiler from source code, said computer program comprising a sequence of program statements declared explicitly in the source code to be a method, said multiple program instructions stored on the computer readable storage media for execution by the processor, said multiple program instructions comprising:
-
first program instructions to fetch an instruction of the computer program; second program instructions to determine that the fetched instruction consists of a call to the method, said fetched instruction being comprised by program code of the computer program; third program instructions to determine, in response to prior execution of the second program instructions, that a program statement of the declared sequence of program statements of the method includes a conditional evaluation of a fixed variable, wherein a declaration statement appearing in the source code explicitly declares the fixed variable as having a fixed value, and wherein an assignment statement appearing in the source code assigns the fixed value to the fixed variable, and wherein the declaration statement and the assignment statement are different statements in the source code; fourth program instructions to determine, in response to prior execution of the third program instructions, that an immediate return condition exits in the method such that an evaluation of the fixed variable results in an immediate return from the method to the program code without performance of any other program statement of the method; and fifth program instructions to delete from the computer program, in response to prior execution of the fourth program instructions, the fetched instruction that consists of the call to the method. - View Dependent Claims (16, 17, 18, 19, 20)
-
Specification