Watchpoint-Based Exceptional Flow Control in Protected Code
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Existing methods for providing exceptional flow control in protected code, such as patching, are incompatible with copy-protected or read-only code and can negate memory advantages gained through process cloning, as they destroy the implicit sharing relationship and are not non-destructive.
Innovation Solution
A system and method that uses watchpoints to provide exceptional flow control in protected code by setting watchpoints at execution points within the generated code, with exception handlers associated with each watchpoint to manage temporary modifications without compromising copy protection, allowing for non-destructive execution redirection.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Ease of operation
If code patching is used to provide exceptional flow control, then execution redirection capability is improved, but copy protection is destroyed and memory sharing advantages are lost
Solution Approach 1:
The patent introduces watchpoints as an intermediary mechanism between the protected code and the exception handling system. Instead of directly patching the protected code, watchpoints monitor execution flow and trigger exceptions when specific conditions are met, allowing exceptional flow control without modifying the protected code itself. This mediator approach preserves copy protection while achieving the desired control flow redirection.
Solution Approach 2:
The patent creates a copy of the execution monitoring functionality through watchpoints rather than modifying the original protected code. The watchpoint mechanism copies the essence of execution control into a separate, non-intrusive layer that can trigger exceptions without altering the protected code's integrity or destroying copy-on-write relationships.
2Productivity
If code patching is used for garbage collection safepoints, then garbage collection efficiency is improved, but process cloning memory advantages are negated
Solution Approach 1:
Watchpoints serve as an intermediary that enables garbage collection safepoint functionality without directly patching protected code. The watchpoint mechanism monitors execution and triggers garbage collection operations through exception handlers, maintaining both garbage collection efficiency and process cloning memory sharing advantages by avoiding code modification.
3Reliability
If polling is used to detect garbage collection requests, then request detection capability is improved, but processor overhead increases
Solution Approach 1:
Instead of continuous polling, the patent implements periodic exception-driven detection where watchpoints are triggered only when relevant conditions occur (such as when garbage collection is needed). This transforms continuous active monitoring into event-driven periodic action, reducing processor overhead while maintaining reliable detection of garbage collection requests.
Solution Approach 2:
The watchpoint mechanism is self-triggering based on execution conditions rather than requiring external polling. When a watchpoint condition is met (such as reaching a safepoint), the exception handler automatically activates, eliminating the need for continuous processor intervention and reducing overall system overhead.
Data Source
AI summary
A system and method for providing exceptional flow control in protected code through watchpoints is described. 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. Execution points within the generated code are identified. A watchpoint corresponding to each of the execution points is set. An exception handler associated with each watchpoint is defined and includes operations exceptional to the normal operations sequence that are performed upon a triggering of each watchpoint during execution of the generated code.


