Patch-Based Method Invocation for JVM Pipeline Efficiency

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

The current Java Virtual Machine (JVM) approaches cause processor pipeline flushes and resource wastage due to uncertainty in target method addresses during method invocations, leading to slowdowns and inefficiencies, particularly when target methods change state from compiled to uncompiled, necessitating costly forced decompilation of calling methods.

Innovation Solution

The technique modifies the parameters of instructions in compiled calling methods to reflect the current state of target methods, allowing direct method calls without decompilation, using branch-and-link instructions to patch calls to both non-virtual and virtual target methods, ensuring correct execution addresses are maintained regardless of state changes.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Reliability

If indirect referencing is used to invoke target methods at runtime, then the correct runtime address can be determined, but processor pipeline flushes occur causing execution slowdown

Engineering Contradiction:
Improvecorrect runtime address determinationVSAvoidexecution speed
Core Design Contradiction:
ReliabilityVSProductivity

Solution Approach 1:

The patent pre-determines possible target method addresses at compile time and stores them in a lookup table. When a method invocation occurs, the pre-computed addresses are directly used without runtime lookup, eliminating pipeline flushes while ensuring correct address determination through preliminary preparation of all possible target addresses

Inventive Principle:
Principle #10Preliminary action

Solution Approach 2:

The patent dynamically selects among multiple pre-determined target addresses based on runtime conditions. The system maintains a list of possible target addresses and dynamically chooses the correct one during execution, allowing the calling method to adapt to different compilation states of target methods without requiring indirect referencing

Inventive Principle:
Principle #15Dynamics

2Productivity

If direct method calls are used to speed up execution, then processor pipeline efficiency improves, but calling methods must be decompiled when target method state changes

Engineering Contradiction:
Improveexecution speedVSAvoiddecompilation overhead
Core Design Contradiction:
ProductivityVSDevice complexity

Solution Approach 1:

The patent pre-computes and stores multiple possible target addresses in a lookup table at compile time. When target method state changes occur, the system preliminarily prepares alternative addresses that can be quickly swapped in without decompiling the calling method, thus maintaining direct calls while adapting to state changes

Inventive Principle:
Principle #10Preliminary action

Solution Approach 2:

The patent changes the address parameter of method invocation instructions from a single fixed address to a selectable set of addresses. By modifying which address from the pre-computed list is used (rather than changing the instruction itself), the system adapts to target method state changes without requiring decompilation

Inventive Principle:
Principle #35Parameter changes

3Reliability

If forced decompilation is performed when target methods change state, then correct addressing is maintained, but significant memory and processor resources are consumed

Engineering Contradiction:
Improveaddress correctnessVSAvoidmemory and processor resource consumption
Core Design Contradiction:
ReliabilityVSLoss of energy

Solution Approach 1:

The patent pre-computes all possible target addresses and stores them in a lookup table during compilation. When target method state changes occur, the system simply swaps to a different pre-computed address from the list rather than decompiling and recompiling, dramatically reducing memory and processor resource consumption while maintaining address correctness

Inventive Principle:
Principle #10Preliminary action

Solution Approach 2:

The patent creates a copy of the calling method's instruction with a different target address when state changes occur, rather than modifying the original compiled code. This copying approach allows quick address changes without the resource-intensive decompilation and recompilation process

Inventive Principle:
Principle #26Copying

Data Source

PatentUS8099724B2Fast patch-based method calls
Publication Date: 2012.01.17 ORACLE AMERICAN INC
  • US8099724B2 patent drawing
  • US8099724B2 patent drawing
  • US8099724B2 patent drawing

AI summary

A patch-based mechanism is disclosed for providing fast invocations of a target method from a compiled calling method. The code for the calling method is stored into a storage. The code for the calling method comprises an instruction for invoking the target method, where the instruction comprises a parameter. In response to a state change from a current state to a new state that is experienced by the target method, the parameter is modified from a first value to a second value, where the second value indicates the correct address for facilitating the execution of the target method in its new state. Thus, the parameter in the instruction for invoking the target method always reflects the correct state of the target method, which provides for a fast invocation of the target method when the instruction is executed.