Executable Image for Dynamic Code Patching in Constrained Memory
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Existing technologies face challenges in dynamically generating and patching computer code in computing environments with restricted executable memory writing, leading to inefficiencies and incompatibility with immutable operating systems like iOS.
Innovation Solution
A method utilizing a process virtual machine to generate and update executable images, employing a JIT compiler and interpreter to modify code on the target device, enabling dynamic code generation and patching within constrained environments.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Adaptability or versatility
If dynamic code generation is used to enable rapid adjustments to computer programs, then adaptability is improved, but compatibility with constrained operating systems is worsened
Solution Approach 1:
The patent introduces an intermediary executable image that acts as a bridge between the constrained operating system and the dynamic code generation process. The executable image contains the interpreter or JIT compiler code, allowing dynamic code generation to occur within the constraints of the operating system by mediating between the two incompatible requirements
Solution Approach 2:
The system segments the computer program into multiple components: the executable image containing the interpreter/JIT compiler, and the dynamically generated code. This segmentation allows the executable image to be loaded and executed in a constrained environment while enabling dynamic code generation through the interpreter or JIT compiler component
2Reliability
If remote servers are used to enable dynamic code generation, then compatibility with constrained operating systems is improved, but execution speed is worsened
Solution Approach 1:
The system enables self-service by embedding the interpreter or JIT compiler within the executable image that runs locally on the constrained operating system. This eliminates the need for remote server communication, allowing the system to perform dynamic code generation autonomously and improving execution speed while maintaining compatibility
3Adaptability or versatility
If cross-compilation is used to account for different target platform characteristics, then adaptability to different platforms is improved, but compilation time is worsened
Solution Approach 1:
The system performs preliminary action by including the interpreter or JIT compiler in the executable image before runtime. This preliminary preparation allows the system to adapt to different target platform characteristics dynamically during execution without requiring time-consuming cross-compilation processes
Solution Approach 2:
The system utilizes parameter changes by allowing the interpreter or JIT compiler to adjust its behavior based on detected target platform characteristics at runtime. The executable image can modify execution parameters to account for different CPU features, operating system endianness, and other platform-specific attributes without requiring recompilation
Data Source
Figure 1
Figure 2
Figure 3
AI summary
A system and method for facilitating adjusting computer code running in computing environments where writing of executable memory is restricted. An example method includes using a virtual machine to generate a first executable image from software code, and employing the first executable image to selectively modify the virtual machine and the first executable image, resulting in an updated virtual machine and a second executable image. The second executable image represents an updated version of the first executable image. To transform dynamic code, such as natively produced computer code, into one or more executable images for running on constrained devices, embodiments may leverage existing dynamic code generators (e.g., within Java HotSpot Performance Engine, also simply called HotSpot), selectively modifying them to generate different, i.e., updated code that is usable on subsequent runs of the associated software application, thereby effectively enabling modification of executable code used to run the software.