首页>
外国专利>
Method for generating an object data structure layout for a class in a compiler for an object-oriented programming language
Method for generating an object data structure layout for a class in a compiler for an object-oriented programming language
展开▼
机译:在面向对象编程语言的编译器中为类生成对象数据结构布局的方法
展开▼
页面导航
摘要
著录项
相似文献
摘要
A method for a computer compiler for an object-oriented programming language for implementing virtual functions and virtual base classes is provided. In preferred embodiments of the present invention, the data structure layout of an object includes a virtual function table pointer, a virtual base table pointer, occurrences of each non-virtual base class, the data members of the class, and occurrences of each virtual base class. If a class introduces a virtual function member and the class has a non- virtual base class with a virtual function table pointer, then the class shares the virtual function table pointer of the non-virtual base class that is first visited in a depth-first, left-to- right traversal of the inheritance tree. In preferred embodiments of the present invention, each instance of a given class shares a set of virtual function tables and virtual base tables for that class. In preferred embodiments, adjusters are used when a function member in a derived class overrides a function member that is defined in more than one base class, and when a derived class has a base class that overrides a function member in a virtual base class of that class and the derived class itself does not override the function member.
展开▼