Run-time type conversion
AssigneeInternational Business Machines Corporation
InventorSachin Agrawal
Life of this patent
Estimating the term…
Abstract
A method, system and computer program product for converting, at run-time, a first class (type) of an object to a second class (type). The second class is any class of a plurality of classes provided. Class layouts for the plurality of classes and an object layout for the object whose class is to be converted are provided. The object layout is associated with an address in a memory. The object layout is changed to provide the class conversion without changing the object layout address and without changing any class layout.
Claims32
A method of converting, at run-time, a class of an object in an object-oriented programming environment, said method comprising:
- providing a plurality of classes including a first class and a second class, said second class being any class of said plurality of classes;
- providing a plurality of class layout data structures (class layouts), each class of said plurality of classes being associated with a class layout of said plurality of class layouts;
- providing an object initially of said first class;
- providing an object layout data structure (object layout), said object being associated with said object layout, and said object layout being associated with an address in a memory;
- and
- converting, at run-time, said object from said first class to said second class, said converting comprising changing said object layout, without changing said address associated with said object layout, and without changing any class layout of said plurality of class layouts.
A system for converting, at run-time, a class of an object in an object-oriented programming environment, said system comprising:
- means for providing a plurality of classes including a first class and a second class, said second class being any class of said plurality of classes;
- means for providing a plurality of class layout data structures (class layouts), each class of said plurality of classes being associated with a class layout of said plurality of class layouts;
- means for providing an object initially of said first class;
- means for providing an object layout data structure (object layout), said object being associated with said object layout, and said object layout being associated with an address in a memory;
- and
- means for converting, at run-time, said object from said first class to said second class, said means for converting comprising means for changing said object layout, without changing said address associated with said object layout, and without changing any class layout of said plurality of class layouts.
At least one program storage device readable by a machine, tangibly embodying at least one program of instructions executable by the machine to perform a method of converting, at run-time, a class of an object in an object-oriented programming environment, said method comprising:
- providing a plurality of classes including a first class and a second class, said second class being any class of said plurality of classes;
- providing a plurality of class layout data structures (class layouts), each class of said plurality of classes being associated with a class layout of said plurality of class layouts;
- providing an object initially of said first class;
- providing an object layout data structure (object layout), said object being associated with said object layout, and said object layout being associated with an address in a memory;
- and
- converting, at run-time, said object from said first class to said second class, said converting comprising changing said object layout, without changing said address associated with said object layout, and without changing any class layout of said plurality of class layouts.
A method for deploying computing infrastructure, comprising integrating computer-readable code into a computing system, wherein the code in combination with the computing system is capable of performing a process of converting, at run-time, a class of an object in an object-oriented programming environment, said process comprising:
- providing a plurality of classes including a first class and a second class, said second class being any class of said plurality of classes;
- providing a plurality of class layout data structures (class layouts), each class of said plurality of classes being associated with a class layout of said plurality of class layouts;
- providing an object initially of said first class;
- providing an object layout data structure (object layout), said object being associated with said object layout, and said object layout being associated with an address in a memory;
- and
- converting, at run-time, said object from said first class to said second class, said converting comprising changing said object layout, without changing said address associated with said object layout, and without changing any class layout of said plurality of class layouts.
Dependencies are inferred from the claim text.