Patent ID: 7356802

Claim:
A method on an information processing system for automatic replacement of object classes, comprising: performing static analysis on a program containing a plurality of objects in order to determine constraints on transformations that can be applied and to detect unused functionality in one or more of the objects to be replaced; analyzing the plurality of objects to detect usage patterns of functionality in the one or more objects replaced; analyzing at least one execution of the program to collect profile information for the one or more objects; and generating customized classes based upon the static analysis and the usage patterns detected and the profile information which has been collected. wherein generating customized classes based upon the usage patterns detected includes: identifying a customizable container class C with surerclass B; creating a class CustomC which contains methods and fields that are identical to those in class C, wherein if B is not customizable, then CustomC's superclass is B, otherwise CustomC's superclass is CustomB; introducing a type C T and making both C and CustomC a subtype of C T and wherein type C T contains declarations of all methods in C that are not declared in any surerclass of C; and introducing a type C âŠ¥ , and making C âŠ¥ a subclass of both C and CustomC, wherein type C âŠ¥ contains no methods, and wherein C T and C âŠ¥ are intermediate types not provided as output during the generation of custom classes; determining at least one equivalence class E of declaration elements and expressions that must have a same type; computing a set of possible types for equivalence class E using an optimistic algorithm, wherein this algorithm associates a set S E of types with equivalence class E , which is initialized as follows: associating a set S E with the equivalence class E containing types C and CustomC if E contains an allocation site expression new C; and associating a set S E with the equivalence class E containing all types except auxiliary types C T and C âŠ¥ , wherein C T and C âŠ¥ are intermediate types not provided as output during the generation of custom classes if E does not contain any allocation site expressions.