Patent ID: 8990545
Filing Date: 2015-03-24
Classification: G06F

Abstract:
1. A method for analyzing a program, the method comprising the steps, executed by a processor, of: initializing, upon start of the program, a plurality of flags included in a first table to a disabled state, each of the plurality of flags corresponding to an instruction of the program; storing, upon start of the program, an initial state of a second table that includes a plurality of entries each corresponding to an instruction of the program and that holds history information in each of the plurality of entries; determining, upon execution of a branch instruction, whether or not a branch has been taken; responsive to the branch not being taken, decrementing a value of the history information of a corresponding entry of the second table; responsive to the branch being taken, incrementing a value of the history information of a corresponding entry of the second table; determining whether a corresponding flag of the first table is enabled or disabled; responsive to the branch being taken, enabling, when the corresponding flag is disabled, the corresponding flag in the first table; responsive to the branch not being taken, leaving the corresponding flag in the first table unchanged; determining whether or not to terminate the program; responsive to the program not terminating, repeating the step of determining whether or not a branch has been taken to the step of determining whether or not to terminate the program; responsive to the program terminating, obtaining a differential history information value of each entry between the stored initial state and a final state of the second table; responsive to the program terminating, obtaining a final state of each flag of the first table; and comparing the differential history value of the second table and the final state of the plurality of flags of the first table to determine if a branch was taken by the corresponding flag being enabled and, if the branch was taken, how many times the branch was taken and how many times the branch was skipped.