Patent ID: 7895603

Claim:
A machine implemented method, comprising: prior to detecting an invocation of a virtual method, initializing a plurality of object classes to reference a shared virtual method dispatch structure (vstructure), wherein an object class is one of the plurality of object classes, wherein the shared vstructure comprises a reference to a set of structure creation instructions; detecting the invocation of the virtual method of a plurality of virtual methods defined in the object class of the plurality of object classes; in response to detecting the invocation of the virtual method, creating a first vstructure for the object class, wherein the first vstructure comprises a plurality of entries, wherein the first vstructure comprises an entry of the plurality of entries for each of the plurality of virtual methods defined in the object class, wherein the first vstructure comprises a reference to a set of instructions that is to be executed when the virtual method is invoked, wherein creating the first vstructure comprises creating a link between a second vstructure and the first vstructure, wherein the second vstructure comprises a reference to the set of instructions, and wherein the set of instructions is located at a current location; relocating the set of instructions from the current location to a new location; updating the second vstructure to cause the second vstructure to reference the set of instructions at the new location instead of the current location; following the link between the second vstructure and the first vstructure to access the first vstructure; and updating the first vstructure to cause the first vstructure to reference the set of instructions at the new location instead of the current location.