US2017139681A1PendingUtilityA1
Class splitting in object-oriented environments
Est. expiryNov 13, 2035(~9.3 yrs left)· nominal 20-yr term from priority
G06F 8/30G06F 9/4491G06F 9/54G06F 9/45516G06F 8/315
51
PatentIndex Score
0
Cited by
0
References
0
Claims
Abstract
Embodiments of the present invention disclose a method, computer program product, and system for class splitting in object-oriented environments in which objects are created by classes. Data is analyzed, in response to generating an instance of an original class in a code component. Fields are separated into sets based on the code paths that access the fields. A split class is generated for a set of fields which shares a common interface with the original class. Cells are replaced in the code component to the original class with a split class.
Claims
exact text as granted — not AI-modifiedWhat is claimed is:
1 . A computer-implemented method for class splitting in object-oriented environments in which objects are created by classes, the method comprising:
analyzing data, in response to generating an instance of an original class in a code component; separating fields into sets based on the code paths that access the fields; generating a split class for a set of fields which shares a common interface with the original class; and replacing calls in the code component to the original class with a split class.
2 . The method of claim 1 , wherein analyzing data further comprises:
analyzing code paths in the original class in the code component; and analyzing fields, wherein the fields are accessed by the code paths.
3 . The method of claim 1 , wherein generating a split class includes adding code for paths utilized by the split class.
4 . The method of claim 1 , wherein generating a split class includes one or more of:
adding shared code which is copied into any split classes using the shared code; and the shared code is accessed by the split class from the original class.
5 . The method of claim 1 , wherein a decision to generate a split class is taken at one or more of: a build time; a runtime, and the decision to generate further comprises one or more of: reducing the amount of code in a most common paths and reducing the size of a most common type object.
6 . The method of claim 1 , wherein replacing calls in the code component is carried out dynamically by checking instance types of an argument to choose which split class to instantiate.
7 . The method of claim 1 , wherein replacing calls in the code component is carried out before running the code component, and calls are statically directed to a split class.
8 . The method of claim 1 , wherein analyzing data is carried out to optimize one or both of code and data.
9 . The method of claim 1 , wherein analyzing data is carried out by one or more of: statically at build time; and dynamically at runtime via a just in time (JIT) compiler.
10 . The method of claim 1 , wherein a split class eliminates decision points for paths not taken for that instance of the object and unused fields are removed from split classes.
11 . The method of claim 1 , a split class is generated for a first constructor that take different arguments from a second constructor of the original class, and calls to the first constructor are replaced by calls to the split class.
12 . The method of claim 1 , wherein a single split class is generated in response to a majority of calls using a single code path.
13 . The method of claim 1 , wherein separating fields into sets further comprises performing escape analysis based on one or more fields grouped into a plurality of sets reachable from each code path.
14 . A computer program product for class splitting in object-oriented environments in which objects are created by classes, the computer program product comprising:
one or more computer-readable storage media and program instructions stored on the one or more computer-readable storage media, the program instructions comprising: instructions to analyze data, in response to instructions to generate an instance of an original class in a code component; instructions to separate fields into sets based on the code paths that access the fields; instructions to generate a split class for a set of fields which shares a common interface with the original class; and instructions to replace calls in the code component to the original class with a split class.
15 . The computer program product of claim 14 , wherein analyzing data further comprises:
instructions to analyze code paths in the original class in the code component; and instructions to analyze fields, wherein the fields are accessed by the code paths.
16 . The computer program product of claim 14 , wherein instructions to generate a split class includes adding code for paths utilized by the split class.
17 . The computer program product of claim 14 , wherein instructions to generate a split class includes one or more of:
adding shared code which is copied into any split classes using the shared code; and the shared code is accessed by the split class from the original class.
18 . The computer program product of claim 14 , wherein instructions to generate a split class is executed at one or more of: a build time; a runtime, and the decision to generate further comprises one or more of: reducing the amount of code in a most common paths and reducing the size of a most common type object.
19 . The computer program product of claim 14 , wherein replacing calls in the code component is carried out dynamically by checking instance types of an argument to choose which split class to instantiate.
20 . A computer system for class splitting in object-oriented environments in which objects are created by classes, the computer system comprising:
one or more computer processors; one or more computer-readable storage media; program instructions stored on the computer-readable storage media for execution by at least one of the one or more processors, the program instructions comprising: instructions to analyze data, in response to instructions to generate an instance of an original class in a code component; instructions to separate fields into sets based on the code paths that access the fields; instructions to generate a split class for a set of fields which shares a common interface with the original class; and instructions to replace calls in the code component to the original class with a split class.Join the waitlist — get patent alerts
Track US2017139681A1 — get alerts on status changes and closely related new filings.
We store only your email — no account needed. See our privacy policy.