Patent ID: 7058561

Claim:
A method for optimising computer software that includes one or more call statements and a procedure which is callable by the or each call statement, the method being implemented by execution of program instructions by a computer, the program instruction being stored in computer-readable memory, the method comprising the steps of: (a) analysing the callable procedure, the callable procedure comprising a branch condition under which control flow code directs program flow from the branch condition to a code branch of two or more code branches, each said code branch being within the callable procedure and branching from the branch condition to program code within the callable procedure, said analysing the procedure identifying the control flow code and the code branches; (b) identifying for each said code branch a new procedure containing the respective code branch and not containing the other code branches of the two or more code branches, wherein the new procedures collectively comprise the two or more code branches; (c) recording a list of data entries corresponding to the respective new procedures, each entry comprising a data item identifying the respective new procedure and a data item representative of the branch conditions under which said control flow code directs program flow to the associated code branch; (d) for the or each call statement, scanning the entries in said list to determine one for which there is correspondence between said branch conditions and call parameters directed to said control flow code by the call statement and modifying the call statement to replace the call to the original procedure by a call to the corresponding new procedure.