Patent ID: 8458681

Claim:
A method for optimizing the object code of an object-oriented program, comprising: at a computer system including one or more processors and memory storing one or more programs, the one or more processors executing the one or more programs to perform the operations of: generating, respectively, a first object code segment for a first virtual function and a second object code segment for a second virtual function, wherein the first virtual function and the second virtual function are two distinct parts of the object-oriented program and the first virtual function is invoked by a first call site and the second virtual function is invoked by a second call site in the object-oriented program; determining that the first object code segment is identical to the second object code segment although the first virtual function is not identical to the second virtual function; generating in a compilation unit of the object-oriented program, respectively, a first debugging information entry for the first virtual function and a second debugging information entry for the second virtual function, wherein both the first and second debugging information entries include information for locating the first object code segment; and inserting into a virtual call table in the compilation unit, respectively, a first entry for the first call site and a second entry for the second call site, wherein the first entry includes information for locating the first call site within a call stack of the object-oriented program, the information further including a first return pointer of the first virtual function, and information for locating the first debugging information entry, the information further including a first address pointer to the first debugging information entry associated with the virtual function table, and the second entry includes information for locating the second call site within the call stack, the information further including a second return pointer of the second virtual function, and information for locating a second debugging information entry, the information further including a second address pointer to the second debugging information entry associated with the virtual function table, such that an operation within the first object code segment at runtime is uniquely associated with a respective one of the first and second virtual functions by a corresponding entry in the call table.