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 for constructing a first element of a plurality of elements in a computer program, wherein the current stack trace is a stack trace that contains 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 suitable for a plurality of nodes; 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 having 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 for constructing 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; 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 having the second element as the parameter; and generating a node string from the plurality of nodes, including at least the first node and the second node, in response to a determination that no additional instruction for constructing an element exists.