1. A method, comprising: recording, into a first node, a mapping of a current stack trace in response to an execution of a first instruction to construct a first element of a plurality of elements in a computer program, wherein the current stack trace is a stack trace that includes stack frames generated up to a particular point in the execution of code instructions in the computer program; storing the first node in a data structure configured for storing a plurality of nodes, wherein the first node includes a first set of stack frames associated with the execution of the first instruction to construct the first element; incrementally updating the first node by recording, into the first node, a first updated mapping of the current stack trace in response to the execution of a first subsequent instruction that has the first element as a parameter; recording, into a second node, the mapping of the current stack trace in response to the execution of a second instruction to construct a second element of the plurality of elements in the computer program; storing the second node in the data structure, wherein the second node comprises: a portion of the mapping of the current stack trace, the portion of the mapping of the current stack trace including a second set of stack frames associated with the execution of the second instruction to construct the second element; and a pointer to the first node; incrementally updating the second node by recording, into the second node, a second updated mapping of the current stack trace in response to the execution of a second subsequent instruction that has the second element as the parameter; and in response to a determination that no additional instruction for constructing an element exists in the computer program, generating a node string from the plurality of nodes that includes at least the first node and the second node.