Dispatch Table Optimization for Unused Virtual Functions
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Existing methods for reducing executable code size in embedded systems, such as Software Defined Radios, often result in removing functionality or failing conformance tests, and are ineffective in eliminating unused virtual functions in object-oriented programming languages.
Innovation Solution
A method that scans object files for references to object-oriented methods in dispatch tables, designates unused virtual functions as such, and deletes them, while maintaining references to used functions, using a 'soft reference' directive to indicate non-essential code, and optimizing dispatch tables during compilation and linking.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Quantity of substance
If existing methods for reducing executable code size are used, then code size is reduced, but functionality is removed or conformance tests fail
Solution Approach 1:
The patent extracts and removes only the unused virtual functions from the executable code while preserving the dispatch table structure and all used functions. This selective extraction approach reduces code size without removing necessary functionality, thereby maintaining conformance with SCA and CORBA standards.
Solution Approach 2:
The patent applies different treatment to different virtual functions based on their usage status. Used virtual functions are preserved with full functionality, while unused virtual functions are removed. This localized differentiation allows code size reduction without compromising the reliability of essential functions.
2Reliability
If unused virtual functions are not eliminated, then conformance is maintained, but executable code size remains large
Solution Approach 1:
The patent performs preliminary analysis during the compilation or linking phase to identify which virtual functions are unused based on the object file references. This preliminary action allows the system to proactively remove unused virtual functions before the executable is generated, reducing code size while maintaining conformance.
Solution Approach 2:
The patent uses an intermediary processing step (such as a linker script or compiler flag mechanism) that mediates between the requirement to maintain standard conformance and the desire to reduce code size. This intermediary allows selective removal of unused virtual functions while preserving the dispatch table structure required for SCA and CORBA compliance.
3Reliability
If all virtual functions are included in the executable, then conformance is ensured, but code size and memory usage increase
Solution Approach 1:
The patent extracts and removes only the unused virtual functions from the executable while preserving the dispatch table structure and all used functions. This selective extraction approach reduces code size without removing necessary functionality, thereby maintaining conformance with SCA and CORBA standards.
Solution Approach 2:
The patent changes the parameter of virtual function inclusion from a binary all-or-nothing approach to a selective inclusion model. By analyzing object file references and determining which virtual functions are actually used, the system dynamically adjusts which virtual functions are included in the executable, optimizing the balance between conformance and code size.
Data Source
AI summary
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.

