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

Compiler

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 $ C$, if an external method $ f$ is invoked on both an object of a class $ A$ and an object of its subclass $ B$, then both $ A.f$ and $ B.f$ will appear in $ C$'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