Hybrid JIT Load Module Compiler for Legacy Code Translation
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Existing load module compilers face challenges in efficiently translating legacy programs from one architecture to another, particularly with self-modifying code and proprietary intermediate representations, which limits flexibility and performance.
Innovation Solution
A method and system for constructing a library of transformation functions to translate legacy programs by converting legacy instructions into an intermediate representation, allowing for the generation of executable code that can run on a different architecture, including support for self-modifying applications through dynamic compilation and caching of compiled basic blocks.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Adaptability or versatility
If a conventional emulator is used to translate legacy instructions, then compatibility with legacy programs is achieved, but performance deteriorates due to multiple layers of translation
Solution Approach 1:
The patent segments the translation process by dividing legacy code into basic blocks and translating them individually into intermediate representation, then selectively compiling to native code. This segmentation allows partial optimization while maintaining compatibility for the remaining emulated portions.
Solution Approach 2:
The patent introduces an intermediate representation as a mediator between legacy instructions and target architecture. This intermediary layer enables efficient translation and optimization without requiring full emulation, thus improving performance while preserving compatibility.
2Ease of manufacture
If proprietary intermediate representations are used in load module compilers, then translation capability is achieved, but flexibility deteriorates
Solution Approach 1:
The patent employs a universal intermediate representation that can represent instructions from multiple legacy architectures and can be compiled to multiple target architectures. This universal IR provides both the translation capability needed for legacy support and the flexibility to adapt to different targets.
Solution Approach 2:
The intermediate representation serves as a flexible intermediary that decouples the legacy instruction set from the target architecture. This mediator layer provides translation capability while simultaneously enabling flexibility in choosing different target architectures and optimization strategies.
3Productivity
If static compilation is used for legacy programs, then execution speed is improved, but adaptability to runtime conditions deteriorates
Solution Approach 1:
The patent implements dynamic compilation where basic blocks are compiled to native code at runtime based on actual execution patterns. This dynamic approach allows the system to adapt to runtime conditions while still achieving the execution speed benefits of compilation for frequently executed code.
Solution Approach 2:
The patent performs preliminary compilation of basic blocks to intermediate representation during program execution, allowing optimization decisions to be made with actual runtime information available. This preliminary action enables both speed improvement through compilation and adaptability through runtime awareness.
4Productivity
If entire programs are compiled at once, then optimization opportunities are maximized, but compilation time and memory usage increase
Solution Approach 1:
The patent segments the program into basic blocks and compiles them individually or in small groups rather than compiling the entire program at once. This segmentation maintains optimization effectiveness within each block while significantly reducing compilation time and memory requirements.
Solution Approach 2:
The patent applies partial compilation by selecting and compiling only the most frequently executed basic blocks or critical paths. This partial action provides sufficient optimization effectiveness for the hot paths while avoiding the overhead of compiling less important code sections.
Data Source
AI summary
The disclosure provides methods for generating libraries of transformation functions and for executing programs compiled for a source architecture on machines having a different target architecture using a hybrid just-in-time load module compiler, a non-transitory computer-readable medium to store instructions for performing such methods, and systems for performing such methods. The systems and methods may enable effective operation of the load module compiler with self-modifying code, and may apply optimizations in the selections of basic blocks for just-in-time compilation, and in the use of optimized library functions to improve system performance.


