Object Pointer Class Identification via Embedded Identifier
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
In object-oriented programming languages, determining the class of an object from an object pointer consumes a large amount of performance resources due to cache misses and inefficient class comparisons, which are common operations.
Innovation Solution
The solution involves using a class identifier (CID) embedded in the object pointer to directly access a class identifier table, eliminating the need for loading the object and reducing cache misses by storing class structure pointers associated with CIDs, allowing for faster class comparisons and virtual method calls.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Measurement precision
If class comparison is performed by loading the object and comparing class structure pointers, then accurate class identification is achieved, but performance resources are consumed heavily due to cache misses
Solution Approach 1:
The patent extracts the class structure pointer from the object and stores it in a separate cache structure. This allows the class identifier to be accessed directly without loading the entire object from memory, thereby maintaining accurate class identification while significantly reducing cache misses and improving comparison speed.
Solution Approach 2:
The patent performs preliminary action by pre-loading class structure pointers into a cache structure before they are needed for comparison. This advance preparation ensures that when class comparison is needed, the data is already available in fast memory, eliminating cache misses and improving performance.
2Loss of information
If the object is loaded from main memory to determine class information, then complete object data is available, but numerous clock cycles are wasted due to cache misses
Solution Approach 1:
The patent extracts only the class structure pointer from the object, storing it separately in a cache structure. This extraction allows the system to access class information without loading the entire object from main memory, thus preserving object data completeness while dramatically reducing the time and clock cycles required.
Solution Approach 2:
The patent segments the object data by separating the class structure pointer from the rest of the object. This segmentation allows the critical class identification data to be cached independently, enabling fast access without requiring the full object to be present in memory, thereby reducing time loss while maintaining information completeness.
3Ease of operation
If traditional object pointer comparison is used to determine class, then class comparison is performed, but performance resources are consumed heavily due to indirect jumps and cache misses
Solution Approach 1:
The patent introduces a cache structure as an intermediary between the object pointer and the class structure. This intermediary stores class structure pointers in a optimized format that enables direct comparison without indirect jumps, maintaining ease of operation while significantly improving execution efficiency by eliminating cache misses.
Solution Approach 2:
The patent performs preliminary action by pre-organizing class structure pointers in a cache structure with direct access paths. This preparation eliminates the need for indirect jumps during class comparison operations, maintaining operational simplicity while dramatically improving execution efficiency.
Data Source
AI summary
Reaching a determination associated with a class of an object is disclosed. An identifier associated with the class of the object is extracted from a pointer to the object. The extracted identifier is compared to a comparison value. At least in part using a result of the comparison a determination is reached.


