Patent ID: 7472383

Claim:
A system for providing exceptional flow control in protected code through memory layers, comprising: a processor; and a memory coupled with the processor, wherein the memory stores instructions for: a compiler to generate code comprising a sequence of normal operations and subject to a type of protection against copying during execution of the generated code; a runtime environment to instantiate the generated code as a master process into a master layer in a memory space and to clone the master process by a copy of the master process instantiated as a child layer in the memory space; a code analyzer to identify execution points within the generated code on the child layer; and a runtime monitor to instantiate a copy of at least a portion of the generated code containing each execution point as an exception layer in the memory space, wherein the runtime monitor defers instantiation until an exception event occurs, and wherein the exception layer is temporarily created by temporarily replacing one or more page table entries, and to patch the generated code in the exception layer 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; wherein the runtime environment executes the patched generated code, removes the executed portion of the patched generated code in the exception layer containing the execution point, then resumes the execution of the generated code on the child layer.