Patent ID: 8095922
Filing Date: 2012-01-10
Classification: G06F

Abstract:
1. A method for providing an optimization for a most derived object during compile time, the method comprising: determining whether the most derived class object is present during compile time; utilizing the most derived class object to obtain a location of a virtual base for the most derived class object during compile time; providing the virtual base of the most derived class object during compile time; and running the optimization during compile time in which the most derived class object does not require a virtual function-table table to be passed in and the most derived class object already knows a final most derived class virtual function-table table and a final most derived class virtual function table; wherein the optimization run during compile time performs a compile-time calculation to find a location offset of a final destination cast in order to allow the optimization to compile multiple casts in argument expressions during compile time, the optimization being run to avoid pre-generation of virtual function tables and to avoid multiple comma expression evaluation; wherein the optimization is executed for at least one of a constructor and a destructor; wherein the at least one of the constructor and the destructor contains arguments which require conversion to a base type; and wherein the conversion is performed at compile time instead of at runtime.