The stack mapper of the present invention seeks to determine the shape of the
stack at a given program counter. This is accomplished by locating all start points
possible for a given method, that is, at all of the entry points for the method
and all of the exception entry points, and trying to find a path from the beginning
of the method to the program counter in question. The mapper first tries to locate
a linear path from the beginning of the method, and then iteratively processes
the sequence of bytes at each branch until the destination program counter is reached.
Once the path is found, a simulation is run of the stack through that path, which
is used as the virtual stack for the purposes of the garbage collector.