摘要 |
A METHOD FOR IMPLEMENTING VIRTUAL FUNCTION TABLES IN A COMPILER FOR AN OBJECT-ORIENTED PROGRAMMING LANGUAGE A method for a computer compiler for an objectoriented programming language for implementing virtual functions is provided. In preferred embodiments of the present invention, the virtual function table for a class contains a tile table and a plurality of sub-tables. The tile table contains pointers to the sub-tables, and the sub-tables contain pointers to the virtual function members of the class. Each child class shares a sub-table of the parent class when the child class does not override a function in that subtable. If the child class overrides a function, then the child is allocated its own sub-table. Each virtual function member for a class is identified by a tile table offset and a sub-table offset.
|