Patent ID: 6925639
Filing Date: 2005-08-02
Classification: G06F

Abstract:
1. A method of inserting spill code to handle a set of spilled variables, the spilled variables being identified by a register allocation procedure, into a plurality of instructions generated by a compiler, the spill code adapted for a CISC machine having registers used when executing instructions, comprising: (a) processing each instruction in reverse order in the plurality of instructions by: (b) generating a spill code load instruction for each variable in the set of spilled variables to be loaded; (c) counting a number of places where the temporary variable associated with the spilled variable has been substituted for the spilled variable; (d) tracking a location of each such temporary variable within the plurality of instructions; and (e) generating spill code based on the number of places where each temporary variable associated with the spilled variable has been substituted for the spilled variable and the location of each temporary variable; and (f) inserting the generated instructions.