Conditional Branch Frame Barrier for Virtual Machine Stack Safety

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Existing call stack management techniques face challenges in efficiently handling frame barriers and safepoints, particularly in virtual machine environments, where ensuring frame safety and coordinating thread local values across multiple threads is complex and often requires waiting for all threads to reach a safe state.

Innovation Solution

The implementation of conditional branches in function epilogues and loop back edges, utilizing a thread local value to determine whether to execute a slow path or return to a calling function, allows for frame-specific control and safepointing without waiting for all threads to become safe, using a single conditional branch to achieve multiple purposes such as frame barriers and thread local handshakes.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Reliability

If traditional frame barrier techniques are used to ensure frame safety in virtual machine environments, then reliability is improved, but device complexity and execution time increase due to requiring all threads to reach a safe state

Engineering Contradiction:
Improveframe safetyVSAvoidthread coordination time
Core Design Contradiction:
ReliabilityVSLoss of time

Solution Approach 1:

The patent divides the global thread coordination problem into individual frame-specific barriers. Each frame has its own barrier that can be independently checked and released, allowing threads to proceed without waiting for all other threads to reach a safe state. This segmentation of the barrier mechanism resolves the contradiction by maintaining frame safety through localized checks while eliminating the time loss associated with global thread synchronization.

Inventive Principle:
Principle #1Segmentation

Solution Approach 2:

The patent implements preliminary marking of frames as safe or unsafe before execution proceeds. By pre-establishing the safety status of each frame and setting up the barrier check mechanism in advance, the system avoids the need for complex runtime coordination between threads. The conditional branch is prepared beforehand to check the frame barrier status, allowing threads to efficiently determine whether to proceed without waiting for other threads.

Inventive Principle:
Principle #10Preliminary action

2Productivity

If conditional branches are used for frame-specific control, then productivity is improved, but device complexity increases due to additional branch instructions

Engineering Contradiction:
Improveframe management efficiencyVSAvoidinstruction complexity
Core Design Contradiction:
ProductivityVSDevice complexity

Solution Approach 1:

The patent makes the conditional branch instruction multi-functional by enabling it to serve both as a frame barrier check and as a safepoint mechanism. The same branch instruction checks the frame barrier status and determines whether to proceed with execution or trigger a safepoint. This universality resolves the contradiction by achieving frame-specific control and improved productivity through a single, versatile instruction rather than requiring multiple separate mechanisms.

Inventive Principle:
Principle #6Universality (Multi-functionality)

3Reliability

If traditional safepointing mechanisms are used to coordinate threads, then reliability is improved, but loss of time increases due to waiting for all threads to reach a safe state

Engineering Contradiction:
Improvethread coordination safetyVSAvoidthread execution speed
Core Design Contradiction:
ReliabilityVSProductivity

Solution Approach 1:

The patent segments the global safepoint coordination into individual frame-specific barrier checks. Instead of requiring all threads to simultaneously reach a safe state, each thread independently checks the barrier status of the specific frame it needs to access. This segmentation maintains reliability by ensuring frame safety through individualized checks while improving productivity by eliminating the need for global thread synchronization and allowing parallel execution.

Inventive Principle:
Principle #1Segmentation

Solution Approach 2:

The patent enables threads to perform self-service barrier checks using conditional branches that automatically evaluate the frame barrier status. Each thread independently determines whether it can proceed by checking its own execution context against the frame barrier, without requiring external coordination or waiting for other threads. This self-service mechanism maintains reliability through consistent barrier checking while dramatically improving productivity by eliminating thread coordination overhead.

Inventive Principle:
Principle #25Self-service

Data Source

PatentUS11249758B2Conditional branch frame barrier
Publication Date: 2022.02.15 ORACLE INT CORP
  • US11249758B2 patent drawing
  • US11249758B2 patent drawing
  • US11249758B2 patent drawing

AI summary

Establishing a conditional branch frame barrier is described. A conditional branch in a function epilogue is used to provide frame-specific control. The conditional branch evaluates a return condition to determine whether to return from a callee function to a calling function, or to execute a slow path instead. The return condition is evaluated based on a thread local value. The thread local value is set such that returns to potentially unsafe frames in a call stack are prohibited. The prohibition to return to a potentially unsafe frame may be referred to as a “frame barrier.” Additionally, the thread local value may be used to establish safepointing and/or thread local handshakes, both after execution of a function body and after execution of a loop body.