摘要 |
Embodiments of a system and method for facilitating the use of stack cutting to be used in programming languages in a safe fashion even when composed with constructs that require destructor operations are described. For stack-based operations that require resolution through destructor operations (such as transactions, synchronization operations, deallocations, unlock operations, and the like), the destructor objects are stored in a virtual stack that is associated with the system stack, for use when a stack cut operation is performed. A container data structure stores an instantiation of the execution state at the cut back point. A virtual stack head pointer stores the location of the last destructor in the virtual stack. During a stack cut operation, the virtual stack is first unwound to execute the destructor operations until the stack frame of the container is reached. Other embodiments are described and claimed.
|