← Back to Patent Explorer
US5794041A Expired / Lapsed US ⏱️ 0.0 years remaining

C++ ojbect model alternatives

Assignee: International Business Machines Corp
•
Filing: 1996-12-06
•
Granted: 1998-08-11
•
Expires: 2016-12-06
📄 Original PDF 🌐 Google Patents 🔄 Sync Now

Abstract

Abstract Alternatives for laying out objects and/or virtual function tables (VFTs), sharing a virtual function table pointer with a direct, virtual base, eliminating the need for an early cast by increasing the number of virtual function table entries, and providing a smart virtual dispatch that eliminates late casts where possible. An object model can be constructed by choosing one option from each of several alternatives. Interaction of alternatives include (1) sharing VFT pointers with a direct, virtual base requires that virtual base pointers are not stored in objects and (2) sharing VFT pointers affects the sharing of virtual base pointers with base classes and placement of late cast adjustment arguments and determining virtual function table entries.

Inventors

  • 👤 Theodore Cheuk-Tak Law
  • 👤 Michael George Burke
  • 👤 Harini Srinivasan
  • 👤 Peter F. Sweeney

Bibliographic Details

Application Number —
Jurisdiction US
Data Source google_patents
Last Synchronized 2026-11-01 16:07
CPC Classifications
G; G06; G06F; G06F9/00; G06F9/06; G06F9/44; G06F9/448; G06F9/4488; G06F9/449

Claims Analysis

Total Claims: 35
Claim 1
Independent Claim 461 words
A computer implemented method of modeling C++ objects in an implementation of the C++ programming language in which a class in the C++ language may inherit another class, an inherited class being known as a base class and an inheriting class being known as a derived class, a class hierarchy graph, , for a C++ language program being defined as a tuple <N,E> where N is a set of nodes representing classes in the program and E is a set of directed edges representing inheritance relationships between the classes, a nonvirtual path from class B to class D is a path in from the node labeled B to the node labeled D such that there is no virtual inheritance edge along this path, a nonvirtual region for a class D is the set of classes such that for each class B in this set, there is a nonvirtual path in from B to D, a class V is a direct, virtual base of a class D if and only if there is an edge labeled virtual in from V to D, a virtual path from class V to class D is a path in from the node labeled V to the node labeled D such that there is at least one virtual inheritance edge along this path, a class V being a virtual base of a class D if there is a virtual path in from V to D, a virtual region for the class D being a set of classes such that for each class V in the set, there is a virtual path in from V to D, said computer implemented method comprising the steps of: laying out a virtual function table (VFT) in computer memory having a number of entries, said virtual function table entry having at least a function address and supporting a virtual dispatch mechanism; laying out an object in computer memory to include as components of the object all base class subobjects of the object, data members defined in the class, and a VFT pointer to the VFT for implementing the virtual dispatch mechanism required for virtual functions; laying out virtual base pointers in computer memory to access virtual base subobjects; sharing with a derived class D a VFT pointer of a direct, virtual base class V only when the virtual base class V has a fixed part of its object that contains only a VFT pointer; and sharing with a derived class D a VFT pointer of a direct, virtual base class V only when the virtual base class V has a fixed part of its object that contains both a VFT pointer and other data and the derived class D has a fixed part of its object that only contains the VFT pointer.
Claim 2
Dependent Claim 461 words
A computer implemented method of modeling C++ objects in an implementation of the C++ programming language in which a class in the C++ language may inherit another class, an inherited class being known as a base class and an inheriting class being known as a derived class, a class hierarchy graph, , for a C++ language program being defined as a tuple <N,E> where N is a set of nodes representing classes in the program and E is a set of directed edges representing inheritance relationships between the classes, a nonvirtual path from class B to class D is a path in from the node labeled B to the node labeled D such that there is no virtual inheritance edge along this path, a nonvirtual region for a class D is the set of classes such that for each class B in this set, there is a nonvirtual path in from B to D, a class V is a direct, virtual base of a class D if and only if there is an edge labeled virtual in from V to D, a virtual path from class V to class D is a path in from the node labeled V to the node labeled D such that there is at least one virtual inheritance edge along this path, a class V being a virtual base of a class D if there is a virtual path in from V to D, a virtual region for the class D being a set of classes such that for each class V in the set, there is a virtual path in from V to D, said computer implemented method comprising the steps of: laying out a virtual function table (VFT) in computer memory having a number of entries, said virtual function table entry having at least a function address and supporting a virtual dispatch mechanism; laying out an object in computer memory to include as components of the object all base class subobjects of the object, data members defined in the class, and a VFT pointer to the VFT for implementing the virtual dispatch mechanism required for virtual functions; laying out virtual base pointers in computer memory to access virtual base subobjects; sharing with a derived class D a VFT pointer of a direct, virtual base class V only when the virtual base class V has a fixed part of its object that contains only a VFT pointer; and sharing with a derived class D a VFT pointer of a direct, virtual base class V only when the virtual base class V has a fixed part of its object that contains both a VFT pointer and other data and the derived class D has a fixed part of its object that only contains the VFT pointer.
Claim 3
Dependent Claim 40 words
The computer implemented method of modeling C++ objects in an implementation of the C++ programming language recited in claim 1 further comprising the step of storing said virtual base pointers in said VFT as offsets to said virtual base subobjects.
Claim 4
Dependent Claim 40 words
The computer implemented method of modeling C++ objects in an implementation of the C++ programming language recited in claim 1 wherein a class C shares virtual base pointers with those base classes that share their VFT pointer with class C.
Claim 5
Dependent Claim 37 words
The computer implemented method of modeling C++ objects in an implementation of the C++ programming language recited in claim 1 wherein a VFT entry contains only an address of the function when no late cast is required.
Claim 6
Dependent Claim 42 words
The computer implemented method of modeling C++ objects in an implementation of the C++ programming language recited in claim 1 wherein a VFT entry contains only an address of a code performing a late cast's adjustment when a late cast is required.
Claim 7
Dependent Claim 38 words
The computer implemented method of modeling C++ objects in an implementation of the C++ programming language recited in claim 1 wherein a VFT for a class contains entries for all virtual functions that are visible at the class.
Claim 8
Dependent Claim 188 words
The computer implemented method of modeling C++ objects in an implementation of the C++ programming language recited in claim 1 wherein when a fully derived object of class D, with static type S, is pointed to by p in a virtual function call p→ƒ( ), and the actual function invoked is ƒ defined in class E, denoted by E::ƒ( ), an early cast is an adjustment of a THIS pointer to a subobject, X, in the D object whose VFT contains the entry that has an address of E::ƒ( ), a late cast is an adjustment of the THIS pointer to point to an E subobject if the E and X subobjects are at different locations within the D object, a class C is defined as an introducing class of a virtual function ƒ, the class C declaring the virtual function ƒ and no base class of C in declaring ƒ, and the VFT contains entries for all virtual functions introduced in a class T and for all virtual functions introduced in the virtual region of the class T, thereby eliminating a need for an early virtual cast.
Claim 9
Dependent Claim 222 words
The computer implemented method of modeling C++ objects in an implementation of the C++ programming language recited in claim 1 wherein when a fully derived object of class D, with static type S, is pointed to by p in a virtual function call p→ƒ( ), and the actual function invoked is ƒ defined in class E, denoted by E::ƒ( ), an early cast is an adjustment of a THIS pointer to a subobject, X, in the D object whose VFT contains the entry that has an address of E::ƒ( ), a late cast is an adjustment of the THIS pointer to point to an E subobject if the E and X subobjects are at different locations within the D object, a class C is defined as an introducing class of a virtual function ƒ, the class C declaring the virtual function ƒ and no base class of C in declaring ƒ, the VFT contains entries for all virtual functions introduced in a class T, and if there is a direct virtual base V of the class D which is not a direct virtual base of any base class of the class D, then the class D's VFT contains an entry for all virtual functions introduced in the nonvirtual region of the class V, thereby eliminating a need for an early virtual cast.
Claim 10
Dependent Claim 418 words
A computer implemented method of modeling C++ objects in an implementation of the C++ programming language in which a class in the C++ language may inherit another class, an inherited class being known as a base class and an inheriting class being known as a derived class, a class hierarchy graph, , for a C++ language program being defined as a tuple <N,E> where N is a set of nodes representing classes in the program and E is a set of directed edges representing inheritance relationships between the classes, a nonvirtual path from class B to class D is a path in from the node labeled B to the node labeled D such that there is no virtual inheritance edge along this path, a nonvirtual region for a class D is the set of classes such that for each class B in this set, there is a nonvirtual path in from B to D, a class V is a direct, virtual base of a class D if and only if there is an edge labeled virtual in from V to D, a virtual path from class V to class D is a path in from the node labeled V to the node labeled D such that there is at least one virtual inheritance edge along this path, a class V being a virtual base of a class D if there is a virtual path in from V to D, a virtual region for the class D being a set of classes such that for each class V in the set, there is a virtual path in from V to D, said computer implemented method comprising the steps of: laying out a virtual function table (VFT) in computer memory having a number of entries, said virtual function table entry having at least a function address and supporting a virtual dispatch mechanism; laying out an object in computer memory to include as components of the object all base class subobjects of the object, data members defined in the class, and a VFT pointer to the VFT for implementing the virtual dispatch mechanism required for virtual functions; laying out virtual base pointers in computer memory to access virtual base subobjects; sharing with a derived class D a VFT pointer and at least one virtual base pointer of a direct, virtual base class V only when the virtual base class V has a fixed part of its object that contains only both a VFT pointer and at least one virtual base pointer.
Claim 11
Dependent Claim 418 words
A computer implemented method of modeling C++ objects in an implementation of the C++ programming language in which a class in the C++ language may inherit another class, an inherited class being known as a base class and an inheriting class being known as a derived class, a class hierarchy graph, , for a C++ language program being defined as a tuple <N,E> where N is a set of nodes representing classes in the program and E is a set of directed edges representing inheritance relationships between the classes, a nonvirtual path from class B to class D is a path in from the node labeled B to the node labeled D such that there is no virtual inheritance edge along this path, a nonvirtual region for a class D is the set of classes such that for each class B in this set, there is a nonvirtual path in from B to D, a class V is a direct, virtual base of a class D if and only if there is an edge labeled virtual in from V to D, a virtual path from class V to class D is a path in from the node labeled V to the node labeled D such that there is at least one virtual inheritance edge along this path, a class V being a virtual base of a class D if there is a virtual path in from V to D, a virtual region for the class D being a set of classes such that for each class V in the set, there is a virtual path in from V to D, said computer implemented method comprising the steps of: laying out a virtual function table (VFT) in computer memory having a number of entries, said virtual function table entry having at least a function address and supporting a virtual dispatch mechanism; laying out an object in computer memory to include as components of the object all base class subobjects of the object, data members defined in the class, and a VFT pointer to the VFT for implementing the virtual dispatch mechanism required for virtual functions; laying out virtual base pointers in computer memory to access virtual base subobjects; sharing with a derived class D a VFT pointer and at least one virtual base pointer of a direct, virtual base class V only when the virtual base class V has a fixed part of its object that contains only both a VFT pointer and at least one virtual base pointer.
Claim 12
Dependent Claim 40 words
The computer implemented method of modeling C++ objects in an implementation of the C++ programming language recited in claim 9 further comprising the step of storing said virtual base pointers in said object as offsets to said virtual base subobjects.
Claim 13
Dependent Claim 40 words
The computer implemented method of modeling C++ objects in an implementation of the C++ programming language recited in claim 9 wherein a class C shares virtual base pointers with those base classes that share their VFT pointer with class C.
Claim 14
Dependent Claim 37 words
The computer implemented method of modeling C++ objects in an implementation of the C++ programming language recited in claim 9 wherein a VFT entry contains only an address of the function when no late cast is required.
Claim 15
Dependent Claim 42 words
The computer implemented method of modeling C++ objects in an implementation of the C++ programming language recited in claim 9 wherein a VFT entry contains only an address of a code performing a late cast's adjustment when a late cast is required.
Claim 16
Dependent Claim 38 words
The computer implemented method of modeling C++ objects in an implementation of the C++ programming language recited in claim 9 wherein a VFT for a class contains entries for all virtual functions that are visible at the class.
Claim 17
Dependent Claim 188 words
The computer implemented method of modeling C++ objects in an implementation of the C++ programming language recited in claim 9 wherein when a fully derived object of class D, with static type S, is pointed to by p in a virtual function call p→ƒ( ), and the actual function invoked is ƒ defined in class E, denoted by E::ƒ( ), an early cast is an adjustment of a THIS pointer to a subobject, X, in the D object whose VFT contains the entry that has an address of E::ƒ( ), a late cast is an adjustment of the THIS pointer to point to an E subobject if the E and X subobjects are at different locations within the D object, a class C is defined as an introducing class of a virtual functions ƒ, the class C declaring the virtual function ƒ and no base class of C in declaring ƒ, and the VFT contains entries for all virtual functions introduced in a class T and for all virtual functions introduced in the virtual region of the class T, thereby eliminating a need for an early virtual cast.
Claim 18
Dependent Claim 222 words
The computer implemented method of modeling C++ objects in an implementation of the C++ programming language recited in claim 9 wherein when a fully derived object of class D, with static type S, is pointed to by p in a virtual function call p→ƒ( ), and the actual function invoked is ƒ defined in class E, denoted by E::ƒ( ), an early cast is an adjustment of a THIS pointer to a subobject, X, in the D object whose VFT contains the entry that has an address of E:ƒ( ), a late cast is an adjustment of the THIS pointer to point to an E subobject if the E and X subobjects are at different locations within the D object, a class C is defined as an introducing class of a virtual function ƒ, the class C declaring the virtual function ƒ and no base class of C in declaring ƒ, the VFT contains entries for all virtual functions introduced in a class T, and if there is a direct virtual base V of the class D which is not a direct virtual base of any base class of the class D, then the class D's VFT contains an entry for all virtual functions introduced in the nonvirtual region of the class V, thereby eliminating a need for an early virtual cast.
Claim 19
Dependent Claim 477 words
A computer implemented method of modeling C++ objects in an implementation of the C++ programming language in which a class in the C++ language may inherit another class, an inherited class being known as a base class and an inheriting class being known as a derived class, a class hierarchy graph, , for a C++ language program being defined as a tuple <N,E> where N is a set of nodes representing classes in the program and E is a set of directed edges representing inheritance relationships between the classes, a nonvirtual path from class B to class D is a path in from the node labeled B to the node labeled D such that there is no virtual inheritance edge along this path, a nonvirtual region for a class D is the set of classes such that for each class B in this set, there is a nonvirtual path in from B to D, a class V is a direct, virtual base of a class D if and only if there is an edge labeled virtual in from V to D, a virtual path from class V to class D is a path in from the node labeled V to the node labeled D such that there is at least one virtual inheritance edge along this path, a class V being a virtual base of a class D if there is a virtual path in from V to D, a virtual region for the class D being a set of classes such that for each class V in the set, there is a virtual path in from V to D, said computer implemented method comprising the steps of: laying out a virtual function table (VFT) in computer memory having a number of entries, said virtual function table entry having at least a function address and supporting a virtual dispatch mechanism; laying out an object in computer memory to include as components of the object all base class subobjects of the object, data members defined in the class, and a VFT pointer to the VFT for implementing the virtual dispatch mechanism required for virtual functions; laying out virtual base pointers in computer memory to access virtual base subobjects; sharing with a derived class D at least one virtual base pointer of a direct, virtual base class V only when the virtual base class V has a fixed part of its object that contains only at least one virtual base pointer; and sharing with a derived class D at least one virtual base pointer of a direct, virtual base class V only when the virtual base class V has a fixed part of its object that contains both at least one virtual base pointer and other data and the derived class D has a fixed part of its object that only contains the at least one virtual base pointer.
Claim 20
Dependent Claim 477 words
A computer implemented method of modeling C++ objects in an implementation of the C++ programming language in which a class in the C++ language may inherit another class, an inherited class being known as a base class and an inheriting class being known as a derived class, a class hierarchy graph, , for a C++ language program being defined as a tuple <N,E> where N is a set of nodes representing classes in the program and E is a set of directed edges representing inheritance relationships between the classes, a nonvirtual path from class B to class D is a path in from the node labeled B to the node labeled D such that there is no virtual inheritance edge along this path, a nonvirtual region for a class D is the set of classes such that for each class B in this set, there is a nonvirtual path in from B to D, a class V is a direct, virtual base of a class D if and only if there is an edge labeled virtual in from V to D, a virtual path from class V to class D is a path in from the node labeled V to the node labeled D such that there is at least one virtual inheritance edge along this path, a class V being a virtual base of a class D if there is a virtual path in from V to D, a virtual region for the class D being a set of classes such that for each class V in the set, there is a virtual path in from V to D, said computer implemented method comprising the steps of: laying out a virtual function table (VFT) in computer memory having a number of entries, said virtual function table entry having at least a function address and supporting a virtual dispatch mechanism; laying out an object in computer memory to include as components of the object all base class subobjects of the object, data members defined in the class, and a VFT pointer to the VFT for implementing the virtual dispatch mechanism required for virtual functions; laying out virtual base pointers in computer memory to access virtual base subobjects; sharing with a derived class D at least one virtual base pointer of a direct, virtual base class V only when the virtual base class V has a fixed part of its object that contains only at least one virtual base pointer; and sharing with a derived class D at least one virtual base pointer of a direct, virtual base class V only when the virtual base class V has a fixed part of its object that contains both at least one virtual base pointer and other data and the derived class D has a fixed part of its object that only contains the at least one virtual base pointer.
Claim 21
Dependent Claim 40 words
The computer implemented method of modeling C++ objects in an implementation of the C++ programming language recited in claim 17 further comprising the step of storing said virtual base pointers in said object as offsets to said virtual base subobjects.
Claim 22
Dependent Claim 508 words
A computer implemented method of modeling C++ objects in an implementation of the C++ programming language in which a class in the C++ programming language may inherit another class, an inherited class being known as a base class and an inheriting class being known as a derived class, a class hierarchy graph, , for a C++ language program being defined as a tuple <N,E> where N is a set of nodes representing classes in the program and E is a set of directed edges representing inheritance relationships between the classes, a nonvirtual path from class B to class D is a path in from the node labeled B to the node labeled D such that there is no virtual inheritance edge along this path, a nonvirtual region for a class D is the set of classes such that for each class B in this set, there is a nonvirtual path in from B to D, a virtual path from class V to class D is a path in from the node labeled V to the node labeled D such that there is at least one virtual inheritance edge along this path, a class V being a virtual base of a class D if there is a virtual path in from V to D, a virtual region for the class D being a set of classes such that for each class V in the set, there is a virtual path in (from V to D, said computer implemented method comprising the steps of: laying out a virtual function table (VFT) in computer memory having a number of entries, said VFT entries having at least a function address and supporting a virtual dispatch mechanism; laying out an object in computer memory to include as components of the object all base class subobjects of the object, data members defined in the class, and a VFT pointer to the VFT for implementing the virtual dispatch mechanism required for virtual functions; and laying out virtual base pointers in computer memory to access virtual base subobjects, wherein when a fully derived object of class D, with static type S, is pointed to by p in a virtual function call p →ƒ( ), and the actual function invoked is ƒ defined in class E, denoted by E::ƒ( ), an early cast is an adjustment of a THIS pointer to a subobject, X, in the D object whose VFT contains the entry that has an address of E::ƒ( ), a late cast is an adjustment of the THIS pointer to point to an E subobject if the E and X subobjects are at different locations within the D object, a class C is defined as an introducing class of a virtual function ƒ, the class C declaring the virtual function ƒ and no base class of C in declaring ƒ, the VFT contains entries for all virtual functions introduced in a class T and for all virtual functions introduced in the virtual region of the class T, thereby eliminating a need for an early virtual cast.
Claim 23
Dependent Claim 508 words
A computer implemented method of modeling C++ objects in an implementation of the C++ programming language in which a class in the C++ programming language may inherit another class, an inherited class being known as a base class and an inheriting class being known as a derived class, a class hierarchy graph, , for a C++ language program being defined as a tuple <N,E> where N is a set of nodes representing classes in the program and E is a set of directed edges representing inheritance relationships between the classes, a nonvirtual path from class B to class D is a path in from the node labeled B to the node labeled D such that there is no virtual inheritance edge along this path, a nonvirtual region for a class D is the set of classes such that for each class B in this set, there is a nonvirtual path in from B to D, a virtual path from class V to class D is a path in from the node labeled V to the node labeled D such that there is at least one virtual inheritance edge along this path, a class V being a virtual base of a class D if there is a virtual path in from V to D, a virtual region for the class D being a set of classes such that for each class V in the set, there is a virtual path in (from V to D, said computer implemented method comprising the steps of: laying out a virtual function table (VFT) in computer memory having a number of entries, said VFT entries having at least a function address and supporting a virtual dispatch mechanism; laying out an object in computer memory to include as components of the object all base class subobjects of the object, data members defined in the class, and a VFT pointer to the VFT for implementing the virtual dispatch mechanism required for virtual functions; and laying out virtual base pointers in computer memory to access virtual base subobjects, wherein when a fully derived object of class D, with static type S, is pointed to by p in a virtual function call p →ƒ( ), and the actual function invoked is ƒ defined in class E, denoted by E::ƒ( ), an early cast is an adjustment of a THIS pointer to a subobject, X, in the D object whose VFT contains the entry that has an address of E::ƒ( ), a late cast is an adjustment of the THIS pointer to point to an E subobject if the E and X subobjects are at different locations within the D object, a class C is defined as an introducing class of a virtual function ƒ, the class C declaring the virtual function ƒ and no base class of C in declaring ƒ, the VFT contains entries for all virtual functions introduced in a class T and for all virtual functions introduced in the virtual region of the class T, thereby eliminating a need for an early virtual cast.
Claim 24
Dependent Claim 39 words
The computer implemented method of modeling C++ objects in an implementation of the C++ programming language recited in claim 19 further comprising the step of storing said virtual base pointers in said VFT as offsets to virtual base subobjects.
Claim 25
Dependent Claim 563 words
A computer implemented method of modeling C++ objects in an implementation of the C++ programming language in which a class in the C++ language may inherit another class, an inherited class being known as a base class and an inheriting class being known as a derived class, a class hierarchy graph, , for a C++ language program being defined as a tuple <N,E> where N is a set of nodes representing classes in the program and E is a set of directed edges representing inheritance relationships between the classes, a nonvirtual path from class B to class D is a path in from the node labeled B to the node labeled D such that there is no virtual inheritance edge along this path, a nonvirtual region for a class D is the set of classes such that for each class B in this set, there is a nonvirtual path in from B to D, a virtual path from class V to class D is a path in from the node labeled V to the node labeled D such that there is at least one virtual inheritance edge along this path, a class V being a virtual base of a class D if there is a virtual path in from V to D, a class V being a virtual base of a class D if there is a virtual path in from V to D, a virtual region for the class D being a set of classes such that for each class V in the set, there is a virtual path in from V to D, said computer implemented method comprising the steps of: laying out a virtual function table (VFT) in computer memory having a number of entries, said VFT entries having at least a function address and supporting a virtual dispatch mechanism; laying out an object in computer memory to include as components of the object all base class subobjects of the object, data members defined in the class, and a VFT pointer to the VFT for implementing the virtual dispatch mechanism required for virtual functions; and laying out virtual base pointers in computer memory to access virtual base subobjects, wherein when a fully derived object of class D, with static type S, is pointed to by p in a virtual function call p→ƒ( ), and the actual function invoked is ƒ defined in class E, denoted by E::ƒ( ), an early cast is an adjustment of a THIS pointer to a subobject, X, in the D object whose VFT contains the entry that has an address of E::ƒ( ), a late cast is an adjustment of the THIS pointer to point to an E subobject if the E and X subobjects are at different locations within the D object, a class C is defined as an introducing class of a virtual function ƒ, the class C declaring the virtual function ƒ and no base class of C in declaring ƒ, the VFT contains entries for all virtual functions introduced in a class T, and if there is a direct virtual base V of the class D which is not a direct virtual base of any base class of the class D, then the class D's VFT contains an entry for all virtual functions introduced in the nonvirtual region of the class V, thereby eliminating a need for an early virtual cast.
Claim 26
Dependent Claim 563 words
A computer implemented method of modeling C++ objects in an implementation of the C++ programming language in which a class in the C++ language may inherit another class, an inherited class being known as a base class and an inheriting class being known as a derived class, a class hierarchy graph, , for a C++ language program being defined as a tuple <N,E> where N is a set of nodes representing classes in the program and E is a set of directed edges representing inheritance relationships between the classes, a nonvirtual path from class B to class D is a path in from the node labeled B to the node labeled D such that there is no virtual inheritance edge along this path, a nonvirtual region for a class D is the set of classes such that for each class B in this set, there is a nonvirtual path in from B to D, a virtual path from class V to class D is a path in from the node labeled V to the node labeled D such that there is at least one virtual inheritance edge along this path, a class V being a virtual base of a class D if there is a virtual path in from V to D, a class V being a virtual base of a class D if there is a virtual path in from V to D, a virtual region for the class D being a set of classes such that for each class V in the set, there is a virtual path in from V to D, said computer implemented method comprising the steps of: laying out a virtual function table (VFT) in computer memory having a number of entries, said VFT entries having at least a function address and supporting a virtual dispatch mechanism; laying out an object in computer memory to include as components of the object all base class subobjects of the object, data members defined in the class, and a VFT pointer to the VFT for implementing the virtual dispatch mechanism required for virtual functions; and laying out virtual base pointers in computer memory to access virtual base subobjects, wherein when a fully derived object of class D, with static type S, is pointed to by p in a virtual function call p→ƒ( ), and the actual function invoked is ƒ defined in class E, denoted by E::ƒ( ), an early cast is an adjustment of a THIS pointer to a subobject, X, in the D object whose VFT contains the entry that has an address of E::ƒ( ), a late cast is an adjustment of the THIS pointer to point to an E subobject if the E and X subobjects are at different locations within the D object, a class C is defined as an introducing class of a virtual function ƒ, the class C declaring the virtual function ƒ and no base class of C in declaring ƒ, the VFT contains entries for all virtual functions introduced in a class T, and if there is a direct virtual base V of the class D which is not a direct virtual base of any base class of the class D, then the class D's VFT contains an entry for all virtual functions introduced in the nonvirtual region of the class V, thereby eliminating a need for an early virtual cast.
Claim 27
Dependent Claim 39 words
The computer implemented method of modeling C++ objects in an implementation of the C++ programming language recited in claim 21 further comprising the step of storing said virtual base pointers in said VFT as offsets to virtual base subobjects.
Claim 28
Dependent Claim 538 words
A computer implemented method of modeling C++ objects in an implementation of the C++ programming language in which a class in the C++ language may inherit another class, an inherited class being known as a base class and an inheriting class being known as a derived class, a class hierarchy graph, , for an C++ language program being defined as a tuple <N,E> where N is a set of nodes representing classes in the program and E is a set of directed edges representing inheritance relationships between the classes, a nonvirtual path from class B to class D is a path in from the node labeled B to the node labeled D such that there is no virtual inheritance edge along this path, a virtual path from class V to class D is a path in from the node labeled V to the node labeled D such that there is at least one virtual inheritance edge along this path, a nonvirtual region for a class D is the set of classes such that for each class B in this set, there is a nonvirtual path in from B to D, a virtual path from class V to class D is a path in from the node labeled V to the node labeled D such that there is at least one virtual inheritance edge along this path, a class V being a virtual base of a class D if there is a virtual path in from V to D, a virtual region for the class D being a set of classes such that for each class V in the set, there is a virtual path in from V to D, wherein when a fully derived object of class D, with static type S, is pointed to by p in a virtual function call p→ƒ( ), and the actual function invoked is ƒ defined in class E, denoted by E::ƒ( ), an early cast is an adjustment of a THIS pointer to a subobject, X, in the D object whose VFT contains the entry that has an address of E::ƒ( ), a late cast is an adjustment of the THIS pointer to point to an E subobject if the E and X subobjects are at different locations within the D object, said computer implemented method comprising the steps of: laying out a virtual function table (VFT) in computer memory having a number of entries, said VFT table entries having at least a function address and supporting a virtual dispatch mechanism; laying out an object model in computer memory to include as components of the object all base class subobjects of the object, data members defined in the class, and a VFT pointer to the VFT for implementing the virtual dispatch mechanism required for virtual functions; laying out virtual base pointers in computer memory to access virtual base subobjects; and performing a nonvirtual cast, for a virtual function call p→ƒ( ), to a most derived subobject that is a base-or-self of the static type pointed to by p and defines a virtual function ƒ( ) and has an entry for ƒ( ) in its VFT, if such a subobject exists, thereby providing a virtual dispatch that eliminates late casts where possible.
Claim 29
Dependent Claim 538 words
A computer implemented method of modeling C++ objects in an implementation of the C++ programming language in which a class in the C++ language may inherit another class, an inherited class being known as a base class and an inheriting class being known as a derived class, a class hierarchy graph, , for an C++ language program being defined as a tuple <N,E> where N is a set of nodes representing classes in the program and E is a set of directed edges representing inheritance relationships between the classes, a nonvirtual path from class B to class D is a path in from the node labeled B to the node labeled D such that there is no virtual inheritance edge along this path, a virtual path from class V to class D is a path in from the node labeled V to the node labeled D such that there is at least one virtual inheritance edge along this path, a nonvirtual region for a class D is the set of classes such that for each class B in this set, there is a nonvirtual path in from B to D, a virtual path from class V to class D is a path in from the node labeled V to the node labeled D such that there is at least one virtual inheritance edge along this path, a class V being a virtual base of a class D if there is a virtual path in from V to D, a virtual region for the class D being a set of classes such that for each class V in the set, there is a virtual path in from V to D, wherein when a fully derived object of class D, with static type S, is pointed to by p in a virtual function call p→ƒ( ), and the actual function invoked is ƒ defined in class E, denoted by E::ƒ( ), an early cast is an adjustment of a THIS pointer to a subobject, X, in the D object whose VFT contains the entry that has an address of E::ƒ( ), a late cast is an adjustment of the THIS pointer to point to an E subobject if the E and X subobjects are at different locations within the D object, said computer implemented method comprising the steps of: laying out a virtual function table (VFT) in computer memory having a number of entries, said VFT table entries having at least a function address and supporting a virtual dispatch mechanism; laying out an object model in computer memory to include as components of the object all base class subobjects of the object, data members defined in the class, and a VFT pointer to the VFT for implementing the virtual dispatch mechanism required for virtual functions; laying out virtual base pointers in computer memory to access virtual base subobjects; and performing a nonvirtual cast, for a virtual function call p→ƒ( ), to a most derived subobject that is a base-or-self of the static type pointed to by p and defines a virtual function ƒ( ) and has an entry for ƒ( ) in its VFT, if such a subobject exists, thereby providing a virtual dispatch that eliminates late casts where possible.
Claim 30
Dependent Claim 55 words
The computer implemented method of modeling C++ objects in an implementation of the C++ programming language recited in claim 23 wherein the VFT contains entries for all virtual functions introduced in the class and for all virtual functions introduced in the virtual region of the class, thereby eliminating a need for an early virtual cast.
Claim 31
Dependent Claim 39 words
The computer implemented method of modeling C++ objects in an implementation of the C++ programming language recited in claim 24 further comprising the step of storing said virtual base pointers in said VFT as offsets to virtual base subobjects.
Claim 32
Dependent Claim 92 words
The computer implemented method of modeling C++ objects in an implementation of the C++ programming language recited in claim 23 wherein the VFT contains entries for all virtual functions introduced in a class T, and if there is a direct virtual base V of the class D which is not a direct virtual base of any base class of the class D, then the class D's VFT contains an entry for all virtual functions introduced in the nonvirtual region of the class V, thereby eliminating a need for an early virtual cast.
Claim 33
Dependent Claim 39 words
The computer implemented method of modeling C++ objects in an implementation of the C++ programming language recited in claim 26 further comprising the step of storing said virtual base pointers in said VFT as offsets to virtual base subobjects.
Claim 34
Dependent Claim 38 words
The computer implemented method of modeling C++ objects in an implementation of the C++ programming language recited in claim 23 wherein a VFT for a class contains entries for all virtual functions that are visible at the class.
Claim 35
Dependent Claim 38 words
The computer implemented method of modeling C++ objects in an implementation of the C++ programming language recited in claim 23 wherein a VFT for a class contains entries for all virtual functions that are introduced in the class.

References Cited (Backward Citations)

US5297284A Cited
US5410705A Cited
US5371891A Cited
US5432936A Cited
US5617569A Cited
US5327562A Cited
US5442793A Cited
CA2097541A1 Cited
US5465362A Cited

USPTO Annuity & Maintenance Windows

Annuity Stage Window Opens Payment Deadline Surcharge Period Until Estimated Fee Status
3.5 Years (Year 4) 2001-08-10 2002-02-09 2002-08-11 $2000.00 Window Closed / Lapsed
7.5 Years (Year 8) 2005-08-10 2006-02-09 2006-08-11 $3760.00 Window Closed / Lapsed
11.5 Years (Year 12) 2009-08-10 2010-02-09 2010-08-11 $7700.00 Window Closed / Lapsed

Assigned Categories & Tags

No categories assigned to this patent yet.

Assign Category Tag