Patent ID: 9678775
Date: 2017-06-13
CPC Classifications: G06F

Claim:
1. A method for allocating memory locations for local variables in a code segment intended for execution in a multi-threaded computing environment in order to simulate the multi-threaded execution in a single-threaded computing environment, the method comprising: identifying a first set of local variables that are referenced in expressions of instructions of the code segment, wherein, for each particular instruction in the code segment, the first set comprises local variables that are referenced in the particular instruction or referenced in expressions in at least one instruction of the code segment prior to the particular instruction; identifying a second set of local variables that are assigned expressions in instructions of the code segment, wherein, for each particular instruction in the code segment, the second set comprises local variables that are assigned expressions in the particular instruction or assigned expressions in at least one instruction of the code segment prior to the particular instruction; determining an intersection of the first set of local variables and the second set of local variables; and allocating a plurality of memory locations in a memory of the single-threaded computing environment for each local variable in the intersection, wherein each memory location in the plurality of memory locations corresponds to a different thread in a plurality of threads, a concurrent execution of the plurality of threads being simulated in the single-threaded computing environment.