Local Entry Points for Indirect Function Calls
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Existing computer systems face inefficiencies in using indirect function calls due to the need for recalculating global entry points, which is less efficient than using local entry points when the caller and callee reside in the same shared object, leading to increased processor resource utilization and memory usage.
Innovation Solution
A method is provided to configure indirect function calls by determining whether a function pointer value is for local-use-only, allowing the compiler, linker, and loader to select between local and global entry points, optimizing the call site by using local entry points when possible, thereby reducing unnecessary recalculations and resource usage.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Reliability
If global entry points are used for indirect function calls, then compatibility and correctness are ensured, but processor resource utilization and memory usage increase due to recalculations
Solution Approach 1:
The patent applies local quality by providing different entry point implementations for different contexts: local entry points for calls within the same shared object and global entry points for calls across shared objects. This allows the system to optimize for speed in local contexts while maintaining correctness in global contexts, resolving the contradiction between reliability and processor resource usage.
Solution Approach 2:
The patent implements dynamics by making the entry point selection adaptive based on runtime conditions. The system dynamically determines whether to use local or global entry points based on whether the caller and callee reside in the same shared object, allowing optimal performance characteristics to be achieved without sacrificing correctness.
2Reliability
If global entry points are used for indirect function calls, then compatibility across shared objects is ensured, but memory usage increases due to TOC pointer saving and restoring
Solution Approach 1:
The patent applies local quality by providing different entry point implementations for different contexts: local entry points for calls within the same shared object and global entry points for calls across shared objects. This allows the system to optimize for speed in local contexts while maintaining correctness in global contexts, resolving the contradiction between reliability and processor resource usage.
3Productivity
If local entry points are used, then processor efficiency is improved, but they cannot be used when caller and callee are in different shared objects
Solution Approach 1:
The patent applies segmentation by dividing the entry point implementation into separate local and global versions. The local entry point is segmented for use within the same shared object to maximize efficiency, while the global entry point is segmented for use across shared objects to ensure adaptability. This segmentation allows each entry point to be optimized for its specific use case.
Solution Approach 2:
The patent applies local quality by providing different entry point implementations for different contexts: local entry points for calls within the same shared object and global entry points for calls across shared objects. This allows the system to optimize for speed in local contexts while maintaining correctness in global contexts, resolving the contradiction between reliability and processor resource usage.
Data Source
AI summary
Embodiments relate to using a local entry point with an indirect call function. More specifically, an indirect call function configuration comprises a first application module having a target function of the indirect function call, a second application module with a symbolic reference to the target function of the indirect function call, and a third application module to originate an indirect function call. A compiler determines and indicates, in the program code, that the function pointer value resulting from a non-call reference of a function symbol is solely used to perform indirect calls in the same module, e.g. local-use-only. A linker or loader can read the indication the compiler made in the program code. The linker or loader use the local entry point associated with the target function if the target function is defined in the same module as the reference and is local-use-only.


