Next: Class loader
Up: Idea
Previous: Idea
Every class is statically compiled to contain a customizing table (ctable) and
an offset table (off_tab). The size of the ctable is proportional to the
number of distinct external method invocations in the class. For each
distinct external method referenced in the code of the class, there is a
corresponding entry in the ctable. In a class , if an external
method is invoked on both an object of a class
and an object of its subclass , then both and
will appear in 's ctable.
A ctable entry maps an external method to a unique natural
number. This natural number is the offset of the entry
for the external method in the offset table.
The offset table entries are filled in incrementally at run time
according to the information in the global allocation table. A virtual method
invocation is compiled to go through the corresponding offset table
entry before accessing the vtable.
Dachuan Yu
2002-05-23