In-Place Executable Relocation via Offset Pointer Adjustment
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
In-place execution in Java Virtual Machines is hindered by execution speed issues due to immutable code and additional indirection caused by symbolic references, which are necessary for relocatable and portable executable files, making it unsuitable for memory-constrained devices like mobile phones.
Innovation Solution
The system loads an in-place executable file with internal pointers, determines the actual memory address, generates an offset if necessary, and adjusts these pointers to their correct locations using a relocation table, allowing the file to be relocated without performance overhead, and optionally writes back the adjusted file to storage.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Quantity of substance
If in-place execution is used with symbolic references for relocatability, then memory consumption is reduced, but execution speed deteriorates due to additional indirection and costly symbolic lookups
Solution Approach 1:
The patent applies preliminary action by performing symbolic reference resolution during the relocation process before execution begins. The relocation table is constructed in advance to map symbolic references to their actual memory locations, eliminating the need for costly runtime symbolic lookups. This pre-computation of reference resolution allows the executable to achieve both relocatability and fast execution.
Solution Approach 2:
The patent introduces an intermediary structure (the relocation table) that mediates between the symbolic references in the in-place executable and the actual memory locations. This relocation table acts as a bridge, translating symbolic references into direct memory addresses during relocation, thereby eliminating the need for expensive symbolic lookups at runtime while maintaining relocatability.
2Quantity of substance
If in-place execution with immutable code is used, then memory consumption is reduced, but runtime optimizations are limited due to code immutability
Solution Approach 1:
The patent applies dynamics by enabling the in-place executable to be relocated to different memory locations during execution. The relocation mechanism allows the code to dynamically adjust its memory address while maintaining the benefits of in-place execution. This dynamic relocation capability provides flexibility for runtime optimizations without compromising memory efficiency.
3Adaptability or versatility
If symbolic references are used for relocatability, then portability is improved, but performance deteriorates due to hashtable lookups and additional indirection
Solution Approach 1:
The patent applies preliminary action by pre-resolving symbolic references during the relocation process. The relocation table is constructed in advance to map all symbolic references to their actual memory locations, eliminating the need for costly runtime hashtable lookups. This pre-computation maintains portability while achieving fast execution.
Solution Approach 2:
The patent introduces an intermediary structure (the relocation table) that mediates between the symbolic references in the portable executable and the actual memory locations. This relocation table acts as a bridge, translating symbolic references into direct memory addresses during relocation, thereby eliminating the need for expensive runtime symbolic lookups while maintaining portability.
Data Source
AI summary
One embodiment of the present invention provides a system that facilitates loading of an in-place executable file into a virtual machine. The system operates by loading the in-place executable file into the virtual machine, where the in-place executable file contains internal pointers that point to memory locations within the in-place executable file, and a target memory address that specifies a target location in memory where the in-place executable file is configured to be loaded. The system then determines an actual memory address at which the in-place executable file is actually loaded. If the actual memory address and the target memory address are different, the system generates an offset value, which is the difference between the actual memory address and the target memory address. Finally, the system adjusts each internal pointer within the in-place executable file by the offset value so that the internal pointers point to intended locations inside the in-place executable file.


