Patent ID: 6230314
Filing Date: 2001-05-08
Classification: G06F

Abstract:
A program storage device, readably by a machine, tangibly embodying instructions to perform method steps for generating a representation of a program P with an original execution behavior, wherein said program P has a class hierarchy H that includes class C1 and C2 both containing element M, and wherein said program P defines a plurality of objects including objects O1 and O2 belonging to class C1 and C2, respectively, said method steps for automatically eliminating unused elements from objects comprising:automatically creating a new class hierarchy H' including at least one class for each variable and one class for each method:automatically computing a set of type constraints associated with element M that indicates i) whether element M in object O1 is used in any execution of program P, and ii) whether element M in object O2 is used in any execution of program P, and wherein said set of type constraints capture sub-type relationships between said element M and said objects O1 and O2 that must be preserved in order to preserve said original execution behavior of said program P;adding to the new class hierarchy H' inheritance relationships based upon said set of type constraints, wherein said class hierarchy H' includes classes Dl and D2, wherein D1 is a type for object O1 and D2 is a type for object O2 such that:in the event that said set of type constraints indicate that element M in object O1 is used in any execution of program P, class D1 contains element M;in the event that said set of type constraints indicate that element M in object O2 is not used in any execution of program P, class D2 omits element M; andgenerating a representation of said program P based upon the new class hierarchy H' execution behavior of said program P is preserved.