IP Library Granted Patent US 8,495,606
Granted Patent B2
US 8,495,606 · App. 12/271,451 · Granted Jul 23, 2013

Redundant exception handling code removal

Inventors: Sheldon M. Lobo (Cary, NC); Fu-Hwa Wang (Saratoga, CA)
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 8,495,606
App. No.
12/271,451
Granted
Jul 23, 2013
Kind
B2
Abstract

A system performs operations comprising creating a call graph for a program translated from source code, identifying redundant exception handling code in the program utilizing the call graph, and removing the redundant exception handling code. The operation of identifying redundant exception handling code may comprise identifying at least one function or callsite by determining that a first function in the at least one function's or callsite's callee chain throws an exception and that the exception is handled by a second function in the function's or callsite's callee chain or by determining that an exception is not thrown in the at least one function's or callsite's callee chain. The operation of removing the redundant exception handling code may comprise removing redundant exception handling code included in at least one function or callsite and/or removing at least one entry for the at least one function or callsite from an exception lookup table.

Claims (44)

1. A computer-implemented method, comprising:

creating a call graph for a program that has been translated from source code;

marking a function in the call graph if the function throws at least one exception;

analyzing the call graph to identify redundant exception handling code in the program by:

identifying at least one function which includes at least a portion of the redundant exception handling code by determining that an exception is not thrown in a callee chain corresponding to the at least one function by determining that the callee chain does not include a marked function; and

removing the redundant exception handling code from the program.

2. The computer-implemented method of claim 1 , wherein said removing the redundant exception handling code from the program comprises:

removing the portion of the redundant exception handling code included in the at least one function.

3. The computer-implemented method of claim 2 , wherein said removing the redundant exception handling code from the program further comprises:

removing at least one entry for the at least one function from an exception lookup table.

4. The computer-implemented method of claim 1 , wherein said program is interpreted from the source code.

5. The computer-implemented method of claim 1 , wherein said program is interpreting from the source code.

6. The computer-implemented method of claim 1 , wherein said source code comprises at least one of actionscript source code, ada source code, c++ source code, d source code, eiffel source code, ml source code, object pascal source code, delphi source code, freepascal source code, objective-c source code, pl/1 (programming language one) source code, smalltalk source code, and prolog source code.

7. The computer-implemented method of claim 1 , further comprising:

concatenating the program into a binary file after the redundant exception handling code has been removed.

8. The computer-implemented method of claim 1 , further comprising:

storing the program to a machine readable medium after the redundant exception handling code has been removed.

9. A system, comprising:

a memory which stores a program that has been translated from source code; and

a processing unit, operatively coupled to the memory, wherein the processing unit creates a call graph for the program, marks a function in the call graph if the function throws at least one exception, analyzes the call graph to identify redundant exception handling code in the program by identifying at least one function which includes at least a portion of the redundant exception handling code by determining that an exception is not thrown in a callee chain corresponding to the at least one function by determining that the callee chain does not include a marked function, and removes the redundant exception handling code from the program.

10. A non-transitory computer program product, including a computer readable storage medium and instructions executable by a processing unit tangibly embodied in the computer readable storage medium, the instructions comprising:

a first set of instructions for creating a call graph for a program that has been translated from source code;

a second set of instructions for marking a function in the call graph if the function throws at least one exception;

a third set of instructions for analyzing the call graph to identify redundant exception handling code in the program by:

identifying at least one function which includes at least a portion of the redundant exception handling code by determining that an exception is not thrown in a callee chain corresponding to the at least one function by determining that the callee chain does not include a marked function; and

a fourth third set of instructions for removing the redundant exception handling code from the program.

11. A computer-implemented method, comprising:

creating a call graph for a program that has been translated from source code;

marking a function in the call graph if the function throws at least one exception;

analyzing the call graph to identify redundant exception handling code in the program by:

identifying at least one function which includes at least a portion of the redundant exception handling code by determining that an exception is not thrown in at least one callsite corresponding to the at least one function by determining that the at least one callsite does not include a marked function; and

removing the redundant exception handling code from the program.

12. A computer-implemented method, comprising:

creating a call graph for a program that has been translated from source code;

marking a function in the call graph if the function throws at least one exception;

analyzing the call graph to identify redundant exception handling code in the program by:

identifying at least one function which includes at least a portion of the redundant exception handling code by determining that a first function in a callee chain corresponding to the at least one function throws an exception and that the exception is handled by a second function in the callee chain corresponding to the at least one function; and

removing the redundant exception handling code from the program.

13. A computer-implemented method, comprising:

creating a call graph for a program that has been translated from source code;

marking a function in the call graph if the function throws at least one exception;

analyzing the call graph to identify redundant exception handling code in the program by:

identifying at least one function which includes at least a portion of the redundant exception handling code by determining that a first function in at least one callsite corresponding to the at least one function throws an exception and that the exception is handled by a second function in the at least one callsite corresponding to the at least one function; and

removing the redundant exception handling code from the program.

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 037311/0206 →
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Nov 14, 2008
From: LOBO, SHELDON M.; WANG, FU-HWA
To: SUN MICROSYSTEMS, INC.
Reel/Frame 021837/0426 →
Continuity (1)
Related Publication 20100125837A1 · May 20, 2010