Patent ID: 7426719

Claim:
A computer system for generating metadata for use during stack unwinding, comprising: a processor; and a memory having computer-executable instructions stored thereon, wherein the computer executable instructions include: a plurality of procedures, wherein each procedure comprises a sequence of binary instructions; a runtime for generating unwind data, wherein the unwind data includes a first plurality of blocks of metadata having a first order of blocks, wherein each block of metadata is associated with a corresponding procedure in the plurality of procedures, wherein each block of metadata in the plurality of blocks of metadata includes at least one unwind table and at least one unwind information block; and an unwind rewriter programmed to obtain the unwind data and reorder the first plurality of blocks of metadata to generate a second plurality of blocks of metadata having a second order, wherein the unwind rewriter reorders the first plurality of blocks in accordance with a second unwind table and a second unwind information block, wherein reordering the first plurality of blocks in accordance with a second unwind table and a second unwind information block further comprises determining when basic blocks identified in a single unwind table associated with the first order of blocks are associated with more than one unwind table associated with a current order of basic blocks, creating a new region header describing a region of zero length when the basic blocks identified in the single unwind table associated with the first order blocks are associated with more than one unwind table associated with the current order of basic blocks, and copying non-when action descriptor records from the unwind information block into the second unwind information block when the basic blocks identified in the single unwind table associated with the first order blocks are associated with more than one unwind table associated with the current order of basic blocks, wherein the first plurality of blocks are reordered in response to a modification of the sequence of binary instructions within a procedure, such that the second plurality of blocks of metadata accurately represents the same runtime semantics as that of the unmodified sequence of binary instructions.