Automatic customization of classes
First Claim
1. A computer readable storage medium containing programming instructions for automatic replacement of object classes, the programming instructions 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 the generating customized classes based upon the usage patterns detected includes;
identifying a customizable container class C with superclass 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 CT, and making both C and CustomC a subtype of CT and wherein type CT contains declarations of all methods in C that are not declared in any superclass 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 CT and C⊥
are intermediate types not provided as output during the generating of custom classes;
determining at least one equivalence class E of declaration elements and expressions that must have a same type.
0 Assignments
0 Petitions
Accused Products
Abstract
A method and computer readable medium for automatic replacement of object classes in a library with custom classes to improve program efficiency. The method begins with static analysis preformed on a program containing a plurality of objects in order to determine type-correctness constraints and to detect unused functionality in one or more of the objects to be replaced. The plurality of objects is instrumented to detect usage patterns of functionality in one or more objects. Customized classes are generated based upon the static analysis and usage patterns detected. Bytecode is rewritten which is used for generating classes. The present invention provides transparency in the replacement of the objects.
-
Citations
20 Claims
-
1. A computer readable storage medium containing programming instructions for automatic replacement of object classes, the programming instructions 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 the generating customized classes based upon the usage patterns detected includes; identifying a customizable container class C with superclass 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 CT, and making both C and CustomC a subtype of CT and wherein type CT contains declarations of all methods in C that are not declared in any superclass 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 CT and C⊥
are intermediate types not provided as output during the generating of custom classes;determining at least one equivalence class E of declaration elements and expressions that must have a same type. - View Dependent Claims (2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14)
-
-
15. An information processing system with programming instructions for automatic replacement of object classes, comprising:
-
means for 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; means for analyzing the plurality of objects to detect usage patterns of functionality in the one or more objects replaced; means for analyzing at least one execution of the program to collect profile information for the one or more objects; and means for generating customized classes based upon the static analysis and the usage patterns detected and the profile information which has been collected; wherein the means for generation of customized classes based upon the usage patterns detected includes; means for identifying a customizable container class C with superclass B; means for 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 Custom B; means for introducing a type CT, and making both C and CustomC a subtype of CT and wherein type CT contains declarations of all methods in C that are not declared in any superclass of C; and means for introducing a type C⊥
, and making C⊥
a subclass of both C and CustomC , wherein type C⊥
contains no methods, and wherein CT and C⊥
are intermediate types not provided as output during the generating of custom classes; andmeans for determining at least one equivalence class E of declaration elements and expressions that must have a same type. - View Dependent Claims (16, 17, 18, 19, 20)
-
Specification