Native Binary Code Compilation for Virtual Machine Portability
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Existing compilation techniques for virtual machine-based execution environments limit the generation of native code, restricting performance and optimization due to constraints that prevent full abstraction of terminal-specific parts and require tight integration with the operating system, resulting in suboptimal code execution.
Innovation Solution
A method that compiles intermediate code into native binary code by extracting function entry points, integrating control flow management, and compiling application code to produce a single optimized binary, allowing the virtual machine to retain control without disturbing its execution, thus eliminating the need for interpreters and AOT/JIT compilers.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Adaptability or versatility
If intermediate code is executed through a virtual machine with interpreter or AOT compilation, then portability across different terminals is improved, but execution performance deteriorates due to interpretation overhead and constraints on native code optimization
Solution Approach 1:
The patent segments the application code into intermediate code instructions that can be independently compiled. Each instruction is extracted and compiled separately into optimized native code, allowing fine-grained optimization while maintaining the ability to run on different terminals through the runtime environment.
Solution Approach 2:
The patent implements dynamic compilation where intermediate code is compiled to native code at runtime based on execution needs. The system dynamically determines which intermediate code instructions to compile and when, optimizing performance for frequently executed paths while maintaining portability through the virtual machine interface.
2Productivity
If native code is generated for direct processor execution, then execution performance is improved, but compatibility with virtual machine constraints deteriorates
Solution Approach 1:
The patent uses an intermediary compilation process that translates intermediate code into optimized native code while maintaining compatibility with virtual machine constraints. The compiled code uses a specific communication interface for interaction between native and virtual worlds, acting as a mediator that satisfies both performance and compatibility requirements.
Solution Approach 2:
The patent changes the compilation parameters and code generation strategy to produce native code that adheres to virtual machine constraints. The compilation process adjusts parameters such as code structure, memory management patterns, and system call interfaces to ensure compatibility while achieving native execution performance.
3Productivity
If complete native code compilation is performed, then optimization potential is improved, but integration complexity with operating system and virtual machine increases
Solution Approach 1:
The patent extracts intermediate code instructions from the virtual machine execution environment and compiles them separately into native code. This extraction approach allows complete optimization of the application logic while keeping the virtual machine integration layer minimal and manageable, reducing overall integration complexity.
Solution Approach 2:
The patent merges the compiled native code with the runtime environment to create a unified executable. The integration layer combines the optimized native code sections with the virtual machine interface, creating a cohesive system that achieves high optimization while managing complexity through unified code generation.
Data Source
Figure 1~4
Figure 2~3
AI summary
The invention relates to a method for compiling an original application written in an intermediate code, in which the original application is executed by means of a virtual machine, said method supplying a native application comprising a native binary code. According to the invention, the method comprises: a step consisting in extracting at least one intermediate code instruction at at least one corresponding function input point; a first step consisting in compiling the intermediate code of the application to a code that includes control flow management and calls said at least one input point of each function implementing the instructions of the intermediate code; and a second step consisting in compiling the compiled application code and intermediate code functions supplying the optimised native application.