Hotspot Intermediate Code Identification in Language Virtual Machines

Resolve Bottlenecks,
Find Innovative Solutions
Generate 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

VSEngineering 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

Engineering Contradiction:
Improveexecution efficiencyVSAvoidstorage space
Core Design Contradiction:
ProductivityVSQuantity of substance

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.

Inventive Principle:
Principle #3Local quality

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.

Inventive Principle:
Principle #35Parameter changes

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

Engineering Contradiction:
Improvecompilation process complexityVSAvoidoperating performance
Core Design Contradiction:
Device complexityVSProductivity

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.

Inventive Principle:
Principle #10Preliminary action

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.

Inventive Principle:
Principle #23Feedback

Data Source

PatentUS10871976B2Method and apparatus for identifying hotspot intermediate code in language virtual machine
Publication Date: 2020.12.22 HUAWEI TECH CO LTD
  • US10871976B2 patent drawing
  • US10871976B2 patent drawing
  • US10871976B2 patent drawing

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.