Patent ID: 8196122

Claim:
A computer-implemented method of compiling computer code, comprising: creating a flowgraph according to abstract computer instructions, the flowgraph identifying possible logic paths that may be taken in executing the abstract computer instructions, the flowgraph having a plurality of basic blocks and a data object, each basic block comprising a series of consecutive programming statements in which flow of control enters at the first statement and leaves at the last statement without stopping and without branching possibilities except at the end of the block, and the abstract instructions being translated from a parse tree formed from computer code; assigning a depth-first order to the plurality of basic blocks; determining a dominance relationship between the plurality of basic blocks, a dominance relationship identifying that all logic paths leading to a second basic block of the plurality of basic blocks must have previously passed through a first basic block of the plurality of basic blocks; identifying a basic block of the plurality of basic blocks contained within a loop that is present within the flowgraph; determining a usage of the data object; determining a creation point, destruction point and lock point within the flowgraph for the data object according to the usage, basic block contained within the loop, dominance relationship and depth-first order of the plurality of basic blocks, the creation point identifying a point before the first use of the data object, the destruction point identifying a point after the last use of the data object, and a lock point identifying a section of the flowgraph where corresponding computer code will have the exclusive ability to modify the data object while that computer code is being executed; and inserting instructions into the computer code to create the data object at the creation point, to destroy the data object at the destruction point and to lock the data object at the lock point.