Class splitting in object-oriented environments

US11036527B2 · US · B2

Patent metadata
FieldValue
Publication numberUS-11036527-B2
Application numberUS-201916456344-A
CountryUS
Kind codeB2
Filing dateJun 28, 2019
Priority dateNov 13, 2015
Publication dateJun 15, 2021
Grant dateJun 15, 2021

How to read this patent

A practical reading order for non-experts. Skip the full description unless you need deep technical detail.

  1. Title

    What the patent document calls the invention.

  2. Abstract

    A short plain-language summary of the technical disclosure.

  3. Assignees and inventors

    Who owns or filed the patent and who is credited as inventor.

  4. Key dates

    Filing, priority, publication, and grant dates set the timeline.

  5. First independent claim

    The legal scope of protection — read this for what is actually claimed.

  6. CPC / IPC classifications

    Technology tags used to group this patent with similar filings.

  7. Citations and related patents

    Prior art links and similar publications in this corpus.

Abstract

Official abstract text for this publication.

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.

First claim

Opening claim text (preview).

What 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: in response to generating an instance of an original class in a code component, analyzing data, wherein the analyzed data is passed when the instance of the original class is created in the code component; in response to dynamically determining a scope of pointers for the analyzed data, determining code paths associated with accessing fields in the code component; separating the fields into sets based on the code paths determined to be associated with the accessed fields; generating a split class at runtime for a set of fields which shares a common interface with the original class, wherein the generating the split class is based on a subset of the set of fields and the code paths determined to be associated with accessing the fields, wherein the generating a split class further comprises: adding code for paths utilized by the split class, and adding shared code, wherein the shared code is from the original class; dynamically determining an argument type associated with the generated split class; identifying one or more system calls for the original class, the system calls comprising a service request; in response to identifying the one or more system calls for the original class, replacing calls in the code component to the original class with calls to the split class; in response to determining a number of fields used in the set of fields crosses a threshold, replacing calls in the code component to the split class with calls to the original class; and generating a second split class at runtime for a first constructor that includes a second argument type from a second constructor of the original class, wherein calls to the first constructor are replaced by calls to the generated second 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 accessed by the code paths. 3. 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. 4. 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. 5. The method of claim 1 , wherein analyzing data is carried out to optimize one or both of code and data. 6. The method of claim 1 , wherein the analyzing of data passed when an instance of an original class is created is carried out dynamically at runtime via a just in time (JIT) compiler. 7. 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. 8. The method of claim 1 , wherein a single split class is generated in response to a majority of calls using a single code path. 9. 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. 10. 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 non-transitory 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 responsive to instructions to generate an instance of an original class in a code component, wherein the analyzed data is passed when the instance of the original class is created in the code; in response to instructions to dynamically determine a scope of pointers for the analyzed data, instructions to determine code paths associated with accessing fields in the code component; instructions to separate the fields into sets based on the code paths determined to be associated with the accessed fields; instructions to generate a split class at runtime for a set of fields which shares a common interface with the original class, wherein the instructions to generate the split class is based on a subset of the set of fields and the code paths determined to be associated with accessing the fields, wherein the instructions to generate a split class further comprises: instructions to add code for paths utilized by the split class, and instructions to add shared code, wherein the shared code is from the original class; instructions to dynamically determine an argument type associated with the generated split class; instructions to identify one or more system calls for the original class, the system calls comprising a service request; in response to instructions to identifying the one or more system calls for the original class, instructions to replace calls in the code component to the original class with calls to the split class; in response to instructions to determining that a number of fields used in the set of fields crosses a threshold, instruction to replace calls in the code component to the split class with calls to the original class; and instructions to generate a second split class at runtime for a first constructor that includes a second argument type from a second constructor of the original class, wherein calls to the first constructor are replaced by calls to the generated second split class. 11. The computer program product of claim 10 , 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. 12. The computer program product of claim 10 , 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. 13. 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 responsive to instructions to generate an instance of an original class in a code component, wherein the analyzed data is passed when the instance of the original class is created in the code; in response to instructions to dynamically determine a scope of pointers for the analyzed data, instructions to determine code paths associated with accessing fields in the code component; instructions to separate the fields into sets based on the code paths determined to be associated with the accessed fields; instructions to generate a split class at runtime for a set of fields which shares a common interface with the original class, wherein the instructions to generate the split class is based on a subset of the set of fields and the code paths determined to be associated with accessing the fields, wherein the instructions to generate a split class further comprises: instructions to add code for paths utilized by the split class, and instructions to add shared code, wherein the shared code is from the original class; instructions to dynamically determine an argument type associated with the generated split class; instructions to identify one or more system calls for the original class, the system calls c

Assignees

Inventors

Classifications

  • G06F9/4491Primary

    Optimising based on receiver type · CPC title

  • Creation or generation of source code · CPC title

  • Runtime code conversion or optimisation · CPC title

  • Interprogram communication · CPC title

Patent family

Related publications grouped by family.

External sources

Frequently asked questions

Answers are generated from the same data shown on this page.

What does patent US11036527B2 cover?
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 s…
Who is the assignee on this patent?
IBM
What technology area does this patent fall under?
Primary CPC classification G06F9/4491. Mapped technology areas include Physics.
When was this patent published?
Publication date Tue Jun 15 2021 00:00:00 GMT+0000 (Coordinated Universal Time) (B2). Legal status and post-grant events are not shown on this page.
What related patents are in patentsdb?
We list 4 related publications on this page (citations in our corpus or others sharing the same primary CPC).