Patent ID: 7647586

Claim:
A system for providing exceptional flow control in protected code through watchpoints, comprising: a processor; an execution mechanism on the processor, wherein the execution mechanism is configured to progressively execute portions of generated code at runtime, wherein the generated code is one of: non-modifiable read-only code that cannot be patched, code embodied on read-only memory, or code being used by a child process in a system that uses copy-on-write semantics; at runtime, the execution mechanism is further configured to: receive an exceptional flow control request; set at least one watchpoint corresponding to at least one execution point in response to the exceptional flow control request, wherein the execution mechanism is configured to set a watchpoint corresponding to each listed execution point in a list of execution points in response to an exceptional flow control request; monitor the execution of the portions of generated code to determine if execution is about to commence for a portion of the generated code that is associated with a set watchpoint; and upon determining that execution of a portion of the generated code that is associated with a set watchpoint is about to commence, halt the execution of the portion of the generated code and execute an exception handler for the watchpoint to perform one or more operations exceptional to the execution of the portions of the generated code, wherein performing at least one of the operations exceptional to the execution of the portions of the generated code involves performing a garbage collection.