Patent ID: 7890941

Claim:
A machine implemented method, comprising: accessing a binary file, wherein the binary file comprises: a code section that represents the executable code of a computer program; and annotation information that indicates the boundaries of one or more portions of the computer program, wherein the annotation information identifies a specific instruction, that when executed, is configured to free at least one register to obtain a free register; and instrumenting the binary file, wherein instrumenting comprises: inserting a set of instrumentation code at one or more points in the code section of the computer program, wherein the one or more points are determined using the annotation information; and inserting a profile section configured to store profile information, wherein the set of instrumentation code, when executed, modifies the profile information and wherein the profile information characterizes the execution of the executable code, wherein the free register is determined, using the annotation information, at a particular point of the one or more points in the code section of the computer program at which the set of instrumentation code is inserted; and inserting a group of instructions that use the free register at the particular point, wherein the group of instructions are executed as part of executing the binary file.