Optimizing object oriented programs using limited customization
AssigneeGoogle Inc.
InventorsSrdjan Mitrovic, Lars Bak
Life of this patent
Estimating the term…
Abstract
A capability for limited customization that utilizes existing virtual dispatch table technology and allows selective customization is provided. Such a capability combines the usage of virtual dispatch tables with both customized and non-customized code to reduce, or even eliminate over-customization. Further, such a capability may employ a runtime system that decides what methods to customize based on several factors including, but not limited to the size of a class hierarchy, the amount of available space for compiled code, and the amount of available time for compilation.
Claims21
A computer-implemented method for optimizing object oriented programs using limited customization comprising:
- determining whether a virtual function is compiled for a first receiver class associated with the virtual function;
- if it is determined that the virtual function is not already compiled for the first receiver class, determining whether to customize the virtual function having the associated first receiver class;
- generating, if it is determined to customize the virtual function, a customized version of the virtual function having one or more devirtualized function calls of the virtual function;
- storing an entry for the customized version of the virtual function in a virtual table associated with the first receiver class, wherein the virtual table stores an entry point of the virtual function that is not customized;
- and
- executing the customized version of the virtual function for an object of the first receiver class based on the stored entry in the virtual table associated with the first receiver class,
- wherein the determining, the generating, the storing, and the executing are performed using one or more computing devices.
A system for optimizing object oriented programs using limited customization comprising:
- at least one processor;
- a virtual function analyzer configured to determine whether a virtual function is compiled for a first receiver class associated with the virtual function and determine whether to customize the virtual function having the associated first receiver class, if it is determined that the virtual function is not already compiled for the first receiver class;
- a virtual function customizer configured to:
- generate, based on the determination of the virtual function analyzer that it is determined to customize the virtual function, a customized version of the virtual function having one or more devirtualized function calls of the virtual function,
- compile the virtual function for the first receiver class, and
- store an entry for the customized version of the virtual function in a virtual table associated with the first receiver class, wherein the virtual table stores an entry point of the virtual function that is not customized;
- and
- an execution unit configured to execute on the at least one processor the customized version of the virtual function for an object of the first receiver class based on the stored entry in the virtual table associated with the first receiver class.
A non-transitory computer readable storage device having instructions stored thereon that, when executed by a computing device, cause the computing device to perform operations comprising:
- determining whether a virtual function is compiled for a first receiver class associated with the virtual function;
- if it is determined that the virtual function is not already compiled for the first receiver class, determining whether to customize the virtual function having the associated first receiver class;
- generating, if it is determined to customize the virtual function, a customized version of the virtual function having one or more devirtualized function of the virtual function;
- storing an entry for the customized version of the virtual function in a virtual table associated with the first receiver class, wherein the virtual table stores an entry point of the virtual function that is not customized;
- and
- executing the customized version of the virtual function for an object of the first receiver class based on the stored entry in the virtual table associated with the first receiver class,
- wherein the determining, the generating, the storing, and the executing are performed using one or more computing devices.
Dependencies are inferred from the claim text.