vtable layout

Jason Merrill jason at cygnus.com
Sat Aug 28 00:32:50 UTC 1999


>>>>> thomson  <thomson at ca.ibm.com> writes:

 > Your statement of the rule would have us adding a slot to D's vtable,
 > but in fact that is what we never do, because a D vtable never needs
 > an "adjust to D" slot; instead we add slots to (some of) the secondary
 > vtables in a D object.

It seemed simpler to me just to add the slot to D's vtable; since we know
the layout of the vtables, we can find it from any of the secondary vptrs.
But adding it to a secondary vtable from one of D's direct bases would also
work.

 > And, as I described in an earlier note, the mechanism is totally different
 > when B is a virtual base:  In that case, I believe we have to allocate a
 > separate slot for each function in B, otherwise reconvergent (diamond)
 > inheritance can introduce conflicts.

Hmm, yes.  Agreed.

 > All of which leads me to remark ...

 > This is an interesting problem and all, but I am not entirely
 > comfortable with the amount of invention it involves.
 > Standards activities usually try to avoid being so creative.

Fair enough.  But the existing solutions have significant drawbacks that
we'd like to avoid, and there are no backward compatibility concerns on a
new architecture.

 > This work is on a promising path, but I believe we should represent
 > it as an "experimental ABI" until it is proven by an implementation.

That would seem reasonable for the ABI as a whole.

Jason




More information about the cxx-abi-dev mailing list