Patent ID: 7904881

Claim:
A method for facilitating a stack cutting operation, the method comprising: storing execution parameters associated with an execution instance in a first stack frame of a system stack, the execution parameters including a virtual stack pointer start field with a value of a first address corresponding to a location of the first stack frame; adding destructor instructions, of a program thread, to a virtual stack associated with the system stack as the program thread is executed, wherein storing the destructor instructions includes updating a value of a virtual stack pointer with a second address corresponding to a latest destructor instruction added to the virtual stack such that the virtual stack pointer points to the latest destructor instruction; and upon execution of a stack cut operation from a second stack frame of the system stack to the first stack frame of the system stack, comparing the value of the virtual stack pointer with the value of the virtual stack pointer start field, and executing a destructor instruction pointed to by the virtual stack pointer and updating the virtual stack pointer to point to the destructor instruction preceding the executed destructor instruction until the value of virtual stack pointer matches the value of virtual stack pointer start field.