vtable layout

thomson at ca.ibm.com thomson at ca.ibm.com
Sat Aug 28 22:08:15 UTC 1999


Jason Merrill:

>I don't see why.  The D::C and D::B vtables can refer to different entry
>points, so they can look in different places to find the 'this'
>adjustment.
>
>This does defeat my earlier claim that we would need at most two entry
>points for virtual functions that don't use covariant returns.  Rather, we
>get one per vtable where the function appears.

True enough, but once you have gone that far there is no point in storing
the adjustments in the vtable any more, you might as well inline them
into the entry points creating conventional adjustment thunks that are
collocated with their target function.

This isn't an outrageous idea, it only works for nonvirtual inheritance but
we are already on a path where the solutions for the virtual and nonvirtual
cases have to be different.  We end up with more entry points, but they
are simpler than the reach-back-into-the-vtable ones.







More information about the cxx-abi-dev mailing list