IP Library Granted Patent US 7,665,076
Granted Patent B2
US 7,665,076 · App. 10/860,412 · Granted Feb 16, 2010

Method and apparatus for activating/deactivating run-time determined software routines in Java compiled bytecode applications

Assignee: International Business Machines Corporation
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,665,076
App. No.
10/860,412
Granted
Feb 16, 2010
Kind
B2
Abstract

Provided is a JIT compiler that changes the status of run-time determined software routines between being activated and deactivated in an application program. Conditional statements which are used at run-time to determine whether such a routine has been activated or deactivated are presented as discrete conditions that always evaluate to a known result by using an invariant flag in the compiled bytecode. The JIT compiler optimises an application program by excluding discrete condition checks. Consequently, if the branch of the discrete condition that will never execute includes a run-time determined software routine, then the routine will be excluded from the JIT compilation and will not form part of the JIT compiled native machine code. A run-time class or code replacement facility is used as a means of activating or deactivating a run-time determined software routine at run-time by changing the value of the invariant flag of said routine.

Claims (21)

1. A method of changing a status of a run-time determined software routine between activated and deactivated, comprising:

employing an invariant flag to evaluate a conditional statement associated with said run-time determined software routine to determine the status as one of activated or deactivated, said invariant flag being selected to cause said conditional statement to always evaluate to a known result; and

during run-time, utilising a run-time code replacement facility to change said invariant flag to a second invariant flag that causes said conditional statement to always evaluate to a different known result; and

optimizing said run-time determined software routine by excluding from compiled native machine code the run-time determined software routine when the invariant flag is selected to cause the conditional statement associated with said routine to evaluate to the different know result.

2. A method as claimed in claim 1 , wherein the invariant flag comprises one of a final static Boolean parameter, a numerical test on an invariant held and a hard coded statement and wherein said step of utilising a run-time code replacement facility to change said invariant flag comprises changing a value of the Boolean parameter, changing the invariant field or replacing the hard coded statement by its converse.

3. A method as claimed in 2 , wherein said final static Boolean parameter comprises a final static Boolean data type.

4. A method as claimed in claim 1 , wherein said run-time determined software routine comprises a class file.

5. A method as claimed in claim 4 , wherein it includes the step of just-in-time (JIT) compiling methods of the class file.

6. A method as claimed in claim 5 , wherein a interpreter maintains a method invocation count for each method of the class file and wherein the method includes the step of JIT compiling only those methods whose invocation count exceeds a threshold value.

7. A virtual machine (VM), stored on a memory for execution on a processor, arranged to carry out the method of changing a status of a runtime determined software routine between activated and deactivated, the VM being configured for:

employing an invariant flag to evaluate a conditional statement associated with said run-time determined software routine to determine its status as one of activated or deactivated, said invariant flag being selected to cause said conditional statement to always evaluate to a known result; and

during run-time, utilising a run-time code replacement facility to change said invariant flag to a second invariant flag that causes said conditional statement to always evaluate to a different known result; and

optimizing said run-time determined software routine by excluding from compiled native machine code the run-time determined software routine when the invariant flag is selected to cause the conditional statement associated with said routine to evaluate to the different known result.

8. A just-in-time (JIT) compiler, stored on a memory and executed on a processor, arranged to carry out the method of changing a status of a run-time determined software routine between activated and deactivated, the method comprising:

employing an invariant flag to evaluate a conditional statement associated with said run-time determined software routine to determine its status as one of activated or deactivated, said invariant flag being selected to cause said conditional statement to always evaluate to a known result; and

during run-time, utilising a run-time code replacement facility to change said invariant flag to a second invariant flag that causes said conditional statement to always evaluate to a different known result; and

optimizing said run-time determined software routine by excluding from compiled native machine code the run-time determined software routine when the invariant flag is selected to cause the conditional statement associated with said routine to evaluate to the different known result.

9. A computer program product in a computer readable medium for carrying out the method of changing a status of a run-time determined software routine between activated and deactivated, said method comprising:

employing an invariant flag to evaluate a conditional statement associated with said run-time determined software routine to determine the status as one of activated or deactivated, said invariant flag being selected to cause said conditional statement to always evaluate to a known result; and

during run-time, utilising a run-time code replacement facility to change said invariant flag to a second invariant flag that cause said conditional statement to evaluate to a different known result; and

optimizing said run-time determined software routine by excluding from compiled native machine code the run-time determined software routine when the invariant flag is selected to cause the conditional statement associated with said routine to evaluate to the different known result.

Assignments (8)
TERMINATION AND RELEASE OF SECURITY INTEREST IN PATENT RIGHTS (REEL 062079, FRAME 0677) Recorded Mar 3, 2026
From: MORGAN STANLEY SENIOR FUNDING, INC., AS COLLATERAL AGENT
To: X CORP. (F/K/A TWITTER, INC.)
Reel/Frame 075015/0574 →
RELEASE OF SECURITY INTEREST Recorded Apr 30, 2025
From: MORGAN STANLEY SENIOR FUNDING, INC., AS COLLATERAL AGENT
To: X CORP. (F/K/A TWITTER, INC.)
Reel/Frame 071127/0240 →
RELEASE OF SECURITY INTEREST Recorded Mar 27, 2025
From: MORGAN STANLEY SENIOR FUNDING, INC.
To: X CORP. (F/K/A TWITTER, INC.)
Reel/Frame 070670/0857 →
SECURITY INTEREST Recorded Oct 28, 2022
From: TWITTER, INC.
To: MORGAN STANLEY SENIOR FUNDING, INC.
Reel/Frame 062079/0677 →
SECURITY INTEREST Recorded Oct 28, 2022
From: TWITTER, INC.
To: MORGAN STANLEY SENIOR FUNDING, INC.
Reel/Frame 061804/0001 →
SECURITY INTEREST Recorded Oct 28, 2022
From: TWITTER, INC.
To: MORGAN STANLEY SENIOR FUNDING, INC.
Reel/Frame 061804/0086 →
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Jan 16, 2014
From: INTERNATIONAL BUSINESS MACHINES CORPORATION
To: TWITTER, INC.
Reel/Frame 032075/0404 →
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Aug 17, 2004
From: CLEMENT, ANDREW SIMON; WEBSTER, MATTHEW ALEXANDER
To: INTERNATIONAL BUSINESS MACHINES CORPORATION
Reel/Frame 015069/0013 →
Priority Claims (1)
GB 0325553.6 · Nov 1, 2003 · national
Continuity (1)
Related Publication 20050097534A1 · May 5, 2005