Next: Example
Up: Idea
Previous: Compiler
The class loader has to maintain the global
allocation table, the offset tables, and the vtables during class loading.
When a class is loaded, the class loader constructs the vtable for
based on the vtable layout of the superclass of , which is specified
in the
global allocation table. Here we reserve the entry 0 to point to some
special exception code.
Once the vtable is constructed, the class loader
registers the vtable layout in the global allocation table. This information
is also propagated to the offset tables of the loaded client classes of .
In this step it is possible that the offset table of a certain class contains
an entry for a method of class , while does not actually exist
in this newly loaded class . This means that there must have been some
binary incompatible changes (e.g. was removed from , while was
compiled with an old version of ). In this case, the class loader
puts the special offset 0 in the corresponding offset table entry.
The entry 0 of a vtable always points to some special
code that would raise proper exceptions when the method is invoked.
Next: Example
Up: Idea
Previous: Compiler
Dachuan Yu
2002-05-23