Exceptional Flow Control in Protected Code via Memory Layers

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Existing methods for exceptional flow control in protected code, such as patching, are incompatible with copy-protected code and can negate memory advantages gained through process cloning, as they modify the original code and disrupt implicit sharing relationships.

Innovation Solution

A system and method that provides exceptional flow control by instantiating a master process in a memory space and cloning it into a child layer, allowing temporary modifications in a separate exception layer or private memory layer without altering the original code, using copy-on-write semantics to maintain memory efficiency and preserve copy protection.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Ease of operation

If code patching is used to implement exceptional flow control, then flow control functionality is achieved, but copy protection is destroyed and memory sharing advantages are negated

Engineering Contradiction:
Improveexceptional flow controlVSAvoidcopy protection
Core Design Contradiction:
Ease of operationVSReliability

Solution Approach 1:

The code is divided into read-only protected segments and writable temporary segments. The exception handling code is placed in separate writable memory regions rather than patching the protected code directly, allowing flow control while preserving copy protection of the original code segments.

Inventive Principle:
Principle #1Segmentation

Solution Approach 2:

Instead of modifying the original protected code, the system creates copies of exception handling code in writable memory regions. These copies are executed when exceptions occur, while the original protected code remains unchanged and can be shared across processes.

Inventive Principle:
Principle #26Copying

2Productivity

If code patching is used for garbage collection safepoints, then garbage collection efficiency is improved, but process cloning memory advantages are destroyed

Engineering Contradiction:
Improvegarbage collection efficiencyVSAvoidmemory sharing
Core Design Contradiction:
ProductivityVSQuantity of substance

Solution Approach 1:

The memory space is segmented into shared read-only code segments and private writable data segments. Garbage collection safepoints are implemented in the writable segments, allowing efficient GC operations while the shared code segments maintain copy-on-write semantics for memory efficiency.

Inventive Principle:
Principle #1Segmentation

Solution Approach 2:

A separate exception handling layer is introduced as an intermediary between the protected code and the exception handling mechanism. This layer contains the garbage collection safepoints and can be modified without affecting the shared protected code, preserving memory sharing advantages.

Inventive Principle:
Principle #24Intermediary (Mediator)

Data Source

PatentUS7472383B2System and method for providing exceptional flow control in protected code through memory layers
Publication Date: 2008.12.30 ORACLE AMERICAN INC
  • US7472383B2 patent drawing
  • US7472383B2 patent drawing
  • US7472383B2 patent drawing

AI summary

A system and method for providing exceptional flow control in protected code through memory layers. Code is generated. The generated code includes a sequence of normal operations and is subject to protection against copying during execution of the generated code. The generated code is instantiated as a master process into a master layer in a memory space. The master process is cloned by instantiating a copy of the master process as a child layer in the memory space. Execution points within the generated code are identified. A copy of at least a portion of the generated code containing each execution point as an exception layer is instantiated in the memory space. The generated code in the exception layer is patched at each identified execution point with operations exceptional to the normal operations sequence and which are performed upon a triggering of each execution point during execution of the generated code.