# US 8,887,131 B2 · Optimized code generation by eliminating unused virtual function

> Agents: this data is available as JSON from the patentgrep API and MCP server — see https://patentgrep.com/llms.txt

- Number: US 8,887,131 B2
- Document ID: US8887131B2
- Status: Granted
- Kind: B2
- Application number: 12/073,788
- Filed: 2008-03-10
- Published: 2009-05-28
- Granted: 2014-11-11
- Earliest claimed: 2007-03-09
- Assignees: Objective Interface Systems, Inc.
- Applicants: William Beckwith; Lance Kibblewhite
- Inventors: William Beckwith; Lance Kibblewhite
- Web page: https://patentgrep.com/patent/US8887131B2

## CPC

- G06F 9/449: {Object-oriented method invocation or resolution}
- G06F 8/4434: {Reducing the memory space required by the program code}
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

The present invention relates to a method for reducing the object code size of an application that requires run-time dispatching of object oriented methods. The method comprises scanning an object file corresponding to the application for references to object oriented methods in a dispatch table that performs run-time object oriented method binding. The highest inheritance level associated with an object oriented method is found. All references to object oriented methods above the highest inheritance level are designated as unused. All references to object oriented methods below the highest inheritance level are designate as used. All references to object oriented methods that are designated as unused are deleted from the dispatch table.

## Claims

### Claim 1

A method for reducing object code size of an application that requires run-time dispatching of object oriented methods, comprising:
scanning an object file corresponding to the application for references to object oriented methods in a dispatch table that performs run-time object oriented method binding;
determining whether the object code or source code contains calls to the object-oriented methods that are capable of being dispatched to implementations of the object-oriented methods;
finding, in a hierarchy of inheritance levels where a highest level of the hierarchy is configured to not inherit from other levels of the hierarchy and where the highest level of hierarchy is above a level that inherits from the highest level, the highest inheritance level associated with an object oriented method;
designating as unused all references to object oriented methods above the highest inheritance level and all references that are not called by the application;
designating as used all references to object oriented methods below the highest inheritance level;
deleting from the dispatch table all references to object oriented methods that are designated as unused;
eliminating a reference to the object-oriented method in the dispatch table when it is determined that the source code does not call the object-oriented method; and
eliminating all of the object-oriented method implementations that are not capable of being dispatched based on the determining step by modifying the object code or a linking process.

### Claim 2 (depends on 1)

The method of claim 1, wherein the object oriented method supports dynamic-binding in object-oriented programming.

### Claim 3 (depends on 1)

The method of claim 1, wherein the object oriented method comprises a virtual function method.

### Claim 4 (depends on 1)

The method of claim 1, wherein said method is implemented as a program-build-tool-chain.

### Claim 5 (depends on 1)

The method of claim 1, wherein said method is implemented as a code optimization tool.

### Claim 6 (depends on 1)

The method of claim 1, wherein said method is implemented during the compilation of a source code or linking of an object code.

### Claim 7 (depends on 1)

The method of claim 1, wherein said object file is generated from at least one of a compiled or linked code.
