Check out the new USENIX Web site. next up previous
Next: Example Up: Idea Previous: Compiler

Class loader

The class loader has to maintain the global allocation table, the offset tables, and the vtables during class loading. When a class $ X$ is loaded, the class loader constructs the vtable for $ X$ based on the vtable layout of the superclass of $ X$, 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 $ X$. In this step it is possible that the offset table of a certain class $ A$ contains an entry for a method $ m$ of class $ X$, while $ m$ does not actually exist in this newly loaded class $ X$. This means that there must have been some binary incompatible changes (e.g. $ m$ was removed from $ X$, while $ A$ was compiled with an old version of $ X$). 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 $ m$ is invoked.


next up previous
Next: Example Up: Idea Previous: Compiler
Dachuan Yu 2002-05-23