Hotspot Intermediate Code Identification in Language Virtual Machines
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Existing language virtual machines face inefficiencies due to the inability to effectively identify hotspot intermediate code, leading to wasted storage space and reduced operating performance as infrequently executed native code occupies significant space, affecting the compilation of frequently executed intermediate code.
Innovation Solution
A method and apparatus that utilize an obtaining circuit to get an instruction address, a determining circuit to identify native instructions, and an updating circuit to increment a hotness value for identified functions, determining if the updated hotness value meets a threshold to classify intermediate code as hotspot intermediate code, thereby optimizing storage and execution efficiency.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Productivity
If the just-in-time compiler compiles all intermediate code into native code, then execution efficiency is improved, but storage space is wasted and compilation overhead increases
Solution Approach 1:
The patent applies local quality by differentiating the treatment of intermediate code based on its execution frequency. Hotspot intermediate code (frequently executed) is compiled into native code for high execution efficiency, while non-hotspot intermediate code (infrequently executed) remains uncompiled to save storage space. This selective compilation approach optimizes both execution efficiency and storage space utilization.
Solution Approach 2:
The patent uses parameter changes by introducing a hotness threshold parameter to determine whether intermediate code should be compiled. By monitoring execution frequency and comparing it against the threshold, the system dynamically adjusts compilation decisions. This parameter-based approach enables adaptive optimization of storage space and execution efficiency.
2Device complexity
If hotspot intermediate code is not effectively identified, then compilation process is simplified, but storage space is wasted and operating performance is reduced
Solution Approach 1:
The patent applies preliminary action by performing hotness analysis on intermediate code during the interpretation phase before compilation. The system pre-identifies hotspot intermediate code by monitoring execution frequency and storing hotness information in a cache. This preliminary identification ensures that when compilation occurs, only the necessary hotspot code is compiled, optimizing operating performance without excessive complexity.
Solution Approach 2:
The patent uses feedback mechanisms by continuously monitoring the execution frequency of intermediate code and updating hotness values in real-time. The system compares current execution frequency against stored hotness information and adjusts compilation decisions accordingly. This feedback loop ensures optimal identification of hotspot code while maintaining manageable compilation process complexity.
Data Source
AI summary
The present disclosure provide a method and an apparatus for identifying hotspot intermediate code. The method for identifying hotspot intermediate code includes: when a language virtual machine executes a to-be-identified function, obtaining an instruction address in an instruction counter, and determining whether a native instruction corresponding to the instruction address is a native instruction of the to-be-identified function; when the native instruction corresponding to the instruction address is the native instruction of the to-be-identified function, increasing a current hotness value of the to-be-identified function by a preset value; and determining whether an updated hotness value of the to-be-identified function is greater than or equal to a hotness threshold of the to-be-identified function, and when the updated hotness value of the to-be-identified function is greater than or equal to the hotness threshold of the to-be-identified function, using intermediate code of the to-be-identified function as hotspot intermediate code.


