JIT Compiler Branch Optimization for Execution Stalls

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Just-in-time (JIT) compilers produce native code that often results in stalls or bubbles during processor execution due to branching instructions, particularly in customized processors like those in handheld devices, leading to suboptimal performance.

Innovation Solution

A Java virtual machine equipped with a JIT compiler that includes optimizers capable of recognizing patterns in Java byte code, such as branching instructions, and optimizing them into native code conditional instructions to produce optimized native code that executes more efficiently on specific processing platforms.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Productivity

If branching instructions are used in Java byte code compilation, then control flow is achieved, but execution stalls and bubbles occur in the processor pipeline

Engineering Contradiction:
Improveexecution speedVSAvoidexecution stalls
Core Design Contradiction:
ProductivityVSLoss of time

Solution Approach 1:

The patent transforms branching instructions into conditional instructions by changing the operational parameters of the code. Instead of using traditional branch instructions that cause pipeline stalls, the compiler generates conditional instructions that evaluate conditions and execute corresponding operations without disrupting the processor pipeline, thereby eliminating execution stalls while maintaining control flow.

Inventive Principle:
Principle #35Parameter changes

Solution Approach 2:

The patent substitutes the mechanical branching mechanism with a conditional instruction mechanism. Rather than relying on branch instructions that require pipeline flushing and cause stalls, the system uses conditional instructions that can be executed continuously in the pipeline, replacing the stall-prone branching mechanism with a streamlined conditional execution approach.

Inventive Principle:
Principle #28Mechanics substitution (Replace mechanical system)

2Productivity

If standard JIT compilation is used, then Java byte code is converted to native code, but the generated native code cannot be efficiently executed on customized processors

Engineering Contradiction:
Improvenative code execution efficiencyVSAvoidperformance degradation
Core Design Contradiction:
ProductivityVSObject-generated harmful factors

Solution Approach 1:

The patent applies local quality by tailoring the code generation to the specific characteristics of the target processor. The JIT compiler analyzes the processor's instruction set and capabilities, then generates native code optimized for that specific platform. This includes selecting appropriate conditional instructions and optimization strategies that match the processor's architecture, thereby maximizing execution efficiency on customized processors while avoiding generic code that would underperform.

Inventive Principle:
Principle #3Local quality

Data Source

PatentUS7421687B1Optimizing branch condition expressions in a JIT compiler
Publication Date: 2008.09.02 ORACLE AMERICAN INC
  • US7421687B1 patent drawing
  • US7421687B1 patent drawing

AI summary

A Java virtual machine includes a just in time (JIT) Java compiler. The JIT compiler includes at least one optimizer. Each of the at least one optimizer includes logic for recognizing a pattern in a received Java byte code, logic for optimizing the recognized pattern to produce optimized native code and logic for outputting optimized native code. A method of producing optimized native code is also provided.